BEST theorem
Tags: #theorem
Statement
Let
Proof
We shall give a bijection between Eulerian cycles and pairs of arborescences rooted at
Given an Eulerian cycle
- Fix an edge
and let be the endpoint of - For all
, mark the first edge of that enters - This will give an arborescence rooted at
- This will give an arborescence rooted at
- For all
, let be the set of edges that go to that is not marked or - We set
to be the permutation of given by the order of their appearance in
Let us verify that the marked edges form an arborescence. In particular, note that there are
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:
- start with the edge
- Pop the last edge of
and record it (from the end) - Set
to be this popped edge - iterate this process
- After all
's are empty, then follow the edges in the arborescence