检查Graphs.jl包中的图形中是否存在边的首选方法是什么?
What is the preferred method for checking whether an edge exists in a graph in the Graphs.jl package?
假设我们有一个GenericGraph G,我们想检查图中是否有边a-> b.我想拥有与has_edge(G, a, b)类似的东西,但似乎不存在.
Say we have a GenericGraph G and we want to check if an edge a->b is in the Graph. I would like to have something similar to has_edge(G, a, b) but that does not appear to exist.
我目前正在使用in(a, in_neighbors(b, G))进行检查,但这可能效率很低.
I am currently using in(a, in_neighbors(b, G)) to check, but that may be quite inefficient.
推荐答案据我了解,是检查图形边缘的正常方法.这也不是效率不高的.
As far as I understand it, that is the normal way to check for an edge in a graph. It's not really inefficient either.