Julia Graphs, dijkstra_shortest_paths

297 views
Skip to first unread message

Dejan

unread,
Dec 5, 2014, 8:47:21 PM12/5/14
to juli...@googlegroups.com
I would like to have expandable graph, being able to add vertices and edges, and run dijkstra_shortest_paths algo. I am not able to find right way to define graph so that dijkstra_shortest_paths would work. Below is my attempt. And error message.

g1= graph(ExVertex[], ExEdge{ExVertex}[], is_directed=false)
dist_key = "dist"
v1 = add_vertex!(g1, "a")
v2 = add_vertex!(g1, "b")
v3 = add_vertex!(g1, "c")
e12 = add_edge!(g1, v1, v2)
e12.attributes[dist_key]=1.0
e13 = add_edge!(g1, v1, v3)
e13.attributes[dist_key]=1.0
e23 = add_edge!(g1, v2, v3)
e23.attributes[dist_key]=1.0
epi = AttributeEdgePropertyInspector{Float64}(dist_key)
dijkstra_shortest_paths(g1, epi, ["a"])


dijkstra_shortest_paths has no method matching   
dijkstra_shortest_paths(::GenericGraph{ExVertex,ExEdge{ExVertex},Array{ExVertex,1},Array{ExEdge{ExVertex},1},Array{Array{ExEdge{ExVertex},1},1}}, ::AttributeEdgePropertyInspector{Float64}, ::Array{ASCIIString,1})

Dejan

unread,
Dec 6, 2014, 3:48:38 PM12/6/14
to juli...@googlegroups.com
Problem is  ["a"]

proper call is for example dijkstra_shortest_paths(g1, epi, [v1])

Iain Dunning

unread,
Dec 6, 2014, 7:53:00 PM12/6/14
to juli...@googlegroups.com
Yo, 

(which you haven't accepted)

Also, this mailing list is for the development of Julia - this sort of post should go on julia-users

Thanks,
Iain

Dejan

unread,
Dec 10, 2014, 3:20:16 AM12/10/14
to juli...@googlegroups.com
Answer is accepted. Sorry for the slow response.
Reply all
Reply to author
Forward
0 new messages