# isEulerian -- determines if a graph or digraph is Eulerian

## Synopsis

• Usage:
E = isEulerian G
E = isEulerian D
• Inputs:
• G, an instance of the type Graph,
• D, an instance of the type Digraph,
• Outputs:
• E, , whether G or D is Eulerian

## Description

A graph is Eulerian if it has a path in the graph that visits each vertex exactly once. A digraph is Eulerian if it has a directed path in the graph that visits each vertex exactly once. Such a path is called an Eulerian circuit. Unconnected graphs can be Eulerian, but all vertices of degree greater than 0 of a graph (or all vertices of degree greater than 0 in the underlying graph of a digraph) must belong to a single connected component.

 i1 : bridges = graph ({{0,1},{0,2},{0,3},{1,3},{2,3}}, EntryMode => "edges"); i2 : E = isEulerian bridges o2 = false i3 : D = digraph(toList(1..4), {{2,3},{3,4},{4,2}}); i4 : E = isEulerian D o4 = true