BEST theorem

Tags: #theorem

Statement

Let G be a directed graph such that the indegree of any vertex is equal to its outdegree. Then, the number of Eulerian cycles on this graph is

#Eulerian cycles=|E|⋅Arbr(G)⋅∏v∈V(indeg(v)−1)!

Proof

We shall give a bijection between Eulerian cycles and pairs of arborescences rooted at r and tuples (πv)v∈V of permutations πv∈S|indeg(v)−1|.

Given an Eulerian cycle c=(e1,…,en)

  1. Fix an edge e and let r be the endpoint of e
  2. For all v≠r, mark the first edge of c that enters v
    • This will give an arborescence rooted at r
  3. For all v∈V, let Ev be the set of edges that go to v that is not marked or e
  4. We set πv to be the permutation of Ev given by the order of their appearance in c

Let us verify that the marked edges form an arborescence. In particular, note that there are v−1 marked edges and for every vertex v≠r, there is one edge entering v. Furthermore, it has no directed cycles. If there was, then it cannot contain r. Additionally, there is a path from r to the cycle. The vertex at which r reaches the cycle will have two in-edges, a contradiction.

Thus, these form an arborescence and yields us the pair.

Given a pair of an arborescence and these permutations, we shall iteratively build the walk starting from the end:

  1. start with the edge e:i→r
  2. Pop the last edge of Ei and record it (from the end)
  3. Set e to be this popped edge
  4. iterate this process
  5. After all Ei's are empty, then follow the edges in the arborescence