[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
## Re: [igraph] bug in igraph_shortest_paths_dijkstra?

**From**: |
Tamas Nepusz |

**Subject**: |
Re: [igraph] bug in igraph_shortest_paths_dijkstra? |

**Date**: |
Wed, 10 Jun 2009 11:10:37 +0100 |

**User-agent**: |
Mutt/1.5.17 (2007-11-01) |

Hi Davide,
>* I'm using igraph from bzr because with igraph-0.5.2 the "giant" graph*
>* is not strongly connected (maybe a problem with DiGraphs?)*
It seems to be strongly connected for me in igraph 0.5.2:
>*>> from igraph import **
>*>> g = load("graphCurrent.net")*
>*>> giant = g.clusters().giant()*
>*>> print giant*
Directed graph (|V| = 19970, |E| = 237535)
>*>> giant.is_connected(STRONG)*
True
>* With the bzr version (0.6 branch) the giant graph has ~20000 nodes*
>* (like networkx says), but the shortest path function doesn't work.*
This is my output in igraph 0.6:
>*>> from igraph import **
>*>> g = load("graphCurrent.net")*
>*>> giant = g.clusters().giant()*
>*>> print giant*
Directed graph (|V| = 19970, |E| = 237535)
>*>> giant.is_connected(STRONG)*
True
>*>> sps = giant.shortest_paths(0, weights="weight")[0]*
>*>> len(sps)*
19970
>*>> sps[17]*
5.0
Note that you don't have to use shortest_paths_dijkstra, igraph will
make that choice automatically when you supply weights (and it even
switches to Bellman-Ford if it detects negative weights).
So I'm quite lost here, as I can't reproduce your problem. Can you
please copy the exact commands you use to load the graph, construct the
giant component and call shortest_paths?
Thanks,
--
Tamas

**
**`pgpzHzsjxOvJ2.pgp`

*Description:* PGP signature