WorksComputer Science
Two choices suffice: -out sampling leaves intercomponent edges for
Abstract
Given a simple undirected graph on vertices, random -out sampling forms a spanning subgraph by having each vertex independently choose incident edges uniformly with replacement. We prove that, for every integer , the expected number of original edges joining distinct sampled components is . This resolves the conjecture of Holm, King, Thorup, Zamir, and Zwick in its full range, improving their logarithmic sampling requirement to the optimal threshold of two choices per vertex. The bound fails for , and the dependence is tight up to constant factors. Our result holds with replacement and consequently also without replacement. In particular, this implies that contracting just two independent local choices per vertex suffices to reduce an arbitrary simple graph to a quotient with edges in expectation, which is crucial in reducing the instance size for many contraction-based algorithms. Our proof uses switching arguments to relate intercomponent edges to bridges and a degree-weighted component potential, whose expectation we also bound with a switching argument.
Introduction
Random edge sampling is a bsimple tool for sparsifying graphs while preserving useful structural information. We study sampling based on local choices at each vertex and ask how many original edges join distinct components of the sample. This property concerns connectivity of the original graph as contracting each sampled component leaves precisely these intercomponent edges and adding them to a spanning forest of the sample preserves the original connected components. Bounds on the number of intercomponent edges are therefore useful for contraction-based minimum-cut algorithms [2], spanning-forest communication protocols [1], and spanning adjacency oracles [13].
Let be a simple undirected graph on vertices. Holm, King, Thorup, Zamir, and Zwick [1] studied this question in the without-replacement -out model, where each vertex independently chooses a uniformly random subset of incident edges and the sampled subgraph is the union of these choices. They proved that the expected number of intercomponent edges is for and conjectured that the same bound should hold for all .
We resolve this conjecture in full, for every integer , in the stronger with-replacement model. Here each vertex independently samples incident edges uniformly with replacement, and is the union of these choices. Writing for the number of intercomponent edges of a spanning subgraph , we prove the following result.
Theorem 1. Let be a simple graph on vertices, and let be its random with-replacement -out subgraph. For every integer ,
The bound also holds without replacement as under a natural coupling, the without-replacement subgraph contains and has no more intercomponent edges (see § 3.0.0.1). In this work, we use the with-replacement model unless stated otherwise.
The result is optimal in both its sampling rate and its intercomponent edge count. The bound fails for , while examples of Holm, King, Thorup, Zamir, and Zwick [1] have expected intercomponent edges for , even without replacement.
Technical Contribution and Significance
A key obstacle to extending the analysis of Holm, King, Thorup, Zamir, and Zwick [1] to constant is their reduction to the expected -out model, where each vertex independently includes each incident edge with probability . For constant , this model leaves each vertex of a complete graph isolated with constant probability, yielding expected intercomponent edges instead of .
Our analysis bypasses this intermediate model and analyzes the -out model directly using the switching technique. The switching method is a double-counting technique for estimating the relative sizes of classes of combinatorial objects. We define transformations called switchings between the classes and compare the numbers of forward and inverse operations, thereby obtaining counting and probability bounds. In graph applications, a switching typically makes local modifications to the graphs, replacing a small set of edges with another. This is not necessary, but it often makes counting and reasoning about the number of forward and inverse switchings simpler. We use one switching argument to relate intercomponent edges to a component potential, and another to bound the expectation of this potential.
The case is outlined in § 2 and proved in § 6. The two-out case in Theorem 12 follows the same two steps but requires more careful treatment.
Implications and Applications
While the distributed sketching application of Holm, King, Thorup, Zamir, and Zwick [1] is already supported by their bound for , extending the bound to constant enables further algorithmic applications.
In particular, our theorem provides the simplification anticipated by Ghaffari, Nowicki, and Thorup [2] in their contraction-based algorithms for exact minimum cut in simple unweighted graphs. Their random -out contraction reduces the graph to vertices, where is the minimum degree, while preserving any fixed nontrivial minimum cut with constant probability. However, they have no bound on the number of edges that remain, and so they apply an additional sparsification step to reduce the edge count to . Our theorem supplies this edge bound directly for their random -out contraction with replacement, removing the need for the additional edge sparsification step. Combined with their vertex bound, it yields, with constant probability, a contracted instance with vertices and edges that preserves a fixed non-singleton minimum cut. Keeping constant is essential here, since it is what gives the constant cut-survival probability.
The same contraction principle improves exact minimum cut in the cut-query model, where each query returns the number of edges crossing a specified vertex subset. Kenneth-Mordoch and Krauthgamer [6] obtained a two-round algorithm using queries by constructing a contraction in the first round and recovering the contracted graph in the second. The recovery cost is nearly linear in the number of remaining vertices and edges. Our expected edge bound lets these sampling and recovery primitives implement random -out contraction and reconstruct the contracted graph using queries, with the cut-survival guarantee above.
Related Work
Early work focused on -out sampling in the complete graph. Fenner and Frieze [17] established -vertex and -edge connectivity for , Frieze [20] proved the existence of perfect matchings for even-order graphs when , and Bohman and Frieze [18] proved Hamiltonicity for , all with probability tending to . These results can be found in the book by Frieze and Karoński [21].
Frieze and Johansson [19] extended connectivity and Hamiltonicity results to graphs whose minimum degree is for some . They showed that is -connected w.h.p. for and is Hamiltonian for sufficiently large . However, they remarked that such results are not possible for graphs with smaller minimum degree.
Minimum cut.
Beyond the cut-query application above, random -out contraction has also been used in streaming. Assadi and Dudeja [12] gave a two-pass algorithm for exact global minimum cut using bits of space, whose first pass builds a with-replacement -out sample.
Spanning structures.
The bound of Holm, King, Thorup, Zamir, and Zwick [1] also gives a one-way communication protocol for finding a spanning forest, using private randomness and bits per vertex. Bodwin and Fleischmann [13] also apply this bound to spanning adjacency oracles, which implicitly represent a sparse spanning subgraph and answer edge-membership queries. One construction uses -out sampling.
Beyond connectivity.
Saneian and Behnezhad [16] use one-sided random -out sampling in bipartite graphs for streaming edge coloring. Each vertex on one side independently chooses three distinct uniform neighbors on the other. When the opposite side is larger by a sufficiently large constant factor, the sample contains a matching covering the sampling side with high probability.
Implementations.
The ConnectIt framework of Dhulipala, Hong, and Shun [14] and the GPU study of Hong, Dhulipala, and Shun [15] evaluate -out sampling and its variants for parallel connectivity.
The switching method.
As described in Wormald’s survey [3], McKay introduced switchings into the study of random graphs to bound subgraph probabilities in random graphs with prescribed degrees [10]. Since then, the switching argument has found many applications, including cycle counts and girth [7], connectivity [8], asymptotic estimates of spanning trees [9], and asymptotic enumeration of graphs with prescribed degrees [11]. Switchings are also crucial in the analysis of exact uniform generation algorithms, beginning with the work of McKay and Wormald [4] which was later improved by Arman, Gao, and Wormald [5] also using switching.
Technical Overview
We prove the bound by relating intercomponent edges to a degree-sensitive potential of the sampled components, and then showing that a special augmentation of a -out sample has expected potential .
From intercomponent edges to component potential
We first describe a simple switching argument to demonstrate how it can be useful. Fix , and leave the first choices at every vertex unchanged. For each intercomponent edge of , choose its smaller-degree endpoint and replace any one of its remaining choices by . Each replacement makes a bridge of the new sample outside the unchanged .
Each intercomponent edge therefore gives forward switchings. Conversely, an image bridge at admits at most inverse switchings, one for each possible previous choice. Thus forward switchings count intercomponent edges multiplied by , while inverse switchings are bounded by bridges weighted by the smaller degree of their endpoints.
These bridge weights are controlled by the component potential
Indeed, after contracting the components of , the bridges outside form a forest. Rooting its trees and charging each bridge to its child component results in at most one charge per component. Each charge is at most that component’s maximum original degree. Double-counting the switchings therefore gives
It remains to bound the expected potential of a suitable subgraph by .
Bounding the component potential
Fix a total order on the vertices by nondecreasing degree, breaking ties arbitrarily. Call the largest vertex of each component its leader, and order the components by their leaders. The potential is the sum of the leaders’ degrees. Their internal neighbors contribute at most because the components are disjoint, so it remains to control their crossing edges. Consider each crossing edge to be owned by the endpoint in the higher component. We prove a bound on the crossing edges owned by leaders using a recurrence.
A recurrence for edges at successive depths.
Write for the number of crossing edges whose owner is at distance from its leader. For such an edge with owner , replace either choice at in the lower component by . The inserted edge becomes a bridge, and is now at depth from the higher leader. We establish
The factor of two comes from the two choices that can be replaced at . To reverse a switch, fix an image and recover the previous choice at . A valid previous choice either stays inside the branch separated from the leader by the inserted bridge , or leads to another lower component. In the first case, the branches below bridges at the same depth are disjoint and therefore sum up to . In the second case, the previous edge is a crossing edge in the image owned by at depth , counted by . Solving the recurrence gives
Using one additional choice.
It remains to handle leaders’ edges to higher components. A leader with many such edges is likely to select one of them given an additional choice, allowing us to merge its component into a higher one and remove its degree from the potential.
This motivates the augmentation . Add each -leader’s third choice only when it reaches a higher -component. Conditioned on , a leader survives as a leader in with probability equal to the fraction of its neighbors lying inside its own component or in lower components. Since each surviving leader contributes its degree to the potential, multiplying the surviving probability by its degree gives the expected contribution to the potential, which is exactly the number of these neighbors. Summing the internal neighbors and crossing edges to lower components gives
Refining the Switching Argument for
Since , the same potential bound holds for . Taking in the first switching argument gives the desired bound for . To reach , we must protect fewer edges, leaving room for switching. We refine the switch so that the inserted crossing edge is a bridge outside in the image, giving
The refined switching argument is given in § 6.
Preliminary
Let be a simple graph, and let denote the neighbors of in . We may assume that has no isolated vertices, as deleting them does not change the intercomponent edges and only decreases . Define the -out sampling process as each node independently and uniformly sampling edges with replacement. The random -out subgraph is formed by taking the union of these sampled edges. These subgraphs admit a natural coupling. Consider the process in which each vertex independently generates an infinite sequence of independent, uniformly random incident edges
The union of the first choices at each vertex gives , where . Thus,
For fixed , the ordered outcomes consisting of the first choices, including repetitions, all have probability . Our counting arguments use these finite prefixes as outcome, and containment is defined by prefixes. Outcome contains outcome if restricted to the first positions is a prefix of for all .
Let be the set of connected components of and . For a spanning subgraph , define its intercomponent edges by
We also call these edges crossing and write . We omit the subscript when it is clear from context.
Comparison of the sampling models.
Let and denote the random -out subgraphs obtained with and without replacement, respectively. Using the sequences above, take the first draws for and the first distinct edges for . All incident edges appear almost surely (with probability ) in the infinite sequence, and their order of first appearance is a uniformly random permutation, so both marginals have the required distributions. Every edge among the first draws belongs to the without-replacement sample. Hence,
Since having more edges can only merge components and reduce crossing edges, we have
Hence, applying Theorem 1, we have , for all .
Bridge Potential to Component Potential
We define two potentials for spanning subgraphs of that are important in our main arguments.
Bridge Potential
An edge is a bridge if deleting it increases the number of connected components. Let denote the bridges of . For nested spanning subgraphs , define the bridge potential by
Each bridge’s weight is at most either endpoint’s degree. We can therefore charge it to either endpoint’s component, using that component’s maximum -degree.
Max-degree Component Potential
For any spanning subgraph of , define its max-degree component potential by
which charges each component of the largest degree of its vertices, with all degrees measured in the original graph . Merging components can only decrease . Hence, if , . The following lemma relates the two potentials.
Lemma 2. Let be a simple graph and be nested spanning subgraphs of . Then we have the following,
Proof. Each edge in joins different connected components of . Otherwise, deleting will not create new components in , contradicting the definition of a bridge. Contract all the edges in , and the edges in form a forest joining . Root each tree arbitrarily and charge the cost of each edge to its child component. Since each component in has at most one parent, the following is true.
◻
Warm-up: Switching Lemma and the near-regular case
In this section, we demonstrate how to reduce the problem of bounding intercomponent edges to bounding the sum of the maximum degrees of each component via a key technique we call the switching argument. We prove the following lemma in this section.
Lemma 3. For any integer , and integer , the following is true. For any graph ,
By applying the following lemma on the number of components of -out subgraphs due to Ghaffari, Nowicki, and Thorup [2], we can get a simple corollary bounding the number of intercomponent edges in nearly regular graphs.
Lemma 4 ([2]). For any -node graph with minimum degree ,
Corollary 5. For any -node graph with minimum degree and maximum degree , and any ,
The above corollary can be extended to by extending the switching argument to real numbers , by selecting the final choice with probability , and complementing it with a generalization of Lemma 4 to random subgraphs that select the second edge with non-zero probability. However, for simplicity of warm-up, we will not expand on the details.
Motivated by applications, we now move on to the proof of Lemma 3, where we use our key technique, the switching argument, a form of careful double counting.
Proof of Lemma 3. Consider any edge . Write for the event that is crossing in . Define to be the designated vertex of with smaller degree in , breaking ties over a globally fixed vertex order.
Now we define a switching process at the designated vertex of a crossing edge in . For a fixed , we consider the first samples in the protected positions and the other samples in that are not in the switchable positions. The number of switchable positions is .
For a fixed outcome , we define the following forward switch operation that maps an outcome containing to another outcome containing . For each switchable position of , swap the position of and in the sequence of . This will make the edge a bridge selected exactly once in the resulting graph. The expected number of forward switches is .
[proof picture,x=1cm,y=1cm]
\node[proof heading] at (3.5,2.15) {(a) Source $\sigma$: $e$ is crossing};
\node[proof heading] at (11.35,2.15) {(b) Image $\sigma'$: $e$ is a bridge};
\begin{scope}
\draw[proof region] (0,-.9) rectangle (2.65,1.65);
\draw[proof region] (4.35,-.9) rectangle (7,1.65);
\node[proof vertex] (v) at (2,.2) {$v_e$};
\node[proof vertex] (w) at (.65,-.25) {$w$};
\node[proof dot] (a) at (.85,1) {};
\node[proof vertex] (u) at (4.95,.2) {$u$};
\node[proof dot] (b) at (6.25,1) {};
\node[proof dot] (c) at (6.25,-.3) {};
\draw[proof edge] (v)--(a)--(w) (u)--(b)--(c)--(u);
\draw[proof choice] (v)--node[below,proof tag] {$f$}(w);
\draw[proof crossing] (v)--node[above,proof tag] {$e$}(u);
\node[proof note] at (3.5,-1.35)
{switch at the smaller-degree endpoint $v_e$};
\end{scope}
\begin{scope}[xshift=7.85cm]
\draw[proof region] (0,-.9) rectangle (7,1.65);
\node[proof vertex] (v2) at (2,.2) {$v_e$};
\node[proof vertex] (w2) at (.65,-.25) {$w$};
\node[proof dot] (a2) at (.85,1) {};
\node[proof vertex] (u2) at (4.95,.2) {$u$};
\node[proof dot] (b2) at (6.25,1) {};
\node[proof dot] (c2) at (6.25,-.3) {};
\draw[proof edge] (v2)--(a2)--(w2) (u2)--(b2)--(c2)--(u2);
\draw[proof removed] (v2)--node[below,proof tag] {$f$}(w2);
\draw[proof bridge] (v2)--node[above,proof tag] {$e$}(u2);
\node[proof note] at (3.5,-1.35)
{one selecting position; $e\notin H^r$};
\end{scope}Figure 1. Solid blue edges are protected positions. The dashed gold edge is crossing, hence not sampled initially. The green arrow is its unique selecting occurrence in the image.
On the inverse side, consider a sampling outcome of and count the number of incoming switches that it can receive. Two conditions have to be met. First, the outcome needs to contain the fixed outcome, with the same protected choices in the same order. Second, there must exist a bridge edge , selected only by its designated , and selected exactly once.
For a sequence outcome , define as the set of valid bridges satisfying the above conditions. The unique occurrence of determines the position to restore. There are at most possible previous choices that can make a crossing edge, which is the required condition in the pre-image. Since the ordered -choice sequences before and after switching have the same probability, we have,
The last inequality follows from Lemma 2, since by definition, and by the choice of the designated switching vertex. ◻
Bounding the Component Potential and the Consequence for
In § 4, we show how the switching argument relates the number of crossing edges to the max-degree component potential . In this section, we prove the -out conjecture for every by providing a linear bound on improving on the crude bound .
Fix an order on the vertices by increasing degrees in , breaking ties arbitrarily. We call the largest vertex of a component, which is also the one with the largest original degree, its leader. Denote as the leader of a component . Then the component potential is the sum of the degrees of the leaders of each connected component. That is
We call a component higher if its leader is higher and lower if its leader is lower.
Augmented -out Graph
To show a potential bound, our idea is to utilize an additional choice at some of the vertices to merge components together, effectively removing one previous leader from the sum toward the potential. With this idea in mind, we define the augmented -out graph in the following way. First, we sample . Then for the leader of each connected component in , we sample a third choice. If this edge connects to another component with a higher leader, we add that edge to . The sampling coupling applies. For the same sequence ,
Lemma 6. For any simple graph ,
With this lemma, we can show our desired bound for quite simply.
Corollary 7. Given any simple graph , and
Proof. Since , and adding more edges can only merge components and reduce potentials, . Applying Lemma 3 with and Lemma 6, we get
◻
Proof of Lemma 6: Bounded Potential on Augmented -out graph
The graph is built upon by adding a third randomly sampled edge from a leader of if that edge connects to a higher component. Hence, if a leader of fails to merge to a higher component, it remains a leader of and contributes to both and . On the other hand, if a leader of merges with a higher component due to its third choice, it contributes to . The leaders of is a subset the leaders of , so no other vertices can contribute to .
Conditioned on the first two choices of the sequences at each vertex, we can calculate the expected contribution of the leaders in to by bounding the probability of them staying as a leader.
Suppose is the leader for a connected component in . Let denote the number of bad neighbors of whose connection fails to merge into a higher component. This includes exactly neighbors inside and neighbors in lower components. The probability that remains a leader in is
If remains a leader, it contributes to . Hence, its expected contribution in this case is . Hence,
Therefore, it is sufficient to show that the sum of the bad neighbors of the leaders in is small. For each leader , we decompose the bad neighbors into internal neighbors in , , and external neighbors connecting to lower components in , denoted by . Since the components are disjoint, . Then, we can write
where is the sum of the leaders’ external neighbors in lower components. Bounding the expectation of allows us to bound the expected potential of .
Leaders’ external neighbors in lower components
Now we bound , the total number of external neighbors in lower components for leaders in . We consider all crossing edges to be owned by the endpoint in the higher component. Fix a spanning subgraph of , for each vertex , define the depth of in as its distance to the leader of its component. For any subgraph of , define as the number of crossing edges whose owner is at depth of its component. Note that . We will show the following relationship between the expected number of crossing edges at adjacent depths via a version of switching argument.
Lemma 8. For any graph , and any integer ,
Proof. Fix an outcome . Define a forward switching operation on the edges counted towards . Suppose is a crossing edge in with in the higher component. Suppose has depth . We perform a switching operation that replaces each of the two existing choices of (not the owner) with . Hence, for each outcome , there are forward switches.
Now consider the inverse switches. Fix an outcome and consider how many forward switches it can receive. A few conditions have to be met. First, after switching, is a bridge selected only by , and selected only once, as it was a crossing edge before the switch. Secondly, is at depth . This is because was in a lower component before switching, so the leader of ’s component will remain the leader in the merged component. Since is a bridge, every path from to the leader passes through . Hence, the depth of is exactly one more than the depth of .
To count the number of possible pre-images, we need to analyze which neighbors of could be a neighbor before the switch. Let be the component of containing . We call a bridge child and the connected component of after the deletion of , ’s internal component, denoted by . There are two possible cases from which the forward switches could come, illustrated in Figure 2..
The -neighbors of in ’s internal component . There are at most such neighbors. Since is a bridge, all the internal components of the bridge children at depth are disjoint. Hence, the total contribution here is at most
The -neighbors of that are in another component of lower than . Every such edge is a crossing edge in owned by whose depth is . Each such edge gives at most one inverse, since the bridge and its selecting position are uniquely determined by . Hence, there are at most such neighbors.
No other sources are possible. Firstly, cannot be from . Otherwise, restoring after deleting would reconnect and , so would not be a crossing edge in the pre-image. Secondly, cannot belong to a component higher than . Otherwise, when is deleted and is restored, lives in a higher component than , and will become the owner of , contradicting the definition of the switching operation. Thus, a fixed outcome receives at most
forward switches. All ordered two-choice sequences are equally likely. Summing over these sequences and dividing by the total number, we have
◻
[proof picture,x=1cm,y=1cm]
\node[proof heading] at (3.45,3.3) {(a) Forward: switch at the lower endpoint};
\node[proof heading] at (11.25,3.3) {(b) Image: the two inverse cases};
\begin{scope}
\draw[proof region] (0,-.35) rectangle (2.25,2.8);
\draw[proof lower] (4,-.35) rectangle (6.9,2.8);
\node[proof leader] (a) at (1.1,2.1) {$\alpha_C$};
\node[proof vertex] (u) at (1.1,.55) {$u$};
\node[proof vertex] (v) at (4.6,.55) {$v$};
\node[proof vertex] (w) at (6.2,1.9) {$w$};
\node[proof dot] (t) at (6.2,.2) {};
\draw[proof path] (a)--node[right,proof note] {$j$}(u);
\draw[proof edge] (v)--(t)--(w);
\draw[proof choice] (v)--node[left,proof tag] {$vw$}(w);
\draw[proof crossing] (u)--node[above,proof tag] {$uv$}(v);
\node[proof note] at (1.1,-.75) {higher component};
\node[proof note] at (5.45,-.75) {lower component};
\node[proof note,text width=6.9cm] at (3.45,-1.45)
{Replace either retained choice at the lower endpoint $v$.};
\end{scope}
\begin{scope}[xshift=7.8cm]
\draw[proof region] (0,1) rectangle (6.9,2.8);
\draw[proof child] (3.65,1.1) rectangle (6.8,2.7);
\draw[proof lower] (3.65,-1) rectangle (6.8,.45);
\node[proof leader] (a2) at (.65,2) {$\alpha_C$};
\node[proof vertex] (u2) at (2.25,2) {$u$};
\node[proof vertex] (v2) at (4.25,2) {$v$};
\node[proof vertex] (w2) at (6.05,2) {$w_{\rm in}$};
\node[proof vertex] (z2) at (6.15,-.3) {$w_{\rm out}$};
\draw[proof path] (a2)--node[above,proof note] {$j$}(u2);
\draw[proof bridge] (v2)--node[above,proof tag] {$uv$}(u2);
\draw[proof path] (v2) to[bend left=30] (w2);
\draw[proof removed] (v2)--(w2);
\draw[proof crossing] (v2) -- (4.25,.7)
-- node[below,proof tag] {$vw$} (6.15,.7) -- (z2);
\node[proof note] at (5.6,1.35) {child side $C_v$};
\node[proof note,anchor=west,text width=1.7cm] at (3.75,-.3) {lower\\component};
\node[proof note] at (4.25,2.5) {$j+1$};
\node[proof note,text width=6.9cm] at (3.45,-1.65)
{Restore $vw$ either inside $C_v$, or to a lower component.
In the second case, $v$ owns the residual edge.};
\end{scope}Figure 2. Dotted blue lines are retained paths. The green arrow is the inserted choice; dashed rose and gold edges are alternative previous choices.
Lemma 9. For any graph , .
With all ingredients needed, we can finally prove Lemma 6.
Refined Switching to the Augmented -out Graph and the case
In this section, we will prove a lemma analogous to Lemma 3. If we can relate the crossing edge of to the augmented -out graph , then applying Lemma 6, we can arrive at the following version of Theorem 1 for .
Theorem 10. Let be a simple graph on vertices. For every integer ,
Lemma 11. For any graph , and any integer ,
Proof. In this proof, we follow the convention of Lemma 3 that the designated vertex of an edge is the one with smaller degree.
Similar to the strategy in Lemma 3, we define some switching/rotating operation that maps one outcome of to another with the following property that allows us to charge the number of switches to the bridges of that are not in using Lemma 2. The switches should be defined such that in the image , is a bridge and does not belong to .
Fix a sequence and an outcome . We define a switching operation for all crossing edges to the -rd to the -th position in . There are three cases for the -rd position. Let be the first three choices in order at .
If is a leader in , we do not perform a third-position switch.
If is a leader in and not a leader in , then we perform a rotation to . We consider rotation a special type of switch.
If is not a leader in , then we perform the normal switch, replace the third choice with , and let .
We perform the normal switches to the -th to the -th positions. The rotation is illustrated in Figure 3.
[proof picture,x=1cm,y=1cm]
\node[proof heading] at (3.5,3) {(a) Before: $v_e$ leads an $H^2$-component};
\node[proof heading] at (11.35,3) {(b) After: $v_e$ is no longer a leader};
\begin{scope}
\draw[proof region] (0,-1.6) rectangle (3.05,2.5);
\draw[proof child] (4.55,.65) rectangle (7,2.5);
\draw[proof lower] (4.55,-1.6) rectangle (7,.05);
\node[proof leader] (v) at (2.3,.55) {$v_e$};
\node[proof vertex] (w) at (.65,1.65) {$w$};
\node[proof dot] (t) at (.65,-.65) {};
\node[proof leader] (a) at (5.8,1.6) {$\alpha_D$};
\node[proof vertex] (u) at (5.8,-.75) {$u$};
\draw[proof edge] (w)--(t);
\draw[proof choice] (v)--node[above left,proof tag] {$f_1$}(w);
\draw[proof edge] (v)--node[below left,proof tag] {$f_2$}(t);
\draw[proof bridge] (v)--node[above,sloped,proof tag] {$f_3$}(a);
\draw[proof crossing] (v)--node[below,sloped,proof tag] {$e$}(u);
\node[proof note] at (5.8,1) {$\alpha_D>v_e$};
\node[proof note] at (1.5,-1.25) {$H^2$-component};
\node[proof note,text width=7cm] at (3.5,-2.15)
{$f_3$ already joins a higher component in $H^{2+}$;
$e$ crosses the full $H^k$-components.};
\end{scope}
\begin{scope}[xshift=7.85cm]
\draw[proof region] (0,-1.6) -- (3.05,-1.6) -- (3.05,.65)
-- (7,.65) -- (7,2.5) -- (0,2.5) -- cycle;
\draw[proof lower] (4.55,-1.6) rectangle (7,.05);
\node[proof vertex] (v2) at (2.3,.55) {$v_e$};
\node[proof vertex] (w2) at (.65,1.65) {$w$};
\node[proof dot] (t2) at (.65,-.65) {};
\node[proof leader] (a2) at (5.8,1.6) {$\alpha_D$};
\node[proof vertex] (u2) at (5.8,-.75) {$u$};
\draw[proof edge] (w2)--(t2);
\draw[proof removed] (v2)--node[above left,proof tag] {$f_1$}(w2);
\draw[proof edge] (v2)--node[below left,proof tag] {$f_2$}(t2);
\draw[proof bridge] (v2)--node[above,sloped,proof tag] {$f_3$: first}(a2);
\draw[proof choice] (v2)--node[below,sloped,proof tag] {$e$: third}(u2);
\node[proof note] at (1.55,-1.25) {new $H^2$-component};
\node[proof note,text width=7cm] at (3.5,-2.15)
{$f_3$ connects $v_e$ to a higher leader already in $H^2$;
its third choice $e$ is not added to $H^{2+}$.};
\end{scope}Figure 3. Shaded regions are -components. The dashed rose edge is the old first choice; labels mark the new positions of and .
We count the number of forward switches. Each crossing edge whose designated vertex is a leader in contributes to forward switches, while all other crossing edges contribute forward switches. Denote the number of crossing edges whose designated vertex is a leader in by . These are the edges that are omitted from switching. The number of forward switches from outcome sequence is
Additionally, we have the following bound for ,
Now we check that in the image , is a bridge and does not belong to . This is clear for the normal cases except when is a leader in and not a leader in . In that case, we perform a rotation. The third choice connects to a higher component, and therefore belongs to . If we just replace with to make , we might still connect to a higher component, making belong to . The rotation makes sure that is selected in the first position, so that is connected to a higher component before the third choice, making a non-leader in and hence will not be in .
Hence, the switches map all to , and we can apply Lemma 2. Switches to can come from possibilities if is in the third position of and possibilities if is in positions onward. Since each sequence has equal positive probability, summing over all sequences and dividing by the number of configurations gives
◻
Now we can prove Theorem 10.
Proof of Theorem 10. Apply Lemma 11, and Lemma 6, we get
◻
The -out case
In this section, we extend the result to choices with replacement. We follow the same two steps as before: relate intercomponent edges to a component potential, and then bound the expected potential. For simplicity of presentation, we only show the argument for the -out case. For , one can either use Theorem 10 to get the desired bound with a better constant or extend the following argument to fit general . The constants below are chosen to simplify the proof.
Theorem 12. For every simple graph on vertices, its random two-out subgraph with replacement satisfies
Technical overview
The -out argument protects two choices and some third choices to make the potential small, leaving the other third choices available for switching. With only two choices, these two uses compete for the same second choice. Our idea is to restrict the switching argument to a constant fraction of the crossing edges in expectation. This loses only a constant factor in the reduction, but leads to a weaker potential in which each leader contributes only its relevant degree which counts only the neighbors used in switching.
Since we only need to switch from a random subset of vertices, we can protect two choices at the other vertices. The graph whose potential we need to bound is therefore an augmented -out graph that is already close to a -out graph. We can then adapt the earlier potential argument to bound this weaker potential in expectation by .
Some technical details that are different from the -out case are as follows. We use a random proper coloring to define the vertices and edges that can perform switchings. As the result, we are no longer working with uniform distributions on the source and image. Hence, we need to correct the expectation calculation with the ratio of the probabilities.
Preliminary
Recall that for the -out graph, each vertex independently samples two incident edges uniformly at random, with replacement. Write for the other endpoint of the -th selected edge .
The marked set and the base graph.
Conditional on , choose a uniformly random proper coloring with colors . Let be its zero set, call its vertices marked, and put . The set is an independent set in . Uniform randomness on coloring is crucial in our analysis, since this gives each vertex probability of being marked and provides the probability estimates needed after switching. An arbitrary proper coloring need not satisfy these estimates. The choice of ten is arbitrary, and any constant larger than 3 would suffice. We only need the information about the , so an outcome is the pair .
We consider the base graph that keeps the first position at every vertex and the second position of every vertex in . Thus, all second choices at are omitted from . Among these omitted second choices, we reserve those leaving for possible use in the augmentation. Denote the set of vertices with reserved choices by
Leaders.
Define the relevant degrees by
We assign degree zero to vertices outside , since they have no reserved choice available for augmentation. Fix a total order on the vertices, chosen independently of the sample and the coloring. Let be the order that sorts vertices by increasing , with ties broken according to . The leader of a component is its largest vertex under , and we compare components by their leaders similar to above.
Augmentation.
Building from , add the reserved second choice of each leader if it reaches a higher component of . Call the resulting graph . Then
Component Potential.
We define the component potential using instead of . Since exactly on , and , we have
From intercomponent edges to component potential
We first prove the following analogue of Lemma 11 using switching.
Lemma 13. For any simple graph ,
Proof. Similar to Lemma 11, we define switches that turn crossing edges into bridges outside the augmented graph. Fix and an edge . For this procedure, order the full -components by their largest vertices under . Designate to be the endpoint in the lower component, and the endpoint in the higher component. This designation depends on but not on . This will allow us to charge the image bridge to the child component which contains the switching vertex, thereby ensuring each component is charged at most once.
The edge is eligible for switching when
Thus . For an eligible edge, write and apply the following switching operation.
If is a leader in , omit this edge from the switching count.
If is a leader in but not in , perform the rotation Since , is still an independent set in .
If is not a leader in , perform the normal switch
Leave all other choices and unchanged. As a result, the set , all , and the leader order are unchanged, since both the old and the new second choices at leave .
A constant fraction of crossing edges is eligible switching.
We first count eligible crossing edges. For distinct vertices , the random zero set satisfies
The first assertion follows from color symmetry, as permuting the colors of a proper coloring is also a proper coloring. If are in different components of , their colors are independent, so the second probability is . Otherwise, are connected. Since each component of is either a tree or contains exactly one cycle, there are at most two distinct paths from to . Consider extending a proper coloring from to along the union of the paths from to . There are at least colors for to choose from, and at most of them is color . Hence, .
Now condition on the entire choice sequence and a crossing edge designated at . Both and differ from . Applying (4) and a union bound, its eligibility probability is
Let count eligible crossing edges. Conditional on , the set of crossing edges is fixed. By linearity of expectation,
Let count eligible edges omitted because their designated endpoint is an -leader. For each component of , any such edge designated at its leader goes to a neighbor in . There are at most such edges. Summing these leader bounds over components gives
The number of performed forward switches is .
Number of inverse switches.
Fix an image and an edge that can receive a switch. Since must be a bridge in , we call a receiving bridge. Each must be selected only once in by one of its endpoints , called the switching endpoint. Additionally, the switching endpoint that selects must select at the second position. If , the possible previous rows have the forms
In either case, the other endpoint of must lie in , so there are at most candidates for each type. Repeated choices are allowed, so is possible. To use these counts in the expectation, we must account for the probabilities of the outcomes.
Correcting contributions to the expectation for inverse switches.
The choice sequences are equally likely, but the pairs need not be, as the conditional probability of obtaining the same zero set may be different for under different sequences . Suppose when we count forward switches from to . Each switch contributes to the expected number of forward switches. Thus, an inverse switching should be counted with a correction factor equal to their ratios of probability.
We bound this correction factor now. Let be the number of proper -colorings of . For an independent set in , fixing its zero class leaves nine colors on , so
In the case of a normal switch, and this probability ratio is one.
In a rotation, the first choice at a vertex of is redirected to another vertex in . This keeps the coloring proper and the induced graph unchanged, i.e., , so only the denominator in (7) changes. Since can be viewed as a directed graph with exactly one directed cycle in each component, the following standard result counts its number of proper colorings. We defer the proof to § 8.
Lemma 14 (Coloring count for a first-choice graph). Let denote the length of directed cycle , where two opposite directed edges form a directed cycle of length two. For every integer ,
In a rotation, changing the first choice either preserves all directed cycles or destroys the cycle it was in. It creates no new cycle. This potentially removes one term in the product in Lemma 14. Therefore, for any rotation,
Hence, each receiving bridge contributes at most from normal switches and at most from rotations, for a total of at most .
The receiving edge is a bridge of outside .
To use an argument analogous to Lemma 2, we need to show this property. We already know that each receiving edge is a bridge of as it was a crossing edge in .
Recall that only includes second choices from . Since is selected only in the second position of and not by any other vertices in , we have . It remains to show that the augmentation does not add .
For a normal switch, only the second choice of changes, so . Since is not a -leader, and the leader order did not change, is also not a -leader. Hence, will also not be in .
For a rotation, reaches a higher -component. Putting it at the first position connects to that higher leader even in , making not a -leader. Hence, the new second choice is not added to . Hence, .
Charging image bridges to components.
Contract every edge of except those in . The resulting graph is a forest, where each contracted vertex comes from a union of connected components of . Root each tree at the contracted vertex that contains the highest original vertex under . Every receiving bridge has its switching endpoint on the child-side of this tree, as the removal of makes the side with the side with a higher leader under . We can charge the contribution of each edge to the child component. Each component of receives at most one charge, since each contracted vertex receives at most one charge from its parent edge. It follows that
Combining this with eq:eligible-count,eq:omit-count, we have
◻
Bounding the component potential
We now bound the expected potential by examining which -leaders survive the augmentation. This is analogous to § 5.
Lemma 15. For any simple graph ,
The expected contribution of a -leader.
Since all leaders of are from , we bound the expected contribution of a -leader. We reveal all the randomness that is just enough to reveal , the relevant degrees, and the leaders. We call these a partial outcome, denoted by
These are all first choices, the sets and , and the second choices at . Note that is needed to define the relevant degrees and the leaders, and it only reveals the vertices in whose second choice leaves , without revealing its actual second choice.
Condition on , and consider a -component whose leader belongs to . Let be the number of neighbors of in that lie inside or in lower -components. Since the augmentation adds the reserved choice of precisely when it reaches a higher component, remains a leader in with probability,
When remains a leader in , it contributes to the potential. Otherwise, it contributes to the potential. Hence, the expected potential conditioned on the partial outcome is
We split these neighbors into internal neighbors and external neighbors in lower components. The internal neighbors contribute at most . Let denote the total number of neighbors in that lie in lower components and are adjacent to -leaders in . We have
It remains to prove .
Bounding leaders’ neighbors in lower components with recurrence and switching
Similar to Lemma 8, we assign each crossing edge to its endpoint in the higher component, called its owner. We only switch edges incident to . Define this set of allowed edges by
All selected choices of are allowed, since is independent in and only unmarked vertices add their second choices to .
For a vertex in a -component , let be its distance to in . For each integer , let and count allowed crossing edges whose owners are at depth and are marked and unmarked, respectively. Write
Every neighbor counted by corresponds to an allowed crossing edge owned by a leader in , at depth zero. Hence,
Note that may also include contribution fromleaders in .
We will relate these counts at adjacent depths by switching at the endpoint in the lower component, showing the following recurrences.
Lemma 16. For every integer ,
Proof. Fix a partial outcome . Suppose is an allowed crossing edge whose owner has depth . We define the forward switch at the lower endpoint as follows.
If , replace its first choice by , giving this switch weight .
If , each of its two choices can be replaced by , giving two switches of weight each.
In the second case, since , changing its second choice does not change . Call the image with base graph .Since is allowed, remains independent in the new first-choice graph. The relevant degrees and leader order are therefore fixed.
We first count the forward switches with these weights. Write for and for . Each initial edge gives total weight one, so the total forward weight from is .
Now consider the inverse switches. Fix an image and count how many forward switches it can receive. First, must be a bridge of , selected in exactly one retained position, since it was crossing before the switch. Second, must be at depth . This is because the old higher component is unchanged, its leader remains the leader of the merged component, and every path from to that leader passes through . The membership of in or determines the type of switching it can receive. In either case, it receives switching of weight at most . Let be the component containing after deleting . The old choice has two possible locations, illustrated in Figure 4.
The -neighbors of inside . Each such neighbor determines at most one inverse. The sets for bridge children like at depth are disjoint. Hence the total number of these inverses is at most
The -neighbors of in a lower component of . Since is a crossing edge owned by at depth . There are at most such edges when and when
[proof picture,x=1cm,y=1cm]
\node[proof heading] at (3.35,3.65) {(a) Internal inverse: $z\in\ChildSide{v}$};
\node[proof heading] at (10.65,3.65) {(b) Residual inverse: $z$ is outside};
\begin{scope}
\draw[proof region] (0,.9) rectangle (6.7,3.1);
\draw[proof child] (3.45,1) rectangle (6.6,3);
\node[proof leader] (a) at (.6,2.05) {$\alpha$};
\node[proof vertex] (u) at (2.15,2.05) {$u$};
\node[proof vertex] (v) at (4,2.05) {$v$};
\node[proof vertex] (z) at (5.9,2.05) {$z$};
\draw[proof path] (a)--node[above,proof tag] {$j$}(u);
\draw[proof bridge] (v)--node[above,proof tag] {$uv$}(u);
\draw[proof path] (v) to[bend left=35] (z);
\draw[proof removed] (v)--(z);
\node[proof note] at (4,2.8) {$j+1$};
\node[proof note] at (5.1,1.3) {child side $\ChildSide{v}$};
\node[proof note,text width=6.5cm] at (3.35,.2)
{Restore the old choice $vz$ inside $\ChildSide{v}$.};
\end{scope}
\begin{scope}[xshift=7.3cm]
\draw[proof region] (0,1.4) rectangle (6.7,3.1);
\draw[proof child] (3.45,1.5) rectangle (6.6,3);
\draw[proof lower] (3.45,-.75) rectangle (6.6,.6);
\node[proof leader] (a2) at (.6,2.05) {$\alpha$};
\node[proof vertex] (u2) at (2.15,2.05) {$u$};
\node[proof vertex] (v2) at (4,2.05) {$v$};
\node[proof vertex] (z2) at (5.8,-.05) {$z$};
\draw[proof path] (a2)--node[above,proof tag] {$j$}(u2);
\draw[proof bridge] (v2)--node[above,proof tag] {$uv$}(u2);
\draw[proof crossing] (v2) -- (4,1.05)
-- node[above,proof tag] {$vz$} (5.8,1.05) -- (z2);
\node[proof note] at (4,2.8) {$j+1$};
\node[proof note] at (5.4,2.65) {$\ChildSide{v}$};
\node[proof note,align=left] at (4.35,-.05) {lower\\component};
\node[proof note,text width=6.7cm] at (3.35,-1.3)
{$v$ owns the residual edge $vz$ at depth $j+1$.};
\end{scope}Figure 4. Green arrows are inserted retained choices. Dashed rose and gold edges are alternative previous choices; dotted blue lines are retained paths.
As in § 7.3, these outcomes are not equally likely and we need to account for the probability ratio of the partial outcomes. Let be the probability of a partial outcome. A forward switch contributes . Summing these contributions by their images gives
The inner sum is over valid switches. To apply the inverse counts above, we need to bound the ratio .
Since sampling is with replacement, the possible hidden second choices depend only on and , not on the revealed choices. Since our switching above preserves both sets, so and have the same number of completions to two choices. All two choice sequences have the same sampling probability, so we only need to compare the probabilities of obtaining from the two first-choice graphs. Writing for the image first-choice graph, (7) gives
If the switch changes a second position, and the ratio is one. Otherwise, the new edge joins different old -components. It therefore creates no directed cycle and destroys at most one in . Applying Lemma 14 as before gives
For the nine-coloring factor, we need a lower bound on the number of colorings after the switch. If is marked, both its old and new first choices are incident to a vertex outside . Neither affects the induced graph on , so this factor is one. Now suppose . First remove its old first choice, obtaining . Every proper coloring of is still proper in , since removing a choice cannot introduce a coloring constraint. We then insert . If , this edge is absent from the induced graph on , so all its colorings remain proper. If , the edge joins distinct components of , since and were in different -components before the switch. The two components can be colored independently, so exactly of their colorings give and the same color due to color symmetry. The other remain proper after inserting . Thus insertion preserves at least of the colorings in either case, giving
Combining these bounds, we have
After multiplying by the switch weight , each inverse contributes at most when is marked and at most when is unmarked. The bounds are listed in Table 1.
| Changed position | Bound on | Bound on | |
| , first | |||
| , first | |||
| , second |
Table 1. Probability ratios and position weights for the two-out potential switching. The last column bounds the weighted contribution of one inverse.
We can now apply the inverse counts to upper bound the inverse contributions. There are at most internal inverses, each contributing at most . Each residual crossing edge contributes at most if its owner is marked and if its owner is unmarked. Thus the total inverse contribution at is at most
Substituting into (11) and taking expectations proves (10).
For the second recurrence, count only initial edges whose owner is marked. Since the edges are allowed, their switching endpoints must be unmarked. Now every inverse has weight at most , and every residual edge has an unmarked owner. The same argument gives
which proves eq:recurrence-marked. ◻
We now apply the recurrences to bound the depth counts. For every , we will show
We use backward induction on . All depth counts are zero for , which gives the base case. For the induction step, use to get
Thus the bounds at depth imply those at depth , proving (14). In particular,
Proof of Lemma 15. Applying (9) and the preceding bound gives
◻
We can now prove Theorem 12.
Proof of Theorem 12. Combining lem:2crossing-potential,lem:2-potential-exp, we obtain
◻
Proof of Theorem 1. The case follows from Theorem 10. For , Theorem 12 gives . ◻
Declaration of AI assistance
OpenAI Codex was used to assist with developing and checking parts of the proofs, drafting and organizing parts of the manuscript, finding relevant references, generating and revising TikZ figures, and editing the LaTeX source. The authors are responsible for the mathematical claims, references, and final content of the paper.
Number of proper colorings of pseudo-forest
Proof of Lemma 14. Each component contains exactly one directed cycle, with trees attached to its vertices. Consider a component with vertices whose directed cycle has length .
First suppose . The cycle has
proper -colorings. Once its colors are fixed, color the remaining vertices in increasing distance from the cycle. Each vertex has exactly choices, since only the color of its parent is forbidden. Thus the component has
proper colorings.
If , the two opposite arcs give a single undirected edge, so the underlying component is a tree. Its number of proper colorings is
which is the same formula with .
Finally, colorings of distinct components can be chosen independently. Multiplying their counts and using that their sizes sum to proves the identity. ◻
References
- [1]Holm, J., King, V., Thorup, M., Zamir, O., & Zwick, U. (2019). Random k-out subgraph leaves only o (n/k) inter-component edges. 2019 IEEE 60th Annual Symposium on Foundations of Computer Science (FOCS), 896–909.
- [2]Ghaffari, M., Nowicki, K., & Thorup, M. (2020). Faster algorithms for edge connectivity via random 2-out contractions. Proceedings of the Fourteenth Annual ACM-SIAM Symposium on Discrete Algorithms, 1260–1279.
- [3]Wormald, N. C. (1999). Models of random regular graphs. London Mathematical Society Lecture Note Series, 239–298.
- [4]McKay, B. D., & Wormald, N. C. (1990). Uniform generation of random regular graphs of moderate degree. Journal of Algorithms, 11(1), 52–67.
- [5]Arman, A., Gao, P., & Wormald, N. (2019). Fast Uniform Generation of Random Graphs with Given Degree Sequences. 2019 IEEE 60th Annual Symposium on Foundations of Computer Science (FOCS), 1371–1379. https://doi.org/10.1109/FOCS.2019.00084
- [6]Kenneth-Mordoch, Y., & Krauthgamer, R. (2025). Cut-Query Algorithms with Few Rounds. 33rd Annual European Symposium on Algorithms (ESA 2025), 351, 100:1–100:14. https://doi.org/10.4230/LIPIcs.ESA.2025.100
- [7]McKay, B. D., Wormald, N. C., & Wysocka, B. (2004). Short cycles in random regular graphs. The Electronic Journal of Combinatorics, R66–R66.
- [8]Cooper, C., Frieze, A., & Reed, B. (2002). Random regular graphs of non-constant degree: connectivity and Hamiltonicity. Combinatorics, Probability and Computing, 11(3), 249–261.
- [9]McKay, B. D. (1981). Spanning trees in random regular graphs. Computer Science Department, Vanderbilt University.
- [10]McKay, B. D. (1981). Subgraphs of random graphs with specified degrees. Congressus Numerantium, 33, 213–223. https://users.cecs.anu.edu.au/~bdm/papers/Subgraphs1981.pdfusers.cecs.anu.edu.au/~bdm/papers/Subgraphs1981.pdf
- [11]McKay, B. D., & Wormald, N. C. (1991). Asymptotic enumeration by degree sequence of graphs with degrees o (n 1/2). Combinatorica, 11(4), 369–382.
- [12]Assadi, S., & Dudeja, A. (2021). A simple semi-streaming algorithm for global minimum cuts. Symposium on Simplicity in Algorithms (SOSA), 172–180.
- [13]Bodwin, G., & Fleischmann, H. (2023). Spanning adjacency oracles in sublinear time. https://arxiv.org/abs/2308.13890
- [14]Dhulipala, L., Hong, C., & Shun, J. (2020). Connectit: A framework for static and incremental parallel graph connectivity algorithms. https://arxiv.org/abs/2008.03909
- [15]Hong, C., Dhulipala, L., & Shun, J. (2020). Exploring the design space of static and incremental graph connectivity algorithms on gpus. Proceedings of the ACM International Conference on Parallel Architectures and Compilation Techniques, 55–69.
- [16]Saneian, M., & Behnezhad, S. (2024). Streaming edge coloring with asymptotically optimal colors. 51st International Colloquium on Automata, Languages, and Programming (ICALP 2024), 121–1.
- [17]Fenner, T. I., & Frieze, A. M. (1982). On the connectivity of random m-orientable graphs and digraphs. Combinatorica, 2(4), 347–359.
- [18]Bohman, T., & Frieze, A. (2009). Hamilton cycles in 3-out. Random Structures & Algorithms, 35(4), 393–417.
- [19]Frieze, A., & Johansson, T. (2017). On random k-out subgraphs of large graphs. Random Structures & Algorithms, 50(2), 143–157.
- [20]Frieze, A. M. (1986). Maximum matchings in a class of random graphs. Journal of Combinatorial Theory, Series B, 40(2), 196–212.
- [21]Frieze, A., & Karoński, M. (2015). Introduction to random graphs (Vol. 1). Cambridge University Press Cambridge.