Proofs: Reverse Cuthill-McKee algorithm
These are the human proofs of Reverse Cuthill-McKee algorithm, at full length.
Reverse Cuthill-McKee returns a permutation whose bandwidth is below twice the level width, and Cholesky fill stays in its envelope full
This proof shows: correctness, termination.
Let be the graph of a symmetric pattern, , . Line numbers refer to the pseudocode. Write for the list built by lines L1 to L8 (the Cuthill-McKee order) and for its reverse, returned at line L10. For an ordering , is the position of .
Lemma 1 (each vertex is appended exactly once). A vertex is appended only at lines L5 and L8, and only when it is not yet numbered, and it is marked as numbered at the same moment. So no vertex is appended twice. Every vertex is examined by the loop at line L2; if it is unnumbered then, line L4 picks a root in the component of (the pseudo-peripheral search only moves along BFS levels of that component), and the breadth-first search of lines L6 to L8 appends every vertex reachable from , which includes . Hence and are permutations of .
Termination. The pseudo-peripheral search of line L4 moves to a new root only when the eccentricity strictly increases; eccentricities are below , so it stops after at most breadth-first searches. The queue of line L6 receives each vertex at most once by Lemma 1, so each search ends. The loop of line L2 has iterations.
Lemma 2 (CM numbers by levels). Within one component with root , the breadth-first search appends the vertices in order of nondecreasing distance from , so the component occupies a contiguous block of , and within it the level (vertices at distance ) occupies a contiguous sub-block, after .
Proof. Standard property of breadth-first search with a FIFO queue: the queue holds vertices of at most two consecutive distances, with the smaller first, so vertices are appended in nondecreasing distance. Components are processed one after another by the loop at line L2.
Theorem 1 (bandwidth). Let be the largest level width over the level structures of the roots chosen at line L4. Then .
Proof. Reversal maps positions , which preserves every difference , so the two bandwidths are equal. For an edge , both ends lie in one component and their distances from differ by at most 1, so by Lemma 2 both lie in the union of two consecutive level blocks , a contiguous range of at most positions. Hence .
Theorem 2 (fill stays in the envelope; any ordering). Let be symmetric positive definite with Cholesky factor , and for row let be the column of its first nonzero. Then for .
Proof. The Cholesky recurrence gives for . Fix and use induction on : by the definition of , and for every by the induction hypothesis, so .
Hence the nonzeros of lie in the envelope , which has entries, and an envelope (profile) solver that stores exactly this set loses nothing. The same holds symbolically: the graph elimination used by the implementation adds an edge with only between later neighbours of an eliminated vertex , and such an edge has .
Theorem 3 (envelope of the reversal; cited). For every Cuthill-McKee ordering , , and the work of envelope Cholesky in the order is at most that in the order . This is the theorem of Liu and Sherman (1976); its proof compares, for each , the number of vertices among the first that still have an unnumbered neighbour with the number of unnumbered vertices adjacent to the first , using the breadth-first structure of . We do not reproduce it; the tests check the inequality on random graphs.
A useful identity behind it: for any ordering , an entry lies in the envelope exactly when is numbered after position and has a neighbour at a position . Counting by ,
the sum of the wavefront sizes. Applied to and rewritten in terms of , becomes the sum over of the number of vertices among the first of that have a neighbour after position .