---
title: Balanced Spanning Tree Distribution
url: https://www.emergentmind.com/topics/balanced-spanning-tree-distribution
type: topic
---

# Balanced Spanning Tree Distribution

The balanced spanning tree distribution is a probability distribution on balanced connected graph partitions in which a partition is weighted by the product of the numbers of spanning trees in its parts. In the redistricting setting, a districting plan is modeled as a balanced partition of a graph into connected subsets, and the distribution supplies a neutral baseline for comparing enacted plans to large ensembles of valid alternatives. In its basic form, if \(P=\{P_1,\dots,P_k\}\) is a balanced partition, then its probability is proportional to \(\prod_{i=1}^k \tau(P_i)\), where \(\tau(P_i)\) is the number of spanning trees in the \(i\)-th district; this “spanning tree score” is described as a measure of district compactness and as aligned with notions of community structure from network science [2210.01401].

## 1. Formal definition and variants

In the grid-graph model studied in the redistricting literature, one considers balanced partitions of an \(n\times n\) grid graph \(G\) into \(k\) districts, assuming for simplicity that \(k\) divides \(n^2\) so that each district contains exactly \(n^2/k\) vertices. If \(P\) is such a partition, its weight is proportional to
\[
\prod_{i=1}^k \tau(P_i),
\]
and the induced probability distribution on the state space \(\mathcal P\) of balanced partitions is
\[
\pi(P)=\frac{1}{Z}\prod_{i=1}^k \tau(P_i),
\]
with \(Z\) the normalizing constant [2210.01401].

A more general formulation treats the same object as a tree-weighted distribution on \(k\)-partitions of a graph. For a partition \(P=\{P_1,\ldots,P_k\}\) of the vertex set of a graph \(G\), the tree-weighted measure is
\[
\pi(P)\propto \prod_{i=1}^k \tau(G[P_i]),
\]
with support only on partitions into connected components. In this literature, balanced partitions are those in which the classes have the same, or nearly the same, size; this is the form used in computational redistricting and related partitioning problems [2508.11130].

A smooth two-district variant replaces hard balance by an exponential penalty. If \(P=(G_1,G_2)\), then the \(\lambda\)-smooth balanced spanning tree distribution assigns probability proportional to
\[
sp(P)\cdot e^{-\lambda\cdot imb(P)},
\]
where
\[
imb(P)=\frac{\bigl||G_1|-|G_2|\bigr|}{2}.
\]
The hard-constraint version is recovered by multiplying the spanning-tree score by an indicator \(f(P)\) that equals \(1\) for balanced partitions and \(0\) otherwise [2509.15137].

## 2. ReCom, RevReCom, and balance-preserving Markov chains

The most influential construction in this area is recombination, or ReCom. ReCom repeatedly selects two adjacent districts, merges them, forms a spanning tree of the union, and cuts that spanning tree by a balanced cut to obtain two new districts. This move is computationally natural and has been widely used to generate ensembles of districting plans, but for three or more districts its stationary distribution has no known closed form [2210.01401].

A reversible modification, RevReCom, alters ReCom so that the chain has a known invariant law. The modification uses a Metropolis–Hastings correction so that the chain is reversible with respect to the spanning-tree-weighted measure. The resulting stationary distribution is the one ReCom was originally designed to approximate: a plan’s stationary probability is proportional to the product of the numbers of spanning trees of its districts. The formal motivation is detailed balance, while the empirical motivation is that the chain yields high-quality samples for full-sized problems within several hours [2210.01401].

More recent work has pursued balance-preserving dynamics directly on spanning trees. The Balanced Up-Down walk operates on the set \(B_k^\varepsilon(G)\) of \(\varepsilon\)-balanced \(k\)-splittable spanning trees. From a current tree \(T\), the chain adds a uniformly random non-tree edge, creating a unique cycle, and then removes a uniformly random edge from that cycle conditioned on the resulting tree remaining in \(B_k^\varepsilon(G)\). The chain is reversible with respect to the uniform distribution on \(B_k^\varepsilon(G)\), and irreducibility is proved in several cases, including a regime where ReCom is not irreducible [2602.11993].

## 3. Quantitative structure on grids and balanced cuts

Grid graphs furnish the main testing ground for exact formulas and structural bounds. For \(n\times n\) grids partitioned into \(k\) parts, analytic diagnostics include the cut-edge bounds
\[
2n(\sqrt{k-1}) \le |\partial P| \le n^2 - 2n + k
\]
and the spanning-tree bounds
\[
1.166(n-1)^2 \le \ln \tau(G) \le 1.386(n-1)^2.
\]
These formulas are used as benchmarks for assessing whether a sampler is producing plausible cut counts and spanning-tree totals [2210.01401].

The dependence of spanning-tree counts on geometric balance has also been made explicit. For rectangular grid graphs with fixed area, the number of spanning trees increases as the side lengths are made more balanced. In particular, if \(lm=l'm'\) and \(l\le l'\le m'\le m\), then
\[
T(l,m)\le T(l',m'),
\]
and among all rectangular grids with \(n^2\) vertices, the square \(n\times n\) grid has the largest number of spanning trees [2605.23773]. This places the tree-weighted distribution in direct contact with a geometric balancing principle: for grids of fixed size, more square-like pieces carry more spanning trees.

For the narrow \(2\)-by-\(n\) grid, the splittability problem can be solved exactly. A uniformly random spanning tree is called balanced if it has an edge whose removal partitions the vertices into two equal sets. The limiting probability of this event exists and depends on the parity of \(n\):
\[
\lim_{n\to\infty,\ n\text{ odd}} \frac{S_n}{T_n}=\frac{3+\sqrt{3}}{9}\approx 0.53,
\qquad
\lim_{n\to\infty,\ n\text{ even}} \frac{S_n}{T_n}=\frac{1+4\sqrt{3}}{6\sqrt{3}}\approx 0.76.
\]
These exact asymptotics show that balanced cuts are not rare in this model [2508.10614].

## 4. Exact and approximate sampling algorithms

A central algorithmic question is whether balanced tree-weighted partitions can be sampled in provable polynomial time. For the \(m\times n\) grid, one answer comes from a lower bound on the frequency of balanced forests. For any constant \(k\), a polynomial fraction of \(k\)-component forests are balanced, and if \(m\ge n\) and \(k\) divides \(m\), then
\[
\Pr[\text{balanced}] \ge \frac{1}{Bk^2 n^{5k-5} m^{3k-3}}
\]
for some fixed constant \(B\). This yields the first provably polynomial-time algorithms for exact and approximate sampling of balanced grid partitions according to the spanning tree distribution [2310.15152].

Dense random graphs furnish a second regime with rigorous guarantees. If \(N=nk\), then the probability that a uniformly random spanning tree of the complete graph \(K_N\) is \(k\)-splittable is
\[
C_k n^{-(k-1)/2},
\]
and for connected random graphs in the \(G(N,p)\) or \(G(N,m)\) models with \(p=\Omega(1/\log n)\), the same probability is at least
\[
C_k\, n^{-k/2-O(1)}.
\]
These inverse-polynomial bounds imply randomized polynomial-time exact sampling for another large graph class [2507.12707].

A further step removes the need to sample a full spanning tree when only a balanced two-way split is required. For a wide class of planar graphs encompassing grid-like graphs used in redistricting, one can sample directly from the balanced tree-weighted \(2\)-partition distribution without first generating a spanning tree; the acceptance and rejection rates are the same as in earlier samplers, and the expected running time is \(O(n)\). The same work also gives a variant with \(O(n\log n)\) exact sampling for uniformly random trees on these families of graphs [2508.11130].

| Method | State space / target | Stated guarantee |
|---|---|---|
| RevReCom | Balanced partitions | Stationary probability proportional to \(\prod_i \tau(P_i)\) |
| Grid rejection / up-down sampling | Balanced \(k\)-partitions of \(m\times n\) grids | Polynomial-time exact and approximate sampling |
| Direct planar \(2\)-partition sampler | Balanced tree-weighted \(2\)-partitions | Expected linear time \(O(n)\) |
| Balanced Up-Down walk | \(\varepsilon\)-balanced \(k\)-splittable trees | Uniform invariant measure; irreducible in several cases |

The algorithmic significance is that the balanced spanning tree distribution is no longer only a heuristic target. On grids, dense random graphs, and broad planar families, there are now exact or approximate samplers with stated complexity guarantees [2310.15152].

## 5. Fairness, compactness, and local structure

In redistricting applications, the distribution is valued because it favors compact, contiguous, and population-balanced districts. The fairness question is whether this local bias toward tree-rich pieces introduces hidden microscopic distortions. To address this, separation fairness was introduced: a distribution is \(\alpha\)-fair if every pair of adjacent nodes is assigned to the same district with probability at least \(\alpha\). For the \(\lambda\)-smooth balanced spanning tree distribution on sufficiently large grid graphs with \(k=2\), there exists a constant \(f_\lambda>0\) such that any pair of adjacent vertices is not separated with probability at least \(f_\lambda\) [2509.15137].

The proof framework for separation fairness relies on Wilson’s algorithm, duality between primal and dual graphs, loop-erased random walks, and an “unseparating mapping” that locally modifies dual cycles so that an edge that was separated becomes unseparated while approximate balance is preserved. The paper also develops graph-partition surgeries for cases in which a purely local repair would increase imbalance [2509.15137]. This establishes a local, edge-by-edge fairness guarantee for a smooth variant of the balanced spanning tree distribution on grids.

The same fairness result has interpretive consequences for Markov chains such as ReCom. In each merge-split step, ReCom samples a two-way partition of a merged super-district according to a balanced spanning tree rule; the separation-fairness theorem therefore provides theoretical support for the claim that such steps do not systematically crack adjacent geographic units in the two-district grid setting [2509.15137]. A plausible implication is that the distribution’s compactness bias can coexist with a nondegenerate local adjacency structure, rather than forcing nearly deterministic separations.

## 6. Limitations, obstructions, and terminological distinctions

Despite its centrality, the balanced spanning tree distribution is not free of algorithmic obstructions. ReCom’s weaknesses are now known to be broader than early intuition suggested. There are graph families for which the ReCom chain on perfectly balanced partitions is not irreducible, and even if a one-vertex imbalance is permitted, the rejection step can take exponential time. In the same constructions, the total spanning-tree weight of nearly balanced partitions can be exponentially larger than that of perfectly balanced partitions, so strict-balance rejection becomes exponentially inefficient [2507.12707].

The balance constraint itself can also create intrinsic computational hardness. For the Balanced Up-Down walk, a key subroutine is deciding whether a weighted tree can be partitioned into \(k\) connected approximately balanced subtrees. The associated decision problem admits dynamic-programming algorithms with running time \(O(k^3 n)\) in general and \(O(kn)\) in the regime \(\varepsilon=O(1/k^2)\), but the counting problem is \(\#P\)-complete [2602.11993]. Thus, exact enumeration or exact uniform sampling over all balanced splits of a given tree is intractable in general.

A separate source of confusion is terminological. In other parts of graph theory, “balanced spanning tree” may refer to a rooted tree whose degree depends only on distance from the root, as in balanced tree embeddings in random geometric graphs [2303.14229]; to edge-disjoint spanning tree packings with vertexwise degree discrepancies bounded by \(5\) or by \(O(\log k)\) [2110.13726]; or to strongly balanced spanning trees containing perfect matchings, which are tractable on balanced bipartite graphs via weighted matroid intersection but NP-hard to recognize in general planar subcubic graphs [2407.02958]. These notions are structurally distinct from the balanced spanning tree distribution on graph partitions.

Taken together, the literature presents the balanced spanning tree distribution as a mathematically explicit, algorithmically consequential, and application-driven measure on balanced connected partitions. Its core weighting rule is simple, but its behavior depends sharply on graph class, balance regime, and the sampling mechanism used to realize it.

Source: https://www.emergentmind.com/topics/balanced-spanning-tree-distribution