No jobs
Core 11 min 2 of 3

Factor graphs and sparsity

Draw the graph and you have drawn the matrix. Eliminate a variable and you can see what it costs.

What this repairs

Treating the factor graph as a diagram for papers, rather than as a literal picture of the linear algebra.

A factor graph is bipartite: variable nodes (poses, landmarks, calibration parameters, biases) and factor nodes (measurements, priors), with an edge wherever a factor depends on a variable. The posterior is the product of the factors, and the negative log posterior is the sum of squared residuals from the previous topic.

The correspondence to the linear algebra is exact:

Graph Information matrix
variable diagonal block
factor between ii and jj off-diagonal block (i,j)(i, j)
no shared factor structural zero
eliminating a variable Schur complement on its neighbours

The Schur complement, and why bundle adjustment uses it

  1. [HppHplHplHll](ΔpΔl)=(bpbl)\begin{bmatrix} H_{pp} & H_{pl} \\ H_{pl}^\top & H_{ll} \end{bmatrix} \begin{pmatrix} \Delta_p \\ \Delta_l \end{pmatrix} = -\begin{pmatrix} b_p \\ b_l \end{pmatrix}

    Order the variables poses-first, landmarks-second. H_ll is block-diagonal: no factor connects two landmarks directly.

  2. Δl=Hll1(bl+HplΔp)\Delta_l = -H_{ll}^{-1}\left(b_l + H_{pl}^\top \Delta_p\right)

    Solve the lower block for the landmarks. Inverting H_ll is cheap precisely because it is block-diagonal — one small inverse per landmark.

  3. (HppHplHll1Hpl)Δp=bp+HplHll1bl\left(H_{pp} - H_{pl}H_{ll}^{-1}H_{pl}^\top\right)\Delta_p = -b_p + H_{pl}H_{ll}^{-1}b_l

    Substitute back. The reduced camera system involves only the poses, of which there are far fewer than landmarks.

  4. fill-in: (i,j)0    poses i,j saw a common landmark\text{fill-in: } (i,j) \ne 0 \iff \text{poses } i, j \text{ saw a common landmark}

    The price. The reduced matrix is denser than the original: eliminating a landmark connects every pose that observed it. Ordering the elimination to minimise this is what a good sparse solver spends its time on.

Check yourself

Why do incremental smoothers re-order variables rather than just appending new ones?

Show answer

Because fill-in depends on elimination order, and the best order changes as the graph grows. Appending naively produces a factorisation with steadily worse sparsity, so the cost per update creeps up until it dominates. Incremental systems (iSAM2 and relatives) re-eliminate only the affected subtree and periodically re-order, keeping the factorisation close to what a batch solve with a good ordering would have produced — which is what makes the update cost track the size of the change rather than the size of the map.

Euler View - ML Experiment Monitor