Solution (source code)

= Solution

A <spanning tree> of a finite connected graph $G$ is a connected acyclic subgraph containing every vertex. A <uniform spanning tree> is a random spanning tree chosen uniformly from the finite set of all spanning trees of $G$.