Note

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

networkx.algorithms.euler.eulerian_path

eulerian_path(G, source=None, keys=False)[source]

Return an iterator over the edges of an Eulerian path in G.

Parameters
GNetworkX Graph

The graph in which to look for an eulerian path.

sourcenode or None (default: None)

The node at which to start the search. None means search over all starting nodes.

keysBool (default: False)

Indicates whether to yield edge 3-tuples (u, v, edge_key). The default yields edge 2-tuples

Yields
Edge tuples along the eulerian path.
Warning: If source provided is not the start node of an Euler path
will raise error even if an Euler Path exists.