Algorithm Search⌘K

Proofs: Multifrontal method

These are the human proofs of Multifrontal method, at full length.

The multifrontal method computes the Cholesky factor, the update matrices it needs are on top of the stack, and Liu's child order minimizes the stack peak full

This proof shows: correctness, termination.

Setting. A∈Rn×nA \in \mathbb{R}^{n \times n} is symmetric positive definite, already permuted, and A=LLTA = L L^T. In exact arithmetic, write Sj={i>j:lij≠0}\mathcal{S}_j = \{i > j : l_{ij} \ne 0\} for the structure of column jj; the implementation computes the symbolic structure, which can only be larger, and the argument below holds for it word for word. The elimination tree has parent(j)=min⁡Sj\mathrm{parent}(j) = \min \mathcal{S}_j, or none when Sj=∅\mathcal{S}_j = \emptyset. T[j]T[j] is the subtree rooted at jj, Ij={j}∪SjI_j = \{j\} \cup \mathcal{S}_j, and line numbers refer to the pseudocode of the page.

Lemma 1 (structure inheritance). If j<p<ij < p < i and lpj≠0l_{pj} \ne 0, lij≠0l_{ij} \ne 0, then lip≠0l_{ip} \ne 0 (symbolically). Consequently Sj∖{p}⊆Sp\mathcal{S}_j \setminus \{p\} \subseteq \mathcal{S}_p for p=parent(j)p = \mathrm{parent}(j), and if ljk≠0l_{jk} \ne 0 with k<jk < j, then jj is an ancestor of kk.

Proof. In the elimination graph model (fill-in), when jj is eliminated its later neighbours pp and ii are joined, so lip≠0l_{ip} \ne 0 when pp is eliminated. Applying this with p=min⁡Sjp = \min \mathcal{S}_j gives the inclusion. For the last claim, follow parents from kk: each step goes to the smallest element of the current structure, and by the inclusion, jj stays in the structure until it is reached, since the parents increase and stay at most jj. □\square

Lemma 2 (symbolic recurrence). Sj=({i>j:aij≠0}∪⋃c child of jSc)∖{j}\mathcal{S}_j = \big(\{i > j : a_{ij} \ne 0\} \cup \bigcup_{c \text{ child of } j} \mathcal{S}_c\big) \setminus \{j\}.

Proof. "⊇\supseteq": aij≠0a_{ij} \ne 0 gives lij≠0l_{ij} \ne 0 symbolically, and Lemma 1 gives Sc∖{j}⊆Sj\mathcal{S}_c \setminus \{j\} \subseteq \mathcal{S}_j. "⊆\subseteq": a later neighbour ii of jj at its elimination is either an original neighbour, or was joined to jj when some k<jk < j with i,j∈Ski, j \in \mathcal{S}_k was eliminated. By Lemma 1, kk is a descendant of jj. Let cc be the child of jj on the path. Repeated use of Lemma 1 along the path from kk to cc keeps ii, which exceeds every vertex of the path, in the structures, so i∈Sci \in \mathcal{S}_c. □\square

column_structures applies this recurrence in increasing jj; children have smaller indices, so their structures are complete when used. elimination_tree is Liu's algorithm, and the tests check parent(j)=min⁡Sj\mathrm{parent}(j) = \min \mathcal{S}_j against an exact factorization.

Lemma 3 (the stack discipline). In a postorder, processing the subtree T[c]T[c] of a non-root cc leaves the stack as it was plus one item, the update matrix UcU_c on top. Hence, when jj is processed, the top ∣children(j)∣|\mathrm{children}(j)| items are exactly the update matrices of its children.

Proof. Induction on the height of cc. Its children's subtrees each add one item by induction. Lines L6 and L7 pop exactly these items, and line L10 pushes UcU_c, which is nonempty because parent(c)∈Sc\mathrm{parent}(c) \in \mathcal{S}_c. Roots push nothing. □\square

Theorem 1 (correctness). For every jj, the update matrix is

Uj=−∑k∈T[j]ℓkℓkT∣Sj×Sj,ℓk=L(Sj,k),U_j = -\sum_{k \in T[j]} \ell_k \ell_k^T \Big|_{\mathcal{S}_j \times \mathcal{S}_j}, \qquad \ell_k = L(\mathcal{S}_j, k),

and line L8 computes column jj of LL exactly.

Proof. Induction along the postorder. Lines L4 to L7 build

Fj=(ajjaSj,jTaSj,j0)⊕⨁cUc,F_j = \begin{pmatrix} a_{jj} & a_{\mathcal{S}_j, j}^T \\ a_{\mathcal{S}_j, j} & 0 \end{pmatrix} \oplus \bigoplus_{c} U_c,

where ⊕\oplus is extend-add: entries are added at matching global indices. This is well defined because Sc⊆Ij\mathcal{S}_c \subseteq I_j by Lemma 1. By the induction hypothesis, the first column of FjF_j is aij−∑k∈T[j]∖{j}likljka_{ij} - \sum_{k \in T[j] \setminus \{j\}} l_{ik} l_{jk} for i∈Iji \in I_j. Cholesky requires lijljj=aij−∑k<jlikljkl_{ij} l_{jj} = a_{ij} - \sum_{k < j} l_{ik} l_{jk}, and by Lemma 1 the nonzero terms have ljk≠0l_{jk} \ne 0, hence k∈T[j]k \in T[j]. So the two sums agree, and ljj=F11l_{jj} = \sqrt{F_{11}} and lij=Fi1/ljjl_{ij} = F_{i1}/l_{jj} are correct. Line L9 subtracts ℓjℓjT\ell_j \ell_j^T from the trailing block, which gives the formula for UjU_j. The children's contributions restricted to Sj\mathcal{S}_j cover every k∈T[j]k \in T[j], because for each such kk the rows of L(:,k)L(:, k) beyond jj lie in Sj\mathcal{S}_j by Lemma 1 applied along the path. □\square

The LDLTLDL^T mode is the same argument with F11=djF_{11} = d_j, lij=Fi1/djl_{ij} = F_{i1}/d_j and update F22−F⋅1F⋅1T/djF_{22} - F_{\cdot 1} F_{\cdot 1}^T/d_j. In rational arithmetic it agrees exactly with the dense LDLTLDL^T, which the tests check.

Termination. The loop at line L3 visits each of the nn columns once, and every inner loop is over finite index sets.

Lemma 4 (stack storage; Liu). Let ucu_c be the storage of UcU_c, let fjf_j be the storage of the front FjF_j, and let the children c1,…,ctc_1, \ldots, c_t of jj be visited in this order. Then the peak storage over the processing of T[j]T[j] is

peak(j)=max⁡(max⁡1≤s≤t(∑r<sucr+peak(cs)), ∑r≤tucr+fj).\mathrm{peak}(j) = \max\Big(\max_{1 \le s \le t}\big(\textstyle\sum_{r < s} u_{c_r} + \mathrm{peak}(c_s)\big),\ \textstyle\sum_{r \le t} u_{c_r} + f_j\Big).

Ordering the children by decreasing peak(c)−uc\mathrm{peak}(c) - u_c minimizes peak(j)\mathrm{peak}(j) over all orders.

Proof. The recurrence follows from Lemma 3. During T[cs]T[c_s], the updates of c1,…,cs−1c_1, \ldots, c_{s-1} wait on the stack. At jj, all children's updates and the front coexist; the code allocates the front before popping. For optimality, compare two adjacent children xx before yy with prefix SS. The terms are max⁡(S+px, S+ux+py)\max(S + p_x,\ S + u_x + p_y) against max⁡(S+py, S+uy+px)\max(S + p_y,\ S + u_y + p_x) for the swapped order. If px−ux≥py−uyp_x - u_x \ge p_y - u_y, then S+ux+py≤S+uy+pxS + u_x + p_y \le S + u_y + p_x and S+px≤S+uy+pxS + p_x \le S + u_y + p_x, so xx first is no worse, and no other term changes. Bubble-sorting any order into the decreasing order therefore never increases the peak. Since peak(j)\mathrm{peak}(j) is nondecreasing in each peak(c)\mathrm{peak}(c), choosing the best order bottom up gives the least peak over all postorders. □\square

The tests check the recurrence against the measured peak and the optimality against brute force over all child orders on small trees.

Floating point. Each computed entry of LL is aija_{ij} minus the products l^ikl^jk\hat l_{ik}\hat l_{jk}, summed in an order fixed by the tree and the extend-adds, and then divided by l^jj\hat l_{jj}. The standard analysis of Cholesky (Higham, Chapter 10) bounds every summation order by the same γ\gamma, so if the factorization runs to completion, A+ΔA=L^L^TA + \Delta A = \hat L \hat L^T with ∣ΔA∣≤γn+1∣L^∣∣L^T∣|\Delta A| \le \gamma_{n+1} |\hat L||\hat L^T|. The tests check this elementwise with exact rational residuals.

Back to Multifrontal method