Proofs: Elimination tree
These are the human proofs of Elimination tree, at full length.
Cost of the elimination tree algorithms full
This proof shows: time.worst, space.extra, symbolic.worst.
ETREE. Lines L1 and L2 cost . Each of the nonzeros starts one climb. The forest given by the pointers is a disjoint-set forest: a climb from is a find that follows pointers to the root of the set of and redirects every node passed, and setting for the new singleton is a link with the new root on top, done before the compression it accompanies. So iteration performs finds and links of a sequence with finds and at most links, with full path compression and arbitrary linking. Tarjan and van Leeuwen (1984) bound such a sequence by pointer operations, which is . Each find also costs , so the time is at least .
ROW-PATTERN. Lines L10 and L12 run once per nonzero of row of plus once per iteration of line L13. Each iteration of line L13 marks an unmarked node, which then appears in the output, so there are of them, and lines L9, L11, L14 and L15 cost . Total .
Symbolic factorization. Summing over gives : at least the input and output, and at most a constant times their size.
POSTORDER. Building the child lists and the depth first search touch each node and each tree edge a constant number of times: .
Space. , , the marks, the child lists and the explicit stack have entries; outputs excluded, the extra space is .
Correctness of the elimination tree algorithms full
This proof shows: correctness, termination.
Structural model: means structurally nonzero. Column of has its nonzeros exactly at the neighbours of in the elimination graph , where and is obtained from by deleting and joining all its neighbours pairwise (the Schur complement pattern).
Lemma 1 (fill paths). For , , the edge is in if and only if has a path from to whose interior vertices are all smaller than . Hence for , if and only if has an to path with interior vertices smaller than .
Proof. Induction on ; for the paths have no interior and the claim is the definition of . Suppose it holds for . An edge with is in if it was in or if both and are neighbours of in . By the hypothesis the first case gives a path with interior below , and the second gives two paths and with interiors below , whose concatenation (shortened to a simple path) has interior vertices at most . Conversely, take a simple to path with interior below . If it avoids its interior is below and , so also in . Otherwise it passes once, and the two pieces show that and are neighbours of in , so they are joined in .
Lemma 2. If and , , then .
Proof. and are neighbours of in , so they are adjacent in ; edges between surviving vertices are never removed, so they are adjacent in , and .
Theorem 3 (ancestor property). If and , then is an ancestor of .
Proof. Induction on . Let , which exists and satisfies by its definition as a minimum. If we are done. Otherwise and Lemma 2 gives with , so is an ancestor of , hence of .
Lemma 4. If and has a path from to whose interior vertices are all smaller than , then is an ancestor of .
Proof. Induction on the path length. Let be the largest vertex of the path other than ; then . The subpath from to has interior vertices smaller than , so by Lemma 1 and is an ancestor of by Theorem 3. If we are done. Otherwise the subpath from to is shorter and has interior vertices below , so is an ancestor of by induction.
Theorem 5 (row subtrees). For each , .
Proof. If then and is an ancestor of (Theorem 3), so the path exists. For , walk up the path from : , and if with , then and Lemma 2 gives . For , let . By Lemma 1 there is a path with . Put , so and . If , the path satisfies Lemma 4, so is an ancestor of . The ancestors of form a chain containing and , and , so lies on the path from to .
Theorem 6 (ETREE). Let be the forest on obtained from the elimination tree by deleting the edges to parents larger than . After iteration of line L1: for , is the true parent if it is at most and otherwise; and if is a root of , while otherwise is a proper ancestor of with .
Proof. Induction on ; before iteration there is nothing to show. In iteration , the nodes whose parent is are, by definition, the with and for , that is the roots of in the row pattern of . By Theorem 5 a root of is in that pattern exactly when its subtree in contains some with (if is on the path from such an , is in its subtree; conversely and are both ancestors of and , so is on the path).
Consider the climb of lines L4 to L7 from such an . Every value it follows is an anc pointer, hence a proper ancestor, so the visited nodes increase strictly and the loop terminates. By the hypothesis, nodes that are not roots of have pointers into the same tree of , unless they were reset to earlier in this iteration. If the climb meets no such node it ends at the root of the tree of , where , and line L6 sets , correctly. If it meets a node whose pointer is already , that node was passed by an earlier climb of this iteration, which continued to the same root and set its parent. No other parents are set, since line L6 acts only at roots of reached from such an , and those all have parent . Every node passed is in a tree now hanging from and receives , a proper ancestor; nodes not passed keep valid pointers, since adding the node above some roots keeps every ancestor an ancestor; and with a root of .
Theorem 7 (ROW-PATTERN). It returns the row pattern of , each node once, and clears its marks.
Proof. Only and output nodes are marked. A climb from with follows the tree path towards , which is an ancestor of and is marked, so it stops, at the first marked node. The nodes it appends are on the path from to , and all unmarked nodes on that path below the stopping node are appended. A marked node on the path other than was output by an earlier climb, which also passed everything above it up to or to another marked node, and so on up to . So the union of the outputs is the union in Theorem 5, without repetition. Line L15 clears exactly what was marked.
Theorem 8 (equivalent orderings). Let be an ordering of in which every node comes before its parent (a postorder is one). Eliminating in the order gives the same filled graph (the graph of ) as the original order. Hence the column counts are permuted by and the new tree is the old one relabelled.
Proof. Every neighbour of in is comparable with in the tree (Theorem 3), so the neighbours of that come after in are its ancestors, which are its neighbours larger than in the original order: the pattern of column of . These form a clique of , because the elimination game made them one. So is a perfect elimination ordering of , and eliminating in order adds nothing. Fill under is given by the paths of Lemma 1 with in place of the numbering; a path in is a path in , so the filled graph of under is contained in that of , which is .
Conversely let with , so is a descendant of and puts before . Lemma 1 gives a path from to in whose interior vertices are smaller than ; for each interior , the piece from to satisfies Lemma 4, so is a descendant of and comes before in . This is a fill path in the order , so is in the filled graph under . The parent of a node is its smallest higher neighbour in , and the higher neighbours are the same set in both orders; as they form a chain of ancestors, the smallest is the same node.
Termination. Every loop is over a finite list except the climbs, which strictly increase the current node (Theorems 6 and 7), and the depth first search, which emits each node once.