Algorithm Search⌘K

Proofs: Nagamochi-Ibaraki sparse certificate

These are the human proofs of Nagamochi-Ibaraki sparse certificate, at full length.

The Nagamochi-Ibaraki scan gives a certificate for k-edge connectivity full

This proof shows: correctness, termination.

Let G=(V,E)G = (V, E) be an undirected graph with nn vertices and mm edges, where parallel edges and self-loops are allowed. Run NI-CERTIFICATE. Write x1,…,xnx_1, \ldots, x_n for the vertices in the order line L4 picks them, and call the pass of lines L4 to L9 that scans xsx_s step ss. Write ρs\rho_s for the value r[xs]r[x_s] at the moment line L4 picks xsx_s. For i≥1i \ge 1 let FiF_i be the set of edges with final label ii, and Hk=F1∪⋯∪FkH_k = F_1 \cup \cdots \cup F_k. For X⊆VX \subseteq V, dA(X)d_A(X) is the number of edges of A⊆EA \subseteq E with exactly one end in XX, and λA(u,v)=min⁡{dA(X):u∈X, v∉X}\lambda_A(u, v) = \min\{d_A(X) : u \in X,\ v \notin X\}.

Lemma 0 (termination and labels). The algorithm stops after nn steps. Every self-loop has label 0, and every other edge e={x,y}e = \{x, y\} gets a label exactly once: in the step that scans the first of its ends, say xx, and the label is the value of r[y]r[y] just after line L7 increases it for ee.

Proof. Each step scans one unscanned vertex, and there are nn of them, so line L4 always finds one and the loop of line L3 ends after nn steps; each step looks at finitely many edges. Line L6 skips loops, so they keep label 0 from line L2. A non-loop edge {x,y}\{x, y\} is treated in line L6 in a step that scans one of its ends while the other is unscanned. That happens in the step that scans the earlier end, and in no other: in the step of the later end, the earlier end is scanned. □\square

So r[y]r[y] is, at every moment, the number of edges between yy and the scanned vertices, for yy unscanned. When an edge {xs,y}\{x_s, y\} gets label ii, yy is unscanned and is scanned in a later step.

Lemma 1. Each FiF_i is a forest, and ∣Fi∣≤n−1|F_i| \le n - 1.

Proof. Direct each edge of FiF_i from the end scanned first to the end scanned later. A vertex yy has r[y]=ir[y] = i right after exactly one execution of line L7 for yy, since r[y]r[y] only grows by 1 at a time, so exactly one edge into yy has label ii, or none. So every vertex has in-degree at most 1 in FiF_i, and every arc goes from an earlier to a later scanned vertex, so there is no directed cycle. Suppose FiF_i had an undirected cycle CC. Every vertex of CC has degree 2 in CC; the vertex of CC scanned last has both its CC edges coming from earlier vertices, so in-degree 2, a contradiction. A forest on nn vertices has at most n−1n - 1 edges. □\square

Fix i≥1i \ge 1. Call step ss a reset if ρs<i\rho_s < i. Step 1 is a reset, since ρ1=0\rho_1 = 0. If step ss is a reset, then at the start of step ss every unscanned vertex vv has r[v]≤ρs<ir[v] \le \rho_s < i, by the choice in line L4.

Lemma 2. Let step tt be a reset, and let t′>tt' > t be the next reset, or t′=n+1t' = n + 1 if there is none. For each ss with t≤s<t′t \le s < t', at the end of step ss, every vertex of

As={xt,…,xs}∪{v unscanned:r[v]≥i}A_s = \{x_t, \ldots, x_s\} \cup \{v \text{ unscanned} : r[v] \ge i\}

is joined to xtx_t by a path of edges that have label ii at that moment.

Proof. By induction on ss. Consider step ss, and assume the claim for s−1s - 1 if s>ts > t. First, xsx_s is joined to xtx_t: for s=ts = t trivially, and for s>ts > t step ss is not a reset, so ρs≥i\rho_s \ge i, and xsx_s was an unscanned vertex with r≥ir \ge i at the end of step s−1s - 1, hence in As−1A_{s-1}, joined to xtx_t by the induction hypothesis. The vertices xt,…,xs−1x_t, \ldots, x_{s-1} are joined to xtx_t by the induction hypothesis, and labels never change once set. Now let vv be unscanned with r[v]≥ir[v] \ge i at the end of step ss. If r[v]≥ir[v] \ge i already held at the start of step ss, then s>ts > t, because at the start of a reset no unscanned vertex has r≥ir \ge i, and v∈As−1v \in A_{s-1}, joined to xtx_t. Otherwise r[v]r[v] took the value ii during step ss, at line L7 for some edge e={xs,v}e = \{x_s, v\}, and line L8 gave ee label ii; so vv is joined to xsx_s, hence to xtx_t. □\square

Lemma 3. If an edge e={x,y}e = \{x, y\} has label j>ij > i, then xx and yy are joined by a path in FiF_i.

Proof. By Lemma 0, ee got its label in the step ss that scans x=xsx = x_s, say, and r[y]r[y] went from j−1≥ij - 1 \ge i to jj for ee. Two cases.

If r[y]<ir[y] < i at the start of step ss, then r[y]r[y] took the value ii during step ss, through an edge {xs,y}\{x_s, y\} that got label ii. That edge joins xx and yy in FiF_i.

If r[y]≥ir[y] \ge i at the start of step ss, then ρs≥r[y]≥i\rho_s \ge r[y] \ge i by the choice of xsx_s in line L4, so step ss is not a reset. Let t<st < s be the last reset before it. Both xsx_s and yy were unscanned with r≥ir \ge i at the end of step s−1s - 1, so both lie in As−1A_{s-1}, and Lemma 2 joins both to xtx_t by edges of label ii. So xx and yy are joined in FiF_i. □\square

Lemma 4 (cut lemma). Let k≥1k \ge 1 and X⊆VX \subseteq V. Then dHk(X)≥min⁡(k,dE(X))d_{H_k}(X) \ge \min(k, d_E(X)).

Proof. If every edge of EE that crosses XX is in HkH_k, then dHk(X)=dE(X)d_{H_k}(X) = d_E(X). Otherwise some edge e={x,y}e = \{x, y\} crosses XX and is not in HkH_k. It is not a loop, since a loop crosses no cut, so its label is some j>kj > k. For each i≤ki \le k, Lemma 3 gives a path from xx to yy in FiF_i. That path starts in XX and ends outside, so one of its edges crosses XX. The forests F1,…,FkF_1, \ldots, F_k are disjoint, because each edge has one label, so these are kk distinct edges of HkH_k, and dHk(X)≥kd_{H_k}(X) \ge k. □\square

Theorem. For every k≥1k \ge 1, ∣Hk∣≤k(n−1)|H_k| \le k(n - 1), and for all u≠vu \ne v,

min⁡(k,λHk(u,v))=min⁡(k,λE(u,v)).\min(k, \lambda_{H_k}(u, v)) = \min(k, \lambda_E(u, v)).

In particular, HkH_k is kk-edge-connected if and only if GG is.

Proof. The size bound follows from Lemma 1. Since Hk⊆EH_k \subseteq E, dHk(X)≤dE(X)d_{H_k}(X) \le d_E(X) for every XX, so λHk(u,v)≤λE(u,v)\lambda_{H_k}(u, v) \le \lambda_E(u, v). For the other direction, take XX with u∈Xu \in X, v∉Xv \notin X and dHk(X)=λHk(u,v)d_{H_k}(X) = \lambda_{H_k}(u, v). By Lemma 4, λHk(u,v)=dHk(X)≥min⁡(k,dE(X))≥min⁡(k,λE(u,v))\lambda_{H_k}(u, v) = d_{H_k}(X) \ge \min(k, d_E(X)) \ge \min(k, \lambda_E(u, v)). Taking the minimum with kk on both sides gives the equality. A graph with at least two vertices is kk-edge-connected exactly when λ(u,v)≥k\lambda(u, v) \ge k for all pairs, and HkH_k has the same vertex set as GG, so the last claim follows. Line L10 returns exactly HkH_k, and by Lemma 0 the algorithm terminates. ■\blacksquare

The vertex version, that HkH_k is kk-vertex-connected when GG is simple and kk-vertex-connected, is proved by Nagamochi and Ibaraki (1992) and is not reproved here. The page gives an example with parallel edges where it fails.

Back to Nagamochi-Ibaraki sparse certificate