0

Does graph-tool have any equivalent function to NetworkX's has_path? I'd like to return True if there's a valid path between any given nodes.

ofey
  • 135
  • 8

1 Answers1

1

This is trivially achieved by checking if there is a finite distance between two vertices:

   has_path = shortest_distance(g, u, v) < g.num_vertices()
Tiago Peixoto
  • 5,149
  • 2
  • 28
  • 28