[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[igraph] Confusing results with get_shortest_paths
From: |
Frederik Elwert |
Subject: |
[igraph] Confusing results with get_shortest_paths |
Date: |
Tue, 16 Jul 2013 21:44:23 +0200 |
Hello,
I am new to igraph, so I might be getting something wrong. I am using
igraph 0.6.5 with python3.
I have a graph and want to calculate the shortest paths between all
pairs of nodes:
>>> graph.is_directed()
False
>>> graph.get_edgelist()
[(0, 1), (1, 2), (2, 3)]
>>> for source, target in combinations(graph.vs, 2):
... graph.get_shortest_paths(source, target)[0]
[0, 1]
[0, 1, 2]
[0, 2, 3]
[1, 2]
[1, 0, 3]
[2, 3]
What bothers me: The paths [0, 2, 3] and [1, 0, 3] seem to be invalid.
There should be no edge 0 -- 2 or 0 -- 3.
Any hints?
Regards,
Frederik
- [igraph] Confusing results with get_shortest_paths,
Frederik Elwert <=