Manuscript Offprint
arXiv:2611.08256Minimum-Cost -Arborescence Packing in Time
Abstract
We give a deterministic, strongly polynomial algorithm running in time that finds arc-disjoint arborescences of minimum total cost in a directed multigraph with vertices and arcs. This significantly improves upon the state of the art for with : the prior fastest weakly polynomial and strongly polynomial algorithms take and time (Gabow and Xu, 1989; Gabow, 1995), respectively.
Roughly, our technique can be viewed as a way to apply a linear number of shortest augmenting paths in near-linear total time for the special case of the weighted matroid intersection problem between the -fold graphic matroid and the indegree partition matroid. This was previously done in the unweighted case by Gabow (1995), but our approach is different.
As an extension, we also obtain a deterministic -time algorithm for minimum-cost maximum-cardinality packing of forests in undirected graphs. In particular, this finds edge-disjoint spanning trees of minimum total cost, if they exist. The previous fastest algorithm takes time (Gabow and Westermann, 1992).
*University of Michigan, United States. Email: zhaienhezhou@gmail.com. Work done in part while the author was an undergraduate student at the University of Science and Technology of China.
Contents
1 Introduction 1
2 Overview 3
3 Preliminaries 7
3.1 Notation and Matroid Terminology 7
3.2 Unions of Forests and Tight Blocks 7
3.3 Weighted Matroid Intersection 8
3.4 Algorithmic Tools 9
4 Min-Cost k-Arborescence Packing 9
4.1 Relax and Augment 9
4.2 Batching Framework 11
4.2.1 Locality of Augmenting Paths 11
4.2.2 Checking Compatibility by Contracting Tight Blocks 12
4.2.3 Optimality and Progress 13
4.2.4 Warm-Up Complexity 14
4.3 Compressing the Exchange Graph 15
4.3.1 Fine-Grained Search Graph 15
4.3.2 Compressed Search Graph 16
4.4 Finding a Maximum Compatible Set of Proposals 19
4.5 Proof of the Relaxation Theorem 20
5 Strongly Polynomial Algorithm via Vertex Prices 22
5.1 Price Invariant 22
5.2 Price Update 23
5.3 Potential for the Compressed Graph 24
5.4 Algorithm and Analysis 25
6 Applications 26
6.1 Indegree-Bounded Forest Packing 26
6.2 Undirected Forest Packing 27
6.2.1 Two-Stage Greedy Lemma 28
6.2.2 Algorithm and Analysis 30
6.3 Minimum-Cost k-Edge-Connected Spanning Subgraphs 32
A Forest-Swap Reachability and Execution 32
B Cyclic Scans 33
Acknowledgments 34
AI Methodology Statement 34
We therefore study the problem of minimum-cost -arborescence packing. Formally, let be a directed multigraph with and , let be the root, let be an integer, and let be arc costs. An -arborescence is a spanning tree of whose arcs are directed away from . Our goal is to find arc-disjoint -arborescences in of minimum total cost. In this work, we mainly consider the small- regime.
For , the classical minimum-cost arborescence problem [CL65, Edm67, Tar77, GGST86] can be solved in time. For fixed , near-linear -time algorithms are known for the unweighted problem [Gab95, AK26], whereas all previously known weighted algorithms incur an additional polynomial factor in .
Namely, for integer costs in , Gabow and Xu's algorithm [GX89, Gab95] runs in time by combining a modification of the matroid intersection algorithm of Frank [Fra81] with a cost-scaling framework. For general real costs, the best known algorithm still needs time [GX89, Gab95].
Minimum-cost -arborescence packing is a key building block in approximation algorithms for network design, including edge-connected spanning subgraphs [KV94, CHN] and flexible graph connectivity [BCHI21, CJK26], and it is sometimes the bottleneck of their running time [KV94, CHN]. This raises the question of whether faster or even near-linear time algorithms exist.
In this work, we answer this affirmatively by giving a deterministic, strongly polynomial algorithm for arbitrary real costs that runs in near-linear time for any polylogarithmic :
Theorem 1.1. Let . A minimum-cost packing of arc-disjoint -arborescences, or a report that none exists, can be computed deterministically in
time for arbitrary real costs. For fixed , this is .
The main difficulty is to batch many augmentations while preserving optimality. The earlier integer-cost algorithm [GX89, GX96] already batches augmentations within its cost-scaling framework, but the number of batch rounds is , incurring an extra factor in the running time.
We develop a batching framework that exploits the locality of shortest augmenting paths to execute many more augmentations in each round, so that the total number of batch rounds is . This approach was already successful in the unweighted case [Gab95], but there are many obstacles to applying it in the weighted case, as described in Section 2.
Minimum-cost -forest packing. We further extend our algorithm to the minimum-cost -forest packing problem, the undirected analogue of -arborescence packing. Here we compute a minimum-cost maximum-cardinality union of edge-disjoint forests in an undirected multigraph.
We use to hide factors polylogarithmic in .
Gabow stated in his paper [Gab95] that, using the techniques in [GX89], one can obtain running times of both and for -arborescence packing, with the latter based on the cost-scaling framework of [GX96].
This problem subsumes, for example, finding edge-disjoint spanning trees of minimum total cost, if they exist.
For , this is essentially the minimum spanning tree problem (assuming is connected), with numerous classical deterministic near-linear algorithms [Bor26, Kru56, Pri57, GGST86]. For , the unweighted variant can be solved in time [GW92] and in time [BMNT23, Qua24]. More recently, Arkhipov and Kolmogorov [AK26] obtained a -time algorithm, achieving almost-linear time for .
For arbitrary real costs, minimum-cost packing of edge-disjoint spanning trees (instead of forests) can be solved in time [RT85]. Later, Gabow and Westermann gave an algorithm for the general -forest problem running in time [GW92].
Our algorithm achieves almost-linear time for arbitrary real costs and .
Theorem 1.2 (Undirected forest packing). Let be an undirected multigraph with vertices, edges, and arbitrary real edge costs, and let be an integer. A minimum-cost maximum-cardinality union of edge-disjoint forests, together with a forest decomposition, can be computed deterministically in
time.
Here denotes the running time of a deterministic algorithm that finds an integral minimum-cost maximum flow in a network with vertices and arcs, whose costs and capacities are integers bounded by a polynomial in . Plugging in the algorithm of [vdBCK+23] gives a strongly polynomial algorithm running in time, which is almost linear for .
| Costs | Running time | Reference |
|---|---|---|
| -Arborescence packing | ||
| real, | [Tar77, GGST86] | |
| unweighted | [Gab95] | |
| real | [GX89, Gab95] | |
| integer in | [GX89, Gab95] | |
| real | Theorem 1.1 | |
| Undirected -forest packing | ||
| unweighted | [GW92] | |
| unweighted | [BMNT23, Qua24] | |
| unweighted | [AK26] | |
| real | [GW92] | |
| real | Theorem 1.2 | |
Table 1: Algorithms for -arborescence packing and -forest packing.
Applications. We give two further applications of Theorem 1.1 in Section 6.
Network design. For nonnegative costs, we obtain deterministic 2-approximation algorithms (Corollary 6.4) with the running time stated in (1.1) for the minimum-cost -edge-connected spanning subgraph of an undirected graph and the minimum-cost strongly -edge-connected spanning subgraph of a digraph. The undirected case uses the reduction of Khuller and Vishkin [KV94]. For the undirected problem, a previous randomized -approximation algorithm runs in time [CHN22].
Another application is an algorithm for a generalization of the minimum-cost -arborescence packing problem, called minimum-cost indegree-bounded forest packing, with the same running time as in (1.1) (Theorem 6.1).
Organization. Section 2 gives an overview of our techniques, and Section 3 collects preliminaries. Section 4 develops the batching framework, the compressed search graph, and the compatible-set computation. Using black-box negative-weight shortest-path algorithms, we obtain a weaker version of Theorem 1.1: for fixed , near-linear time with logarithmic cost dependence for integer costs, and strongly polynomial almost-linear time for real costs (Remark 4.10). In Section 5, we construct a feasible potential function and use Dijkstra's algorithm to prove Theorem 1.1. Section 6 gives the applications, including minimum-cost undirected forest packing and network design.
2 Overview
By Edmonds' theorem (Lemma 3.1), an arc set forms a -arborescence packing if and only if it can be partitioned into forests of the underlying undirected graph and has indegree at every vertex other than . The first condition is equivalent to independence in the union of graphic matroids, and the second corresponds to independence in a partition matroid whose classes consist of arcs sharing the same head. Therefore, our problem can be formulated as a weighted matroid intersection problem. Throughout this section, independent refers specifically to independence in .
The standard algorithm for weighted matroid intersection [Law75] searches for augmenting paths in an exchange graph, whose vertices represent ground set elements and whose directed edges represent exchanges allowed by the two matroids. Along such a path, an augmentation alternately inserts and removes elements, increasing the size of the common independent set by one. In our setting, the solution has size , requiring the same number of augmentations. Rebuilding the exchange graph and recomputing shortest paths after each augmentation yields at least a quadratic running time in the size of the solution.
The main idea of this paper is a way to perform a linear number of augmentations in near-linear total time for this weighted matroid intersection problem. The only earlier method we know that does this is Gabow's algorithm for the unweighted problem [Gab95]. We first recall why his algorithm is fast, and then explain the obstacles that costs create and how we overcome them.
Gabow's algorithm: augmenting in local time. At a high level, Gabow's algorithm maintains a set that is independent in , along with a forest decomposition , where are spanning trees and is a forest. The set grows until becomes a spanning tree, and then the algorithm proceeds to pack the next tree.
His algorithm uses what we call a fine-grained augmenting path, which is more fine-grained than standard matroid-intersection augmenting paths in the exchange graph: each exchange in is expanded into a sequence of swaps among the maintained forests, allowing the forest decomposition to be updated explicitly. Gabow shows that these paths have useful locality: each path stays entirely within a single component of , except for its final arc.
In each round, every component of has such a path starting from a vertex in it with indegree less than . By locality, finding each of them (with cyclic-scanning search) only requires time linear in the size of the containing component, so the total time still sums to linear. To apply many paths at once, Gabow applies a simple cycle-avoiding selection rule to choose a subset of them, keeping the resulting independent. He shows that each round reduces the number of components of by half, so after rounds, becomes a spanning tree. This shares the same spirit as Borůvka's algorithm [Bor26] for MST.
Keeping the augmentations cheapest (Section 4.1). Gabow's way of packing the trees one by one can be seen as relaxing the matroid: once is a complete solution for , the algorithm switches from to . Without costs this is harmless. With costs, the augmenting-path algorithm needs to be cheapest among the common independent sets of its size (Theorem 3.5). This can fail: a cheapest packing of trees need not be cheapest for , and we do not know how to repair efficiently.
We therefore fix from the start, so that all forests grow together, and raise only the indegree bounds. Our new invariant is that is cheapest among all independent sets with the same indegree vector as . Raising an indegree bound does not change the sets is compared with, so the invariant still holds. Switching from to , in contrast, adds new sets to compare with, even for the same indegree vector. The relaxation theorem below shows that augmentations also keep the invariant.
Concretely, let be the minimum cost of an independent set with indegree vector . We maintain the invariant that has cost , where is the indegree vector of . We also maintain a forest decomposition . To raise the indegree of a vertex , we use a matroid-level augmenting path from : a standard augmenting path in the exchange graph of and the current indegree bounds, but starting with an arc entering . It ends with a free arc , that is, and is independent. We call it matroid-level to distinguish it from Gabow's fine-grained paths.
Our first contribution is an elementary proof of a relaxation theorem for an arbitrary matroid, here , intersected with a partition matroid (Theorem 4.2). Let . First, a shortest augmenting path from (with ties broken by the number of exchanges) raises the indegree of at cost , so the augmented set costs exactly , maintaining the invariant. Second, raising the indegrees of all vertices in a set together costs at least the sum of the single-vertex costs:
So if element-disjoint shortest paths, one for each , can be executed together, the result costs the right-hand side and is thus optimal (Lemma 4.7). This does not need a path to remain shortest after another path is executed, as in usual augmenting-path arguments.
Locality to tight blocks (Section 4.2.1). Gabow's fine-grained paths are local to the components of , guaranteeing local-time search and path disjointness. Since we fix and grow all forests together, there is no single forest whose components play this role.
We find that the right notion is locality to tight blocks. A vertex set is tight if has arcs inside , the most that forests allow. The maximal tight sets, the tight blocks, partition . A shortest (matroid-level) augmenting path from a vertex stays inside the tight block of , except for its last arc, which enters the block from outside (Lemma 4.4). This is because such a path stops at the first free arc, and every arc outside crossing tight blocks is free (Lemma 3.2). This locality is more refined than Gabow's -component locality, since tight blocks refine the components of every forest. It also depends only on instead of the decomposition.

Figure 1: One phase for . Each proposal changes the tree inside its tight block (blue zigzag) and adds a terminal entering . We execute the proposals of and and reject (orange dashed arc): after are added, the shaded set is tight and contains both ends of .
Selecting compatible augmenting paths (Section 4.2.2). Call a vertex deficient if its indegree is less than , and a tight block deficient if it contains one. Each phase of our algorithm picks one deficient vertex in every deficient tight block , and computes a shortest augmenting path from , the proposal of . By locality, the proposal changes only arcs inside , except for its last arc, the terminal, which enters , and proposals of different blocks are element-disjoint.
Still, executing all of them may break independence. We next determine which paths can be executed together. Intuitively, the change inside keeps the arcs inside independent and tight, and it does not affect anything outside . So we contract every tight block, and let be the arcs of that cross the blocks. We show that a set of proposals can be executed together if and only if together with their terminals is a union of forests in the contracted graph (Lemma 4.5), regardless of how they change the inside of the blocks. We call such a set of terminals compatible. So we choose a maximal compatible set of terminals , and then execute the corresponding proposals at once (Figure 1). By the relaxation theorem, the result again satisfies the invariant.
For , the tight blocks are the components of the forest and , so a compatible set is a set of terminals with no cycle in the contracted graph, as in Gabow's cycle-avoiding rule. For this rule no longer works: the terminals must fit into forests together with . Equivalently, letting be the set of all terminals, we must extend to a basis of in of the contracted graph. We call the unweighted forest-packing algorithm of Arkhipov and Kolmogorov [AK26] once on the contracted graph to give a largest union of forests, but it may miss some arcs of . We repair it by adding these arcs back one at a time, and each one replaces one of the chosen terminals (Section 4.4). Since our paths are matroid-level, executing them does not maintain the explicit forest decomposition. So we will need to rebuild the forests once at the end of the phase, with the same algorithm. These two steps take time per phase.
Progress (Section 4.2.3). Let be the number of missing arcs. After a phase, we show that every deficient tight block of the new set contains the head of an executed terminal. Otherwise, the arcs inside the block are unchanged, and the terminal of an old proposal inside it could still be added, which contradicts maximality. The number of missing arcs drops by , and at most tight blocks of the new set are deficient, each missing at most arcs. Hence drops by at least a fraction, and phases suffice (Lemma 4.8).
Compressing the exchange graph (Section 4.3). Since there are phases, it suffices to make each phase near-linear. The remaining cost is the shortest-path computation that finds all proposals: the exchange graph can have arcs, and its arc weights can be negative.
Gabow finds his fine-grained augmenting paths by a reachability search in a fine-grained search graph: like the exchange graph, its vertices are the arcs of , and it has a directed edge for and with the same head. Instead of the matroid-level exchange edges, it has a directed edge for every forest swap: lies in a forest with , on the -path between the ends of , so can replace in . Each path in this graph projects to a matroid-level augmenting path with the same cost (Lemma 4.13), so we can also use it to find our paths.
Gabow avoids building this graph by visiting the elements in an order he calls cyclic scanning [Gab95, Section 2.3]. This order lets him list the unvisited neighbors of the visited set quickly. In the weighted case, we need shortest paths, so we cannot visit the elements in this order.
We therefore build this graph explicitly and make it small. We add one auxiliary vertex per head for the exchanges in the partition matroid, and compress the tree paths with a sparse-table-like structure (following the approach of [SXZ26]), so that each element needs at most four arcs per forest (Section 4.3.2). We further show that for each element, it suffices to keep its swaps into a single forest, saving a factor of in the number of scan arcs (Section B). The resulting graph has vertices and arcs and preserves shortest paths.
With black-box negative-weight shortest-path algorithms for the proposals, this already gives a weaker version of Theorem 1.1: for fixed , near-linear time with logarithmic cost dependence for integer costs, and almost-linear time for real costs (Remark 4.10).
Strongly polynomial algorithm via vertex prices (Section 5). To get better runtime, we maintain a potential on the search graph to make all arc weights nonnegative. We maintain a price for each vertex , and assign each arc the adjusted cost . Our invariant is that is a minimum-cost independent set of under the adjusted costs (with no indegree constraints).
Under these costs, a -exchange arc in the exchange graph has weight , which is nonnegative by the optimality of . For an augmenting path from , the prices cancel except for , so its adjusted cost is its original cost minus . Thus the shortest augmenting paths from each vertex remain shortest.
To preserve the invariant after augmentation, we update the vertex prices so that the old set remains optimal and every shortest proposal has zero adjusted cost. Any compatible batch then preserves optimality for the new adjusted costs, so the next phase starts with the same invariant.
However, the compressed graph represents each exchange by several arcs, whose individual weights may still be negative. We extend the vertex prices to a feasible potential on the compressed graph by propagating adjusted-cost bounds along the scan arcs in linear time. This lets us find all proposals with one Dijkstra computation per phase, giving the deterministic, strongly polynomial algorithm of Theorem 1.1.
Indegree-bounded forest packing (Section 6.1). If the indegree of each vertex may be at most , we add a new root with very cheap and very expensive arcs into each . The cheap arcs use up the capacity that the bound removes, the expensive ones mark unused slots, and the original arcs of an optimal packing form an optimal solution (Theorem 6.1).
Undirected forest packing (Section 6.2). For undirected graphs, we follow the outer loop of the unweighted algorithm of Arkhipov and Kolmogorov [AK26]. Each round finds a cheapest maximum union of pseudoforests (graphs in which every component has at most one cycle) with min-cost flow, orients it with indegree at most , finds a cheapest maximum union of forests inside it with the indegree-bounded algorithm above, and contracts the resulting tight blocks.
We prove a two-stage greedy lemma: the greedy union of forests inside the greedy union of pseudoforests is contained in the greedy optimal solution (Lemma 6.2). Hence every contraction fixes only edges of an optimal solution. The progress argument is the same as in [AK26].
3 Preliminaries
3.1 Notation and Matroid Terminology
We use the graph notation from the introduction, and regard parallel arcs as distinct elements. For arborescence packing, we delete loops and arcs entering , and assume .
We write . We do not assume that is polynomially bounded in , so some running times contain . Exact arithmetic operations and comparisons take constant time.
For a set and an element , we write and . We write for the symmetric difference of sets . For , let . For an arc , head denotes its head. For , is the set of arcs of with both ends in . We write for the number of arcs of entering , and for the number entering from . For , is its indicator vector and .
We use standard matroid terminology [Sch03], writing and for the rank and closure operators of a matroid . If is independent and is not, then contains a unique circuit, the fundamental circuit of ; for , the set is independent iff lies in this circuit.
3.2 Unions of Forests and Tight Blocks
Let be the graphic matroid of the undirected multigraph underlying , and let be the union of copies of ; its independent sets are the unions of forests. By Nash-Williams [NW64], is independent in iff
A forest decomposition of is a partition into forests. An element is free if is independent.
When and for every , the deficiency of a nonroot vertex is . Set and .
Lemma 3.1 (Matroid formulation; Edmonds [Edm73]). is the arc set of arc-disjoint -arborescences iff is independent in , , and for every .
Proof. One direction is clear. Conversely, if is independent with these indegrees, then every nonempty has by (3.1), and Edmonds' theorem [Edm73] gives arc-disjoint -arborescences in . They use all arcs.
Tight blocks. Let be independent. A nonempty set is -tight if ; equivalently, every forest of a forest decomposition of , restricted to , is a spanning tree of . Intersecting -tight sets have an -tight union, so the maximal -tight sets partition . We call this partition and its members the -tight blocks. A vertex or tight block is deficient if its deficiency is positive. An arc is internal if both its ends lie in one block, and crossing otherwise.
Lemma 3.2 (Free elements). An element is free iff it is crossing. If is internal to a block , then its fundamental circuit lies in .
Proof. Adding increases only for sets containing both ends of , so (3.1) fails for iff some tight set contains both ends. If is internal to , then is dependent.
Lemma 3.3 (Deficiency of a tight block). Let have no arc entering and indegree at most at every other vertex, and let be -tight. Then if , and if .
Proof. The heads in receive arcs, and their capacity is if and if .
Lemma 3.4 (Computing tight blocks [GW92, Theorem 5.4]; see [AK26, Lemma 4.4]). Given a forest decomposition of , the partition can be computed deterministically in time.
The tight blocks are the vertex sets of the connected components of the top clump of , together with the remaining singletons; thus the cited top-clump algorithm computes
3.3 Weighted Matroid Intersection
Let be matroids on , and let be costs. A set is common independent if it is independent in both matroids. A common independent set is extreme if for every common independent with . Following [Sch03, Section 41.2], let
Exchange graph. The exchange graph has vertex set . For and , it has
- an arc of weight if is independent in , and
• an arc of weight 0 if is independent in .
Augmenting paths. An augmenting path is a simple path in with and . We identify with its element set. Its cost is
and its exchange count is , counting only the -exchanges. With the arc weights of , the cost of equals the cost of its last element plus the sum of its arc weights. Throughout, a shortest augmenting path minimizes , with ties broken by minimizing .
Theorem 3.5 ([Sch03, Theorems 41.2–41.3 and 41.5–41.6]). A common independent set has maximum cardinality iff has no augmenting path. It is extreme iff has no negative cycle. If is extreme and is a shortest augmenting path, then is an extreme common independent set of size .
A clump is a set with ; the top clump is the unique inclusion-maximal clump [AK26, Definition 4.3]. Every tight set induces a connected clump, except for singletons, and hence lies in one component of the top clump. Conversely, equality in the clump size bound and (3.1) force every component of a clump to be tight.
3.4 Algorithmic Tools
Lemma 3.6 (Unweighted forest packing; [AK26, Theorem 1.1 and Appendix A.5]). Let be a digraph with vertices and arcs. The algorithm of Arkhipov and Kolmogorov computes a maximum-cardinality union of forests in with indegree at most at every vertex, together with a forest decomposition, deterministically in time. If every vertex of has indegree at most , the output is a basis of .
Lemma 3.7 (Arborescence extraction; [BHKP08, Theorem 1.4]). If an unweighted digraph contains arc-disjoint -arborescences, then the algorithm of Bhalgat, Hariharan, Kavitha, and Panigrahi finds such arborescences deterministically in time.
4 Min-Cost -Arborescence Packing
This section presents our algorithm, following the plan of Section 2.
Section 4.1 works with an arbitrary matroid intersected with a partition matroid. It shows that a shortest augmenting path raises one class count and keeps the set cheapest for its class counts, and that raising several counts together costs at least the sum of the single-count costs (Theorem 4.2). We defer the proof to Section 4.5.
Section 4.2 specializes to and builds the batching algorithm from this theorem. In each phase, every deficient tight block proposes one shortest augmenting path, which stays inside the block except for its last arc (Section 4.2.1). Section 4.2.2 then gives a criterion, based on contracting the tight blocks, for when a set of proposals can be executed together while keeping independent. Section 4.2.3 shows that executing any maximal such set keeps optimal and reduces the number of missing arcs by at least a fraction, so phases suffice.
Section 4.2.4 reduces the total running time to two steps per phase: finding the proposals, and choosing a largest compatible set. Sections 4.3 and 4.4 implement these two steps. The first replaces the exchange graph by a search graph of near-linear size with the same shortest-path distances. The second finds a largest compatible set with one call to the forest-packing algorithm of Arkhipov and Kolmogorov [AK26], followed by a repair step. With black-box negative-weight shortest paths, this already gives a weaker version of our main result (Remark 4.10).
4.1 Relax and Augment
In this subsection, we establish the optimality properties used by our batching algorithm. We first show how to increase one indegree optimally, and then give a lower bound on the cost of increasing several indegrees together. We work with an arbitrary matroid intersected with a partition matroid, where class counts play the role of indegree bounds.
Setup. Let be a matroid on , and let be partitioned into classes . For an integer vector , let be the partition matroid with capacity on . To relax a class means to raise by one. Let
with if no such exists. An independent set of with class counts is extreme for and iff .
Augmenting paths. Fix an independent set of with class counts , and let be the exchange graph.
For elements and , the graph has an arc iff is independent in , and an arc iff is independent in . Since every class is full, the condition for holds exactly when and belong to the same class.
An augmenting path from class is a simple path in with and (recall that is independent in ). If is independent, its class counts are , since enters class and each is replaced by from the same class. We define and as in Section 3.3, and a shortest augmenting path from class minimizes cost among those paths, breaking ties by the number of exchanges. Let .
Remark 4.1. Note that an augmenting path from class is a path in , the exchange graph for the current capacities , and not in . This differs from the standard algorithm behind Theorem 3.5. Every class is full for , so , and we start at instead.
Searching in would be wrong. In general, is not extreme for and : the common independent sets of size may then have class counts for any , and some of them may be cheaper than . By Theorem 3.5, may then have negative cycles, and a shortest augmenting path need not exist.
Theorem 4.2 (Relaxation theorem). Let I be extreme with class counts b.
(a) If , then an augmenting path from class exists. For every shortest augmenting path from class , the set is independent with class counts , and .
(b) For every , we have .^4
Part (a) shows that a shortest augmenting path relaxes one class optimally. Part (b) implies that executing several such paths together is also optimal, provided that the paths are element-disjoint and the resulting set is independent. We give an elementary proof in Section 4.5.
The next lemma shows that a shortest augmenting path stops at its first free element.
Lemma 4.3 (Only the Last Element Is Free). Let be extreme, and let be a shortest augmenting path from class . Then .
Proof. Suppose for some . The prefix is an augmenting path from class with fewer exchanges, so cost minimality and the tie-breaking rule give . Since is independent in , so is . Hence has the arc , and is a cycle in of weight
which is a negative cycle, contradicting Theorem 3.5.
The graph setting. We use , with the set of arcs entering . Then class counts are indegrees, and is the set of free arcs. For and , the exchange graph has
• an arc of weight if e is free or f lies on the fundamental circuit of e, and
• an arc of weight 0 if head(e) = head(f).
An augmenting path from class u starts at an arc entering u and ends at a free arc.
This lower bound also appears to follow from the aggregation results in [Mur20, Proposition 4.6(2)].
4.2 Batching Framework
By Theorem 4.2, element-disjoint shortest augmenting paths from distinct vertices preserve optimality if applying them together preserves independence. We use tight blocks to select such paths: each deficient block proposes one path, and we choose a compatible subset of them. We then show that this selection guarantees progress in every phase.
We maintain an independent set that has minimum cost among all independent sets with the same indegree vector . We also maintain a forest decomposition of . Initially, . Throughout, no arc of enters , and every other vertex has indegree at most . In Section 5, we maintain a stronger optimality certificate to implement the shortest-path searches with Dijkstra's algorithm.
4.2.1 Locality of Augmenting Paths
We use the exchange graph and the augmenting paths of Section 4.1, for .
Lemma 4.4 (Localization to a tight block). Let lie in a tight block , and let be a shortest augmenting path from . All elements of except the last are internal to , and the last element is a free arc entering ; we call it the terminal of .
Moreover, is independent and satisfies
Proof. By Lemma 4.3, no element of before its last one is free. By Lemma 3.2, a nonfree element with head in is internal to , and its fundamental circuit lies in plus that element. Hence each exchange stays in , and so does the next step , which goes to an arc with the same head. The final element is free, so its tail is outside . The same localization argument applies to any augmenting path with no free element before its last one.
The augmenting-path criterion and Theorem 4.2(a) give independence of and the stated indegree vector. Before its terminal, removes as many elements of as it adds from , giving the second equality in (4.1). Thus remains tight after augmentation.
In each deficient block , relax one deficient vertex , and let the proposal be a shortest augmenting path from , with terminal . Such a path must exist: assuming a packing exists, deleting arcs from it gives an independent set with indegree vector , so and a proposal exists by Theorem 4.2(a). Therefore, if some deficient block has no proposal, we report that no packing exists.
Different proposals are element-disjoint: their internal elements belong to disjoint blocks, and their crossing terminals have heads in those blocks and are thus distinct.
Let denote the running time of the shortest-path subroutine on a graph with vertices and arcs. For now, we compute the proposals using . But recall that the cost of an augmenting path equals the sum of its arc weights plus the cost of its last element. We therefore add a sink and an arc of weight for each free .
To compute the shortest-path distance from each element to , we simply run a reverse SSSP computation from . Then the minimum cost from a class is . We defer the efficient implementation to Section 4.3.
4.2.2 Checking Compatibility by Contracting Tight Blocks
By Lemma 4.4, each proposal replaces by another basis of in and adds its terminal. Intuitively, the choice of the internal basis should not affect whether the proposals can be applied together.
We therefore contract each block of to a vertex. Let be the set of arcs in whose endpoints lie in different blocks, and let be the set of terminals. We check compatibility in the contracted graph with vertex set and arc set
Independence is still taken in the underlying undirected graph.
The following lemma shows that the internal replacements do not affect compatibility.
Lemma 4.5 (Contraction and lifting). For every set X of arcs crossing the old blocks, the following are equivalent:
(a) is independent in the original graph;
(b) is a union of k forests in the contracted graph.
The equivalence is unchanged if any internal basis is replaced by another basis of .
Proof. In a forest decomposition of an independent set containing the internal bases, the arcs inside T force each forest restricted to T to be a spanning tree. Contract these trees in every forest to obtain a forest decomposition of the contracted graph.
Conversely, combine any forest decomposition of the contracted graph with a decomposition of each internal basis: adding its th tree inside each contracted vertex to the th forest of the contracted graph gives a forest.
Formally, we call compatible if is independent in the contracted graph. We find a largest compatible and execute the proposals whose terminals lie in . Lemma 4.5 shows that executing them together gives an independent set.
Lemma 4.6 (Indegree bounds after contraction). Every vertex of the contracted graph has indegree at most k. If , then .
Proof. For a nonroot tight block of , Lemma 3.3 gives . As we find a proposal for iff , in such a case the terminal raises by one, and we still have .
The root block has no entering arc of and no proposal. Summing the bounds over the other blocks proves the claim.
Keeping old crossing arcs. Because the indegree in the contracted graph is at most , satisfying the requirements of Lemma 3.6, the idea is to use this algorithm to compute a maximum-cardinality forest packing of , but this need not contain . The proposals leave all old crossing arcs unchanged, so the chosen terminals must be independent together with . What we actually need is an extension of to a basis of . This can be done by repairing , as described in Section 4.4. For now, we denote the running time of this step by .
We summarize the procedure described above as the following pseudocode:
Algorithm 1 Packing by selection on the contracted graph
Input: digraph , root , integer , costs
1: delete loops and arcs entering ; if return the empty packing
2: with empty forests
3: while do
4: compute ; choose a deficient vertex in each deficient block
5: for each , find a shortest augmenting path from in ; if none exists, return "infeasible"
6: contract the old blocks; form the arc set with
7: extend to a basis of
8: \quad execute the chosen proposals
9: compute a forest decomposition of using Lemma 3.6
10: partition into arborescences using Lemma 3.7; return them
The augmentation in Line 8 preserves independence but does not explicitly maintain a forest decomposition. Since the updated satisfies the indegree bounds, we simply compute a fresh forest decomposition using Lemma 3.6 on .
4.2.3 Optimality and Progress
Lemma 4.7 (A compatible batch is optimal). Let be any compatible set of terminals, let , and set
Then is a minimum-cost independent set with indegree vector .
Proof. By Lemmas 4.4 and 4.5, compatibility of implies that is independent. By Lemma 4.4 and element-disjointness of the paths, . By Theorem 4.2(a), we have for each . Then, by element-disjointness and Theorem 4.2(b), we have
Thus equality holds.
Lemma 4.8 (Geometric progress). Suppose , and let be a maximal compatible set of terminals. Then the resulting satisfies .
Consequently, total deficiency decreases by a factor of in each phase, and there are phases.
Proof. By (4.1), every old block remains tight in , so each new tight block is a union of old blocks.
We claim that every deficient new block contains the head of a chosen terminal. Suppose not. Then no old block inside executes a proposal, so and the indegrees in are unchanged.
Since and , the set is -tight as well, so itself is a single old tight block. Since was already deficient in , it must have proposed , whose tail lies outside .
However, since is also an -tight block, the arc is still a crossing arc for , and thus is independent by Lemma 3.2. By Lemma 4.5, this means that is compatible, contradicting the maximality of .
Hence there are at most deficient new blocks, each of deficiency at most . This proves . The deficiency thus shrinks by a factor per phase. It starts at , which gives the phase bound.
The proof uses only the fact that is maximal.
4.2.4 Warm-Up Complexity
We first bound the running time in terms of the cost of finding the proposals and the cost of compatible selection. This makes clear what we need to improve.
Lemma 4.9 (Parametrized running time). Suppose each phase finds all proposals in time and a largest compatible set of terminals in time , where . Then the entire algorithm runs in
time.
Proof. By Lemma 4.8 there are phases. In one phase, computing the tight blocks of takes time by Lemma 3.4, since . Finding the proposals costs . Building the contracted graph costs by Lemma 4.6, and finding a largest compatible set of terminals costs . Applying the chosen proposals costs , since their total length is at most by element-disjointness. Rebuilding the forest decomposition of costs by Lemma 3.6, as . An infeasible input stops in the first phase in which some deficient block has no proposal. The final extraction costs by Lemma 3.7, and is within the first term.
For fixed , (4.2) is near-linear if each phase finds all proposals and a largest compatible set of terminals in near-linear time. For the search step, there are two remaining issues.
-
Size of the search graph. The exchange graph has vertices and arcs, since an element of can have an arc to each of the at most elements of . Building it also requires the fundamental circuits of the nonfree elements in .
-
Negative-weight shortest paths. The graph has negative arc weights, so we cannot directly use Dijkstra's algorithm.
Remark 4.10 (Implementations using black-box shortest paths). On a graph with vertices, arcs, and no negative cycle, exact SSSP takes time deterministically for integer weights in , where [HJS26, Theorem 1.1], or time with high probability for real weights using a Las Vegas algorithm [HLLZ26]. We combine these SSSP running times with the compression in Section 4.3 and the compatible-set computation in Section 4.4. Substituting into (4.2), we obtain a deterministic algorithm for integer costs with running in
time, and a Las Vegas algorithm for arbitrary real costs running in
time with high probability. The compressed arcs have weights 0 or , so compression preserves the integer-weight bound. The randomized integer-weight algorithm of [BNWN22] also achieves the first running time with high probability.
In Section 5, we construct a feasible potential function and use Dijkstra's algorithm to obtain the strongly polynomial running time stated in Theorem 1.1.
4.3 Compressing the Exchange Graph
Throughout this subsection, fix the current set and its forest decomposition . We suppress this dependence in the notation for the search graphs, writing for .
We find the matroid-level augmenting paths using a fine-grained search graph based on forest swaps, similar to Gabow's search graph [Gab95]. We then compress this graph using sparse tables while preserving shortest-path costs.
4.3.1 Fine-Grained Search Graph
The exchange graph is too large in two ways: an exchange needs a matroid-level test, and the arcs join every to every with the same head.
We first replace the matroid exchanges by forest swaps.
Definition 4.11 (Forest Swaps and Joining Elements).
-
For and , we call a forest swap in if , the ends of are connected in , and lies on the -path between them.
-
We say that reaches by forest swaps if there are elements , with , such that each is a forest swap in some . The forest may differ between steps.
-
An element is joining if its ends lie in different components of for some with .
The next lemma relates forest-swap reachability to exchanges and shows how to execute the corresponding paths. It specializes the standard matroid-union augmenting-path argument; see [Sch03, Theorem 42.4].
Lemma 4.12 (Forest-swap reachability and execution). Let .
(a) The element is free iff it reaches a joining element by forest swaps.
(b) If is nonfree, then the elements of reachable from are exactly the elements of in its fundamental circuit.
(c) If is nonfree, a path from to a reachable with the fewest forest swaps yields a forest decomposition of in which each forest keeps its connected components.
We defer the proof to Section A.
Construction of the fine-grained graph . Start with a vertex for every element of and a sink . Each arc has a primary weight and a secondary length . For every free element , add an arc with .
We then add all forest swaps between elements of . Formally, for each and each forest in the decomposition with , if the ends of are connected in , we add an arc with for every on the -path between them. We call this operation scanning into . We iterate over all elements and forests and perform every applicable scan.
To represent the same-head exchanges of , add a head vertex for every . For and , add , .
For a shortest path, the goal is to minimize total weight first and total secondary length second.
Lemma 4.13 (Path Correspondence between and ).
(a) Every simple -to-z path in projects to an augmenting path from in with and .
(b) Conversely, every augmenting path from u with no free element before its last one lifts to a -to-z walk in with the same cost and exchange count.
(c) If I is extreme, then has no negative cycle.
Proof. (a) To project to , delete the head vertices, , and every element that is not immediately followed by a head vertex. Let be the resulting sequence.
Between consecutive head vertices, visits an element and follows forest swaps to an element . If is nonfree, is independent by Lemma 4.12(b); if is free, this holds for every . The segment therefore represents the exchange , with weight and secondary length one. The next element of has the same head as , giving a partition exchange of weight zero. The final segment enters a free element and then , contributing the terminal cost. Thus is an augmenting path with the stated cost and exchange count; its elements are distinct because is simple.
(b) To lift an augmenting path , replace each matroid exchange by a sequence of forest swaps from to . Such a sequence exists by Lemma 4.12(b), since every nonterminal element of is nonfree. Replace each partition exchange by , prepend , and append . The resulting walk has the same cost and exchange count as by the accounting in (a).
(c) A cycle without head vertices has weight zero. A cycle with head vertices projects by the same argument to a closed walk of with the same weight, which is nonnegative when is extreme by Theorem 3.5.
4.3.2 Compressed Search Graph
Tree-path compression. We use the tree-path compression of [SXZ26, Appendix B], which we recall in our notation. The idea is to represent all forest swaps from an element to a tree path by at most four arcs into a shared auxiliary graph.
Root every component of each forest . Write for the ancestor edges above in , and for the edge joining a nonroot vertex to its parent. As in a sparse table, we create jump vertices for power-of-two blocks of root paths.
For every with and , create and add
Give all these arcs weight zero. By induction on , the elements of reachable from through jump vertices are exactly the edges from to . The auxiliary graph has vertices and arcs.
Now let scan its path in , and let be the lowest common ancestor of and . For each nonempty branch from to , let be its length and put . Add weight-zero arcs from to the two jump vertices
omitting one if they coincide. Since , the two length- blocks cover the entire branch. Thus at most four arcs represent all forest swaps from into ; see Figure 2. A route from to an

(a) LCA decomposition
(b) Auxiliary connections and vertices reachable from e when the u-a path has six edges
Figure 2: Tree-path compression, adapted from [SXZ26, Figure 2]. (a) Split the scanned path in at its lowest common ancestor . (b) For a six-edge branch, write , , and . The two entry blocks and cover and , respectively, and share . Blue entries and arcs show the reachable jump structure; green arcs lead to forest elements. Gray entries are not reached from these two blocks. All auxiliary arcs have weight zero.
element , with only jump vertices in between, exists exactly when lies on the scanned path, and has weight zero. Costs and exchange counts remain on the arcs incident to head vertices.
We build the arcs between jump vertices and preprocess each forest for -time LCA queries in total time, using Euler tours and sparse tables. For each scanned tree path, its two-block cover in (4.3) requires only a constant number of ancestor queries. We answer all ancestor queries offline in one depth-first traversal of each forest: maintain the current root path in an array indexed by depth, and answer each query at when the traversal visits . Thus, if the elements scan tree paths in total, the scan graph has arcs and can be built in the same time.
Construction of the compressed graph. To build , replace the forest swaps of by the jump construction above.
We then suppress the vertex for every element : we combine its only incoming arc, from head, with each outgoing arc and label each resulting arc by , so that we can recover when reconstructing an augmenting path. The remaining vertices are those for elements of , the head vertices, the jump vertices, and . This reduces the number of vertices from to , avoiding an additional logarithmic factor on the term in Dijkstra's running time.
For a scanning element , let be the (at most ) jump vertices covering its scanned tree paths as in (4.3). The resulting arcs are listed below; we keep parallel arcs as they can have different labels.
| type | arc | w | q | label |
|---|---|---|---|---|
| Head exchange | 1 | — | ||
| 0 | e | |||
| Forest scans | 0 | 0 | — | |
| jump vertex child | 0 | 0 | — | |
| 0 | 0 | — | ||
| To the sink | 0 | e |

the label and the final element give the exchange ; stays in , and only leaves the set
Figure 3: A path segment between two head vertices in the compressed graph. The label records an element entering and scanning . The element scans . Only the arcs incident to head vertices carry costs, and only the arc into a head vertex counts as an exchange for the tie-breaker .
Lemma 4.14 (Search in the compressed graph). The statements of Lemma 4.13 hold for as well. If is extreme, the distance from each to equals the minimum cost of an augmenting path from in .
Proof. To project a simple -to- path in to , first insert each arc label just after its head vertex. Then delete the head vertices, , the jump vertices, and every element not immediately followed by a head vertex. See Figure 3 for an example.
Each jump route represents exactly one forest swap, so the same argument as in Lemma 4.13(a) shows that the projection preserves the cost and exchange count. Its elements of are distinct because the search path is simple. Its labels from are also distinct: every arc labeled by leaves the same vertex head, which the path visits at most once. Hence the projection is an augmenting path.
Conversely, lift an augmenting path with no nonterminal free element to a walk in using Lemma 4.13(b). Replace each forest swap by a jump route and suppress each vertex , keeping as a label. This gives a walk in with the same cost and exchange count.
Expanding a cycle in gives a closed walk in with the same weight. Thus has no negative cycle when is extreme, by Lemma 4.13(c). Finally, a shortest augmenting path has no nonterminal free element by Lemma 4.3, so it lifts to a walk in . Conversely, a shortest simple search path projects to an augmenting path of the same cost. These two directions give the distance equality.
Restricting scans to one forest. So far, an element may scan up to forests. Following the cyclic-scanning idea of Gabow and Westermann [GW92, Lemma 2.2], we restrict each element to scan only one forest. We now let every element of scan only , and every element of scan only , with indices modulo ; all other arcs and weights stay the same. For , elements of do not scan. Thus , and these jump vertices cover at most one tree path.
These cyclic scans preserve the elements of reachable from each nonfree element ; we defer the proof to Section B. This is the reachability property used above, so Lemma 4.14 remains valid. From now on, denotes this restricted graph.
Each element now scans at most one tree path, and the jump graphs of the forests have total size. We can therefore build in time, with
Shortest paths and path recovery. Suppose that is extreme. Compute exact distances to by one reverse SSSP computation on . We then keep only arcs satisfying , and run a reverse 0–1 BFS from with lengths . This gives a shortest-path tree that minimizes the number of exchanges among minimum-cost paths. For each chosen with finite distance, project its tree path to to obtain the proposal , by Lemma 4.14.
The work after SSSP takes total time. Filtering and BFS are linear. To bound the total length of the tree paths, note that their projections have no nonterminal free element. Thus the scans of the path from stay inside , and each visited jump vertex represents a nonempty tree-path segment inside . Paths from distinct blocks are therefore vertex-disjoint except at , so projecting takes total time as well.
4.4 Finding a Maximum Compatible Set of Proposals
Let be the arc set of the contracted graph in Section 4.2.2, and let . We call the arcs in mandatory. The algorithm of Lemma 3.6 gives a basis of , possibly missing some arcs of . We repair by restoring these arcs one at a time, each time removing an arc outside and updating the forest decomposition by forest swaps. In this subsection all forests and tight blocks are in the contracted graph.
Algorithm 2 EXTEND(H): largest independent with
Input: the arc set of the contracted graph on vertices, with indegree at most , where is independent in
Output: a largest independent with , and a forest decomposition of
1: compute a basis of with forest decomposition using Lemma 3.6
2: compute
3: for each block do
4: while some is not in do
5: build a graph representing all forest swaps among , using forest scans and the tree-path compression of Section 4.3.2
6: find a path of forest swaps with and minimum BFS
7: for all at once: remove from its old forest and insert into
8:
9: return with its current forest decomposition
Lemma 4.15 (Restoring a mandatory arc). Let be a -tight block and let . Given the spanning trees , we can find an arc and a decomposition of into spanning trees of in time.
Proof. The fundamental circuit of with respect to is not contained in the independent set (as ), so it contains an element of . By Lemma 4.12(b), there is a path of forest swaps from to . We find such a path with the fewest swaps. By Lemma 4.12(c), executing these forest swaps gives a decomposition of with the same forest components. Thus each forest remains a spanning tree of , and all elements of are preserved.
For the running time, we use the tree-path compression of Section 4.3.2 without the cyclic-scanning restriction: and every element of scan their paths in all trees that do not contain them. The resulting graph has arcs. A 0-1 BFS, with length one on arcs leaving element vertices, finds a path with the fewest swaps in time linear in the size of this graph.
Lemma 4.16. Algorithm 2 is correct and runs in time.
Proof. Correctness. Since every vertex of the contracted graph has indegree at most , Lemma 3.6 guarantees that the initial forest packing is a basis of . An element of that crosses would be free for (Lemma 3.2), so all missing mandatory arcs lie inside blocks.
Each iteration of the inner loop repairs one missing mandatory arc using Lemma 4.15: it adds that arc, removes an arc outside , and keeps every forest restricted to a spanning tree. Therefore, after the while loop (Line 4), contains .
Each repair replaces, for each , the spanning tree by another spanning tree on , leaving all other arcs unchanged. Thus every remains a forest. The final set contains and has the same cardinality as the initial basis, so it is a largest independent set containing .
Running time. The initial basis computation takes time by Lemma 3.6. Each block is missing at most mandatory arcs: the heads in receive at most arcs of , whereas . Thus each block requires at most repairs, taking
time in total.
We implement the extension step of Algorithm 1 by computing and taking . Since by Lemma 4.6 and , the extension takes time per phase.
4.5 Proof of the Relaxation Theorem
We return to the matroid-and-partition setting of Section 4.1 and use one more fact from [Sch03]. Our exchange graph is the reverse of the one there, and the weight of a cycle, i.e., the total weight of its arcs, is its length there for the weights .
Lemma 4.17 ([Sch03, Lemma 41.5]). Let be common independent in and , let be a cycle in , and let . If is not common independent, then has a cycle with such that , or and .
Proof of Theorem 4.2. We first verify that an augmenting path from class exists whenever . In this case, is not a maximum-cardinality common independent set of and . By Theorem 3.5, there is a path from to in . Every arc of this graph that is absent from enters . The suffix starting at the last vertex in therefore lies in and is an augmenting path from class .
For every such , define the minimum augmenting-path cost
We will prove that .
We adapt the virtual-element construction in the proof of [Sch03, Theorem 41.6], adding one virtual element for each relaxed class. Fix such that for every . For each , let be a new virtual element of cost , and let . We extend and to matroids and on as follows:
• A set is independent in iff is independent in .
- is the partition matroid obtained by adding to class and increasing its capacity by one, for every .
Then is common independent in and , and every class is full. Let . Figure 4 illustrates this construction.
(a) Original exchange graph
(b) Add virtual elements

Figure 4: The virtual-element construction. The yellow band marks an augmenting path from class ; the two outer arcs extend to a cycle through . Every element of has an -exchange arc to every element of ; in the right panel, every element of has an -exchange arc to every element of .
Claim. The set is extreme for and , and
Proof of the claim. By Theorem 3.5, it suffices for extremality to show that has no negative cycle. Compared with , the graph has the new vertices and the following additional arcs:
Indeed, is independent in iff , and in iff .
Since has no negative cycle, any negative cycle in must pass through . Split such a cycle at its virtual elements into pieces , where is an augmenting path from class in . This piece has weight . Each piece ends at the virtual element where the next piece begins (cyclically), so the total weight is
Thus the cycle has nonnegative weight, and is extreme.
Every independent set of with class counts is also common independent in and , with . Hence
which proves the lower bound.
Part (a). Let be any shortest augmenting path from class , so . Take in the construction above. By the claim, is extreme, and has no negative cycle.
We next show that is independent. Extend by the arcs and to form a cycle . Then and . If this set were not common independent in and , Lemma 4.17 with would give a cycle through with and , since has no negative cycle. Removing from would leave an augmenting path from class of cost with fewer exchanges, contradicting the tie-breaking rule for . Thus is independent in with class counts .
Its cost is , matching the lower bound (4.5) for . Hence .
Part (b). If , the inequality is immediate. Otherwise, for each , relaxing alone is feasible, i.e., . By part (a), for every , so (4.5) gives the desired inequality.
5 Strongly Polynomial Algorithm via Vertex Prices
We now complete the algorithm and prove Theorem 1.1. We maintain vertex prices that certify optimality of the current set. The vertex prices can be viewed as dual variables for the current indegree equalities. We first show how to update them so that any compatible batch preserves the certificate, and then extend them to a feasible potential on the compressed graph. This lets us find the required paths using Dijkstra's algorithm within the batching framework of Section 4.
This shares the spirit of the classical weight-splitting approach to weighted matroid intersection [Fra81]; see also [Sch03, IT76]. For general matroid intersection, the split weights are attached to elements. In bipartite matching, where both matroids are partition matroids, they can be attached to the vertices, that is, to the classes of the partitions, on both sides. In our setting, one side is a partition matroid, so we naturally get vertex prices on that side. We believe the invariant and update below also apply to an arbitrary matroid intersected with a partition matroid.
5.1 Price Invariant
For vertex prices , the adjusted cost of an arc is , and . The algorithm keeps and for every , and maintains
The minimum ranges over all independent sets, with no restriction on their cardinalities or indegrees. Since , sets with the same indegree vector receive the same price adjustment. Thus this invariant implies that is extreme within its indegree vector as well.
We use the following standard local optimality conditions to maintain this invariant.
Lemma 5.1 (Local optimality conditions). Let be a matroid with costs on its ground set, and let be independent. Then minimizes over all independent sets iff
Proof. Necessity is clear. For sufficiency, run the matroid greedy algorithm on the negative-cost elements in increasing cost order, breaking ties in favor of elements of . Inductively, it accepts exactly the elements of encountered so far: an element of can be added since is independent; for a negative-cost , (5.3) implies that is dependent, and (5.4) puts every element of in its fundamental circuit before in the order, so is rejected. The resulting set is optimal among all independent sets. By (5.2), the remaining elements of have cost zero; adding them preserves optimality and gives .
By Lemma 5.1, (5.1) holds iff the conditions (5.2)–(5.4) hold for the adjusted costs .
Initialization. If some has fewer than entering arcs, no packing exists, and we stop. Otherwise start with , for , and . Then all adjusted costs are nonnegative, and (5.1) holds.
Adjusted distances. For , let be the minimum cost of an augmenting path from in , with if none exists, and define the adjusted distance . For an augmenting path , write for its adjusted cost. If starts from , the prices of and cancel as they share the same head, so
Regrouping the element costs gives . By Lemma 5.1, every term is nonnegative, so .
5.2 Price Update
Assume that the augmenting distances and shortest proposals have been computed. A shortest proposal from has adjusted cost . If , executing it would violate the price invariant: the old independent set would have smaller adjusted cost than the new one.
We therefore first update the prices so that remains optimal and every shortest proposal has zero adjusted cost. Any compatible batch then preserves the same optimum. We denote the new prices by and the new adjusted costs by .
By (5.5), setting makes a shortest proposal from have adjusted cost . To handle vertices with no augmenting path as well, we cap the increments:
Since is the largest finite , the cap only changes vertices with : it keeps their prices finite, and it is large enough for the exchange conditions in the proof below.
Lemma 5.2 (Price update and batch augmentation).
(a) minimizes over all independent sets of .
(b) If , then , and every shortest augmenting path from has .
(c) After executing the proposals whose terminals belong to a compatible set , the resulting set minimizes over all independent sets of .
Proof. (a) Write for the price increment at . Then and . We verify the three conditions of Lemma 5.1.
• For , increasing the price can only decrease its adjusted cost, so .
-
For a free element , the single-element augmenting path has adjusted cost . Hence , giving .
-
Consider a nonfree and with independent. Given an augmenting path from head, prepend the exchange and a partition exchange from to the first element of . Deleting nonnegative cycles gives an augmenting path from head. Hence by the triangle inequality of shortest paths,
Since , taking the capped distances gives
Thus .
Thus remains optimal for .
(b) If is finite, then . By (5.5), every shortest augmenting path from therefore has
(c) By (a), the old set is optimal for . By (b), each executed proposal has zero adjusted cost. Since the executed proposals are element-disjoint,
The new set is independent by Lemma 4.7, so it attains the same optimum.
Parts (a) and (b) also give an alternative price-based proof of the lower bound in Theorem 4.2(b).
5.3 Potential for the Compressed Graph
We now extend the vertex prices to a feasible potential on the compressed graph. Let Q be the subgraph of induced by the vertices for elements of I and the jump vertices, with only the arcs that represent cyclic forest swaps. Define
(5.6)
Here reachability includes paths of length zero. The internal potentials propagate the bounds backward along scan paths. Write for the reduced arc weights.
Lemma 5.3 (A feasible potential). Under (5.1), all reduced weights are nonnegative. In particular, has no negative cycle.
Proof. Every vertex of reaches an element of , so is finite. We verify nonnegativity for each type of arc.
- Forest-scan arcs . Every element of reachable from is reachable from , so . Hence
- Arcs , . By the definition of , since reaches itself in . So
- Arcs head labeled by . Let achieve the minimum defining , so and is reachable from through forest swaps.
If is nonfree, is independent by Lemma B.1, so by (5.4). If is free, by (5.3) and (5.2). Hence
- Arcs head labeled by a free element . Since , their reduced weight is
by (5.3).
We compute in time by propagating minima backward over the acyclic graph of strongly connected components of .
5.4 Algorithm and Analysis
We first show how one Dijkstra computation gives both the adjusted distances needed for the price update and the proposals needed for batch augmentation.
Lemma 5.4 (Computing Adjusted Distances and Proposals). Under (5.1), the distance from to in with weights is . One reverse Dijkstra computation from , followed by path recovery as in Section 4.3.2, computes all and the proposals for the chosen vertices with finite distance in total time.
Proof. By Lemma 5.3, all reduced weights are nonnegative. For any -to- path , the potential terms cancel along the path, and
By Lemma 4.14, minimizing gives the minimum cost of an augmenting path from . Subtracting gives its minimum adjusted cost, namely . Thus Dijkstra on the reversed graph computes the adjusted distances at the head vertices.
Since reweighting shifts all path costs from the same start by the same amount and leaves the exchange counts unchanged, the path-recovery procedure of Section 4.3.2 applies directly with weights in place of .
Graph construction, potentials, and recovery take time. Using Fibonacci heaps [FT87], Dijkstra takes time by (4.4).
Initialize and the prices as in Section 5.1, and use Algorithm 3 for each iteration of Algorithm 1. The price update uses the distances of all head vertices, including those not chosen as augmentation starts; unreachable heads receive the capped increment of Section 5.2.
Algorithm 3 One phase with Dijkstra and selection on the contracted graph
Input: with a forest decomposition and prices satisfying (5.1)
1: compute ; choose a deficient vertex in each deficient block
2: build with cyclic scans and compute
3: run Dijkstra from in the reverse of with weights ; let be the distances
4: set for all
5: if some , return “infeasible”
6: recover the proposals using distances and weights , as in Section 4.3.2
7: for all
8: contract the old blocks and form the arc set using the old and the proposed terminals
9: ;
10:
11: compute a forest decomposition of using Lemma 3.6
12: return with these forests
Proof of Theorem 1.1. Correctness. By Lemmas 5.2 and 5.4, our implementation computes the required proposals and preserves the price invariant. Correctness therefore follows from the batching framework in Section 4.2, followed by the arborescence extraction of Lemma 3.7.
Running time. By Lemma 5.4 and Section 4.4, we may take and in Lemma 4.9, giving (1.1). Table 2 summarizes the costs of each step.
| Step | Time per phase |
|---|---|
| Tight blocks and contracted graph | |
| Compressed graph and feasible potential | |
| Dijkstra, tie-breaking, and path recovery | |
| Basis computation and mandatory repair on the contracted graph | |
| Apply chosen proposals and rebuild on the original vertices | |
| Number of phases | |
| Final arborescence extraction (once) |
Table 2: Cost of each step, where is the number of old tight blocks. Summed over the phases, the term of Dijkstra's algorithm gives the term of (1.1).
6 Applications
6.1 Indegree-Bounded Forest Packing
Theorem 6.1 (Indegree-bounded forest packing). Let for every . Call feasible if is independent in and for every . A feasible set of maximum cardinality and, subject to that, of minimum cost can be computed deterministically in
time for arbitrary real costs. The algorithm also returns a forest decomposition of the set.
Proof. The algorithm in Theorem 1.1 requires indegree exactly k at every nonroot vertex. We add a new root s with k arcs into each vertex v, of two kinds:
forced arcs of cost . They are so cheap that every optimum contains all of them, so they use up the capacity that the bound takes away.
heavy arcs of cost . They serve as placeholders for unused slots; they are so expensive that an optimum uses as few of them as possible.
Here exceeds the total absolute cost of the original arcs, and we denote the set of new arcs by . Then alone already forms a packing of -arborescences, so we can apply Theorem 1.1 to the auxiliary graph to get a minimum-cost packing .
On the one hand, gives a feasible set in . First, contains all forced arcs: omitting one increases their total cost by at least , while the total cost of all other arcs can vary by at most . Thus any packing omitting a forced arc is more expensive than the packing consisting of all arcs in . Let . It is independent as a subset of , and the forced arcs leave only slots at each , so . Hence is feasible in . The packing uses heavy arcs, so
where the constant depends only on the instance.
On the other hand, any feasible set can be extended to a packing in . Add all forced arcs and heavy arcs at each , obtaining a set with indegree at every original vertex. To check (3.1), a vertex set not containing contains only arcs of , while a set containing has at most internal arcs by the indegree bound. Hence is independent in , and Lemma 3.1 shows that it is a packing of -arborescences. This extension uses heavy arcs, so
with the same constant as above.
Finally, by the optimality of , we have , so
for every feasible . The costs of any two subsets of differ by less than , so has maximum cardinality and, subject to that, minimum cost.
The auxiliary graph has vertices and arcs, so Theorem 1.1 gives the stated running time.
6.2 Undirected Forest Packing
In this subsection is an undirected multigraph. The matroid on edge set is the union of copies of the graphic matroid. Its bases are the maximum-cardinality unions of forests, so the task is to find a minimum-cost basis of .
Write for the time of a deterministic algorithm that finds an integral minimum-cost maximum flow in a network with N vertices and M arcs, whose costs and capacities are integers bounded by a polynomial in .
Theorem 1.2 (Undirected forest packing). Let be an undirected multigraph with vertices, edges, and arbitrary real edge costs, and let be an integer. A minimum-cost maximum-cardinality union of edge-disjoint forests, together with a forest decomposition, can be computed deterministically in
time.
Plugging in deterministic min-cost flow [vdBCK ] gives the running time
The resulting algorithm is strongly polynomial and runs in time for fixed k.
Before describing the algorithm, we introduce pseudoforests.
Pseudoforests. A pseudoforest is a graph in which every connected component has at most one cycle. Let be the pseudoforest matroid, also called the bicircular matroid, whose independent sets are the pseudoforests, and let be the union of copies of ; its independent sets are the unions of edge-disjoint pseudoforests, which we call -pseudoforests. A set is independent in iff
Equivalently, X can be oriented so that every vertex has indegree at most k.
Indeed, by Hakimi’s orientation theorem [Hak65, Theorem 4], (6.2) holds iff has an orientation with indegree at most at every vertex. Given such an orientation, split into parts so that every vertex has at most one incoming edge in each part. Each part has indegree at most one, so it is a pseudoforest. Conversely, orienting each pseudoforest with indegree at most one gives an orientation of with indegree at most . Since , every -independent set is -independent.
Overview. The algorithm repeats a round that follows [AK26, Section 4].
(1) Choose a minimum-cost maximum-cardinality k-pseudoforest , together with an orientation of indegree at most k. This can be done with minimum-cost maximum flow.
(2) Inside , choose a minimum-cost maximum-cardinality union of forests. Using this orientation, we find by Theorem 6.1 with all bounds equal to .
(3) Contract all -tight blocks, and repeat on the contracted graph. The edges of that survive the contraction are inherited by the next round.
Contracting a block fixes its internal forest edges in the final solution, so we must ensure that these edges belong to an optimal solution. The next lemma shows that if both choices follow the same greedy order, then is contained in the forest packing obtained by running greedy directly on all edges under that order.
6.2.1 Two-Stage Greedy Lemma
Greedy bases. Fix a strict total order on . For a matroid on and a set , let be the set obtained by scanning in this order and accepting every edge that keeps the accepted set independent. We use three standard facts.
-
If is a prefix of the order, then .
-
An edge is rejected iff it lies in the closure of the edges accepted before it. In particular, is a basis of in .
-
If the order lists the edges by nondecreasing cost, then is a minimum-cost basis of . It is the unique one if all costs are distinct.
Order the edges of by , and call this the order. Let for the cost order. By the third fact, is a minimum-cost maximum-cardinality union of forests, and it is the set that Theorem 1.2 computes. We call the greedy optimum.
Lemma 6.2 (Two-stage greedy). Fix a strict total order on . With respect to this order, let
Then .
Proof. Run the three greedy scans in parallel. For a prefix of the order, write , , and . By the first two facts, and are bases of in and in , and is a basis of in . We show that for every prefix ,
Intuitively, the left-hand side denotes all the elements that will be “rejected” by , while the right-hand side denotes that these elements should be either “rejected” by (so they won’t have the chance of getting into ), or “rejected” by itself.
The closure in . Call a vertex set saturated if , that is, if attains the bound (6.2). The function is supermodular, so (6.2) for gives for saturated and . Hence unions of saturated sets are saturated, and the union of all saturated sets is the largest saturated set; may be empty. An edge makes dependent iff some saturated set contains both ends of , that is, iff . Therefore
Blocks of do not cross . Let be a -tight block, so . We claim that or . Suppose not. Since , every edge of outside belongs to . Using (3.1) for and the nonempty set , we get
By (6.2), equality holds, so is saturated. Since , this contradicts the maximality of .
Proof of (6.3). Let . This is an edge that the direct scan would reject but the first stage would accept. We show that , so the second stage would reject it. Since , we have , and in particular . As is dependent, Lemma 3.2 puts both ends of in one -tight block , and . The block is not inside , since otherwise . By the claim, is disjoint from , so . Since is a basis of in ,
Conclusion. Let , and let be the set of edges before . Both stages accept , so and . By (6.3), , so the direct scan accepts . Thus .
Remark 6.3 (Matroid pairs). The conclusion of Lemma 6.2 extends to any pair of matroids on a common ground set , with in place of , respectively, provided that
6.2.2 Algorithm and Analysis
Preprocessing. For each pair of vertices, keep only the cheapest parallel edges under the cost order. As every union of forests contains at most edges between any two vertices, this does not change the solution. The number of edges is thus reduced to at most , which is polynomial in and ; this absorbs the cost sorting time and keeps the running-time bound clean.
Let be the set inherited from the preceding round, initially empty. Let list first in the cost order, followed by the remaining edges in the cost order. In each round we compute
with respect to , contract the -tight blocks, and inherit the remaining edges of .
Algorithm 4 Minimum-cost maximum-cardinality undirected forest packing
Input: undirected multigraph , integer , real edge costs
Output: a minimum-cost maximum-cardinality union of forests, with a forest decomposition
1: delete loops; for each vertex pair, keep only its cheapest parallel edges
2: sort the remaining edges by ; start with an empty stack
3: loop
4: compute with respect to , with an orientation of indegree
5: compute with respect to , with a forest decomposition
6: if then
7: lift the forest decomposition of through previous contractions, and return it
8: compute and let be the set of edges of inside blocks; push the trees inside every nonsingleton block onto the stack
9: contract every block, delete loops, and set
We implement the two greedy choices using minimum-cost algorithms. As in [GW92, Section 3], assign each edge the cost , its position in . Since these costs are distinct and increase along , the unique minimum-cost bases are exactly the bases obtained by greedy in this order.
Computing . We build a flow network with a super source , a super sink , a node for every current edge , and a node for every current vertex. Its arcs are as follows.
| arc | capacity | cost |
|---|---|---|
| 1 | ||
| 1 | 0 | |
| 0 |
An integral flow selects when carries a unit, and it orients toward the end that receives this unit; this gives a -pseudoforest with an orientation of indegree at most . The edge set selected by a maximum flow is therefore a basis of , and a minimum-cost maximum flow gives the minimum-pos-cost basis, which is , together with an orientation. The network has vertices and arcs, and its costs and capacities are integers at most .
Computing . Apply Theorem 6.1 to this orientation of , with costs pos and indegree bounds for every vertex . Since the orientation has indegree at most , every subset of satisfies the bounds, so the indegree bounds impose no extra restriction here. Hence we obtain as the minimum-pos-cost maximum-cardinality -forest inside , together with a forest decomposition.
Proof of Theorem 1.2. Optimality. At the start of each round, let be the greedy optimum of the current graph under the cost order. We maintain two invariants:
-
;
-
adding the edges saved inside previously contracted blocks to gives the greedy optimum of the original graph.
Both hold initially, since and no edges have been saved.
We use a simple property of greedy: moving a subset of a greedy basis to the front, while preserving the order of all other edges, leaves that basis unchanged. Indeed, inductively, every basis edge is still accepted, and every other edge is still rejected because the earlier basis edges that caused its rejection remain before it. Since , greedy under still returns . Both scans accept first, since it is independent in both matroids. Together with Lemma 6.2, this gives
Now consider the contraction step. Let be the edges contracted in this round. Since , all these edges belong to the optimum we want to recover. We claim that the greedy optimum after contraction is .
To see this, consider a greedy scan that processes first and then the remaining edges in the cost order. By the same property, it still returns . After accepting , it rejects every other edge internal to a block, since already consists of spanning trees of . On the surviving edges, its independence tests are exactly those in the contracted graph, by the contraction and lifting argument of Lemma 4.5. Hence the claim follows.
Therefore, the inherited set in the next round is , which is contained in , preserving the first invariant. Saving the edges of and replacing by also preserves the second.
Termination. Ignoring costs, each round follows the same steps as [AK26, Algorithm 4]: is a maximum-cardinality -pseudoforest containing , is a maximum-cardinality forest packing inside , and all -tight blocks are contracted. The cost-based choices preserve these properties, so the progress analysis of [AK26, Lemmas 4.5–4.6 and Corollary 4.7] applies: there are rounds, and when , the set has maximum cardinality in the current graph.
Since , we have at termination. By the second invariant, lifting its forest decomposition through the saved trees, as in Lemma 4.5, recovers the original greedy optimum.
Running time. Preprocessing takes time. The remaining graph has at most edges, so sorting costs . Since , these costs are absorbed by the flow term in (1.2). In each round we compute in time and, since , compute in time by Theorem 6.1. The remaining work per round takes time, including tight-block computation by Lemma 3.4. Since over all contracted nonsingleton blocks, storing and lifting the saved trees takes time in total. Summing over rounds gives (1.2).
All flow costs and capacities are integers bounded by , so using [vdBCK+23] gives (6.1). The original real costs are used only in preprocessing and sorting, so the algorithm is strongly polynomial.
6.3 Minimum-Cost k-Edge-Connected Spanning Subgraphs
For the undirected problem, we use the reduction of Khuller and Vishkin [KV94] (see also [CHN 22, Theorem 34]). For the directed problem, we combine an outward and an inward packing. Write for the edges of an undirected graph with exactly one endpoint in , and for the arcs of a digraph entering from outside. An undirected graph is k-edge-connected if for every nonempty proper vertex set , and a digraph is strongly k-edge-connected if for every such . Costs are nonnegative.
Corollary 6.4. Let . There are deterministic 2-approximation algorithms, which also detect infeasibility, for
(i) the minimum-cost k-edge-connected spanning subgraph of an undirected graph, and
(ii) the minimum-cost strongly k-edge-connected spanning subgraph of a digraph.
Both algorithms have the same running time as the algorithm in Theorem 1.1.
Proof. Each reduction makes at most two packing calls on vertices and at most arcs.
(i) Fix a root , replace every edge by two arcs and of cost , compute an optimal packing of r-arborescences, and return the edges with at least one arc in . For a cut with (possibly after complementing), each arborescence has an arc entering , so has at least such arcs. They correspond to distinct undirected edges, because the two orientations of an edge cannot both enter .
For an optimal solution , the bidirected graph of contains arc-disjoint r-arborescences by Edmonds' theorem [Edm73], so . The same argument shows that infeasibility of the packing implies infeasibility of the problem.
(ii) Return the union of an optimal packing of out-arborescences rooted at and an optimal packing of in-arborescences rooted at , the latter computed on the reversed graph. If , then gives arcs entering ; if , then gives arcs leaving . An optimal contains both kinds of packings by Edmonds' theorem, so .
The same approximation ratio and running time hold for connectivity augmentation: give the edges of the existing subgraph cost zero and add that subgraph to the output.
A Forest-Swap Reachability and Execution
We prove Lemma 4.12 for the fixed forest decomposition . We first state triangular exchange for forests and include the elementary proof, following [SXZ26, Lemma 3.2].
Lemma A.1 (Triangular exchange for forests). Let be a forest. For an edge whose ends are connected in , let denote the path between them. Let be pairs such that , , and for every . Assume moreover that for every , . Then is again a forest.
Proof. For each , removing from separates its connected component into two parts. Since , the edge crosses this cut.
Suppose the final graph contains a cycle , and choose the largest index such that . Since crosses the cut of , the cycle must contain another edge crossing the same cut. No edge of crosses it. If this other edge is some with , then , contradicting the assumption. If it is some with , this contradicts the choice of . Hence no such cycle exists, and the final graph is a forest.
Proof of Lemma 4.12. If is nonfree, its ends lie in one tight block by Lemma 3.2. Every is a spanning tree of , so forest swaps from elements internal to stay internal to , and no such element is joining. Conversely, suppose that reaches no joining element, and let consist of and the elements of it reaches. For each , every has its -path inside , so spans in the graphic matroid, and . Hence , so is not a union of forests, and is dependent.
For the second claim, let be nonfree and let be as above. If is not reachable, then , so is dependent. Suppose now that is reachable. Take a path with the fewest forest swaps. For each , let be the forest containing . We simultaneously replace by in for all .
Fix a forest and list its exchanges as in path order. Each is a forest. For , the -path of cannot contain , since the swap would shorten the path. The are distinct and outside , and the are distinct and in . By Lemma A.1, the resulting edge set is a forest. Each exchange adds and removes an edge within the same original component of , so each such component retains its number of edges and remains a spanning tree. Thus each forest keeps its connected components. Intermediate elements move between forests, while enters and leaves, so the resulting forests partition . This proves both the execution claim and the independence of , completing the characterization of the fundamental circuit.
B Cyclic Scans
We prove that the cyclic scans used at the end of Section 4.3.2, a special case of the cyclic-scanning principle of Gabow and Westermann [GW92, Lemma 2.2], preserve the elements of reachable from each nonfree element . This justifies the restriction to one scanned tree path per element.
Lemma B.1 (Cyclic reachability). Let be a union of spanning trees of a vertex set , and let have both ends in . Keep only the following forest swaps:
(a) scans its path in , and
(b) if , each element of scans its path in (indices modulo ).
Then the elements of reachable from are exactly the elements of in the fundamental circuit of in .
Proof. For this is the tree-path description of a fundamental circuit. Let , and let be the set of elements of reachable from . Every element of has its -path in , so
Thus these closures are equal, with common graphic rank . Since each is a forest, it is a basis and .
The -path of lies in , so . Hence has size and graphic rank . Its rank in is therefore at most , so is dependent.
On the other hand, is independent in . So contains the unique circuit of , the fundamental circuit of , and every element of in this circuit is reachable from . Conversely, an element reachable with the kept swaps is also reachable with all forest swaps, so it lies in the fundamental circuit by Lemma 4.12(b) applied to ; here is nonfree since is -tight.
We now apply Lemma B.1 to the whole graph , in which every element of scans and every element of scans . Fix a nonfree , and let be the tight block containing its ends (Lemma 3.2). Each is a spanning tree of , so the scanned path of every element internal to stays in . Moreover, forest swaps only enter elements of , so a path from never passes through another element of . Hence the elements of reachable from are those given by Lemma B.1 with , namely the elements of in the fundamental circuit of . This is the reachability property used in Lemma 4.14. Free elements need no such property, since a shortest augmenting path uses a free element only as its last element (Lemma 4.3), through its arc to . Restricting the scans only removes arcs, so it changes no arc weights or exchange counts.
Acknowledgments
The author thanks Thatchaphol Saranurak for suggesting the problem, for recommending textbooks that helped the author develop the virtual-element proof of the relaxation theorem (Theorem 4.2), and for pointing out that the algorithm of Arkhipov and Kolmogorov could implement the rebuild step. The author also thanks him for many helpful discussions and suggestions on the exposition.
AI Methodology Statement
The author began studying this problem in fall 2025, before using AI tools for this project. The author developed the initial algorithmic framework, including the idea of extending Gabow's algorithm using matroid-level augmenting paths, the elementary virtual-element argument for the relaxation theorem, much of the batching framework, rebuilding forest decompositions between phases, and sparse-table compression of the search graph.
But the initial batching argument was incomplete. The author had considered tight blocks among possible ways to repair it, but had not resolved how to compute a maximum compatible set of proposals while keeping the required arcs.
After the release of GPT-6 Astra, the author provided it with a research note describing the above ideas and approach. In subsequent discussions, GPT proposed the approach that developed into the repair procedure in Section 4.4. The author further simplified the compatibility argument by observing that tight blocks could be contracted before performing the block-internal replacements.
Following the author's suggestion to replace black-box negative-weight shortest paths with a potential-based method, GPT also proposed the vertex-price update and compressed-graph potential developed in Sections 5.2 and 5.3. The weight assignment and potential were subsequently simplified through further discussion, including the author's suggestion to concentrate the weights on arcs incident to head vertices.
The author devised the reduction for the bounded-indegree problem in Section 6.1. The author then suggested using ideas from Arkhipov and Kolmogorov to address undirected forest packing; GPT assisted in developing the extension in Section 6.2, particularly the proof of Lemma 6.2.
GPT and Claude Opus 5.5 assisted with initial drafting, proof simplifications, and related-work discussions. The author directed the manuscript's organization and exposition, subsequently rewrote the vast majority of the paper, and revised the entire text. The author verified the correctness and originality of all content, including references.
References
[AK26] Pavel Arkhipov and Vladimir Kolmogorov. Faster algorithms for packing forests in graphs and related problems. In Kasper Green Larsen and Barna Saha, editors, Proceedings of the 2026 Annual ACM-SIAM Symposium on Discrete Algorithms
(SODA), pages 4023–4042. Society for Industrial and Applied Mathematics, 2026. Full version: arXiv:2409.20314v3.
[BCHI21] Sylvia Boyd, Joseph Cheriyan, Arash Haddadan, and Sharat Ibrahimpur. Approximation algorithms for flexible graph connectivity. In 41st IARCS Annual Conference on Foundations of Software Technology and Theoretical Computer Science (FSTTCS 2021), volume 213 of Leibniz International Proceedings in Informatics (LIPIcs), pages 9:1–9:14. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2021.
[BHKP08] Anand Bhalgat, Ramesh Hariharan, Telikepalli Kavitha, and Debmalya Panigrahi. Fast edge splitting and Edmonds’ arborescence construction for unweighted graphs. In Proceedings of the Nineteenth Annual ACM-SIAM Symposium on Discrete Algorithms, pages 455–464. SIAM, 2008.
[BMNT23] 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, pages 1229–1242. ACM, 2023.
[BNWN22] Aaron Bernstein, Danupon Nanongkai, and Christian Wulff-Nilsen. Negative-weight single-source shortest paths in near-linear time. In 2022 IEEE 63rd Annual Symposium on Foundations of Computer Science (FOCS), pages 600–611. IEEE, 2022.
[Bor26] Otakar Borůvka. O jistém problému minimálnim. Práce Moravské přírodovědecké společností, 3(3):37–58, 1926.
[CHN 22] Parinya Chalermsook, Chien-Chung Huang, Danupon Nanongkai, Thatchaphol Saranurak, Pattara Sukprasert, and Sorrachai Yingchareonthawornchai. Approximating k-edge-connected spanning subgraphs via a near-linear time LP solver. In 49th International Colloquium on Automata, Languages, and Programming (ICALP 2022), volume 229 of LIPIcs, pages 37:1–37:20. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2022.
[CJK26] Karthekeyan Chandrasekaran, Raymond Jiang, and Krishna Kalathur. A -approximation for -flexible graph connectivity, 2026. arXiv:2609.14243.
[CL65] Y. J. Chu and T. H. Liu. On the shortest arborescence of a directed graph. Scientia Sinica, 14(10):1396–1400, 1965.
[Edm67] Jack Edmonds. Optimum branchings. Journal of Research of the National Bureau of Standards, Section B: Mathematics and Mathematical Physics, 71B(4):233–240, 1967.
[Edm73] Jack Edmonds. Edge-disjoint branchings. In Randall Rustin, editor, Combinatorial Algorithms, pages 91–96. Algorithmics Press, New York, 1973.
[Fra81] András Frank. A weighted matroid intersection algorithm. Journal of Algorithms, 2(4):328–336, 1981.
[FT87] Michael L. Fredman and Robert E. Tarjan. Fibonacci heaps and their uses in improved network optimization algorithms. Journal of the ACM, 34(3):596–615, 1987.
[Gab95] Harold N. Gabow. A matroid approach to finding edge connectivity and packing arborescences. Journal of Computer and System Sciences, 50(2):259–273, 1995.
[GGST86] Harold N. Gabow, Zvi Galil, Thomas Spencer, and Robert E. Tarjan. Efficient algorithms for finding minimum spanning trees in undirected and directed graphs. Combinatorica, 6(2):109–122, 1986.
[GW92] Harold N. Gabow and Herbert H. Westermann. Forests, frames, and games: Algorithms for matroid sums and applications. Algorithmica, 7:465–497, 1992.
[GX89] Harold N. Gabow and Ying Xu. Efficient algorithms for independent assignments on graphic and linear matroids. In 30th Annual Symposium on Foundations of Computer Science, pages 106–111. IEEE Computer Society, 1989.
[GX96] Harold N. Gabow and Ying Xu. Efficient theoretic and practical algorithms for linear matroid intersection problems. Journal of Computer and System Sciences, 53(1):129–147, 1996.
[Hak65] S.L. Hakimi. On the degrees of the vertices of a directed graph. Journal of the Franklin Institute, 279(4):290–308, 1965.
[HJS26] Bernhard Haeupler, Yonggang Jiang, and Thatchaphol Saranurak. Deterministic negative-weight shortest paths in nearly linear time via path covers. In Proceedings of the 58th Annual ACM Symposium on Theory of Computing, pages 198–209. ACM, 2026. arXiv:2511.08551.
[HLLZ26] Isaac M. Hair, George Z. Li, Jason Li, and Junkai Zhang. Bellman-Ford in almost-linear time, 2026. arXiv:2607.19346.
[IT76] Masao Iri and Nobuaki Tomizawa. An algorithm for finding an optimal “independent assignment”. Journal of the Operations Research Society of Japan, 19(1):32–57, 1976.
[Kru56] Joseph B. Kruskal, Jr. On the shortest spanning subtree of a graph and the traveling salesman problem. Proceedings of the American Mathematical Society, 7(1):48–50, 1956.
[KV94] Samir Khuller and Uzi Vishkin. Biconnectivity approximations and graph carvings. Journal of the ACM, 41(2):214–235, 1994.
[Law75] Eugene L. Lawler. Matroid intersection algorithms. Mathematical Programming, 9(1):31–56, December 1975.
[Mur20] Kazuo Murota. On basic operations related to network induction of discrete convex functions, 2020. arXiv:2001.03018, version 4.
[NW64] C. St. J. A. Nash-Williams. Decomposition of finite graphs into forests. Journal of the London Mathematical Society, s1-39(1):12, 1964.
[Pri57] R. C. Prim. Shortest connection networks and some generalizations. Bell System Technical Journal, 36(6):1389–1401, 1957.
[Qua24] Kent Quanrud. Faster exact and approximation algorithms for packing and covering matroids via push-relabel. In Proceedings of the 2024 Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 2305–2336. SIAM, 2024.
[RT85] James Roskind and Robert E. Tarjan. A note on finding minimum-cost edge-disjoint spanning trees. Mathematics of Operations Research, 10(4):701–708, 1985.
[Sch03] Alexander Schrijver. Combinatorial Optimization: Polyhedra and Efficiency, volume 24 of Algorithms and Combinatorics. Springer-Verlag, Berlin, 2003.
[SXZ26] Thatchaphol Saranurak, Kaiyang Xie, and Zhaienhe Zhou. Incremental directed minimum cut by dynamizing Gabow's algorithm, 2026. arXiv:2608.16382v1.
[Tar77] Robert E. Tarjan. Finding optimum branchings. Networks, 7(1):25–35, 1977.
[vdBCK 23] Jan van den Brand, Li Chen, Rasmus Kyng, Yang P. Liu, Richard Peng, Maximilian Probst Gutenberg, Sushant Sachdeva, and Aaron Sidford. A deterministic almost-linear time algorithm for minimum-cost flow. In 2023 IEEE 64th Annual Symposium on Foundations of Computer Science (FOCS), pages 503–514. IEEE, 2023. arXiv:2309.16629.