Proofs: Aldous-Broder algorithm
These are the human proofs of Aldous-Broder algorithm, at full length.
The Aldous-Broder algorithm returns each spanning tree with probability proportional to the product of its weights full
This proof shows: correctness, termination.
Claim. Let be a finite connected undirected multigraph with vertices and a weight on each edge; parallel edges and self-loops are allowed. For each start vertex , ALDOUS-BRODER stops with probability 1, and its output satisfies
for each spanning tree , the sum over all spanning trees . With all weights 1, .
Setup
For a vertex , let be the sum of over the edges at , with a self-loop counted twice, as in the implementation. The walk at takes an edge at with probability (a self-loop with probability ) and moves to its other end. Write for the probability to move from to , so for , where is the total weight of the edges between and .
The walk is reversible with respect to : for , , since both sides equal . So is a stationary distribution, and a walk started from looks the same forward and backward in time: for each , the sequences and have the same law.
Termination. From each vertex, a fixed path of at most steps reaches any other vertex with probability at least . So in each block of steps, the walk visits all vertices with probability at least , independent of the past, and the probability that the walk has not covered the graph after blocks is at most . Since the visited set never shrinks and each new vertex adds one edge that joins it to the visited set, the output is a tree on all vertices.
Step 1: vertex trees first
We first ignore which of several parallel edges is used, and work with rooted vertex trees: a pair where assigns to each vertex a neighbor , its parent, such that following parents from any vertex reaches . Define its weight
Since ,
Step 2: a chain on rooted trees
Define a Markov chain on rooted vertex trees. From , take one step of the walk from to .
- If (a self-loop), stay at .
- Otherwise, move to , where , for , and has no parent.
is a rooted tree: in , the path from to ends at ; after the change, every vertex whose path in passed through now stops at , and every other vertex reaches and then .
Lemma 1. The weight is stationary for : for each rooted tree , .
Proof. The term for the self-loop step is . The other predecessors of are the trees that the rule maps to with . For such a tree, , so is a child of in . Removing the edge from to from splits it into the subtree of and the rest, which holds . The tree agrees with except that has no parent and has a parent . For to be a tree rooted at , the path from must reach without passing through , which holds exactly when . So the predecessors with are the pairs ( a child of in , a neighbor of ), and for each,
The subtrees of the children of partition , so the sum over all predecessors is
Lemma 2. The marginal of on roots is proportional to : for a constant that does not depend on .
Proof. By (1), . A rooted vertex tree is an unrooted spanning tree of the simple graph underlying with an orientation toward , and each unrooted tree has exactly one such orientation; so the last sum is over unrooted vertex trees , which does not depend on .
Step 3: last exits in the past
Let and let , a probability distribution. Fix . Draw from , and run for steps, which runs the walk and updates the tree. By Lemma 2, has law , so the walk is stationary. By Lemma 1, has law .
By the update rule, after the walk leaves a vertex at time by a step to , the parent of is , until becomes the root again. So if every vertex other than is visited during , then is the last-exit tree : each has as parent the vertex to which the walk moved at its last exit from before time 0. This tree is a function of the walk alone, not of . Let be the event that the walk covers during . Then for each rooted tree ,
The law of on the event does not depend on how the walk before is extended, and by termination . For a stationary walk indexed by all integers, which exists by the Kolmogorov extension theorem, is defined with probability 1, and letting gives .
Step 4: reversal turns last exits into first entrances
Let for . By reversibility, is a walk with the same transition probabilities, started from . The last exit of before time 0 in , at time with , is the first visit of by , at time , coming from . So is the first-entrance tree of , with each pointing to the vertex from which first entered it. Hence, by Step 3 and (1),
Divide by . The factor cancels, and
for a constant that does not depend on or . A walk conditioned on is the walk started at , which is what the algorithm runs with ; its first-entrance tree up to the cover time is the vertex tree of the output.
Step 5: parallel edges
Given the sequence of vertices of the walk, the edge used in a step from to is the edge between them with probability , independently of all other steps. So, for an edge set that is a spanning tree with vertex tree ,
where is the total weight between the ends of . Summing over gives .
Disconnected graphs. The implementation runs an independent walk in each component. Each walk gives a tree of its component with probability proportional to its weight product, so a spanning forest with the components of has probability proportional to , which is uniform when all weights are 1.