networkx.classes.function.is_path

is_path(G, path)[source]

Returns whether or not the specified path exists

Parameters
  • G (graph) – A NetworkX graph.

  • path (list) – A list of node labels which defines the path to traverse

Returns

isPath – A boolean representing whether or not the path exists

Return type

bool