igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] testing if two nodes are connected


From: Ahmed Abdeen Hamed
Subject: Re: [igraph] testing if two nodes are connected
Date: Sat, 15 Feb 2014 00:19:51 -0500

Thank you! it turned out that are_connected(v1, v2) returned false if there was no direct edge between v1 and v2. However, there is still could be a path between the two vertices. How can I check that a path does not exist and the two vertices are not disconnected? I am trying to compare two very similar graphs and looking up the entirely disconnected path in one and see if they are connected in the other.

Thanks as always!

-Ahmed



On Thu, Feb 13, 2014 at 4:24 AM, Tamás Nepusz <address@hidden> wrote:
> I am trying to test if two specific nodes in a graph have an edge:
> […]
> I am thinking there might be a better message than what I am doing. Is there a method like is_connected(v1, v2)?

It’s called are_connected(v1, v2).
Also, you could use get_eid(v1, v2, error=False), in which case you get a return value of -1 if there is no edge between v1 and v2.

T.




reply via email to

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