is_path#

is_path(G, path)[source]#

Returns whether or not the specified path exists.

For it to return True, every node on the path must exist and each consecutive pair must be connected via one or more edges.

Parameters:
Ggraph

A NetworkX graph.

pathlist

A list of nodes which defines the path to traverse

Returns:
bool

True if path is a valid path in G