Manuscript Offprint
arXiv:2610.13937Constructive Arboricity in Almost-Linear Time for Dense Graphs
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
The arboricity of a graph is the minimum number of forests needed to partition its edges. We present a randomized algorithm that computes the exact arboricity of a simple graph and constructs an optimal forest partition in time both in expectation and with high probability, where and denote the numbers of vertices and edges. In particular, it runs in almost-linear time, , on dense graphs with .
We also give the first known almost-linear-time algorithm that constructs a partition into at most one more forest than optimal.
We are posting this preliminary version to record the results. We will improve the exposition in future versions.
Email: {imangholami77, hajiaghayi, mahdijafariraviz, akaviani05, mohammadkhani.soheil, s.a.m.shahrezaei}@gmail.com
Contents
1 Introduction 3
1.1 Main results 3
2 A near-linear constructive additive-one algorithm 5
2.1 Number of cycles 5
2.2 Converting pseudoforests into forests 6
2.3 Proof of Theorem 2 7
3 Vertex Reduction 7
3.1 Build the flow network 8
3.2 Construct the color classes from the flow 8
3.3 Why failure means no partition exists 10
3.4 Why each new color class is a forest 10
3.5 Size and running time 11
4 The exact algorithm and its two time bounds 11
4.1 Peeling and the core 12
4.2 First approach: Deletion and star restoration 13
4.3 Second approach: Rooted tree construction 13
4.4 Choosing between the two approaches 14
4.5 Proof of Theorem 1 16
The arboricity is directly related to the pseudoarboricity of the graph, defined as the minimum number of pseudoforests needed to partition its edges. A pseudoforest is a graph in which each connected component contains at most one cycle. The Nash–Williams characterization also provides a formula for the pseudoarboricity:
It is known that the arboricity is within one of the pseudoarboricity for simple graphs: . A k-out orientation of a graph is an orientation of its edges such that each vertex has outdegree at most k. A partition into pseudoforests is equivalent to the orientation of the edges such that each vertex has outdegree at most .
Using recent breakthroughs on almost-linear maximum flow algorithms [VCK+23], computing the value of the pseudoarboricity can be done in almost-linear time using the equivalent orientation characterization which can be turned into one maximum flow computation. The same algorithm is constructive and gives an orientation and hence a pseudoforest partition within the same time bound. Recently, Cen et al. [CFL+25] provided a reduction for computing the arboricity value to the global minimum cut problem, even in weighted graphs. In a concurrent work as ours, Fleischmann et al. [FLS+26] provided an almost-linear time algorithm for the directed global minimum cut problem which consequently provides an almost-linear time algorithm for computing the arboricity value. However, the reduction provides no construction for the forests. Gabow [Gab91] provides an time algorithm for constructing the forest partition, which on simple graphs gives a algorithm. Blumenstock and Fischer [BF20] provide an algorithm for constructing forests in time . Their algorithm converts a pseudoforest partition in this time into a forest partition.
In this work, we present a randomized algorithm for constructing a forest partition of a graph which runs in time , both in expectation and with high probability.
1.1 Main results
Our main result is a randomized algorithm that computes the exact arboricity and constructs an optimal forest partition.
Theorem 1 (Constructive exact arboricity). For every simple unweighted undirected graph G with n vertices and edges, a randomized algorithm returns and a partition of into forests. The running time is
both in expectation and with high probability. Every returned partition is correct.
For dense graphs with , this is almost linear in the number of edges: we obtain an optimal forest partition in time.
An orientation is k-out if every vertex has outdegree at most k. We begin by finding the smallest feasible k and a k-out orientation in almost-linear time using exact flow. Since , it remains to decide whether k forests suffice. Our approach combines a fast additive-one decomposition with a procedure for inserting a star while updating an existing forest partition.
Blumenstock and Fischer [BF20] convert k pseudoforests into forests in time. Our randomized algorithm builds on their conversion and improves this bound by choosing a pseudoforest partition with few cycles.
Theorem 2 (Constructive additive-one decomposition). Given a simple graph G and a k-out orientation, a randomized algorithm constructs forests partitioning in time, both in expectation and with high probability.
The key is to assign distinct outgoing colors uniformly at random at each vertex, independently across vertices. The resulting color classes are pseudoforests with at most cycles in expectation. We try at most independent colorings, stopping once the number of cycles is at most . This bound holds for the final coloring with probability at least . For each , remove one edge from each cycle of to form a matching , and let be the surplus graph. We show that the algorithm of Blumenstock and Fischer [BF20] converts these pseudoforests into forests in deterministic time . When the cycle bound holds, this is . After computing an orientation with , this gives a partition into at most forests.
To decide whether forests suffice, for we use a greedy hitting set to find a set of vertices whose deletion leaves a -out orientation. By Theorem 2, we can partition the edges of into forests. We then restore the vertices of one by one. Each restoration inserts a star, and our star-completion procedure updates the partition, recoloring old edges as needed, or reports that forests are impossible. If all insertions succeed, we obtain an optimal -forest partition of . Otherwise , and a second call to EXACTK with parameter and the same orientation constructs an optimal partition.
Finding and constructing the initial partition take time. The star insertions take time in total. Thus this branch takes time. For small , we instead use Gabow's rooted tree construction [Gab91]. Its directed graph has arcs, giving a running time of . We choose the cheaper of these two procedures. The star-completion procedure is our third result.
Theorem 3 (Vertex Reduction). Let be a simple graph with and a specified vertex . Suppose is partitioned into forests . Given this partition, a deterministic algorithm returns either a -forest partition of , possibly recoloring edges of , or reports that no such partition exists. It runs in time and uses at most one integral minimum-cost-flow computation on a network of size.
We encode chains of edge replacements in a flow network: inserting an edge may displace an old edge, which is reassigned elsewhere. Flow conservation enforces outdegree at most one in each color. Costs derived from depths in the original forests ensure acyclicity, since a resulting cycle would contradict minimum-cost optimality. Compressing the network to size gives the almost-linear bound. If the star cannot be fully inserted, a cut extracted from the same flow supplies the density witness.
2 A near-linear constructive additive-one algorithm
In this section, we prove Theorem 2. With the k-out orientation of the input graph, we randomly and independently assign outgoing edges of each vertex to one of k colors. Then because each vertex has at most one outgoing edge in each color, all edges of each color form a pseudoforest. We show that the number of cycles is small in expectation, allowing for an efficient conversion to a forest partition by applying the algorithm of Blumenstock and Fischer [BF20].
Algorithm 1: Additive forest partition
Input: Simple graph G and a k-out orientation Output: A partition of into forests
1 for do 2 Start with empty pseudoforests 3 foreach do 4 Assign the outgoing edges of v uniformly at random to distinct , independently of the other vertices 5 the total number of cycles in 6 if then break
7 Apply the conversion of Blumenstock and Fischer [BF20] to to obtain the forest partition
8 return
2.1 Number of cycles
We show that the probability that all trials in lines 1–6 of Algorithm 1 have more than cycles is at most . Since the trials use independent random choices, it is enough to show that a single trial exceeds this threshold with probability at most . We obtain this bound by first estimating the expected number of cycles.
Lemma 2.1 (Expected number of monochromatic cycles). In one iteration of Algorithm 1, the total number Z of cycles in satisfies
Proof. For each , we first bound the number of directed cycles of length in the supplied k-out orientation of G. To count them, first pick an arbitrary edge as the starting edge of the cycle. There are m options for this edge. Then for the next edges, pick an outgoing edge of the current vertex. There are at most k choices for each such edge. Finally, there is at most one edge that closes the cycle, since the graph is simple. Also, we overcount a cycle of length exactly times because of the choice of the first edge. Hence, there are at most directed cycles of length . The probability that a fixed directed cycle of length is monochromatic is . Using linearity of expectation, the expected number of monochromatic cycles of length is at most . Summing over all :
Using concludes the proof.
5
□
By Lemma 2.1 and Markov's inequality, the probability that one iteration is rejected is at most
The loop reaches its limit without finding a coloring below the threshold only if all trials are rejected. Since the trials are independent,
Thus, with probability at least , the coloring passed to the conversion has .
2.2 Converting pseudoforests into forests
Let be the pseudoforests obtained at line 5. For each pseudoforest, pick an arbitrary edge from each cycle and remove it, forming the edges where each forms a matching. Also let . We show that the algorithm of Blumenstock and Fischer [BF20] runs in deterministic time , and returns a forest partition .
Set for each . Following Blumenstock and Fischer [BF20], we view as the surplus graph on and give every edge of and color . The algorithm changes these sets while keeping them a partition of .
Lemma 2.2 (Pseudoforest conversion). Let be a partition of the edges of into pseudoforests. Let for each , where is a forest and is a matching and let . Then the partition can be converted deterministically into forests in time .
Proof. If is empty, the sets are already forests. If , we may instead give each edge a distinct color. Otherwise, we use the algorithm of Blumenstock and Fischer [BF20] and count its operations in terms of the initial number of edges of .
Their algorithm keeps a valid partition into pseudoforests with where is a forest and is a matching. Let be the surplus graph. The algorithm will make a forest through a sequence of exchange operations and cycle exchanges. We say an edge has color if it belongs to .
The exchange operation of Blumenstock and Fischer [BF20] acts on two incident edges of H. It either swaps their colors or moves at least one of them into a forest, while preserving a valid partition. Their Lemma 8 applies these exchanges along a path whose first and last edges have the same color. It moves at least one edge out of H using a number of exchanges proportional to the path length.
First make H colorful, meaning that each of its connected components has at most one edge of each color. As in their Lemma 9, search a component until a color appears twice or the search finishes. A repeated color is found after examining at most edges. Applying Lemma 8 to a path between the two edges moves an edge out of H with exchanges. Repeat until every component is colorful. A colorful component has at most k edges.
Next remove the cycles of H using their Lemma 11. In a colorful cyclic component C, choose a vertex v on a cycle. Their Lemma 10 gives a color i present in C such that v has no neighbor in C through an edge of . Move color i to an edge uv on the cycle by the exchange operation. Either an edge leaves H, or uv can be exchanged with the first edge vw on the path from v to u in . The choice of i ensures that w lies outside C. Thus the new edge vw joins two different components of H and lies on no cycle. This is their cycle exchange. It preserves the valid partition. The joined components have at most 2k edges altogether. Apply the repeated-color search to these components again to keep H colorful.
We now bound the number of these operations. Moving an edge from H to a forest decreases the number of edges of H, and no operation increases that number. There are therefore at most as many such moves as there were edges initially. A cycle exchange removes an edge on a cycle and inserts an edge joining two different components. It decreases the number of edges that lie on cycles in H. Removing edges from H cannot increase this number either. Thus there are also at most as many cycle exchanges as there were edges of H initially. Once no cycle remains, set . The valid partition condition gives the required partition into forests.
For the running time, initialize the union-find structures and link-cut trees of Sections 6 and 7 in time. Use the deterministic adjacency data structure in their Lemma 12. Its construction takes time, and its queries and updates take polylogarithmic amortized time. Finding the color i for a cycle exchange takes adjacency queries, hence time. Each sequence of exchanges also takes time.
It remains to count the searches. Each search that finds a repeated color is charged to an edge moved out of H. A search that finishes a component examines at most k edges. Initially there are at most n components. Removing an edge creates at most one additional component, and a cycle exchange requires revisiting only the components it joins. Thus the number of completed searches is , with measured initially. Clear only the vertices and colors visited by a search, so restarting it does not scan all n vertices. The same count covers the cycle searches, each of which either finishes an acyclic component or leads to an edge removal or a cycle exchange. The total time is therefore .
2.3 Proof of Theorem 2
We now combine the two earlier bounds to prove Theorem 2.
Proof of Theorem 2. We use Algorithm 1. Each run in the loop takes linear time and the loop iterates at most times, giving a total time of .
Let be the pseudoforest partition of the graph after the loop breaks. Choose one edge from each cycle and set to be the set of these chosen edges in .
By Lemma 2.1, with probability , we get . Then Lemma 2.2 gives a valid partition into forests, in time .
3 Vertex Reduction
We prove Theorem 3. The input is a simple graph , a specified vertex , and a partition of into forests . We seek a partition of into forests and may recolor the edges of . On success, the output is with . On failure, the output is a set with . This inequality rules out a -forest partition, since each forest has at most edges inside .
Write , , and . We call the edges of original edges and those of star edges. We construct a directed flow network with vertices and edges. We compute one minimum cost flow in , then use its edge flows to construct or obtain from a cut. We prove that the returned color classes are forests and bound the running time.
3.1 Build the flow network
The terminals of are a source and a sink . Its other vertices are one vertex for each , and two vertices for every such and every .
Add as an isolated vertex to each and root its singleton component at . Root every other tree of arbitrarily and direct its edges toward the chosen root. Let be the depth of in that rooted tree, with depth zero at its root. Set
If is an edge of , then and hence
Add the following directed edges to D.
-
For every original edge directed in , add . Its capacity is one and its cost is zero.
-
For every and such that has no outgoing edge in , add . Its capacity is one and its cost is zero.
-
For every and , add , , and . Each has capacity . Only has a nonzero cost, equal to .
-
For each , add an edge with capacity one and cost zero.
-
Add with capacity and cost .
Flow can use only after an original edge of enters . Then and , so its cost is positive. A directed cycle that avoids these edges cannot visit any , since the only other edge entering comes from s. It would stay in one color and follow a rooted forest, which has no directed cycle. Hence every directed cycle has positive cost, and a minimum cost flow has no directed circulation.
We send units from to . A unit on selects the edge . The flow on counts the unselected edges of . Every path starting with ends at a vertex with no outgoing edge of and then uses .
Let be an integral minimum cost flow of value . Such a flow exists because can carry all units. Write for the flow on that direct edge. The number of selected edges of is . Each use of a positive cost edge follows a distinct original edge, and costs at most . Thus all edges other than together cost at most . One unit on costs more than this bound. Consequently, minimizes and selects as many edges of as possible. Subject to that choice, it minimizes the sum of the costs on edges .
3.2 Construct the color classes from the flow
To construct , match the units entering and leaving each and each . Flow conservation guarantees these matchings. A unit at carries the original edge that led to . A unit entering from s carries rv. After matching, each such unit reaches a definite vertex next.
Start with empty sets and apply these rules.
- For in , if carries no flow, put in and retain its direction.
Algorithm 2: VertexReduction(H, r, )
Input: , with
Output: A k-forest partition of or an impossibility certificate
1
2 Root at r and the other components of each arbitrarily
3 for
4
5
6
7 foreach do
8
9 foreach do
10
11
12
13
14
15
16
17
18
20
21
22
23
24
25
26
27
28
29
30
-
For in , if carries a unit, let be the next vertex reached by that unit. Put in and direct it .
-
For , if carries a unit, let be its next vertex. Put in and direct it .
Every edge of appears in one . An edge of appears exactly when its source edge carries flow.
Each has exactly one outgoing edge in D, of capacity one. If that edge carries no flow, no unit reaches ; any original edge directed out of v in color i stays unchanged. If it carries one unit, any such original edge is reversed, and the arriving unit supplies one new edge directed out of v in color i. Thus each color has outdegree at most one. Every edge incident with r is directed toward r, so r is a sink. We prove below that the color classes have no cycles.
In Algorithm 2, adds to with capacity and cost . After matching flow units as above, NextColor( ) is the index of the next vertex reached by the unit for .
3.3 Why failure means no partition exists
Assume . To prove that no partition exists, form a smaller network with vertices . For each original edge , add with capacity one. For each , add with capacity one. For every , add with capacity , where counts original edges directed out of . Each has at most one such edge, so this capacity is nonnegative.
Remove the flow on from . Replace each by and discard the resulting loops. This projects the remaining flow to with value . We show that is a maximum flow value in . Take any integral flow in . At , its used outgoing original edges have distinct colors, since each has at most one outgoing edge there. Assign its units on to distinct colors without an outgoing original edge at . Match the incoming units at to these outgoing colors. A used original edge of color uses . An incoming unit of color matched to color uses if , and otherwise. A unit from uses . A unit on assigned color uses . These routes lift the flow to . Send any remaining units through to obtain value . Since minimizes the flow on , its projected value is maximum in .
Because , we have . In the residual network of , let be the vertices of reachable from , and put . The cut has capacity . The edges with have total capacity . This sum of outdegrees counts every edge inside once and every original edge leaving once. Adding the capacities of the original edges leaving therefore gives . The edges crossing the cut contribute . Hence
Since , this gives , and hence . Each forest has at most edges inside , so cannot be partitioned into forests. CutCertificate returns this .
3.4 Why each new color class is a forest
The outdegree bound does not exclude a directed cycle. We use the optimality of to exclude one. First, a unit entering through cannot leave through . Replacing those two edges by would reduce its cost by . Thus a passage through changes an original color.
Write * for a unit entering from the star. The cost of assigning an incoming unit of type j to color i at v is
For the acyclicity proof, replace the edges incident with each in and the direct edges by edges for all . Give each such edge capacity and cost . For each , replace by of capacity one and cost zero, and add of capacity and cost zero for every . Keep all other edges of . Call each edge from a vertex to a vertex a transition. This expanded network is used only in the proof.
The matchings used to decode turn it into a flow of the same value and cost in the expanded network. Conversely, an expanded minimum cost flow can be chosen without directed circulations, since all its edge costs are nonnegative. Route its color changes and units from U through in D, using the direct edge when . At any v, at most m used original or star edges enter, so each edge at has enough capacity. This routing preserves cost. Hence the expanded flow obtained from is minimum cost. We use its residual network below.
A minimum cost flow has no negative cost closed walk in its residual network, since such a walk contains a negative cost cycle. Each transition into has capacity . At most one unit enters , because its only outgoing edge has capacity one. Thus every transition into has unused forward capacity.
Consider an edge of decoded color that avoids . It came from . We associate with it a residual walk from to . If it kept its original direction, it belonged to and its network edge is unused. This edge followed by has cost zero. If it was originally in and was reversed, reverse its used transition and its used original edge . This walk also has cost zero.
Suppose the edge was originally in with . Its flow uses . A used transition enters , where or . Reverse these three used edges, then use the forward transition . The resulting residual walk is
Its cost is . If , Equation (3) makes this -1. If , it is . For every other , including , it is . Thus an edge that changes color gives a negative cost residual walk.
If contained a cycle, its outdegree bound would orient that cycle consistently. The cycle cannot contain the sink . At least one edge of it changed color, since had no cycle. Concatenating the residual walks of its edges would give a negative cost closed walk, a contradiction. Hence every is a forest.
3.5 Size and running time
The vertex list gives the stated vertex count. In color , exactly vertices have no outgoing original edge. Thus the first two edge groups contain edges in total. The three edges for each pair contribute , the source edges contribute , and contributes one. This gives the stated edge count.
Rooting the forests, building , decoding its flow, and constructing take time. Since each has at most edges and , we have . All capacities are at most , the flow value is at most , and all costs are at most . By [VCK+23], the integral minimum cost flow in takes deterministic time. Computing the residual cut and the output fits within the same bound.
4 The exact algorithm and its two time bounds
For a given , we first obtain the core of G by repeatedly peeling vertices of current degree at most k. This reduction preserves whether a partition into k forests exists. Given a k-out orientation of the core, we provide two approaches that either construct a partition of the core into forests, which extends to , or certify that no such partition exists. In the latter case, this guarantees the existence of a density witness, that is, a vertex set with and . Of the two approaches, deletion and star restoration are efficient for large ; rooted tree construction is efficient for small . We choose between them using the peeled core's vertex count, prove correctness, and derive both running-time bounds.
Finally, the wrapper in Section 4.5 uses binary search to find the minimum outgoing bound and a corresponding orientation. This guarantees that . We then try to partition into forests using one of the two approaches: a successful partition is optimal, while a negative answer is followed by a call to EXACTK at , which constructs an optimal partition using the same orientation. The parameter need not be the minimum outgoing bound before this final wrapper.
4.1 Peeling and the core
Vertices of degree at most k are easy to add to an existing partition into k forests: assign their incident edges distinct forest labels, so that each forest gains at most one edge incident with the new vertex and no cycle is created. We therefore repeatedly remove such vertices and postpone adding them back until the remaining graph has been partitioned. This peeling process leaves an induced graph of minimum degree at least , called the core.
Lemma 4.1 (Peeling and reverse restoration). For a threshold , repeatedly remove a vertex of current degree at most b, recording its edges to still-present vertices. The procedure takes time. If the remaining induced core has N vertices and M edges and has a b-out orientation, then
Any forest partition of the core with at least b available labels extends to the whole graph in linear time by reverse restoration. Every induced-density violation in the core remains valid in G.
Proof. A queue of vertices of degree at most b, with degree updates after each removal, visits each edge a constant number of times. Every vertex left in the core has degree at least . The degree sum proves the first inequality, and summing the restricted orientation's outdegrees proves the second.
Restore vertices in reverse removal order. At its restoration a vertex has at most b recorded edges, all to already present vertices. Give these edges distinct labels among the available b labels. Each forest gains at most one edge incident with a previously isolated vertex, so no cycle is created. Every edge was recorded once and is restored once. Finally, the core is induced, so its internal edges on a witness set are exactly those of G.
Apply this procedure with threshold , and let be the remaining core, with and . The supplied orientation restricts to a -out orientation of , so
Thus on a nonempty core. If the core is empty, reverse restoration directly constructs a partition into k forests. Otherwise, we apply one of the two approaches below to Q. A successful partition extends to G by reverse restoration, and any density witness in Q remains valid in G.
4.2 First approach: Deletion and star restoration
Recall that the additive-one construction yields k forests when supplied with a -out orientation. To reach this bound, a vertex of outdegree k must either be deleted or lose an outgoing neighbor. The next lemma expresses these requirements as a hitting-set problem.
Lemma 4.2 (A small deterministic deletion set). Let Q have N vertices, M edges, and a k-out orientation, with . A set of vertices R with
can be found deterministically in time so that the restricted orientation of Q - R is -out.
Proof. For every vertex of outdegree , form the constraint . By the preceding observation, it suffices to find a set hitting all these constraints. If there are none, take .
Otherwise, greedily choose a vertex contained in the most unhit constraints. Each constraint has members, so when s constraints remain, the chosen vertex hits at least . Starting with constraints, after t choices at most
remain. Hence choices suffice.
Maintain the incidence lists and a maximum heap of vertex counts. Whenever a constraint is hit, decrement the counts of its members. There are incidences, each processed once, so the total time is .
Apply the additive-one construction to Q - R with its restricted -out orientation to obtain k forests. Restore the vertices of R one at a time. Each restoration adds a star to the current induced graph, so Theorem 3 either extends the partition, possibly recoloring old edges, or rules out a partition into k forests. After all vertices of R have been restored, reverse restoration of the peeled vertices extends the partition to G.
4.3 Second approach: Rooted tree construction
The alternative branch builds a directed graph with indegree exactly k at every original vertex. Its total number of arcs then equals the number used by k spanning trees. This equality ensures that a successful packing covers every original edge, while an incoming cut of size less than k guarantees that no k-forest partition exists.
Lemma 4.3 (Exact core partition by rooted tree construction). If Q is a nonempty core obtained by peeling vertices of degree at most k, and has a supplied k-out orientation, then a k-forest partition can be constructed or its impossibility determined in deterministic time.
Proof. Reverse the supplied orientation, add a root , and add parallel arcs for each . Every original vertex has indegree , no arc enters , and the total arc count is
For a nonempty , its incoming cut has size
Algorithm 3: EXACTK(G, k, O)
Input: Simple graph G, , and a k-out orientation O
Output: A k-forest partition, or No if none exists
1 (Q, L) ← Peel(G, k), and restrict O to Q
2 if Q is empty then
3 return reverse restoration from the empty core, using labels in [k]
4 ,
5 if then
6 Apply the rooted construction of Lemma 4.3
7 If it rules out a k-forest partition, return No
8 Let F be its partition of E(Q)
9 else
10 the greedy deletion set of Lemma 4.2
11
12 AdditiveOne(Q[W], k - 1, O|_W)
13 for each in a fixed order do
14 , and regard a as isolated in F
15 if then
16 Apply COMPLETESTAR to Q[W ∪ {a}], F, and
17 If it rules out a k-forest partition, return No
18 Replace F by the returned, possibly recolored partition
19
20 Restore L in reverse order using distinct incident labels in [k]
21 return F
Apply Gabow’s rooted tree construction [Gab91] directly to this rooted instance. A cut with fewer than k incoming arcs implies , ruling out a k-forest partition.
Otherwise the construction returns k arc-disjoint underlying spanning trees on vertices. Each has N arcs, so together they use kN arcs, exactly all arcs of the instance. Deleting r from each tree removes the added arcs and leaves a forest on the original vertices. Ignoring directions, every original edge appears in exactly one of these forests.
The core inequality gives . Since , we also have . Hence , and the construction takes time, including the added parallel arcs.
4.4 Choosing between the two approaches
On a nonempty core, the two branches have cost multipliers and , respectively. We bound their subroutine costs using one common subpolynomial factor in the original edge count . This permits the algorithm to choose the smaller numerical multiplier and yields both claimed bounds for the same execution.
The procedure EXACTK(G, k, O) takes a simple graph, , and a supplied k-out orientation O. It returns a partition into k forests or No, guaranteeing that no such partition exists. The call PEEL implements Lemma 4.1. The peeling record L consists of the removal order and each removed vertex's edges to vertices present at its removal. Algorithm 3 gives explicit pseudocode. All empty forest labels are implicit.
Lemma 4.4 (Correctness of EXACTK). Algorithm 3 returns a valid k-forest partition or No if no such partition exists.
Proof. For every , peeling leaves an induced core with
If the core is empty, reverse restoration with k labels gives a forest partition by Lemma 4.1. If the rooted branch is chosen, Lemma 4.3 gives either a core partition that extends by reverse restoration or a guarantee that no such partition exists in Q, and hence none exists in G.
When , the test always selects the rooted branch. Thus the deletion branch has , and Lemma 4.2 gives a -out orientation of . Theorem 2 therefore produces forests there. Maintain a partition of , initially . Restoring adds exactly the edges , all incident with . Theorem 3 either partitions the enlarged induced graph or rules out a -forest partition there, and hence in . On success replace by . An edge between two restored vertices is inserted exactly when its later endpoint is restored, so all edges of are eventually present once. Reverse restoration of peeled vertices preserves the forests by Lemma 4.1.
Proposition 4.5 (Time for EXACTK). For , Algorithm 3 runs in
expected and high-probability time.
Proof. Let be a common nondecreasing envelope for exact-flow per-edge costs at all sizes at most , sorting and heap factors, dynamic-tree factors, and resampling trials. The constants can depend on the desired high-probability exponent. Taking the maximum of the per-edge factors over sizes at most and absorbing polylogarithms gives such a nondecreasing envelope without changing its subpolynomial form. We express the failure probability in terms of the original , even when a randomized call is made on a smaller subgraph.
Reading, peeling, and final restoration cost . The rooted branch costs . For the deletion branch, the greedy set has vertices. The additive-one input work, a coloring trial, and the accepted conversion cost . The expected trial count is constant. The geometric tail bounds the probability of more than trials by , even for a smaller invocation. This is a running-time analysis; the algorithm keeps resampling until it accepts. Its work is therefore bounded by in expectation and with the desired overall probability. Build and solve every nonempty star network from scratch. Each has at most M edges and costs at most . No sharing of flow work across calls is assumed. The two branch bounds are therefore
The test chooses the smaller numerical multiplier and . Hence the same algorithm has time
Empty cores satisfy the stated bound directly.
The bound. For a nonempty core, if , then . Otherwise gives
Since , Equation (7) is .
The bound. Independently, gives
Simplicity implies , and . Thus Equation (7) is also . These two estimates hold for the same algorithm and the same envelope, proving their minimum.
4.5 Proof of Theorem 1
To obtain an optimal partition, we first find the smallest for which admits a -out orientation. Since , it then suffices to determine whether can be partitioned into forests. We use EXACTK to make this decision; if no such partition exists, we call EXACTK again with parameter . The same orientation is also -out, and the second call must succeed because . The following lemma finds and the orientation needed by both calls.
Lemma 4.6 (Minimum outgoing bound). For , the minimum outgoing bound and a corresponding orientation can be computed deterministically in time after reading the vertices.
Proof. For a candidate , create one node for each edge , one node for each incident vertex, and terminals . The arcs are
| arc | capacity |
|---|---|
| . |
An integral flow of value chooses one endpoint of every edge. Orient the edge out of that endpoint. The capacity into enforces maximum outdegree at most . Conversely, a -out orientation defines such a flow.
Feasibility is monotone in : increasing the outgoing bound can only increase the capacities into . The network has nodes and arcs and polynomial integral capacities. Binary search on uses exact maximum-flow computations to find and its orientation. Only the edgeless graph has minimum outgoing bound zero. Each flow computation takes time [VCK+23], and the logarithmic number of calls is absorbed into the subpolynomial factor.
The orientation-free arboricity wrapper. An edgeless graph has arboricity zero and the empty partition. For , Algorithm 4 finds the minimum outgoing bound before calling EXACTK. This makes a returned -forest partition optimal. If the first call rules out forests, we call EXACTK. Since is also -out and , this call returns an optimal partition.
Algorithm 4: ARBORICITY(G)
Input: Simple unweighted undirected graph with Output: and an optimal forest partition
1 Find the minimum outgoing bound and a -out orientation 2 3 if is a forest partition then 4 return 5 else 6 7 return
Optimality. By Lemma 4.6, we obtain the minimum outgoing bound and a corresponding orientation. As noted in Section 1, . If ExACTK returns forests, they attain the lower bound and are optimal.
If the first call to ExACTK returns No, then , and hence . The same orientation O satisfies the outgoing bound for the second call ExACTK( ). By Lemma 4.4, this call returns a partition into forests, which is optimal.
Running time and randomness. Orientation search costs . The wrapper makes at most two calls to ExACTK, with parameters and on the same graph. Proposition 4.5 applies to any supplied outgoing bound, so each call takes
expected and high-probability time. Thus the second call changes the total bound by at most a constant factor. For , both and dominate , so orientation search is absorbed into the same bound. Each call to ExACTK uses the additive-one construction at most once, in its deletion branch. There are therefore at most two such randomized calls in the wrapper. Their running-time bounds hold uniformly conditional on their inputs, including those of the second call. A union bound gives the overall high-probability bound, and linearity of expectation gives the expected bound. Isolated vertices may be processed just once. The edgeless case costs .
All randomness is confined to outgoing coloring and its resampling. Accepted colorings are converted by deterministic invariant-preserving operations, and every flow output is integral and exact. Therefore every returned answer is correct. This proves the theorem.
Verification and scope. A partition is checked by grouping nonempty color classes and testing each for acyclicity. Only vertex-color incidences of present edges are needed, at most 2m, so verification takes time after the input vertices have been read. No allocation of all nk pairs on the original graph is required. Simplicity is used in the cycle count, the missing-neighbor argument, the orientation gap proof, and the quadratic bound on m. Auxiliary directed multigraphs in the rooted branch do not extend the theorem to undirected multigraph or weighted inputs.
AI acknowledgment
Some of the proofs in this paper were developed with the help of OpenAI's GPT Astra, which also contributed to the writing and exposition. The authors are responsible for the correctness of the results and the final content of the paper.
References
[BF20] Markus Blumenstock and Frank Fischer. "A constructive arboricity approximation scheme". In: International Conference on Current Trends in Theory and Practice of Informatics. Springer. 2020, pp. 51–63.
[CFL+25] Ruoxu Cen, Henry Fleischmann, George Z Li, Jason Li, and Debmalya Panigrahi. "Fast Algorithms for Graph Arboricity and Related Problems". In: 2025 IEEE 66th Annual Symposium on Foundations of Computer Science (FOCS). IEEE. 2025, pp. 964–982.
[FLS+26] Henry Fleischmann, Jason Li, Thatchaphol Saranurak, and Benyu Wang. Directed Global Minimum Cut in Almost-Linear Time. 2026. arXiv: 2610.10898 [cs.DS]. URL: https://arxiv.org/abs/2610.10898.
[Gab91] Harold N Gabow. "A matroid approach to finding edge connectivity and packing arborescences". In: Proceedings of the twenty-third annual ACM symposium on Theory of computing. 1991, pp. 112–122.
[Nas64] C St JA Nash-Williams. "Decomposition of finite graphs into forests". In: Journal of the London Mathematical Society 1.1 (1964), pp. 12–12.
[VCK+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). IEEE. 2023, pp. 503–514.