NetworkX

Previous topic

networkx.eulerian_circuit

Next topic

networkx.eulerian_circuit

networkx.is_eulerian

is_eulerian(G)

Return True if G is an Eulerian graph, False otherwise.

An Eulerian graph is a graph with an Eulerian circuit.

Parameters:G : NetworkX graph

Notes

This implementation requires the graph to be connected (or strongly connected for directed graphs).

Examples

>>> is_eulerian(nx.DiGraph({0:[3], 1:[2], 2:[3], 3:[0, 1]}))
True
>>> is_eulerian(nx.complete_graph(5))
True
>>> is_eulerian(nx.petersen_graph())
False