Title: Generating Random Spanning Trees
1Generating Random Spanning Trees
- Sourav Chatterji Sumit Gulwani
- EECS Department
- University of California, Berkeley
2Outline
- Applications
- Determinant based algorithms (unweighted)
- Random walk based algorithms (weighted)
- Broders algorithm (undirected)
- CFTP based algorithm (strongly connected)
- Wilsons algorithm (directed)
- Comparison
- Relation to generating perfect random state
- Future work
3Applications
- Perfect random sampling
- Statistical physics
- generating random domino tilings
- Computer networks
- accessing network reliability
- Computational biology
- generating random permutations of genomes
- Electrical networks
- Recreation
4Random maze
Enter Berkeley
Get Ph.D.
5Random maze demystified
Enter Berkeley
Get Ph.D.
6Determinant Based Algorithm
- Matrix tree theorem The number of spanning trees
of G is N(G) Det(A), - where Aij degree(vi), if (i j)
- -1 if (i,j)
2 G - 0 otherwise
- RST(G)
- Let G contract e in G
- With probability N(G)/N(G), put e in RST(G)
- If yes, then compute RST(G) else compute RST(G
e ) - Extensions
- Can it be adapted to work for weighted graphs?
- Can we approximate the ratio faster?
7Terminology (for r.w. based algorithms)
- Arborescence directed spanning tree
- Random walk on G
- w.l.o.g. G is stochastic
- A random walk on G defines a MC on G
- Forward Tree
- Backward Tree
8Random Walk
9Forward Tree
- A random walk for t steps defines a forward tree
Ft - First entrances in reversed orientation
10Backward Tree
- A random walk for t steps defines a backward tree
Bt - Last exits
11Markov Chain on Trees
- A random walk defines a MC Bt on the set of
trees
12Aldous/Broders Algorithm
- Undirected weighted graphs
- Works in cover time C
- Algorithm
- Perform a random walk until the cover time
- Output the forward tree FC
- Proof
- Pr(FC T) ?(T), where ? is the stationary
distribution for the backward tree chain - ?(T) / w(T)
- Markov Tree chain theorem
13CFTP
- Strongly connected directed weighted graphs
- Works in O(C) time
- Reduces generating random arborescence to
generating random arborescence with root r - Uses CFTP to generate random root r
- Generating random arborescence with root r
- Uses CFTP again!
- Markov Chain Mr
- ? arborescence with root r
- Transitions Simulate M Bt until reach a
state in Mr - Random Map
14Random Map
Definition excursion (path from r to
r) Application change the parent of v to be the
vertex after the last occurrence of v in the
excursion
15Random Map
Definition excursion (path from r to
r) Application change the parent of v to be the
vertex after the last occurrence of v in the
excursion Collapsing test cover time
16Loop Erasure of a Random Walk
17Wilsons Algorithm
- Directed weighted graphs
- Fastest r.w. based algorithm runs in O(?)
- ? mean hitting time
- Reduces generating random arborescence to
generating arborescence with root - Add a sink v and edges of weight ? from each
vertex to v - Generate a random arborescence T with root v
- If T v is a tree, output it
- Else repeat for a smaller value of ?
18Wilsons Algorithm
- Generating random arborescence with root r
- Current_Tree r
- While some vertex v not in Current_Tree
- Perform random walk from v till it reaches
Current_Tree - Add its loop erasure to Current_Tree
- Proof
- Algorithm finishes with a tree T and a collection
of cycles C1, C2, , Cs - PrT, C1, C2, , Cs
- PrT /
19Extensions
- Wilsons algorithm removes loops
- Alternative remove an edge which breaks the loop
20A birds eye view
- Determinant vs. random walk approach
- Broders algorithm vs. CFTP based algorithm
- Broders algorithm vs. Wilsons algorithm
- Wilsons algorithm starts from a vertex not in
the Current tree and that makes all the
difference
Clique
21Relationship with generating a perfectly random
state
- Random state to generate a random spanning tree
- via generation of random root (e.g. CFTP)
- Random spanning tree to generate a random state
- Seen few techniques for generation of random
states - Strong Stationary Time, CFTP
- Random spanning trees is another technique!
- Use Wilsons algorithm to generate a random
spanning tree, and output its root
22Future Directions
- Can there be a better algorithm than Wilsons ?
- Hybrid Algorithms
- Allowing for bias
- Lower bounds
- Generating a random spanning tree with some
property like bounded degree, diameter - Is there an interesting pre-metric that makes the
analysis amenable to path coupling ? - Several natural pre-metrics do not work!
23Motivation Hybrid Algorithm
Clique
1
0.0001
1
24Extra Slide Running Time of Wilsons Algorithm
- Running Time for specified root r
- add the number of visits to each vertex u
- Standard result number of times a random walk
starting at u visits u before reaching r is
?(u)Eu Tr Er Tu - Total expected time
- When r is ? -random, then
- Total Running Time
- Remains O(?)
- When ? large, hit v twice soon restart
- When 1/? O(?), probability of failure is small