igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] edge in graph


From: Tamas Nepusz
Subject: Re: [igraph] edge in graph
Date: Wed, 11 Mar 2015 21:48:05 +0100
User-agent: Mutt/1.5.23 (2014-03-12)

> What is the most efficient way to check if an edge, given by a tuple
> of source and target vertex names, is present in the graph? I
> understand get_eid could be used along with try-catch, but if there
> are tens of thousands of such tuples to be checked, I doubt try-catch
> would help here. Any suggestions?
get_eid(source, target, error=False) would simply return -1 instead of raising
an exception if the edge does not exist. But there's also the are_connected()
method of the graph which simply returns True or False.

T.



reply via email to

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