Note

This documents the development version of NetworkX. Documentation for the current release can be found here.

networkx.classes.function.is_path

is_path(G, path)[source]

Returns whether or not the specified path exists

Parameters
Ggraph

A NetworkX graph.

path: list

A list of node labels which defines the path to traverse

Returns
isPath: bool

A boolean representing whether or not the path exists