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 be an undirected graph with vertices and edges, where parallel edges and self-loops are allowed. Run NI-CERTIFICATE. Write for the vertices in the order line L4 picks them, and call the pass of lines L4 to L9 that scans step . Write for the value at the moment line L4 picks . For let be the set of edges with final label , and . For , is the number of edges of with exactly one end in , and .
Lemma 0 (termination and labels). The algorithm stops after steps. Every self-loop has label 0, and every other edge gets a label exactly once: in the step that scans the first of its ends, say , and the label is the value of just after line L7 increases it for .
Proof. Each step scans one unscanned vertex, and there are of them, so line L4 always finds one and the loop of line L3 ends after steps; each step looks at finitely many edges. Line L6 skips loops, so they keep label 0 from line L2. A non-loop edge 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.
So is, at every moment, the number of edges between and the scanned vertices, for unscanned. When an edge gets label , is unscanned and is scanned in a later step.
Lemma 1. Each is a forest, and .
Proof. Direct each edge of from the end scanned first to the end scanned later. A vertex has right after exactly one execution of line L7 for , since only grows by 1 at a time, so exactly one edge into has label , or none. So every vertex has in-degree at most 1 in , and every arc goes from an earlier to a later scanned vertex, so there is no directed cycle. Suppose had an undirected cycle . Every vertex of has degree 2 in ; the vertex of scanned last has both its edges coming from earlier vertices, so in-degree 2, a contradiction. A forest on vertices has at most edges.
Fix . Call step a reset if . Step 1 is a reset, since . If step is a reset, then at the start of step every unscanned vertex has , by the choice in line L4.
Lemma 2. Let step be a reset, and let be the next reset, or if there is none. For each with , at the end of step , every vertex of
is joined to by a path of edges that have label at that moment.
Proof. By induction on . Consider step , and assume the claim for if . First, is joined to : for trivially, and for step is not a reset, so , and was an unscanned vertex with at the end of step , hence in , joined to by the induction hypothesis. The vertices are joined to by the induction hypothesis, and labels never change once set. Now let be unscanned with at the end of step . If already held at the start of step , then , because at the start of a reset no unscanned vertex has , and , joined to . Otherwise took the value during step , at line L7 for some edge , and line L8 gave label ; so is joined to , hence to .
Lemma 3. If an edge has label , then and are joined by a path in .
Proof. By Lemma 0, got its label in the step that scans , say, and went from to for . Two cases.
If at the start of step , then took the value during step , through an edge that got label . That edge joins and in .
If at the start of step , then by the choice of in line L4, so step is not a reset. Let be the last reset before it. Both and were unscanned with at the end of step , so both lie in , and Lemma 2 joins both to by edges of label . So and are joined in .
Lemma 4 (cut lemma). Let and . Then .
Proof. If every edge of that crosses is in , then . Otherwise some edge crosses and is not in . It is not a loop, since a loop crosses no cut, so its label is some . For each , Lemma 3 gives a path from to in . That path starts in and ends outside, so one of its edges crosses . The forests are disjoint, because each edge has one label, so these are distinct edges of , and .
Theorem. For every , , and for all ,
In particular, is -edge-connected if and only if is.
Proof. The size bound follows from Lemma 1. Since , for every , so . For the other direction, take with , and . By Lemma 4, . Taking the minimum with on both sides gives the equality. A graph with at least two vertices is -edge-connected exactly when for all pairs, and has the same vertex set as , so the last claim follows. Line L10 returns exactly , and by Lemma 0 the algorithm terminates.
The vertex version, that is -vertex-connected when is simple and -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.