Level 0: Foundation
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.Mostly empty tables
Imagine a table showing which of a million people are direct neighbours. Each person has only a handful of neighbours, so almost every square in the table is “no”. Writing out the whole table would waste enormous space. Just listing the neighbours is tiny. Big engineering problems produce exactly such sparse matrices. Instead of solving them in one heroic elimination, we improve a guess again and again until it’s good enough.
A thermal or structural model with a million nodes gives a million-by-million matrix: 8 terabytes if stored densely, about 40 MB if sparse. SLAM back-ends (g2o, GTSAM, Ceres) and CFD codes are fast only because they exploit sparsity. Iterative solvers with good preconditioners are how the largest simulations on Earth, and onboard estimators, actually get solved.
- 1. A sparse matrix is one where…
- 2. Storing only nonzeros saves…
- 3. Iterative solvers…
Level 1: Beginner
★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.Storage formats
- COO: a list of (row, col, value) triplets. Easy to build.
- CSR (compressed sparse row):
dataandindices(the nonzeros and their columns, row by row), plusindptr(where each row starts). The matrix-vector product costs . - Matrix-free: never store the matrix at all; just code (e.g. a stencil).
Why not Gaussian elimination?
Dense LU costs flops and storage. For a 2-D grid with that’s about flops. Sparse direct solvers (with nested-dissection ordering) do much better but suffer fill-in. Iterative methods need only matrix-vector products.
Classical iterations
Split :
- Jacobi: .
- Gauss–Seidel: .
- SOR: over-relax Gauss–Seidel by .
- 1. CSR matrix-vector cost is proportional to…
- 2. Dense LU on N unknowns costs about…
- 3. Gauss–Seidel differs from Jacobi by…
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 40 minUndergraduate students and practising engineers.Conjugate gradients
For symmetric positive definite , CG minimizes the -norm error over the growing Krylov space . It needs one matvec and a few vector operations per iteration:
Convergence and conditioning
For Poisson on an grid, . So CG needs iterations, while Jacobi and Gauss–Seidel need .
Preconditioning
Solve with cheap to invert. Options:
- Jacobi: .
- Incomplete Cholesky or LU.
- Multigrid: near total work.
For nonsymmetric systems, use GMRES or BiCGSTAB.
- 1. CG requires A to be…
- 2. CG iterations scale like…
- 3. A preconditioner M should be…
Level 3: Advanced
★★★★☆ Advanced⏱ 40 minGraduate level, with full derivations and proofs.Why CG is optimal in the Krylov space
The residuals are mutually orthogonal and the directions -conjugate (). So minimizes over . Equivalently, for the best polynomial with . Bounding with a shifted Chebyshev polynomial on gives the rate. ∎ In exact arithmetic CG terminates in at most steps.
Convergence of Jacobi
The error satisfies . It converges iff the spectral radius . For 1-D Poisson, , so it needs iterations.
Condition number of 1-D Poisson
The eigenvalues of are . So .
Exercise 3.1: CG iteration bound for κ = 10⁴, tolerance 10⁻⁶
. Jacobi would need about κ·14.5 ≈ 145 000 iterations.
- 1. CG directions are mutually…
- 2. Jacobi converges iff…
- 3. κ of 1-D Poisson grows like…
Level 4: Expert
★★★★★ Expert⏱ 35 minResearchers: original papers and open problems.Matrix-free PCG for a heterogeneous plate
A radiator plate with copper heat straps (conductivity 1000× the aluminium) gives a 5-point operator whose coefficients jump by three orders of magnitude. Plain CG slows from about 150 iterations (uniform plate) to about 1700. Diagonal (Jacobi) preconditioning rescales each row by its own conductivity and brings it back to about 190. The operator is applied matrix-free as a stencil on the grid. The dense matrix would need 42 MB for this modest 48 × 48 grid. The same pattern (stencil plus Krylov plus preconditioner) runs large thermal, CFD and SLAM back-ends.
Sparse linear algebra in AI, robotics and aerospace
- SLAM and bundle adjustment: sparse normal equations solved by sparse Cholesky with good orderings (g2o, GTSAM, Ceres), plus Schur complements for landmarks.
- Large-scale simulation: PETSc and hypre (CG, GMRES and algebraic multigrid) run on supercomputers for CFD and structural analysis.
- Graph learning: graph Laplacians are sparse; spectral GNNs and PageRank-type computations use sparse matvecs.
- Optimization: interior-point and SQP solvers (IPOPT, OSQP) factor sparse KKT systems at every iteration.
References
- Y. Saad (2003). Iterative Methods for Sparse Linear Systems, 2nd ed. SIAM.
- J. Shewchuk (1994). “An introduction to the conjugate gradient method without the agonizing pain.” CMU-CS-94-125.
- M. Hestenes, E. Stiefel (1952). “Methods of conjugate gradients for solving linear systems.” J. Res. Nat. Bur. Standards, 49(6).
- T. Davis (2006). Direct Methods for Sparse Linear Systems. SIAM.
- W. Briggs, V. Henson, S. McCormick (2000). A Multigrid Tutorial, 2nd ed. SIAM.
- F. Dellaert, M. Kaess (2017). “Factor graphs for robot perception.” Foundations and Trends in Robotics, 6(1–2).
- S. Balay et al. PETSc Users Manual. Argonne National Laboratory.
- L. N. Trefethen, D. Bau (1997). Numerical Linear Algebra. SIAM. Lectures 38–40.