I'm doing calculations that involve DiGraphs, and I'd like to know whether there's a path from one point to another.
I had been usingdef Conn(G,i,j):return(G.all_paths(i,j) != [])But when the graphs got big, this started to take forever.
def Conn2(G,i,j):return(j in Set(G.connected_component_containing_vertex(i)))but this treats ignores the directedness.