...

/

Charging Station: Generating All Eulerian Cycles

Charging Station: Generating All Eulerian Cycles

Let’s learn how to generate Eulerian cycles in graphs.

Iterative construction of every possible bypass graph

The inherent difficulty in generating all Eulerian cycles in a graph is keeping track of potentially many different alternatives at any given node. On the opposite end of the spectrum, a simple directed graph, a connected graph in which each node has indegree and outdegree equal to 1, offers a trivial case, since there is only one Eulerian cycle.

Our idea, then, is to transform a single labeled directed graph Graph containing n1n ≥ 1 Eulerian cycles to nn different simple directed graphs, each containing a single Eulerian cycle. This transformation has the property that it’s easily invertible, i.e., that given the unique Eulerian cycle in one of the simple directed graphs, we can easily reconstruct the original Eulerian cycle in Graph.

Given a node vv in Graph (of indegree greater than 1) with incoming edge (u,vu, v) and outgoing edge (v,wv, w), we’ll construct a “simpler” (u,v,wu, v, w ...