shortest_path versus bidirectional_dijkstra

23 views
Skip to first unread message

lesshaste

unread,
Dec 24, 2009, 6:12:06 AM12/24/09
to networkx-discuss
I have a graph with edge weights zero or one. When I use shortest_path
it seems to give the wrong answer and certainly a different answer
from when I use bidirectional_dijkstra. What is meant to be the
difference between these two functions?

Raphael

Dan Schult

unread,
Dec 24, 2009, 10:09:00 PM12/24/09
to networkx...@googlegroups.com

shortest_path ignores edge weights--each edge is length 1;
dijkstra uses the edge weights. If you specify an edge but give
it a weight of zero, djikstra follows those edges without "cost",
while a straightforward shortest_path routine gives them a cost of 1.

There are more details in the docs:
http://networkx.lanl.gov/reference/algorithms.traversal.html

Dan

Raphael Clifford

unread,
Dec 25, 2009, 5:32:36 AM12/25/09
to networkx-discuss
2009/12/25 Dan Schult <dsc...@colgate.edu>:

Thanks! However, I really can't see that description at

http://networkx.lanl.gov/reference/generated/networkx.shortest_path.html#networkx.shortest_path

for example where it just says

"
Return a list of nodes in a shortest path between source and target.

There may be more than one shortest path. This returns only one.
"

Raphael

franck kalala

unread,
Mar 1, 2010, 4:29:40 PM3/1/10
to networkx...@googlegroups.com
Hey all,

How do we reference the NetworkX package?
I have written a paper I would to add a reference about NetworkX.

Cheers.



Message has been deleted

franck kalala

unread,
Mar 1, 2010, 4:40:09 PM3/1/10
to networkx...@googlegroups.com
Is there any one who can post for me and example using animation in which networkx is invoqued.
I mean an animation example which networkx stuff in it,

Cheers



Reply all
Reply to author
Forward
0 new messages