Manuscript Offprint
arXiv:2611.05043A Low-Diameter Nash-Williams--Tutte Theorem
Abstract
The Nash-Williams–Tutte theorem characterizes the existence of edge-disjoint spanning trees by a condition on every vertex partition. We prove that, for simple graphs, the same condition guarantees edge-disjoint spanning trees, each of diameter and with internal vertices, where is the number of vertices and is the minimum degree. Both bounds hold simultaneously for every tree, with absolute implicit constants independent of , and each is asymptotically optimal in general. Our proof is constructive and yields a randomized algorithm with expected running time .
We derive applications to short edge-disjoint routes and weak linkages, small Steiner trees, and survivable networks with short paths. The joint bounds also yield low-diameter spanning Eulerian subgraphs and short tours for postman and general routing problems.
*National Taiwan University †Academia Sinica
1 Introduction
The theorem of Nash-Williams (1961) and Tutte (1961) gives an exact condition for a graph to contain edge-disjoint spanning trees: every partition of its vertex set into nonempty sets must have at least edges joining distinct sets. Such trees provide a common representation of edge-disjoint routes between every pair of vertices. The classical theorem, however, does not control the lengths of these routes or the number of internal vertices in each tree. We show that, for simple graphs, the same partition condition suffices to retain all trees while simultaneously bounding both parameters. The bounds are asymptotically optimal and have absolute implicit constants, independent of .
Theorem 1 (Low-diameter Nash-Williams–Tutte theorem). Let be an -vertex simple graph with and minimum degree , and let be an integer. The graph contains edge-disjoint spanning trees if and only if every partition of its vertex set into nonempty sets has at least edges joining distinct sets. Whenever this condition holds, the trees can be chosen so that each has diameter and internal vertices, simultaneously. All implicit constants are absolute. Moreover, these trees can be computed by a randomized algorithm in expected time.
This running-time bound follows from a direct algorithmic implementation of our proof.
Since the partition condition implies , the theorem also gives diameter and internal vertices in every tree. The two bounds in terms of are separately asymptotically optimal in general, already for one spanning tree: the extremal examples of Erdős, Pach, Pollack, and Tuza (1989) force diameter , while connected-domination lower bounds force internal vertices; see Alon (2023). Simplicity is essential. Replacing each edge of an -vertex path by parallel edges gives a multigraph containing edge-disjoint spanning trees, but every spanning tree has diameter and internal vertices.
Low-diameter spanning trees. For a single spanning tree, the diameter bound follows from the classical radius bounds of Erdős, Pach, Pollack, and Tuza (1989). Hasunuma (2000) proved that a simple graph containing edge-disjoint spanning trees contains such trees, each of diameter . This gives the desired order for fixed , but the constant grows with . Chandra, Chang, Dory, Ghaffari, and Leitersdorf (2024) gave a distributed construction of edge-disjoint spanning trees of diameter , where is the edge connectivity. In a different parameter regime, Chuzhoy, Parter, and Tan (2020) obtained edge-disjoint spanning trees of diameter when is sufficiently large compared with , where is the diameter of the host graph. These results use different parameters and, in the distributed setting, a different computational model. Our result gives a centralized construction retaining every tree permitted by the exact partition condition, with a constant in the bound that is independent of .
Spanning trees with many leaves. The number of internal vertices in a spanning tree is closely related to connected domination. Combining the domination bound of Lovász (1975) with the connected-domination bound of Duchet and Meyniel (1982) gives internal vertices in a single spanning tree, with asymptotic leading constant 3 when natural logarithms are used. Kleitman and West (1991) reduced this constant to arbitrarily close to 2.5, and Caro, West, and Yuster (2000) reduced it to 1. Alon (2023) subsequently sharpened the bound to . For graphs containing edge-disjoint spanning trees, the degree-balancing results of
Illingworth, Powierski, Scott, and Tamitegama (2023) and Hörsch (2023), together with a balanced distribution of the remaining edges, yield edge-disjoint connected spanning subgraphs of minimum degree . Applying the single-tree bounds within these subgraphs gives edge-disjoint spanning trees, each with internal vertices. Theorem 1 removes the dependence on .
Simultaneous diameter and internal-vertex bounds. For a single spanning tree, both bounds follow by combining existing results. Chandran, Das, Rajendraprasad, and Varma (2012) give a connected two-step dominating set of size , while the classical domination bound gives a dominating set of size . Attaching to a spanning tree of the subgraph induced by through a forest of depth at most two, and then attaching all remaining vertices as leaves adjacent to , gives a tree of diameter at most with internal vertices. The same decomposition into connected spanning subgraphs used above yields edge-disjoint spanning trees, each simultaneously having diameter and internal vertices. Theorem 1 removes the dependence on .
Theorem 1 retains all edge-disjoint spanning trees and simultaneously achieves both optimal bounds on every tree, with absolute implicit constants independent of .
For the routing applications below, assume that satisfies the partition condition for , and let denote its minimum degree.
Short routes and prescribed terminal pairs. Galil and Yu (1995) proved a short version of Menger's theorem: in a simple graph of minimum degree at least , any two vertices joined by edge-disjoint paths are joined by such paths, each of length . A degree-sensitive refinement of the proof of Henzinger, Kleinberg, and Rao (1997) gives length when . In our setting, Theorem 1 gives a fixed tree representation for all vertex pairs simultaneously. The trees use exactly edges, and their unique paths supply the routes for any queried pair.
The same representation preserves arbitrary prescribed pairings. Let be the trees supplied by Theorem 1. For prescribed pairs , pick the unique path in from to . The resulting paths are edge-disjoint and each has length , even when terminals repeat. Thus every -edge-connected simple graph admits a short version of weak -linkage, which requires edge-disjoint paths joining any prescribed terminal pairs. Huck (1991) established weak -linkage under -edge-connectivity for odd and -edge-connectivity for even . Our consequence adds length control under a stronger connectivity hypothesis for larger .
Small Steiner trees and short survivable networks. The internal-vertex bound additionally controls the size of the subtrees needed to connect terminal sets. For any set of terminals, pruning each tree to its minimal subtree containing them gives edge-disjoint Steiner trees, each of diameter and with edges. The minimum combines two bounds: a connector is the union of short tree paths, and every nonterminal vertex it retains is internal in the original tree.
This observation also applies to unweighted survivable network design, where each unordered pair of distinct vertices has a nonnegative integer requirement for the number of edge-disjoint connecting paths. Let , and let OPT be the minimum number of edges in a subgraph meeting these requirements without length restrictions. We construct a subgraph with at most edges in which every pair has edge-disjoint paths, each of length . At level , we prune a different tree to the vertices incident with a requirement of at least . Any feasible subgraph has degree at least at vertex , so the total number of these vertices, counted over all levels, is at most 2OPT. The internal-vertex bound controls the additional vertices. The guarantee complements the classical cost approximation of Jain (2001): it bounds route lengths while allowing an explicit additive term relative to the unconstrained optimum.
The same connectors, combined with paths that pair up the odd-degree vertices, yield alternative feasible postman and general-routing tours with pairwise disjoint augmentation edge sets. The connector bounds control the additional traversals; the required edges may be shared by the tours.
These applications use both guarantees on the same trees: the diameter bound controls route lengths, while the internal-vertex bound controls connector size and branching. Together they yield small Steiner trees and survivable networks with short routes, as well as low-diameter Eulerian subgraphs with few branching vertices.
Further structural consequences. The theorem also gives quantitative refinements of classical graph structures. Let be -edge-connected, with .
-
Spanning Eulerian subgraphs with low diameter and few branching vertices. Jaeger (1979) showed that every graph containing two edge-disjoint spanning trees is supereulerian: it contains a connected spanning Eulerian subgraph. Applying this construction to pairs of trees from Theorem 1 yields edge-disjoint connected spanning Eulerian subgraphs, each of diameter , with at most edges and only vertices of degree greater than two. All branching vertices lie among the internal vertices of the two trees used in the construction.
-
Short cycles through prescribed edges. The spanning-tree deletion theorem, as presented by Catlin, Lai, and Shao (2009), guarantees edge-disjoint spanning trees after deleting any edges. The remaining minimum degree is at least . Hence Theorem 1 places any prescribed distinct edges on that many edge-disjoint cycles, each of length and containing exactly one prescribed edge.
-
Shallow spanning out-branchings. In the setting where the orientation may be chosen, rather than fixed as in Edmonds (1973), directing the trees away from any prescribed root gives arc-disjoint spanning out-branchings, each of depth and with internal vertices.
-
Low-diameter spanning trees sharing a common bipartition. The maximum-cut argument of Bang-Jensen, Havet, Kriesell, and Yeo (2022) gives a bipartite spanning subgraph with edge-connectivity at least and minimum degree at least . Applying Theorem 1 to this subgraph yields edge-disjoint spanning trees sharing a common bipartition, each satisfying both the diameter and internal-vertex bounds.
Step 1: Supply leaves. Repartition the edges of into spanning trees so that, outside a set of size , every vertex is a leaf in at least of the first trees. This follows from Theorem 2 and takes expected time.
Step 2: Group the trees. Let and . The trees with supply leaf edges for shortening the trees with .
Step 3: Shorten the second group. Apply Theorem 4 to , using as the supplying class and as the receiving class. The resulting trees are edge-disjoint, and every with has diameter and internal vertices. Moreover, outside a set of size , every vertex is a leaf in at least trees in this group. This step takes expected time.
Step 4: Shorten the first group. Apply Theorem 4 to , using as the supplying class and as the receiving class. In the resulting trees , every tree with an index in satisfies the two bounds. The changes to the trees with indices in preserve their bounds. Thus all trees are edge-disjoint, each with diameter and internal vertices. This step takes expected time.
Step 5: Replace by . If , the tree already satisfies the bounds in Theorem 1. Otherwise, apply Lemma 6.1 to . The resulting trees have diameter and internal vertices. This step takes expected time.
In total, the construction takes expected time. The expected bounds include the time for rejected samples and their retries.
1.2 Hardness of Improving the Bounds
The diameter and internal-vertex bounds in Theorem 1 are asymptotically optimal. Moreover, even for graphs promised to contain edge-disjoint spanning trees, deciding whether all trees have diameter at most is NP-hard for a sufficiently small constant and every fixed (Theorem 5). Similarly, deciding whether all trees have at most internal vertices is NP-hard for a sufficiently small constant and every sufficiently large fixed (Theorem 7).
Paper Organization. Section 2 introduces notation and preliminaries. Sections 3 to 5 establish the tools used in Section 6 to prove Theorem 1. Section 7 proves the hardness results, and Section A proves the Set Cover hardness theorem used in Section 7.
2 Notation and Preliminaries
For a positive integer , let . For a function on a finite set and a subset of its domain, let .
For a graph , let and denote its vertex set and edge set, respectively. We write for an undirected edge . A collection of subgraphs of is edge-disjoint if for any two distinct .
For a vertex , let denote its neighborhood and let denote its degree. We write and for the minimum degree and edge connectivity of , respectively. For , let denote the subgraph of induced by . For vertices of a connected graph , let denote the length of a shortest path, where length is measured in edges. The diameter is the maximum distance between two vertices of .
For a tree , let denote its set of internal vertices. A vertex of degree one in a tree is a leaf.
An orientation of a graph assigns a direction to each edge. For an arc , the vertex is its tail, is its head, and is an outneighbor of . The outdegree of a vertex is the number of arcs directed away from it.
A family of sets is laminar if, for every , either , , or . We follow standard notation for matroid theory; see, for example, Oxley (2011).
Unless otherwise stated, log denotes the natural logarithm. The notation suppresses poly-logarithmic factors in the relevant parameters, and a subscript on asymptotic notation indicates parameters on which the implicit constants may depend.
3 Supplying Leaves for Shortening
Theorem 2. Let be an -vertex simple graph with whose edge set is the union of edge-disjoint spanning trees. There is an edge partition of into spanning trees such that every vertex outside a set of size is a leaf in at least of .
The theorem supplies many leaf occurrences at almost every vertex while retaining all trees. We obtain the partition by repeatedly extracting a tree that has few internal vertices in a randomly selected set. The key requirement is that each extraction leave a spanning-tree partition of the remaining edges.
We state the extraction lemma (Lemma 3.1) and use it to prove the theorem. The extraction lemma is proved afterward using a structural bound on tight sets (Lemma 3.2), a weighted estimate (Lemma 3.3), and the weight-splitting theorem of Frank (1981).
3.1 From one tree to many leaf occurrences
Lemma 3.1. Let be an -vertex simple graph with whose edge set is the union of edge-disjoint spanning trees. Let and , and orient each of these trees toward . Suppose that every vertex has at most outneighbors in . Let minimize among all spanning trees of for which can be partitioned into spanning trees, where for every . Then .
The orientation condition makes sparse among outgoing neighbors. The lemma ensures that minimizing the number of incidences with produces a tree in which all but vertices of are leaves, without preventing further extractions.
Proof of Theorem 2. If , let and choose any edge partition of into spanning trees. Assume , and let . Fix a root . We extract successively, maintaining a spanning-tree partition of the unused edges.
At round , let be the number of remaining trees, and orient them toward . Sample each vertex independently with probability to form , using randomness independent of earlier rounds. Call a nonroot vertex bad if at least of its outneighbors lie in . Let be obtained from by deleting every sampled outneighbor of every bad vertex. Every vertex then has at most outneighbors in . Apply Lemma 3.1 to extract a tree with , and retain a partition of the remaining edges into trees.
Each nonroot vertex has distinct outneighbors, so a Chernoff bound gives a bad-vertex probability of at most . Each bad vertex causes at most deletions. Consequently,
Here and . Let count all sampled internal-vertex occurrences over the rounds. Then
Let , and let consist of the vertices that are leaves in fewer than extracted trees. The independent samples give , even though the extracted trees depend on earlier rounds. Since , another Chernoff bound gives
Every vertex in with contributes at least to . Therefore,
Some choice of the samples therefore gives . Retain its extracted trees and label the remaining trees . Every vertex outside is a leaf in at least of the first trees.
3.2 Controlling tight sets
The following lemma depends only on the given tree partition and its orientation, not on or any edge weights. Its role is to isolate vertices that can account for most of the arcs leaving a tight set.
Lemma 3.2. Let be an -vertex simple graph with whose edges are partitioned into spanning trees, each oriented toward . Call a nonempty set tight if , and call it nontrivial if . Let consist of and every vertex for which some nontrivial tight set containing has at least arcs directed from to . Then .
Proof. For any tight set , each given tree contributes at most edges to , so equality forces every tree to induce a tree on . Every vertex other than has outgoing arcs. Subtracting the arcs internal to shows that exactly arcs leave if , and none leave otherwise.
We record the effect of intersecting two tight sets . Let count the edges joining to . Since every nonempty set satisfies ,
Thus , and both and are tight.
For each , let be an inclusion-minimal witnessing set. Passing to a smaller nontrivial tight set containing preserves the witnessing arcs, so is inclusion-minimal among all nontrivial tight sets containing . In particular, , and distinct vertices of have distinct sets , since two such vertices would supply more than outgoing arcs from the same tight set.
Suppose that and neither set contains the other. The intersection is a nontrivial tight set, so minimality implies and . Since no edge joins these exclusive parts, the witnessing arcs from both vertices leave the tight union , contradicting its outgoing-arc bound. Hence the sets are nested or intersect in at most one vertex.
If and , minimality gives . At least 3k/4 of the arcs leaving start at , so at most start at . At least 3k/4 arcs from leave , so at least end in . By simplicity,
Let be one of the given spanning trees. Since each is a nontrivial tree, its edge set determines . Thus the sets are distinct and form a laminar family on the edges of : sets whose vertex sets intersect in at most one vertex have disjoint edge sets. Moreover,
so and each member has at least edges. For nested members,
Form the inclusion forest of this family, with each nonmaximal member a child of its smallest strict superset in the family. For each leaf, take its associated edge set. For each node with exactly one child, take the difference between its associated edge set and that of its child. These sets are pairwise disjoint, and each contains edges. Since they are subsets of , there are leaves and nodes with exactly one child. The number of branching nodes is at most the number of leaves, so . Since by simplicity, adding preserves this bound.
3.3 Bounding spanning-tree weights
Using Lemma 3.2, we establish the weighted inequality in Lemma 3.3, which we then use to prove Lemma 3.1.
Lemma 3.3. Let be an -vertex simple graph with whose edge set is the union of edge-disjoint spanning trees. Let and , and orient each of these trees toward . Suppose that every vertex has at most outneighbors in . Define for every , and let denote the maximum -weight of a spanning tree of . For every , let . Then
Proof. Let be the set supplied by Lemma 3.2, let , and let . Adding an integer constant to every leaves unchanged because . We may therefore assume that for every .
For each integer , let
Then . Let be the collection of vertex sets of the connected components of . For , let count the components of , and let .
Since , each component of is also a component of . Kruskal's algorithm expresses and as sums of threshold ranks. Within , these ranks are and , respectively. Counting by thresholds therefore gives
Singleton sets C contribute zero.
Call a vertex set large if or . For , let count the large components of , and let count the components joined to by an edge of . These two collections need not be disjoint. Our goal is to prove the component bound
and then sum its two terms by charging vertices of L and counting branches of a splitting tree.
For , we show that at most components are counted by neither nor . For each such component , let if possible, and otherwise let . No edge of joins to : when , its -weight would be zero and it would also lie in ; otherwise and the edge would make count toward . Since and , has outgoing arcs. At most lead to by hypothesis, and fewer than lead to because . Thus supplies at least outgoing arcs whose underlying edges are absent from .
There are at most arcs whose tails lie in C and whose underlying edges are absent from . If more than components were of neither type, their distinct representatives would therefore give
Hence , so by integrality. The spanning-tree partition then gives
so and is tight. Each chosen representative therefore has at least outgoing arcs leaving , contradicting its being outside . Consequently, , proving the component bound. For , we have , so the component bound also holds.
It remains to bound the two terms on the right-hand side.
For every component counted by , let with and , and charge to . Because , , and , we have . This edge is absent from , since is a component of disjoint from . Together with its membership in , this gives by integrality. An edge with and larger -weight would have and belong to , contradicting that is a component disjoint from . Hence
Thus determines its only possible charging threshold and belongs to only one component of there. Each vertex of receives at most one charge, giving
For the branching term, consider the two sequences
Along either sequence, components only split, and the first graph is by normalization. For each sequence, include both and at its first index and stop there. Let be the splitting tree with one node for every large component at every level of the sequence. The node associated with at the first level is the root. Each nonroot node in is a child of the unique node at the preceding level whose associated component contains its vertex set. This node exists because every ancestor of a large component is large.
The leaves of have disjoint vertex sets. At most have size at least , and at most others contain a vertex of . A node in corresponding to has children; a component not represented in has . The sum of the number of children minus one over all branching nodes in is the number of leaves minus one. The branching term uses only the levels; including the levels can only increase it. Summing over both trees therefore gives
Summing the component bound and applying these two estimates proves the lemma.
3.4 Proof of the extraction lemma
For an edge set , let . Since
it suffices to bound the minimum feasible tree weight by . Frank's weight-splitting theorem will express this weight in the form bounded by Lemma 3.3.
Theorem 3 (Weight-splitting theorem; Frank (1981)). Let and be matroids on the same ground set , with respective families of bases and , and suppose that . For every integer-valued weight function , there exist a basis and integer-valued weight functions with such that is a maximum -weight basis in and a maximum -weight basis in .
Proof of Lemma 3.1. If , then , so assume . Let . Let for every and for every . Within each , identify with when referring to a subgraph of or its weight. Define and by
• , and
is the direct sum of graphic matroids, and is a partition matroid. Let and be their respective collections of bases. An edge-partition of into spanning trees gives a common independent set of cardinality , the rank of both matroids. Hence . Conversely, every common basis induces an edge-partition of into spanning trees.
Define by and for . Every common basis satisfies . Thus maximizing minimizes subject to the remaining edges being partitionable into spanning trees. By the choice of , the maximum common-basis weight is .
By Theorem 3, there are integer-valued functions with and a common basis that is a maximum -weight basis of and a maximum -weight basis of . Such a basis also maximizes among all common bases.
We replace by and by , where . These replacements preserve and the optimality of in both matroids. Indeed, every basis of has the same -weight. Moreover, the original optimality of in implies that for every . Thus , with equality on , so remains optimal in .
Let , and let denote the maximum -weight of a spanning tree of . By the optimality of , we have and . Since , Lemma 3.3 gives
3.5 Running time
The construction in Theorem 2 can be implemented as a Las Vegas algorithm with expected running time , and hence . The input consists of , represented by adjacency lists, and ; an initial spanning-tree partition is not required. The algorithm returns the entire tree partition and the exceptional set . Under the theorem's hypotheses, and .
Implementing an extraction. Suppose that trees remain. The two matroids in the proof of Lemma 3.1, with replaced by , have ground-set size and common rank . Both have explicit graphic representations. For , use disjoint copies of the residual graph. For , use a separate pair of vertices for each residual edge , joined by parallel edges corresponding to . A forest in this second graph contains at most one copy of each . Both graphs can be constructed in time.
The extraction requires a maximum-weight common basis, rather than an unrestricted maximum-weight common independent set with the nonpositive weights . To enforce the required cardinality, give each element weight . A common basis has weight at least , since only its first tree incurs a cost. Any smaller common independent set has weight at most . Thus a maximum-weight common independent set is a common basis and, among common bases, maximizes . Its first tree is the required minimum-weight extraction, and its other trees explicitly partition the residual edges.
The weighted graphic matroid-intersection algorithm of Gabow and Xu (1989) runs in
time for two explicitly represented graphic matroids on elements of rank at most , with positive integer weights at most ; see also Huang, Kakimura, and Kamiyama (2019). Here , so one extraction takes time. Frank's weight splitting, the set , and the threshold graphs are used only to prove the extraction guarantee; the algorithm need not construct them.
Obtaining and processing the tree partitions. We compute an initial partition once, using the same two graphic representations with and uniform weight one. Maximizing the weight then maximizes cardinality, and the input promise guarantees a common basis of size . This costs . If , return this partition and , as in the existence proof.
For , one attempt performs the extraction rounds from that proof. At a round with remaining trees, rooting and orienting these trees, sampling , counting sampled outneighbors, and marking the vertices deleted to obtain take time. Constructing the graphic representations and their weights is already included in the extraction bound. Summing over the rounds gives time per attempt. Computing all leaf counts and the resulting set , verifying the returned tree partition, and writing the output take additional time. In particular, the bound includes reading the input edges.
Verifying success and bounding retries. Let be a fixed absolute constant for which the proof of Theorem 2 gives . After an attempt, accept precisely when ; this test uses the actual leaf counts. Markov's inequality gives success probability at least . Upon rejection, restart from the saved initial partition with fresh random samples. All other choices can be made deterministically. The expectation bound remains valid despite the dependence of each extracted tree on earlier rounds, because the proof conditions on those rounds before applying the outneighbor estimate. Hence the expected number of attempts is at most two. Every accepted output satisfies the required leaf guarantee, and every attempt has the time bound above, including unsuccessful attempts. Together with the initialization cost, this proves the claimed expected running time.
4 Shortening Theorem
In this section, we prove a shortening theorem that repartitions the edges between two classes of spanning trees. The trees in one class attain the desired bounds on diameter and the number of internal vertices, while those in the other class incur only additive increases in these quantities.
Theorem 4 (Shortening theorem). Let be sufficiently large. Let be a simple graph on vertices whose edges are partitioned into spanning trees . Partition into a receiving class and a supplying class . Suppose that every vertex outside a set is a leaf in at least supplying trees.
Then has a new partition into spanning trees . For each receiving tree , , we have
For each supplying tree , , we have
There is also a set of size outside which each vertex is internal in fewer than receiving trees. Given the original partition, the construction takes expected time.
We call the trees indexed by the receiving trees and those indexed by the supplying trees. In particular, when , both the diameters of the receiving trees and are . The proof starts by reserving leaf edges from the supplying trees (Lemma 4.3). Each such edge belongs to the reserve at its leaf endpoint, which we call its owner. Whenever a receiving tree takes a reserved edge at , it returns another edge incident with (Lemma 4.1). Thus still has the same number of edges to use when we reattach it to the supplying trees, even though their other endpoints may have changed. The proof is constructive, and we analyze the expected running time of the resulting algorithm in Section 4.4.
4.1 Shortening one receiving tree
The following lemma uses reserved edges from the supplying trees to shorten a receiving tree and bound its number of internal vertices, while preserving the size of each reserve.
Lemma 4.1 (Shortening one receiving tree). Let be a spanning tree of a simple graph on vertices. For each , let be a set of edges incident with . Assume that and the sets are pairwise disjoint. Let and let be an integer. Suppose that every has at least edges in whose other endpoint belongs to .
The set can be partitioned into the edge set of a spanning tree and sets , where each consists of edges incident with and . The tree satisfies
The proof uses the following lemma to shorten a tree while preserving the size of each reserve. We prove this auxiliary lemma in Section 5.
Lemma 4.2 (Outdegree-preserving shortening). Let be a spanning tree of a simple graph on vertices. Let and let be a positive integer. Suppose that is an orientation of in which every vertex outside has outdegree at least . Then there are a spanning tree of and an orientation of such that
and every vertex has the same outdegree in as in . Such a tree and orientation can be found deterministically in time.
Proof of Lemma 4.1. Build a rooted forest. Start with one rooted component for each vertex of . Whenever a root has an edge of to a vertex of in a different component, add that edge as the parent edge of . The root of the other component becomes the root of the merged tree. Let be the forest when no further merge is possible.
Every vertex of remains a root, so each component that meets contains exactly one vertex of . In every other component, the root belongs to , and all its reserved neighbors in lie in the same component. There are at least distinct neighbors because is simple. Counting the root as well, each such component contains at least vertices of . Thus the number of components satisfies
Now attach each vertex outside to a vertex of by one edge of its own reserve. The resulting spanning forest still has components. Every vertex outside is a leaf of , and every nonroot vertex owns its parent edge.
Insert the forest into the tree. Starting from , insert the edges of in order from the roots toward the leaves. To insert the parent edge of , take it from and add it to the current tree.
On the resulting cycle, remove the other edge incident with and return it to . This exchange preserves the tree and replaces one edge of by another incident with .
The edge removed at lies outside . Indeed, was disjoint from , and none of the child edges at has yet been inserted. Thus the final tree contains , and every reserve retains its size. Figure 1 illustrates two exchanges.

Figure 1: Inserting the path . First takes from its reserve and returns to it. Next adds and returns to its own reserve. The second exchange leaves in the tree.
Identify the core. The tree has exactly edges outside , joining the components of . A leaf of can become internal in only at an endpoint of one of these joining edges. Let be the set of their endpoints. Then
Set . Every vertex outside is still a leaf attached to . Deleting these leaves gives the core, the tree induced by (Fig. 2). Its order is .

Figure 2: The dashed edges join the three components of . Their endpoints form . Only the shaded core is shortened. The solid arrows point from children to parents in . In this example and belong to both and .
Shorten the core. Each vertex used at most one of its original reserved edges, namely its parent edge in . Hence each still has at least reserved edges connecting to . Select of them and orient them away from . Both ends of every selected edge lie in . Apply Lemma 4.2 to together with the selected edges, taking as the exceptional set. We obtain a tree on and an orientation of the edges left over in this graph. Since , the bound on gives
Replace by and keep the leaf edges outside in place. Remove the selected edges from the reserves and assign each complementary edge to its tail. By Lemma 4.2, each vertex receives exactly as many edges as it gave up, yielding the required sets .
A path in the resulting tree uses at most one pendant edge at each end, so . If is empty, contains a root of and its distinct reserved neighbors. Hence , which absorbs the additive two. Every internal vertex of lies in , giving the second bound.
4.2 Proof of the shortening theorem
We now prove Theorem 4. The next lemma lets us choose the reserves before the first exchange and restore the supplying trees after the last. We prove it in Section 4.3.
Lemma 4.3 (Restoring the supplying trees). Let be sufficiently large. Let be a simple graph on vertices whose edges are partitioned into spanning trees . Let partition . Suppose every vertex outside is a leaf in at least of the trees indexed by . Set .
There exist a set and pairwise disjoint edge sets satisfying the following.
(i) and .
(ii) Each consists of edges incident with from the supplying trees. Its size is for , and for .
(iii) Let
be the set of edges available for exchange. Suppose is repartitioned into spanning trees and reserves , each consisting of edges incident with . Then the edges of outside the new receiving trees can be partitioned into spanning trees such that, for every ,
Proof of Theorem 4. Take and the reserves from Lemma 4.3. Write for the current reserve at . Its size stays at for .
Choose attachment points for each tree. Choose and . For sufficiently large , we have . Process the receiving trees in a fixed order. When we reach , choose a uniform -element set , independently of all earlier choices. Put a vertex in if fewer than edges of join it to . Then every vertex outside meets the hypothesis of Lemma 4.1.
Shorten using that lemma. Let be the internal vertices of the new tree outside . We have
Count appearances across trees. Recall that we need a set of size such that every vertex outside is internal in fewer than receiving trees. Outside , every internal vertex of belongs to or . To form , add the vertices that appear at least times in either family. Set
For , the two counts add to less than . This proves the required bound on the number of trees in which is internal. To bound , observe that each vertex of contributes at least to . Hence
Bound the size of the exceptional set. First bound . Condition on all choices before we sample . This fixes the current reserve at each , whose edges lead to distinct neighbors because is simple. The number of these neighbors in is hypergeometric with mean . The Chernoff bound gives
For , we count how often a fixed vertex is itself sampled. The sets are independent, so is binomial with mean . The Chernoff bound gives, for sufficiently large ,
Combining these estimates with (2), , and gives
By Markov's inequality, with probability at least 1/2 we have
Finish the partition. Fix a sample satisfying (3). Since and , we have . Every lies in , so (1) gives . Counting the internal vertices in , , and gives
Each reserve still has its original size and consists of edges incident with its owner. Thus Lemma 4.3 restores the supplying trees with the stated bounds and completes the partition of .
4.3 Restoring the supplying trees
We now prove Lemma 4.3. We select leaf edges from the supplying trees, reserving half for exchanges with the receiving trees and protecting the other half for reconstruction. After the exchanges, the reserved edges may have different endpoints. We use matchings to reattach the deleted leaves to the supplying trees, and restrict the attachment points to small sets to control the number of new internal vertices.
The following lemma gives a degree condition for a perfect matching and shows that it survives sampling with high probability. We prove it at the end of this subsection.
Lemma 4.4 (Sampling a perfect matching). Let be a simple bipartite graph with vertex classes and , both of size . Let and be the minimum degrees on and . Suppose that .
(i) has a perfect matching.
(ii) Independently for each , choose a random subset . Suppose there is a such that
Let be the spanning subgraph with for each . If , then has a perfect matching with probability at least .
Proof of Lemma 4.3. Choose the reserves.
Since is simple, , so . For each vertex , let index the supplying trees in which is originally a leaf. For , we have .
Independently at each , choose a uniform -element subset , and put on . Fix an ordering of and protect the leaf edges corresponding to the first indices of . The head of an edge incident with is its other endpoint; let be the set of protected heads. Put on .
To restore using an edge in , we need ; otherwise is also selected for deletion from that tree. Since exchanges may change the reserved endpoints, we must consider every possible head .
Set . At each , test
The first test requires that each possible head is selected for deletion in at most trees indexed by . The second requires that at most protected heads at are selected for deletion from each tree indexed by . We will use these conditions to guarantee a perfect matching that reattaches to the supplying trees after the exchanges. Let be the set of vertices where at least one test fails.
Condition on , which also fixes . For and any fixed set of indices, sampling without replacement gives
For , this probability is zero. Conditional on , the choices at distinct protected heads are independent, so specified heads all select a given with probability at most . A failure of either test has a witness of size among at most indices or heads. Its conditional probability is therefore at most
There are at most tests of the first type and of the second type. Since , for sufficiently large ,
Choose an outcome with , and let . For each , cancel its selections and set . Its selected edges remain in their original supplying trees. For each , let consist of its unprotected selected leaf edges. The two inequalities still hold at every such . We have now fixed and all the reserves before any repartition, with .
No selected edge is selected at both ends, since a tree on at least three vertices has no adjacent leaves. Thus all selected edges have a unique owner, their leaf endpoint, and the protected edges and movable reserves are pairwise disjoint.
Match the available heads after a repartition.
For each , delete from the vertices with , and call the retained subtree . We delete only original leaves, so is a nonempty tree containing every original internal vertex. Its vertex set is precisely .
Fix an arbitrary repartition allowed in the lemma, and let be the updated reserve at . For every , it still consists of edges incident with , although their other endpoints may have changed. Let consist of the other endpoints of these edges and the protected edges at . Since is simple,
Define the bipartite graph with vertex classes and by
Thus is admissible exactly when the available edge can attach directly to the retained tree .
A perfect matching in would assign one available edge at to each supplying tree from which was deleted. Choosing such a matching for every would restore spanning trees by attaching the deleted vertices as leaves to the retained subtrees.
We now verify that these matchings exist. The first inequality gives every head in at least available tree indices. The second gives every tree index in at least available protected heads. Consequently,
Part (i) of Lemma 4.4 therefore gives a perfect matching in every , for every allowed repartition.
Although this restores the supplying trees, the attachment points may become new internal vertices. To bound this increase, we will restrict the heads used in each tree to a small set .
Restrict the attachment points.
Independently for each , choose a uniform subset of size , where
For sufficiently large , we have , since . In each , retain exactly the edges with ; see Fig. 3.
For a fixed , the retained neighbor sets are independent over . Put . If , then for every ,
where the numerator is zero if . If , then , and the same upper bound holds. Apply part (ii) of Lemma 4.4 with and . Since , the restricted lacks a perfect matching with probability at most . Call a vertex failed if this happens. Linearity of expectation gives at most failed vertices in expectation for sufficiently large ; independence between different vertices is not needed. By Markov's inequality, with probability at least , at most vertices fail. Fix such a sample and choose a surviving matching at every successful vertex. This sample may depend on the fixed repartition; the original reserves do not.

Figure 3: A schematic illustration of the matching restriction. The sets on the right list the sampled heads for each tree. An original edge survives exactly when . Shading marks protected heads.
Repair failures and restore the trees. For every failed vertex , choose a perfect matching in the unrestricted graph using part (i) of Lemma 4.4. For each , add its matched head to . This head belongs to by the definition of , and enlarging preserves all previously chosen matchings. Each failed vertex adds at most one head per tree, so
The edge sets , over , contain exactly the protected edges and updated reserves, each with a unique owner. Together with the edges of the retained supplying subtrees and updated receiving trees, they partition . The matchings assign every available edge to exactly one supplying tree. In the resulting , every deleted vertex has exactly one edge to , so is a spanning tree. A longest path in consists of a path in , possibly a single vertex, and at most one new leaf edge at each end. Only heads in can become new internal vertices. Hence
The bound on gives the required bound on internal vertices. Since the repartition was arbitrary, the reserves fixed above have the stated restoration property for every allowed repartition.
Proof of Lemma 4.4. By Hall's theorem, a perfect matching fails to exist exactly when some has fewer than neighbors. Equivalently, there is a set of size with no edge to .
Fix and with , and . Let count the edges of between them. A vertex of has at most neighbors outside , and a vertex of has at most neighbors outside . Consequently,
Thus every such pair has an edge, proving (i). For (ii), the pair loses all its edges only if each misses its neighbors in . Independence over gives
For a fixed , specifying a pair requires choosing the side of the smaller set, its vertices, and the vertices outside the larger set on the opposite side. There are at most choices. A union bound over these pairs, using , gives
This proves (ii).
4.4 Running time
The construction is a Las Vegas algorithm with expected running time . We assume that the original trees are given by their edge lists and count operations on -bit indices. Simplicity gives .
Preparing the reserves. Sampling the selections and testing the two conditions take time per trial. Each intersection test takes time, there are ordered adjacent pairs, and testing the protected heads takes time per vertex. Repeat until . Since , the expected number of trials is .
Shortening the receiving trees. Each vertex of has complementary outdegree . The implementation of Lemma 4.2 analyzed in Section 5 therefore takes time on the core, since and .
The forest construction makes at most merges, each costing , while the remaining exchanges and updates take . Thus shortening one receiving tree takes time, and a complete receiving trial takes . This bound holds for every sampling outcome.
Repeat the receiving trial with fresh samples until (3) holds, resetting the receiving trees and reserves to the accepted preparation after each rejection. Conditional on that preparation, each trial succeeds with probability at least 1/2, so the expected number of trials is .
Restoring the supplying trees. Sampling all takes time. Each matching graph has vertices and edges, so an augmenting-path algorithm tests it in time. Testing all vertices and repairing the failures therefore take time. If more than vertices fail, resample only the . Conditional on the fixed repartition, each trial succeeds with probability at least , so the expected number of trials is .
The total expected running time is
using .
5 Outdegree-Preserving Shortening
In this section, we prove Lemma 4.2.
We shorten a spanning tree of large diameter through a sequence of edge exchanges with its complementary orientation, preserving every vertex's outdegree in that orientation. Each exchange decreases a potential defined by the cuts obtained by deleting tree edges. Along a diametral path, the edges whose cuts have sufficient weight on both sides form a middle segment; the remaining edges have a small side. We first bound the total size of these small sides, then the length of the middle segment, and finally the number of edges near the ends. The corresponding algorithm is given after the proof.
Proof. If , the statement is immediate. Henceforth assume , so .
A potential on feasible spanning trees. Call a spanning tree feasible if its complementary edges admit an orientation in which every vertex has the same outdegree as in the input orientation . We define a potential on feasible spanning trees. Give weight to each vertex of and weight two to every other vertex. Let denote the total weight of a vertex set . For a feasible spanning tree and an edge , let and be the vertex sets of the two components of . Define the charge of and the potential by
An edge of is saturated if its charge is , and light otherwise. Since every charge is at most , a saturated edge cannot gain charge. Since , every light edge has a unique side of weight less than , called its small side. As each vertex in has weight , is disjoint from and .
Exchanges preserving the outdegrees. For a feasible spanning tree , fix a complementary orientation witnessing its feasibility. For each vertex , let . Root at , and simultaneously replace the parent edge of each by . Let be the resulting graph. It is a tree: following parent edges from any vertex follows its path in toward until it reaches or a vertex in , which now points directly to .
For each , replace the complementary arc by the arc from to its parent in . In the complementary orientation, each affected vertex loses and gains one outgoing arc, so the resulting tree is feasible. Similarly, a leaf can be detached and reattached to any of its outneighbors in while preserving every outdegree, and hence feasibility.
Start with . In each round, choose a diametral path of . Test the reattachment of each endpoint of to each of its outneighbors in , as well as the exchange for every . If a candidate decreases , accept it together with its complementary orientation and begin a new round. If no candidate decreases , terminate the process. Since is a nonnegative integer, the process terminates. Let , and be the tree, orientation, and diametral path in the final round, and define using from now on. We output and prove that . By the termination condition, neither nor a reattachment of either endpoint of to an outneighbor in decreases .
For each , root both and at . To compare charges, pair each edge of with the edge of having the same child. Let be the paired edge and let
The subtree rooted at any vertex in is contained in the subtree rooted at the same vertex in . For each non-root vertex , the subtree rooted at in also excludes the subtree in of every proper descendant of that belongs to , whose path to in bypasses .
By the stopping condition,
Bounding the small sides. We first prove that the total size of all small sides is at most 2N. We will use this estimate to bound the number of small sides containing each endpoint of P. Let
Fix a light edge , let , and let be the endpoint of in . For , the charge of the paired edge can increase by at most . For , the subtree rooted at in is exactly . The subtree rooted at in is contained in and excludes every vertex in . Therefore, . Each vertex of has outdegree at least in , so at least of its outneighbors lie outside . Summing over gives
Saturated edges have nonpositive changes, and there are fewer than N light edges. Hence
Bounding the saturated middle. We next show that the saturated edges on form a subpath with at most vertices. They are consecutive because, along , the weight on one side of successive cuts increases while the weight on the other side decreases. Let be this subpath; if there is no saturated edge, let consist of one vertex of . Let . For each , let be the vertex set of the component of containing . These sets partition , and
For this counting argument, mark exactly outgoing arcs in at each vertex outside , and none at vertices of , and keep these marks fixed. Fix a vertex , and let be the unique vertex with . Consider a marked arc with and . The first two edges of the path lie in . Root at , let be the parent of , and let be the parent edge of . The subtree rooted at in consists of and the subtree rooted at in . Redirecting to removes the latter subtree, and other redirections can only shrink what remains. Thus the subtree at in is contained in , even if is also redirected. Since is saturated,

Figure 4: The shaded sets and are the vertex sets of components of , with . The first two edges of the path in lie in . Redirecting to removes the subtree rooted at in from the subtree rooted at . The subtree at in , below the edge paired with , is therefore contained in . Straight arrows indicate the temporary rooting at , not the complementary orientation.
There are at least such marked arcs. Indeed, vertices of supply marks each. For a fixed vertex , at most three vertices of lie within distance one of , and simplicity allows at most one arc from each of them to . These exclusions account for at most marks in total.
For a fixed , different marked arcs with and select different edges : the edge , oriented toward , determines its child and the unique preceding neighbor on . Across all , each is used at most times: an associated marked arc has its tail at one of the at most two neighbors of on , and each such tail has only marks. All other saturated-edge changes are nonpositive. Consequently,
Adding the light-edge contribution, which is at most , and using the stopping condition gives
Bounding the light ends. It remains to bound the number of light edges on . Let count the small sides containing . Double counting the pairs such that is a light edge and gives . We show that each endpoint of satisfies .
If , there is nothing to prove. Otherwise, belongs to a small side for some . Since , we have and . As an endpoint of a diametral path, is a leaf. Reattach to any of its outneighbors in , obtaining . The leaf edges incident with in and both isolate , so both have charge two. Among the other light cuts, a small side containing but not loses two units of weight, while one containing but not gains at most two. All other light-cut charges are unchanged, and saturated cuts cannot gain. Excluding the leaf cut at in from the count therefore gives
The first inequality follows from the stopping condition. Thus every outneighbor of in has . There are at least such vertices, so
The same bound holds for the other endpoint .
Every light edge of has exactly one of in its small side since each cut on separates . There are therefore at most such edges, whereas the saturated edges are the edges of . Combining the bounds already proved yields
The orientation preserves all input outdegrees by feasibility, so it serves as .
5.1 Algorithm and running time
Let . The construction takes time in the nontrivial case. The case returns the input pair after preprocessing.
Number of rounds. Use fixed orders to resolve all choices. The integer potential is nonnegative and at most , so there are at most accepted exchanges, followed by one final round.
Cost of a round. Two tree traversals find a diametral path in time. Scanning the current orientation groups all arcs by head in time. There are at most candidates. For a candidate , root at and replace the specified parent edges; for an endpoint candidate, replace its single leaf edge. Each candidate tree can be constructed in time. Another traversal computes all subtree weights and hence every cut charge, also in time.
Rejected candidates need no copy of the complementary orientation. For an accepted candidate, update its exchanged edge directions in time. A round therefore costs . Multiplying by the bound on the number of rounds proves the claimed running time, including initialization and the final unsuccessful round.
6 Proof of the Main Theorem
We combine the results of Sections 3 to 5 as in Steps 1–4 of Section 1.1 to obtain k edge-disjoint spanning trees with bounds in terms of k (Proposition 1). We then strengthen these bounds in terms of the minimum degree (Lemma 6.1).
Proposition 1. Let be an -vertex simple graph with . Given edge-disjoint spanning trees of , we can construct edge-disjoint spanning trees, each of diameter and with internal vertices, in expected time.
The following lemma strengthens the bounds in Proposition 1 by replacing with the minimum degree , while retaining all trees. We partition into parts, construct trees within each part using Proposition 1, and connect them using the given edge-disjoint spanning trees.
Lemma 6.1. Let be an -vertex simple graph with minimum degree . Given edge-disjoint spanning trees of , we can construct edge-disjoint spanning trees, each of diameter and with internal vertices, in expected time.
Proof. If , the result follows from Proposition 1 when ; when , any spanning tree suffices because . Assume , and let . Then and .
Initially, let . If can be partitioned into two nonempty sets with fewer than edges of joining them, split into these sets and apply the same procedure recursively to each. Let be the sets obtained when no further split is possible. Let count the edges joining distinct parts. There are splits, each contributing at most such edges, so
For a vertex set , let be the set of edges with exactly one endpoint in . Any vertex in has at most neighbors inside and at most neighbors outside it. Thus for every . Summing over , and noting that each of the edges joining distinct sets is counted twice, gives
Therefore, .
For every with , the graph is -edge-connected. By the Nash-Williams–Tutte theorem, it contains edge-disjoint spanning trees. Applying Proposition 1, we obtain such trees with the stated diameter and internal-vertex bounds. Retain any of these trees and denote them by . Since , for every ,
If is a singleton, let each be its one-vertex tree.
Let be the given edge-disjoint spanning trees of . For every , contract each vertex set to a single vertex in and discard loops. The resulting multigraph is connected. Choose a spanning tree of it, and let be the corresponding edges of . Then
is a spanning tree of . The sets are pairwise disjoint because the trees are edge-disjoint. Each edge in joins distinct sets , whereas each local tree lies within one such set. Since the local trees within each are also edge-disjoint, so are .
For every , a path in visits each vertex set at most once because contracting these sets gives a tree. Hence
A vertex that becomes internal when the edges of are added must be an endpoint of one of these edges. Since , we obtain
Thus the trees satisfy both required bounds.
We now bound the running time. If , one application of Proposition 1 suffices. Otherwise, the recursive partition uses tests for a cut of size less than . To perform each test, fix a vertex of the induced subgraph and compute a flow to every other vertex, stopping each flow computation after finding units of flow. If any flow computation terminates with value less than , it gives a cut of size less than . If every flow reaches , no such cut exists. An augmenting-path implementation takes time per induced subgraph, where . Since and , the partition and construction of the induced subgraphs take time in total.
For each non-singleton , find edge-disjoint spanning trees of in time, and apply Proposition 1 to them. Since , all these applications take expected
time in total. The final trees can be assembled in time from the local trees and the given trees. As , the stated bound follows. The expected time includes the cost of rejected samples and retries.
Proof of Theorem 1. The partition condition is necessary by the Nash-Williams–Tutte theorem. If it holds, the same theorem gives edge-disjoint spanning trees. When , Lemma 6.1 constructs trees satisfying both minimum-degree bounds. When , the given trees satisfy these bounds. Finding the initial trees takes time, and the subsequent construction takes expected time.
7 Hardness results
This section proves two hardness results for -vertex simple graphs promised to contain edge-disjoint spanning trees.
-
For every fixed , it is NP-hard to decide whether contains edge-disjoint spanning trees, each of diameter at most .
-
For every sufficiently large fixed , it is NP-hard to decide whether contains edge-disjoint spanning trees, each with at most internal vertices.
The following two observations give the edge-disjoint trees used in both reductions.
Observation 7.1. Let be the clique on . Then contains pairwise edge-disjoint spanning trees , each of depth at most two from , such that for every .
Proof. For each , start with . For each , put in , and in . In , every vertex outside is a leaf adjacent to or . Thus has the stated properties. The root edges are distinct across the trees, and the four edges between any two designated pairs are used once each. Hence the trees are pairwise edge-disjoint.
Observation 7.2. Let be a clique with disjoint pairs of vertices . Then contains pairwise edge-disjoint spanning trees such that and every vertex outside is a leaf of .
Proof. For each , start with . For each , add to and to . Attach every vertex outside the designated pairs to in . Each is a spanning double star centered at . The four edges between any two designated pairs are used once in total, while all other edges used by the trees are distinct. Thus the trees are pairwise edge-disjoint.
7.1 Hardness of finding spanning trees with small diameter
We first show that finding edge-disjoint spanning trees of depth two from a prescribed root is hard, even when the input is promised to contain the required number of edge-disjoint spanning trees. We then attach a long tail to turn this rooted depth requirement into a diameter bound.
Bermond and Fraigniaud (1992) proved the following lemma for , using a reduction due to Alon. We generalize their reduction to every fixed .
Lemma 7.3. For every fixed integer , it is NP-hard to decide, given a simple graph containing pairwise edge-disjoint spanning trees and a specified root , whether has pairwise edge-disjoint spanning trees of depth at most two from .
Proof. Fix . We reduce from monotone NAE-3-SAT, which is NP-hard (Lovász, 1973). An instance has variable set and clause set , with each clause containing three distinct unnegated variables. The question is whether each clause can contain both a true and a false variable.
Create a vertex for each variable, a root , and vertices for ; make these vertices a clique . For each clause , add a vertex adjacent exactly to its three variable vertices and to . Add a vertex adjacent exactly to . Let be the resulting simple graph. Its size is polynomial in the size of .
First, satisfies the promise, regardless of the answer for . Apply Observation 7.1 to the clique on . In tree , attach each variable and to . For each clause , choose two distinct variables in , and attach through the first in tree 1, the second in tree 2, and in each tree . This gives pairwise edge-disjoint spanning trees of .
Suppose has an NAE assignment; color true variables red and false variables blue. Start again with the trees from the observation. For each red variable , attach to in tree 1 and to in every tree . For each blue variable , attach to in tree 2 and to in every tree . Attach through in tree . Finally, attach each through a red variable of in tree 1, a blue variable in tree 2, and in every tree . The resulting trees are edge-disjoint and have depth at most two from .
Conversely, suppose has edge-disjoint spanning trees of depth at most two from . Since is not adjacent to and has precisely the neighbors , its paths from in the trees use these neighbors distinctly. Relabel the trees so that tree contains . For each clause , the paths from to in trees 1 and 2 must pass through variables of : a path through , , would use , already used by tree . Color red if belongs to tree 1, and blue otherwise. The variable on the tree-1 path is red, whereas the variable on the tree-2 path is blue because the trees are edge-disjoint. Thus every clause contains both colors, giving an NAE assignment. This proves the reduction.
Theorem 5. For every fixed integer , it is NP-hard to decide, given an -vertex simple graph containing pairwise edge-disjoint spanning trees, whether has pairwise edge-disjoint spanning trees of diameter at most .
Proof. Fix , and let be an instance of Lemma 7.3; in particular, contains edge-disjoint spanning trees. Put . We attach a tail at : its far endpoint forces every vertex of to remain close to in any spanning tree of small enough diameter.
For a set , define a block with terminals , vertices for , and dummy vertices in , all distinct. Its nonterminal vertices form a clique; the terminal edges are exactly and for .
Let and be chosen later. Form a tail from one copy of followed by copies of , initially disjoint from each other and from . Identify consecutive right and left terminals, and let be the first and last terminals of the tail. Identify with to obtain ; see Figure 5.

Figure 5: The graph , obtained by identifying the left end of the tail with .
Claim 5.1. We have . Moreover, contains pairwise edge-disjoint spanning trees with for every .
Proof. The terminal neighborhoods in a block are disjoint, and is a path, so each block has terminal distance three and .
For each block, apply Observation 7.2 to its internal clique with the designated pairs , and add to tree . The block trees are edge-disjoint and each has diameter three, with terminal distance three. Concatenating the -th trees over the blocks gives a spanning tree of . Its path has length . Every path with endpoints in different blocks traverses at most three edges in each block it meets, and a path within one block has length at most three. Thus every path has length at most , and the trees have the claimed diameters and are edge-disjoint.
By the promise on and Claim 5.1, gluing corresponding trees at gives edge-disjoint spanning trees of . Thus the constructed graph satisfies the theorem's promise and . The vertex has degree , so .
Claim 5.2. The graph has pairwise edge-disjoint spanning trees of depth at most two from if and only if has pairwise edge-disjoint spanning trees of diameter at most .
Proof. If has the rooted trees, glue them to the trees of Claim 5.1. In each resulting tree, distances within are at most four, within at most , and between and at most . Since , its diameter is at most .
Conversely, let be a spanning tree of of diameter at most . As and meet only at , the restriction of to each is a spanning tree, and the path from any to passes through . By Claim 5.1, . Therefore . Restricting each of the edge-disjoint trees to gives the required rooted trees.
Excluding the dummy vertices in , each block contributes new vertices. We choose the length and the size of to make , so the target threshold equals the bound in Claim 5.2. Choose the smallest such that , and take . The number of vertices of is
Since , the desired threshold is . For fixed , both and are , so the construction is polynomial in the input size. Claim 5.2 now maps YES instances to YES instances and NO instances to NO instances, completing the reduction.
7.2 Hardness of finding spanning trees with few internal vertices
A Set Cover instance consists of a nonempty finite universe and nonempty sets whose union is ; sets may repeat. A cover is an index set such that . The frequency of an element is the number of sets containing it, counted with multiplicity.
Our reduction uses the following Set Cover gap. The bound will control the number of vertices in the graph, while the frequency condition will ensure a large minimum degree.
Theorem 6. There is a positive integer such that, for every fixed integer , the following promise problem is NP-hard. The input is a Set Cover instance with universe and sets , where and every element has frequency at least . Writing for its minimum cover size, the task is to distinguish the following two promised cases:
Theorem 7. For every sufficiently large fixed positive integer k, it is NP-hard to distinguish the following two cases for an n-vertex simple graph G promised to contain k pairwise edge-disjoint spanning trees:
YES: G contains k pairwise edge-disjoint spanning trees, each with fewer than internal vertices.
No: Every spanning tree of has more than internal vertices.
Proof of Theorem 7. Fix sufficiently large and put , so that Theorem 6 applies and . The two cases are disjoint for such , since every graph under the promise has minimum degree at least . Given an instance of that theorem with universe and sets , let be its minimum cover size and put . We construct an -vertex graph whose minimum degree is , whose ratio is comparable to , and whose spanning trees encode covers.
For each , create vertices . Also create vertices , and make all these vertices a clique . Add each element as a vertex and join it to every such that . These are the only edges incident with .
Add a clique on new vertices , with exactly the edges , , between and the rest of the graph. The clique fixes the minimum degree at . Figure 6 illustrates the construction.

Figure 6: Schematic of , showing selected vertices and omitting the internal edges of the cliques and . The displayed incidences are and .
Claim 7.1. We have .
Proof. Every vertex has degree at least , since its frequency is at least . Since , we have , and every vertex of has degree at least . In , the vertices with have degree , while the others have degree . Therefore . As ,
Using , , and , we have . Hence , since .
Claim 7.2. For every cover , the graph has pairwise edge-disjoint spanning trees, each with at most internal vertices.
Proof. Apply Observation 7.2 to with pairs , obtaining trees , and to with pairs , obtaining trees . For each , start with and the edge . For each , choose with and add the edge to for every . Each is a spanning tree: the first added edge joins the two clique trees and every other added edge attaches a new leaf. The trees are pairwise edge-disjoint because the clique trees are, and their added edges have distinct indices . Only and vertices with can be internal in , so .
Taking the cover in Claim 7.2 shows that every graph produced by the reduction contains pairwise edge-disjoint spanning trees, including in the NO case.
Claim 7.3. Every spanning tree of satisfies .
Proof. Root at . The parent of each is a vertex with . That parent is internal: it has both a parent of its own and the child . The corresponding set indices form a cover with . Hence .
In the YES case, , so Claims 7.1 and 7.2 give pairwise edge-disjoint spanning trees with
In the NO case, , so Claims 7.1 and 7.3 give every spanning tree the bound
The construction has polynomial size and takes polynomial time for each fixed . This proves the promised hardness gap.
AI Methodology
We used OpenAI's GPT-6 Astra to investigate whether the result in an earlier version of our manuscript, which gave trees satisfying both bounds, could be improved. After extensive exploration, GPT-6 Astra suggested that all trees could be obtained and provided an approach. We examined this approach and subsequently developed a proof with a substantially different structure. We also used ChatGPT to help check the correctness of our proofs. We are responsible for the final results and their proofs.
References
Noga Alon. Spanning trees with few non-leaves. Israel Journal of Mathematics, 256(1):9–20, 2023.
Jørgen Bang-Jensen, Frédéric Havet, Matthias Kriesell, and Anders Yeo. Low chromatic spanning sub(di)graphs with prescribed degree or connectivity properties. Journal of Graph Theory, 99(4):615–636, 2022.
Jean-Claude Bermond and Pierre Fraigniaud. Broadcasting and NP-completeness. Graph Theory Notes of New York, 22:8–14, 1992.
Joakim Blikstad, Sagnik Mukhopadhyay, Danupon Nanongkai, and Ta-Wei Tu. Fast algorithms via dynamic-oracle matroids. In Proceedings of the 55th Annual ACM Symposium on Theory of Computing (STOC), pages 1229–1242, 2023.
Yair Caro, Douglas B. West, and Raphael Yuster. Connected domination and spanning trees with many leaves. SIAM Journal on Discrete Mathematics, 13(2):202–211, 2000.
Paul A. Catlin, Hong-Jian Lai, and Yehong Shao. Edge-connectivity and edge-disjoint spanning trees. Discrete Mathematics, 309(5):1033–1040, 2009.
Shashwat Chandra, Yi-Jun Chang, Michal Dory, Mohsen Ghaffari, and Dean Leitersdorf. Fast broadcast in highly connected networks. In Proceedings of the 36th ACM Symposium on Parallelism in Algorithms and Architectures (SPAA), pages 331–343, 2024.
L. Sunil Chandran, Anita Das, Deepak Rajendraprasad, and Nithin M. Varma. Rainbow connection number and connected dominating sets. Journal of Graph Theory, 71(2):206–218, 2012.
Miroslav Chlebík and Janka Chlebíková. Approximation hardness of dominating set problems in bounded degree graphs. Information and Computation, 206(11):1264–1275, 2008.
Julia Chuzhoy, Merav Parter, and Zihan Tan. On packing low-diameter spanning trees. In Proceedings of the 47th International Colloquium on Automata, Languages, and Programming (ICALP), volume 168 of LIPIcs, pages 33:1–33:18, 2020.
Pierre Duchet and Henry Meyniel. On Hadwiger's number and the stability number. In Graph Theory, volume 62 of North-Holland Mathematics Studies, pages 71–73. North-Holland, 1982.
Jack Edmonds. Edge-disjoint branchings. In Combinatorial Algorithms, pages 91–96. Algorithmics Press, 1973.
Paul Erdős, János Pach, Richard Pollack, and Zsolt Tuza. Radius, diameter, and minimum degree. Journal of Combinatorial Theory, Series B, 47(1):73–79, 1989.
András Frank. A weighted matroid intersection algorithm. Journal of Algorithms, 2(4):328–336, 1981.
Harold N. Gabow and Herbert H. Westermann. Forests, frames, and games: Algorithms for matroid sums and applications. Algorithmica, 7:465–497, 1992.
Harold N. Gabow and Ying Xu. Efficient algorithms for independent assignment on graphic and linear matroids. In Proceedings of the 30th Annual Symposium on Foundations of Computer Science (FOCS), pages 106–111, 1989.
Zvi Galil and Xiangdong Yu. Short length versions of Menger's theorem. In Proceedings of the 27th Annual ACM Symposium on Theory of Computing (STOC), pages 499–508, 1995.
Toru Hasunuma. On edge-disjoint spanning trees with small depths. Information Processing Letters, 75(1-2):71–74, 2000.
Monika Rauch Henzinger, Jon Kleinberg, and Satish Rao. Short-length Menger theorems. SRC Technical Note 1997-022, Systems Research Center, Digital Equipment Corporation, 1997.
Florian Hörsch. Globally balancing spanning trees. European Journal of Combinatorics, 109, Article 103644, 2023.
Chien-Chung Huang, Naonori Kakimura, and Naoyuki Kamiyama. Exact and approximation algorithms for weighted matroid intersection. Mathematical Programming, 177(1-2):85–112, 2019.
Andreas Huck. A sufficient condition for graphs to be weakly k-linked. Graphs and Combinatorics, 7(4):323–351, 1991.
Freddie Illingworth, Emil Powierski, Alex Scott, and Youri Tamitegama. Balancing connected colourings of graphs. The Electronic Journal of Combinatorics, 30(1), Article P1.54, 2023.
François Jaeger. A note on sub-Eulerian graphs. Journal of Graph Theory, 3(1):91–93, 1979.
Kamal Jain. A factor 2 approximation algorithm for the generalized Steiner network problem. Combinatorica, 21(1):39–60, 2001.
L. G. Khachiyan. A polynomial algorithm in linear programming. Doklady Akademii Nauk SSSR, 244(5):1093–1096, 1979.
Daniel J. Kleitman and Douglas B. West. Spanning trees with many leaves. SIAM Journal on Discrete Mathematics, 4(1):99–106, 1991.
László Lovász. Coverings and colorings of hypergraphs. In Proceedings of the 4th Southeastern Conference on Combinatorics, Graph Theory, and Computing, volume 8 of Congressus Numerantium, pages 3–12, 1973.
László Lovász. On the ratio of optimal integral and fractional covers. Discrete Mathematics, 13(4):383–390, 1975.
Crispin St John Alvah Nash-Williams. Edge-disjoint spanning trees of finite graphs. Journal of the London Mathematical Society, 36(1):445–450, 1961.
James Oxley. Matroid Theory. Oxford University Press, 2 edition, 2011.
Luca Trevisan. Non-approximability results for optimization problems on bounded degree instances. In Proceedings of the 33rd Annual ACM Symposium on Theory of Computing (STOC), pages 453–461, 2001.
William Thomas Tutte. On the problem of decomposing a graph into n connected factors. Journal of the London Mathematical Society, 36(1):221–230, 1961.
A Proof of the Set Cover hardness theorem
The following Set Cover hardness result follows from the analysis of Chlebík and Chlebíková (2008, Section 2.1) of the construction of Trevisan (2001).
Theorem 8. There is a positive integer such that, for every fixed integer , the following promise problem is NP-hard. The input is a Set Cover instance with universe and sets . An integer satisfying is also given.¹ Each set has size at most , and every element has frequency at most . Writing for the instance's minimum cover size, the task is to distinguish the following two promised cases:
Proof of Theorem 6. Fix an integer and set . For sufficiently large , we have , so we reduce from the promise problem in Theorem 8. For an input , and , consider the following linear program (LP) in the variables :
We test feasibility in polynomial time and, if feasible, obtain an exact rational solution of polynomial encoding length (Khachiyan, 1979). This test guides the reduction. If the LP is feasible, its solution tells us how many copies of each set to use so that every element occurs at least times. If it is infeasible, the source instance must be NO: a cover of size at most would give a feasible 0-1 solution. In that case we output a fixed NO instance instead.
Case (i): the LP is feasible. Fix a feasible solution and set . We will take copies of each . The following bounds show that there are at most copies and every element belongs to at least of them.
Claim 6.1. We have
¹Chlebík and Chlebíková remark that, for every sufficiently large , it is NP-hard, on Set Cover instances satisfying and , to distinguish
where is an absolute constant and the threshold is part of the input, and the sets cover the universe. Choose so that the gap factor exceeds one and . Instances with are trivially NO under the promise. Map them to the one-element, one-set instance with . For , an empty universe is trivially YES; map it to the same instance with . Otherwise, delete empty sets; the universe and all remaining sets are nonempty, and the optimum is unchanged. Write for the number of remaining sets and set . Since is an integer and , the YES bound is preserved, while preserves the NO bound. For sufficiently large , the latter is stronger than , and .
Proof. Since ,
For every , the covering constraint gives
Set . Take copies of each , and add copies of until there are exactly sets. Denote the resulting sets by . Claim 6.1 ensures that the extra copies can be added and that every element has frequency at least . All output sets are nonempty. Since , every source set is retained, and taking copies does not change the minimum cover size. Writing and for the source and output minimum cover sizes, respectively, we have .
The feasible LP also bounds the size of the source instance in terms of . These bounds will verify the output conditions and preserve the NO gap.
Claim 6.2. The source instance satisfies and .
Proof. Summing the covering constraints over and using gives
Since each is nonempty and every element has frequency at most B, we also have
Since , Claim 6.2 gives . Together with Claim 6.1 and nonemptiness of the sets, this verifies the input conditions of Theorem 6.
If the source instance is YES, then . Since , we have , and hence .
If the source instance is NO, Claim 6.2 and give
For sufficiently large , we have , so
Case (ii): the LP is infeasible. As observed above, the source instance is NO. We output the following fixed NO instance of Theorem 6.
Let be the largest even integer at most . Taking sufficiently large ensures . Define
Set , and take r copies of each . Thus m = qr; denote the copies by , and let be their minimum cover size.
Claim 6.3. Every is nonempty, , and every element has frequency at least . Moreover,
Proof. Every , and hence every , is nonempty. Each belongs to exactly of the sets , so it belongs to of their copies. Moreover,
since .
For , the sets with cover exactly when . Indeed, an uncovered element is a -subset of , and such a subset exists exactly when . Taking copies does not change the minimum cover size, so . As ,
Finally, , so . Consequently, .
For sufficiently large , the factor exceeds one, so the two target cases are disjoint. The reduction maps YES instances to YES instances and NO instances to NO instances. It runs in polynomial time for every fixed : in Case (i), , while the output in Case (ii) depends only on .