I want to get shortest distance between two edges.
using Graphs,GraphRecipes ,Plots,Karnak,NetworkLayout,Colors,SimpleWeightedGraphs
begin
G=SimpleWeightedGraph(5)
add_edge!(G, 1, 2,2000)
add_edge!(G, 1, 3,1800)
add_edge!(G, 1, 4,1500)
add_edge!(G, 2, 3,500)
add_edge!(G, 3, 4,500)
add_edge!(G, 3, 5,600)
add_edge!(G, 4, 5,800)
@drawsvg begin
background("grey10")
sethue("aquamarine")
drawgraph(G,vertexlabels=["NR","NER","ER","WR","SR"],vertexfillcolors = (vtx) -> distinguishable_colors(nv(G), transform=tritanopic)[degree(G, vtx)],
vertexshapesizes = 20,)
end 600 400
end
MethodError: no method matching SimpleWeightedGraphs.SimpleWeightedEdge{Int64, Float64}(::Int64, ::Int64)
Closest candidates are:
SimpleWeightedGraphs.SimpleWeightedEdge{T, U}(::Any, ::Any, !Matched::Any) where {T<:Integer, U<:Real} at ~/.julia/packages/SimpleWeightedGraphs/8bXKJ/src/simpleweightededge.jl:7
reconstruct_path!@astar.jl:15[inlined]
a_star_impl!(::SimpleWeightedGraphs.SimpleWeightedGraph{Int64, Float64}, ::Int64, ::DataStructures.PriorityQueue{Int64, Float64, Base.Order.ForwardOrdering}, ::Vector{Bool}, ::Vector{Float64}, ::Vector{Int64}, ::SparseArrays.SparseMatrixCSC{Float64, Int64}, ::Graphs.var"#110#111"{Float64}, ::Type{SimpleWeightedGraphs.SimpleWeightedEdge{Int64, Float64}})@astar.jl:37
a_star(::SimpleWeightedGraphs.SimpleWeightedGraph{Int64, Float64}, ::Int64, ::Int64, ::SparseArrays.SparseMatrixCSC{Float64, Int64}, ::Function, ::Type{SimpleWeightedGraphs.SimpleWeightedEdge{Int64, Float64}})@astar.jl:94
a_star@astar.jl:81[inlined]
top-level scope@Local: 1[inlined]
a_star(G,2,4)
See picture below