igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] strange result by get_all_shortest_paths in python


From: Gábor Csárdi
Subject: Re: [igraph] strange result by get_all_shortest_paths in python
Date: Fri, 17 May 2013 15:04:43 -0400

Hi!

On Fri, May 17, 2013 at 12:30 PM, 四正(红砖) <address@hidden> wrote:

Hi,

I figure it out! That may happen when there are only links from 0 to 3 and from 134 to 3!

You mean you can't? :)
 
==================================

Hi,

I'm trying the function get_all_shortest_paths in python, and I've gotten some strange result as following:

>>> g.get_all_shortest_paths(0,134,mode='OUT')
[[0, 33, 134]]
>>> g.get_all_shortest_paths(0,134,mode='IN')
[[0, 33, 134], [0, 11, 134]]
>>> g.get_all_shortest_paths(0,134,mode='ALL')
[[0, 33, 134], [0, 33, 134], [0, 33, 134], [0, 33, 134], [0, 11, 134], [0, 11, 134], [0, 3, 134]]

I can figure out that there are both links from 0 to 33 and from 33 to 0. Maybe also links from 33 to 134 and 134 to 33.

but where does the path [0, 3, 134] come from? why does not it exist in neither of the results of IN mode and OUT mode?

Well, we don't know for sure, because you haven't sent your full code and data. But note the mode=ALL is not a union of mode=IN and mode=OUT in general, this is because you might have a path with mode=ALL that looks like this:

0 -> 3 <- 134

This does not show up in mode=IN or mode=OUT, but it does with mode=ALL.

But maybe this is an igraph bug, without the data we cannot rule that out, either.

Gabor
 

Thanks

_______________________________________________
igraph-help mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/igraph-help




--
Gabor Csardi <address@hidden>     MTA KFKI RMKI

reply via email to

[Prev in Thread] Current Thread [Next in Thread]