hasEulerianTrail -- determines whether a graph or a digraph has an Eulerian trail
Synopsis
Usage:
E = hasEulerianTrail G
E = hasEulerianTrail D
Inputs:
G, an object of class Graph (missing documentation)
D, an object of class Digraph (missing documentation)
Outputs:
E, a Boolean value, whether G or D has an Eulerian trail
Description
A graph has an Eulerian trail if there is a path in the graph that visits each edge exactly once. A digraph has a Eulerian trail if tehre is a directed path in the graph that visits each edge exacly once. An Eulerian trail is also called an Eulerian path. Unconnected graphs can have a Eulerian trail, 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 : G = cycleGraph 5;
i2 : hasEulerianTrail G
o2 = true
i3 : D = digraph(toList(1..4), {{1,2},{2,3},{3,4}});
i4 : hasEulerianTrail D
o4 = true
See also
isEulerian -- determines if a graph or digraph is Eulerian