Manuscript Offprint
arXiv:2610.40591Maximum Cardinality Matching in Time
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
We consider the maximum cardinality matching problem in general graphs, and give an -time algorithm for the problem. Our work builds on recent work on combinatorial algorithms for maximum flow and extends the techniques to skew-symmetric flow problems which capture general matchings as a special case.
Concurrent Work: OpenAI released an -time algorithm for the same problem on October 6, 2026. We first obtained our result the day before this announcement and the techniques seem orthogonal. We believe our results are independently interesting, giving a simpler combinatorial algorithm for general matchings.
Acknowledgments: Sanjeev Khanna and Junkai Song mentioned skew-symmetric flows as an approach towards general matchings algorithm when the first author was visiting NYU in February 2026. Since then, the authors have discussed the approach in this paper with several humans (Aaron Bernstein and Isaac Hair) and several non-humans (GPT 5.5, 5.6, and 6).
1 Introduction
In recent years, there has been tremendous progress in designing faster algorithms for classical problems in graph algorithms. From maximum flow and min-cost flow [CKL 22, BBL 25, HJS26] to minimum cut [ALPS23, HLRW24, FLSW26] to shortest paths [BNWN22, DMM 25, HLLZ26], there have been numerous breakthroughs on designing almost-linear time algorithms for many classical graph problems. One problem which remained untouched was the maximum matching problem in general graphs, where the classical -time algorithm [MV80] remains the fastest in sparse graphs and matrix-multiplication based algorithms [MS04] remain fastest on dense graphs. Our main result is an improvement on dense graphs:
Theorem 1. Given a unweighted general graph G with n vertices, we can compute a maximum matching of G in time with high probability.
In fact, our algorithm extends to the maximum integral symmetric flow problem on simple graphs, i.e., graphs with no parallel edges between any two vertices.
Theorem 2. Given a simple, directed, skew-symmetric graph G with n vertices, and two symmetric vertices s and , we can compute a maximum integer skew-symmetric flow from s to in time with high probability.
At a high level, we speed up this algorithm by finding each regular path in sublinear time, without looking at the entire residual graph. Our algorithm is inspired by a recent maximum flow algorithm [Li26], which finds augmenting paths in a sparsifier of the current residual graph. Unlike the algorithm of [Li26], ours does not compute a sparsifier upfront; instead, we alternate between searching the sampled graph for a regular path and sampling new edges to add to this graph.
For illustration, we first describe how our algorithm would find (not necessarily regular) augmenting paths in the standard maximum flow problem. The sampled graph is initially empty, and a search from the source vertex returns just as the set of vertices reachable from . The algorithm tries to sample an outgoing edge from the current reachable set , which would add a new vertex into . Unfortunately, sampling edges from cuts in directed graphs is difficult in general. Instead, our algorithm uses a cut-sampling data structure on the underlying undirected residual graph, which samples an edge on the (undirected) boundary of . If a constant fraction of edges on the boundary of are outgoing from , then the sampled edge is outgoing with constant probability. The issue is when most of the edges on the boundary are incoming to . The algorithm of [Li26] “ toggles” such “unbalanced” cuts by simultaneously increasing the sampling weight of all outgoing edges and decreasing the sampling weight of all incoming edges, a procedure handled implicitly by a dynamic data structure. Instead, our algorithm only modifies the weight of the sampled edge: if it is outgoing from , its sampling weight is increased, and if it is incoming to , its sampling weight is decreased. In a sense, our algorithm implements a “stochastic” version of the cut toggling operation in [Li26].
We now return to the integral symmetric flow problem, which requires finding regular paths in the current residual graph. The main technical difficulty is that the absence of a regular path is not characterized by a cut, but a barrier that decomposes the vertex set into arbitrarily many fragments, among other sets of vertices. Here, our algorithm takes inspiration from the shortest (weighted) regular path algorithm of [GK96], which also alternates between searching and adding new edges to the current search graph. We assign charges to the edges according to the barrier, such that edges with negative charge bypass the barrier similar to how the outgoing edges from bypass the cut. The charges are almost exactly the adjustment values in the shortest regular path algorithm of [GK96], except that for technical reasons, we ignore the contribution of large fragments to the charges. When there are remaining augmenting path iterations, we define large fragments to be those with more than vertices, of which there are at most . Our algorithm targets a running time of for the next augmenting path, which adds up to time overall.
2 Preliminaries
As mentioned before, we consider the more general problem of maximum integral-symmetric flows, introduced in [GK04], which captures the general matching and maximum flow problems as special cases. In this section, we will introduce all notations, definitions, and basic results we later use for graphs and skew-symmetric flows.
2.1 Integral Skew-Symmetric Flows
Definition 3 (Skew-symmetric graphs). A directed multigraph with positive integer edge capacities is called skew-symmetric if it has a mapping that maps vertices and edges in to their symmetric counterparts in . This mapping satisfies the following conditions:
i. and for every vertex and edge ii. if is an edge, then its symmetric edge is an edge from to , and they have the same capacity, i.e.,
For simplicity, we use to denote the symmetric vertex of a vertex , and to denote the symmetric edge of an edge . The symmetric set of a vertex set is defined as , and the symmetric path of a path is defined as .
Definition 4 (Maximum integral symmetric flow (IS-Flow) problem). Given a skew-symmetric graph with a pair of symmetric vertices and , the maximum integral symmetric flow problem asks to find the maximum flow from to such that the flow on edges is integral and symmetric ( ).
The general matching problem can be formulated as a maximum integral symmetric flow problem on the following “matching graph” construction.
Definition 5. For a graph , the matching graph is a skew-symmetric graph constructed as follows:
• For each vertex , create a vertex with its symmetric counterpart .
-
For each edge , create an edge with its symmetric edge . Both edges have capacity 1.
-
Add a source vertex with its symmetric counterpart . For every vertex , add edge with its symmetric edge . Both edges have capacity 1.
Observation 6. Any general matching in the original graph G corresponds to an integral symmetric flow in the matching graph whose flow value is twice the matching size. Conversely, any integral symmetric flow in corresponds to a general matching in G.
Proof. For every matching edge in a matching, we can map it to the following pair of integral symmetric paths in the matching graph : and . For the other direction, we can always decompose an integral symmetric flow in into such pairs of paths, which gives a matching in .
2.2 Basic (Skew-Symmetric) Flow Theory
[GK96, GK04] introduced a theory of integral skew-symmetric flows, defining regular paths and barriers on skew-symmetric graphs as analogous objects for augmenting paths and cuts in standard flows. We focus on the unit capacity case for simplicity, as our matching graph satisfies this condition.
Definition 7. A path from to is called a regular path if and only if it does not contain both an edge and its symmetric pair simultaneously for any edge .
Definition 8. A barrier from to is a partition of the vertex set , where and are symmetric sets and each fragment is self-symmetric, such that
• (and symmetrically ), and
• there are no edges from A to , or from A to M, and
• there are no edges between and for , or between and M, and
• for every i, there is exactly one edge from A to .

Figure 1: Example of a barrier in a skew-symmetric graph H. Black edges represent edges already in H. Red edges represent edges that do not exist in H, but can be added to H to bypass the barrier.
Theorem 9. A regular path from s to exists if and only if no barrier from s to exists.
Theorem 10. Given an skew-symmetric graph G with edge capacity 1 and an integral symmetric flow f on G,
-
The flow f is maximum if and only if there is no regular path from s to in this residual graph.
-
If there is a regular path from s to , augmenting one unit along it and its symmetric path gives an integral symmetric flow of larger value.
With these results, we can find maximum integral symmetric flows in any skew-symmetric graph by repeatedly finding regular paths and augmenting along them, until we hit a barrier on the residual graph. Our main result is that, instead of searching the graph in time, we can find a regular path on the residual graph in amortized time, which gives an algorithm for maximum integral symmetric flows on matching graphs, hence yielding an algorithm for general matchings.
2.3 Graph Notation
We now define the notations used in this paper. Throughout the paper, we use G to denote the skew-symmetric graph in the integral symmetric flow problem (except at the definition of matching graphs). We use n and m to denote the number of vertices and edges. We do not distinguish the size of the original graph and the skew-symmetric graph, as the matching graph construction in Definition 5 only increases the number of vertices and edges by a constant factor.
All graphs in this paper are simple and of unit capacity, though our algorithm also works in the same running time for graphs with at most a constant number of parallel edges between two vertices. For skew-symmetric graphs, we follow the simplified notation for symmetric objects in Section 2.1, where we use to denote the symmetric vertex of , and to denote the symmetric edge of ; the symmetric set of a vertex set is defined as , and the symmetric path of a path is defined as . For a vertex subset , we define the cut as all edges between and , including both directions for directed graphs.
Throughout our algorithm, we maintain symmetric weights on all edges (including their corresponding reverse edges that may appear during augmentation) in the skew-symmetric graph . For each pair of symmetric edges, we maintain a variable , which defines the weight of these two edges as . We use to denote the variable associated with the edge , so and refer to the same variable.
We call an edge active if its capacity is 1 in the current residual graph, and inactive otherwise. The algorithm only maintains weights on active edges, and we reset the variable and weight whenever an edge becomes inactive after an augmentation.
3 Finding Regular Paths in Residual Graphs
In this section, we give our algorithm for finding the maximum integral symmetric flow in the residual skew-symmetric graph. This is the main technical result behind Theorem 1, as the general matching problem reduces to the maximum integral symmetric flow problem on the matching graph, constructed in Definition 5.
Theorem 2. Given a simple, directed, skew-symmetric graph G with n vertices, and two symmetric vertices s and , we can compute a maximum integer skew-symmetric flow from s to in time with high probability.
The core of this result is an algorithm that finds an integral symmetric flow on the residual graph of value at least half of the remaining flow value, which is stated in the following lemma.
Lemma 11. There exists an algorithm that, given a skew-symmetric graph G with unit capacity and a parameter K, assuming that the maximum integral symmetric flow of G is at least K, finds an integral symmetric flow of value at least in time with high probability.
Before stating our algorithm for Lemma 11, we first prove that it implies Theorem 2, and thus Theorem 1.
Proof of Theorem 2. We maintain an integral symmetric flow on the skew-symmetric graph , and try to augment it in rounds. In each round, we try for each in increasing order, and run the algorithm in Lemma 11 with the flow before this round. If some run of failed to get the desired flow in time, we augment with the flow returned by the last successful run, and proceed to the next round. Assuming that all runs are correct, when the algorithm fails to compute an integral symmetric flow of value , it means the remaining flow value is less than . Since the last successful run augments by at least , the algorithm reduces the remaining flow value by a constant factor in each round. By repeating for rounds, we get the maximum integral symmetric flow in .
3.1 Algorithm Overview
We start by giving a high-level overview of our algorithm. Our algorithm maintains an integral symmetric flow f and tries to augment f by finding a regular path from s to in the residual graph, and then augmenting along it and its symmetric path. To avoid visiting all m edges to find a regular path, we run a regular reachability algorithm on a subgraph H of the residual graph. When the algorithm gets stuck in the subgraph, i.e., it finds a barrier, we add a pair of symmetric edges from the residual graph to H to bypass this barrier, and continue the search. Each included edge pair helps the algorithm reach new vertices using regular paths, so we only add edges to the subgraph H before we find a regular path.
When the regular reachability algorithm finds a barrier in the subgraph H, we try to find an edge in the residual graph that can bypass the barrier, as indicated by the red edges in Figure 1, and add it to the subgraph. We find such edges by sampling. For the barrier we encountered, we define a charge on every edge in the residual graph, such that we can efficiently sample an edge with non-zero charge with probability proportional to its weight times the absolute value of its charge . Moreover, any negatively charged edge can bypass the barrier, and such an edge exists if the remaining flow is large enough. Finally, negatively charged edges can be sampled with constant probability if we have a “balanced” weighting of the residual graph, like the flow value of an integral symmetric flow. If the edge weights are balanced, we can find an edge that can bypass the barrier with high probability in few rounds of sampling. Otherwise, if the edge weights are unbalanced, we can modify the edge weights so they become more balanced. The detailed process of sampling and modifying weights is described in the next subsection, before we give the full algorithm.
3.2 Barrier toggle operations
Suppose that the algorithm finds a barrier in the subgraph . Recall that a barrier is a partition of the vertex set in the skew-symmetric graph such that , and
• are self-symmetric sets, and is the symmetric set of A, and
• there are no edges from A to or from A to M, and
• there are no edges between two different fragments and , or between and M, and
• there is exactly one edge from A to each fragment .
And for this barrier, we can add one of the following edges (see Figure 1 for an illustration) to H to bypass the barrier:
• edges from A to a fragment , excluding the existing one in the barrier, or
• edges between two different fragments and , or
• edges from A to , or
• edges from A or to M.
For this barrier, we define an operation vector for toggling this barrier. It assigns a charge to every active symmetric edge pair , defined as follows.
Definition 12. Consider a barrier and a parameter . Let be the edge from to in the barrier. Let be an auxiliary vertex potential such that
We define the charge on an active edge as
The operation vector is the vector of charges for all active edges in the graph.
This edge charge has the following properties. First, charges are symmetric and in the range . Second, negatively charged edges can be added to the subgraph to bypass the barrier. These properties are illustrated in Figure 2. The parameter is the same as in Lemma 11, which is a lower bound on the remaining flow before any augmentation. We exclude large fragments with to support sampling an edge with probability proportional to efficiently, as we will show in Section 3.6.

Figure 2: Illustration of the operation vector for a barrier. is a fragment of size , and is a fragment of size . All edges with non-zero charge are drawn with edge weights showing their charge. Barrier edges (black edges) have charge zero.
Suppose that we can sample an edge with probability proportional to efficiently. If negatively charged edges constitute a constant fraction of the total weight of edges with non-zero charges, then we can find a negatively charged edge with high probability in a few rounds of sampling, which can be added to the subgraph to bypass the barrier. Otherwise, the weight is unbalanced, since the total weight of positively charged edges is much larger than the total weight of negatively charged edges. In this case, we can use the following barrier toggle operation to modify the edge weights. The operation below is stated in a “stochastic” form for efficiency. In expectation, it shifts the variable of each edge by a value proportional to its charge , so negatively charged edges now have a smaller variable and thus larger weight , while positively charged edges have a larger variable and thus smaller weight .
Definition 13 (Barrier toggle operations). For an operation vector given by a barrier, we define the operation of toggling this barrier as follows: Sample an edge with probability proportional to . If the sampled edge has negative charge ( ), we multiply by . If the sampled edge has positive charge ( ), we multiply by .
3.3 The full algorithm
Using the edge weights and barrier toggle operations defined above, we now describe the full algorithm for Lemma 11, which finds an integral symmetric flow of value on the residual graph, assuming that the remaining integral symmetric flow has value at least K.
Algorithm. Initialize for every edge pair in . Repeat the following steps to find regular paths in the residual graph of until we increase the flow value by at least , or the algorithm declares a failure.
-
Initialize the subgraph H to contain no edges.
-
Run the regular reachability algorithm on H until it finds a barrier or a regular path.
-
If a barrier is found, apply the barrier toggle operation defined in Definition 13 on this barrier to modify the edge weights.
-
If the sampled variable drops below 1, clip it back to 1. If the sampled variable exceeds U, declare failure and terminate the algorithm.
-
If the sampled edge has a negative charge, add it and its symmetric edge to H and resume the search from step 2. Otherwise, repeat this operation starting from step 3.
-
If a regular path is found, augment along it and its symmetric path to update the flow. Remove all edges that become inactive from supporting data structures, then add all edges that become active to these data structures while setting their variable .
For regular reachability algorithms, we use the algorithm in [GK96]. This algorithm naturally supports resuming after adding edges to the subgraph, which we will discuss in Section A in more detail. The edge weight upper bound U is polynomial in n, and we will choose it later in Section 3.5 so that the algorithm succeeds with high probability.
The remaining part of this section is to analyze the correctness of this algorithm, which completes the proof of Lemma 11. The next subsection bounds the total number of barrier toggle operations by , and the subsection after that shows that the algorithm succeeds with high probability. Finally, we show that the sampling step in the barrier toggle operation can be implemented efficiently, so the algorithm runs in time.
3.4 Energy bound of barrier toggle operations
In this subsection, we show that the total number of barrier toggle operations is bounded by for polynomially bounded . In each operation, we either sample a negatively charged edge, which allows the algorithm to reach new vertices using regular paths, or sample a positively charged edge, which multiplies the variable by . The former case only occurs times for finding a regular path, and times for the whole algorithm. Assuming that is polynomially bounded, the latter case also only occurs times before some variable exceeds .
Formally, we define the energy as follows:
We first claim that the energy is always non-negative. As long as the algorithm does not declare failure, we have . Since we multiply by at most in each barrier toggle operation, we have after any operation, so . Next, we consider the changes in energy in the algorithm. There are three sources of energy increase: initialization, augmentation, and sampling a negatively charged edge during barrier toggle operations. As each edge contributes at most to the energy, initialization contributes at most to the energy. Each augmentation contributes at most to the energy. Sampling a negatively charged edge increases the energy by at most . As every such edge allows the algorithm to reach new vertices using regular paths, there are at most such operations in each augmentation. Since there are at most augmentations, the total energy increase from all sources is . Whenever we sample a positively charged edge, the energy decreases by . Therefore, the total number of barrier toggle operations that sample a positively charged edge is at most . Combined with the operations that sample a negatively charged edge, the total number of barrier toggle operations is at most .
3.5 Preservation of maximum integral symmetric flows
In this subsection, we prove that, if we set U to be a sufficiently large polynomial in n, then with high probability, the variable of any edge will not exceed U before we find an integral symmetric flow of value at least , assuming that the maximum integral symmetric flow has value at least K.
Lemma 14. Let be a maximum integral symmetric flow in . Suppose that . With probability at least , all edge variables will not exceed throughout the algorithm in Lemma 11.
We prove this lemma in two steps. First, we use the lemma below to show that the total change of edges in the current residual flow is negative. Since the expected change of each edge variable is proportional to its charge , this implies that the variables of edges in the support of are bounded with high probability. Next, we show that if the above holds, then the expected increase of each active edge variable is also bounded, which implies that all active edge variables are bounded with high probability.
Lemma 15. Let be the current residual graph, and be an operation vector based on a barrier on a subgraph of . For an integral symmetric flow in of value at least , the total charge on edges in the flow is negative, i.e., .
Proof. Let the barrier be . Recall that the charge for an edge is defined as
where .
By the flow decomposition theorem of skew-symmetric flows ([GK04]), we can split into a set of regular paths from to or from to , with additional regular cycles that do not use both an edge and its symmetric edge simultaneously. We consider the contribution of vertex potential , small fragment terms, and large fragment terms to the total charge separately.
-
For any path from to , vertex potential contributes to the total charge, and this path contributes 1 to the flow value. For any path from to , vertex potential contributes 2 to the total charge, and this path contributes -1 to the flow value. Vertex potential contributes 0 to the total charge of a cycle. Therefore, the total contribution of vertex potential to the total charge is .
-
For each small fragment , the term contributes at most 0 to any regular path or cycle, as a regular path or cycle cannot use symmetric edges and simultaneously, and if it uses one of them, it must use another edge in to enter or exit .
-
For a large fragment , the only term is , which contributes at most 2 to the whole flow. As a large fragment has size strictly larger than , there are fewer than such fragments, so the total contribution here is less than .
Therefore, the total charge of edges in the flow is strictly less than for flows of value at least .
Using this lemma, we can prove Lemma 14.
Proof of Lemma 14. Let be the current integral symmetric flow found by the algorithm, so that is supported by the current residual graph. In particular, all edges in the support of are active.
Our proof proceeds by defining a super-martingale and applying the optional stopping theorem. We first track the quantity
throughout the algorithm, where is the total energy, is the number of barrier toggle operations where a negative charge edge is sampled, is the number of augmentations already made, and is a large enough constant so that always holds.
The quantity defines a stochastic process that is frozen when the algorithm terminates, possibly with failure. It is always non-negative since , , and . Moreover, the initial value of is at most .
We now show that Q is a super-martingale, i.e., the expected value of Q does not increase throughout the algorithm. We analyze the expected change of Q in each step below.
-
For augmentations, we set for augmented edges, and then replace them by their reverse edges in the residual graph. The first step does not increase the sum of for edge pairs in . The second step increases it by at most as the algorithm changes at most edge pairs, and each of them has . This also increases by at most by removing some edges and adding at most reverse edge pairs with . Therefore, the expected increase from the first two terms is at most , which is canceled by the last term decreasing by .
-
For barrier toggle operations, we consider the expected change of each term in Q. For the energy term , if the operation samples a positive charge edge, then decreases by , and N is unchanged. If it samples a negative charge edge e, then increases by , and N increases by 1. Therefore, does not increase. Next, we consider the sum of for edges . In barrier toggle operations, the probability of sampling an edge e is proportional to , and the change to this variable is . So the expected change to a variable is proportional to its charge . Since the remaining flow value is at least , Lemma 15 gives that the total charge of edges in is negative, so the expected change to is negative. Therefore, the expected value of Q does not increase during barrier toggle operations.
-
For the clipping step, the only change to variables is that a variable gets clipped back to 1. If this edge is not in , then only decreases, and does not increase. Otherwise, decreases by , and increases by , so does not increase.
Define a bound to be chosen later. Consider stopping the super-martingale at the first time some edge has , or when the algorithm terminates, possibly with failure. By the optional stopping theorem, the expected value of at this stopping point is at most the initial value, which is at most . In the event some edge has , we have . Since is nonnegative, the probability that this event occurs is at most by Markov's inequality.
Consider another stochastic process
where is the total number of barrier toggle operations, except that we freeze this process the moment any edge has . We now show that is also a super-martingale.
-
For augmentations, we remove edges with variable and replace them by their reverse edges with variable 1, so cannot increase.
-
For each barrier toggle operation, let denote the total sample weight. Since Lemma 15 implies that the total charge of edges in is negative, some edge has nonzero charge. Assuming that the stochastic process is not frozen, we have , so .
The probability of sampling each edge is , and the change to this variable is before clipping. Therefore, increases by for each edge before clipping. Together with and , we conclude that increases by at most in each barrier toggle operation before clipping, and possibly by another 1 after clipping. Therefore, the expected increase of is at most , which is canceled by the term decreasing by .
Consider stopping the super-martingale at the first time some edge has , or when the algorithm terminates, possibly with failure. By the optional stopping theorem, the expected value of at this stopping point is at most the initial value, which is at most . In the event some edge has and no edge has at a previous point in time (which would freeze the process), we have . Since is nonnegative, the probability that this event occurs is at most by Markov's inequality.
We have bounded the probability that any edge has (at any point in time) by , and the probability that some edge has and no edge has at a previous point in time by . The probability that some edge has is at most the sum of these two probabilities. By setting , the total failure probability is at most .
3.6 Efficient non-zero charge edge sampling
Now we consider the sampling process in the barrier toggle operation. We will show that this operation can be reduced to sampling edges from a cut in an undirected graph, with updates to the cut S and the graph, as stated below.
Lemma 16. There is an algorithm that maintains an undirected graph G with polynomially bounded edge weights and a cut , using preprocessing time, and supports the following operations in amortized time:
• Add or remove an edge in the graph.
• Add or remove a vertex from the cut S.
• Sample an edge from the cut with probability proportional to its weight.
We first prove this lemma using expander techniques. Suppose that the graph is a -expander, i.e., for any cut , , where is the total degree of the vertices in . In this simple case, we can sample an edge from the cut as follows: First sample a vertex from ( if ) with probability proportional to its degree , and then sample an edge adjacent to ; if this edge is not in the cut , we reject it and repeat the process. Each edge in the cut is sampled with probability proportional to its weight, and the expected number of repeats is at most because of the -expansion property. We extend this idea to general graphs by maintaining a sequence of dynamic expander decompositions, similar to the one used for directed graph sparsification.
in [Li26], which fully decomposes the edges of the graph into expanders. We start by stating the dynamic expander decomposition on unweighted graphs that we will use in our algorithm.
Definition 17 ( -expander). An undirected graph is a -expander if for any cut , ,
Definition 18 ( -expander decomposition with slack s). A -expander decomposition of an unweighted graph G with slack s is a partition of the vertex set V such that the induced subgraph on each cluster is a -expander, and the total number of edges between different clusters, denoted as , is at most .
Theorem 19 (Theorem 7.2 of [GRST21]). Let be a parameter. There is a randomized algorithm that, given an unweighted graph undergoing edge insertions and deletions, maintains a -expander decomposition with slack , with the explicit set of edges . The algorithm has update time and amortized recourse with respect to , which means that the amortized changes to the set is at most per update in .
Using these results, we can prove Lemma 16.
Proof of Lemma 16. For every possible , let be the subgraph of that contains all edges with weight in . For each , similar to Theorem 10 of [Li26], we maintain a sequence of dynamic expander decompositions as follows: We first apply Theorem 19 and maintain a expander decomposition of with , then recursively perform this operation on the remaining edges between different expanders to get , and so on. As the number of edges is reduced by a factor of for each level of recursion, the total number of levels is . As the amortized recourse of each level is , the overall recourse is , and the total update time is also per update.
This process splits the edges of into many -expanders, where each edge is in exactly one expander, and each vertex is in at most expanders. For each vertex in each expander , we maintain its degree in , and the set of its adjacent edges in . For each expander with vertex support , we maintain its intersection with the cut , along with each vertex's degree for , and we also maintain the same information for the complement . Finally, for each expander , supposing that it comes from graph , we set its weight to be . All of this information can be maintained for cut updates, as each vertex is in at most expanders, and each edge is in exactly one expander.
For sampling, we first sample an expander (of vertex support ) with probability proportional to its weight , where is the index of the graph that contains . Next, supposing that is the smaller side of the cut and , we sample a vertex from with probability proportional to its degree in , and then sample an edge adjacent to in . If this edge is not in the cut , we reject it and repeat; If this edge is in , we also reject and repeat with probability . The expanding property of guarantees that we choose an edge in with probability at least . The probability that an edge in the cut is sampled is proportional to , where is the index of the graph that contains , and thus the final step guarantees that the probability of sampling is proportional to its weight . The expected number of repeats is at most .
We now finish the task of sampling an edge with non-zero charge using this lemma by reducing our task to sampling edges from a cut in an undirected graph. Recall that for a barrier , we define the edge charge for every edge as
where . Our goal is to sample an edge with probability proportional to .
Our first step is to write the charge for edge as the difference of vertex heights for some function on vertices, except for barrier edges and edges in a small fragment , as follows.
Lemma 20. Let be the current residual graph, and let be the barrier found by the algorithm that is used to define the operation vector . Consider an auxiliary bipartite graph as follows: For each vertex in , add two copies and into ; for each edge in , add an edge into . Define height on vertices in as follows:
For any edge in that is not any of the barrier edge from to each and from each to , and not in a small fragment , the charge can be written as the difference of vertex heights in , i.e. .
Proof. Since the edge is not any of the barrier edges, its charge simplifies to
In addition, since the edge is not in a small fragment , the expression is equivalent to . We conclude that .
Since both barrier edges and edges in a small fragment have charge 0, we can ignore them in the sampling process. Therefore, if we remove these edges from the graph , the problem reduces to sampling edges with probability proportional to their weight times the absolute difference of vertex heights . This can be reduced to the problem of sampling edges from a cut in an undirected graph as follows.
Lemma 21. Let be any directed graph with vertex heights . Define an undirected graph as follows: For each vertex in , create two vertices and in . For each edge in , add two copies and of this edge in . Let be the following set defined by vertex heights :
Then for any edge in , the number of copies of this edge in the cut is exactly .
Proof. For each , the edge is in if and only if exactly one of and is true. Since and are restricted to , the number of such satisfying exactly one of and is exactly .
Therefore, we can apply Lemma 16 to the auxiliary graph to support the sampling process we need. It remains to maintain these auxiliary graphs and with barrier edges and edges in small fragments removed as the regular reachability algorithm runs. We use the following property of the regular reachability algorithm to maintain these graphs efficiently. The detailed analysis of the regular reachability algorithm is deferred to Section A.
Observation 22. The regular reachability algorithm declares barriers as follows: It maintains a vertex set A and a set of fragments . During the algorithm, it performs the following operations on these sets:
• Add a new vertex to A.
- Merge some existing fragments and vertices in A into a new fragment, with a barrier edge connecting A and the new fragment. These vertices are removed from A.
• Declare that the current set A and fragments form a barrier.
By this observation, the vertex height of any copy of a vertex in is changed at most three times during the regular reachability algorithm: (i) when it is added to , (ii) when it is merged into a small fragment, and (iii) when it is merged into a large fragment. We delete an edge from if it becomes a barrier edge or an edge in a small fragment, and we add it back if it is no longer such an edge. Barrier edges only lead to edge deletions and additions. To delete edges in small fragments, when we merge some fragments or vertices into a small fragment, we delete all edges between them; and when we merge them into a large fragment, we add all edges within each small fragment back. For a small fragment of size before merging into large fragments, we make edge deletions and additions. Therefore, the total number of edge deletions and additions is at most , as each small fragment has size at most .
Summing these together, we get a total of edge modifications. This results in time for maintaining the auxiliary graphs when finding one regular path. Since we want to augment the flow by in Lemma 11, this takes time in total. Barrier toggle operations take time in total. This completes the proof of Lemma 11, and thus the proof of Theorem 1.
References
[ALPS23] Amir Abboud, Jason Li, Debmalya Panigrahi, and Thatchaphol Saranurak. All-pairs max-flow is no harder than single-pair max-flow: Gomory–Hu trees in almost-linear time. In 2023 IEEE 64th Annual Symposium on Foundations of Computer Science (FOCS), pages 2204–2212. IEEE, 2023.
[BBL 25] Aaron Bernstein, Joakim Blikstad, Jason Li, Thatchaphol Saranurak, and Ta-Wei Tu. Combinatorial maximum flow via weighted push-relabel on shortcut graphs. In 2025 IEEE 66th Annual Symposium on Foundations of Computer Science (FOCS), pages 464–485. IEEE, 2025.
[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.
[CKL 22] Li Chen, Rasmus Kyng, Yang P. Liu, Richard Peng, Maximilian Probst Gutenberg, and Sushant Sachdeva. Maximum flow and minimum-cost flow in almost-linear time. In 2022 IEEE 63rd Annual Symposium on Foundations of Computer Science (FOCS), pages 612–623. IEEE, 2022.
[DMM 25] Ran Duan, Jiayi Mao, Xiao Mao, Xinkai Shu, and Longhui Yin. Breaking the sorting barrier for directed single-source shortest paths. In Proceedings of the 57th Annual ACM Symposium on Theory of Computing (STOC), pages 36–44. Association for Computing Machinery, 2025.
[FLSW26] Henry Fleischmann, Jason Li, Thatchaphol Saranurak, and Benyu Wang. Directed global minimum cut in almost-linear time, 2026. Preprint.
[GK96] Andrew V. Goldberg and Alexander V. Karzanov. Path problems in skew-symmetric graphs. Combinatorica, 16(3):353–382, 1996.
[GK04] Andrew V. Goldberg and Alexander V. Karzanov. Maximum skew-symmetric flows and matchings. Mathematical Programming, 100(3):537–568, 2004.
[GRST21] Gramoz Goranci, Harald Räcke, Thatchaphol Saranurak, and Zihan Tan. The expander hierarchy and its applications to dynamic graph algorithms. In Proceedings of the 2021 ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 2212–2228. Society for Industrial and Applied Mathematics, 2021.
[HJS26] Bernhard Haeupler, Yonggang Jiang, and Thatchaphol Saranurak. Combinatorial minimum cost flow in almost-linear time on dense graphs, 2026. To appear in FOCS 2026.
[HLLZ26] Isaac M. Hair, George Z. Li, Jason Li, and Junkai Zhang. Bellman–Ford in almost-linear time, 2026. Preprint.
[HLRW24] Monika Henzinger, Jason Li, Satish Rao, and Di Wang. Deterministic near-linear time minimum cut in weighted graphs. In Proceedings of the 2024 Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 3089–3139. Society for Industrial and Applied Mathematics, 2024.
[Li26] Jason Li. Balancing weights, directed sparsification, and augmenting paths. arXiv preprint arXiv:2604.14633, 2026.
[MS04] Marcin Mucha and Piotr Sankowski. Maximum matchings via Gaussian elimination. In 45th Annual IEEE Symposium on Foundations of Computer Science (FOCS), pages 248–255. IEEE Computer Society, 2004.
[MV80] Silvio Micali and Vijay V. Vazirani. An algorithm for finding maximum matching in general graphs. In 21st Annual Symposium on Foundations of Computer Science (FOCS), pages 17–27. IEEE Computer Society, 1980.
A Resumable Regular Reachability
For a barrier as in Definition 8, the unique edge from to and its symmetric edge (the unique edge from to ) are the barrier edges. A symmetric pair of new edges violates a barrier of if the barrier is not a barrier of . For instance, every edge with negative charge in Definition 12 violates the barrier that defines the charges.
Linear-time algorithms that find a regular path or a barrier are given in [GK96] (see also [GK04, Section 7]): a search structure is grown from s, and self-symmetric fragments are trimmed when they are discovered. These algorithms are stated for a fixed graph, while we need to stop at each barrier and continue after inserting edges. This is essentially free because in an Edmonds-type search the edges may be scanned in any order: an inserted edge is just one more edge to scan, and no earlier step of the search has to be undone. Below we describe the algorithm in this form. Its analysis closely follows [GK96, GK04], so we only sketch it.
Lemma 23. Given a source vertex s (along with its mate ) and an initial skew-symmetric graph H, there is an algorithm which runs until it either outputs a regular path in H or pauses. When it is paused, symmetric edge pairs can be inserted into H, and then the algorithm resumes. The algorithm has the following guarantees:
(i) Pauses. Whenever the algorithm pauses, it has found a barrier of the current and is the set of vertices reachable from by regular paths in . While symmetric edge pairs are inserted, the algorithm takes time per pair and only resumes the search when some inserted pair violates the current barrier.
(ii) Progress. The algorithm maintains a partition which initially has , and . Between each resume and pause, the partition changes only through the following two operations:
• Grow: a pair leaves ; is added to and to .
- Merge: for a nonempty set and fragments ( ), the sets are replaced by the single fragment , which receives a barrier edge from A.
The total running time is , where m is the final number of edges of H.
The algorithm for static regular reachability depends on the following contraction operation.
Theorem 24 (Theorem 2.3 of [GK96]). Suppose that there is a regular path P from some vertex v to its symmetric vertex , and there is another regular path Q from s to v that does not intersect P except at v. Let be the last edge of Q incident to v. Define the contraction operation as follows:
- Remove all vertices on P and the symmetric path except for v and . Replace the path with a pair of symmetric edge from v to .
• For any edge whose destination is on P or (except edge ), redirect it to .
• For any edge whose source is on P or (except edge ), redirect it to v.
This contraction operation preserves regular reachability from s to , and a regular path from s to in the original graph can be reconstructed from a regular path in the contracted graph efficiently.
The algorithm works as follows. We maintain a set of vertices which we already know can be reached from via a regular path, and a tree that represents all regular paths from to the vertices in . We run a breadth-first search like algorithm to explore new vertices. If we find a regular path from to a vertex , and another regular path from to its symmetric vertex , we can take the path , which either gives a regular path from to directly, or gives a regular path from some vertex to its symmetric vertex that contains . In the latter case, we apply the contraction operation to this path, which contracts both and . Using these steps, never contains both a vertex and its symmetric vertex simultaneously, except for these contracted pairs at the boundary. When the algorithm cannot make further progress, all edges exiting are from those contracted pairs at the boundary, which corresponds to the fragments in the barrier. The remaining part of corresponds to the set in the barrier. The property of maintaining fragments that we want comes from the contraction operation. Resuming the algorithm after adding new edges is essentially the same as continuing the breadth-first search.