🔁Linear Systems: Iterative Methods
Jacobi and Gauss–Seidel
Splitting A = M − N, the Jacobi and Gauss–Seidel iterations, spectral radius and diagonal dominance
Göttingen, 26 December 1823
Carl Friedrich Gauss is directing the geodetic survey of the Kingdom of Hanover — years of triangulation, every angle measured repeatedly, every measurement slightly wrong. Fitting the network by least squares produces linear systems far too large to eliminate comfortably by hand.
On the day after Christmas he writes to his former student Christian Ludwig Gerling, who is facing the same problem in his own survey. Gauss describes his method. Do not eliminate. Start from a guess. Find the equation that is most violated, correct the one unknown that fixes it, and repeat.
He recommends it warmly. It almost never goes wrong, he says, and it can be carried out half asleep, or while thinking about other things.
Gauss never published it. Jacobi described a similar scheme in 1845 and Philipp Ludwig von Seidel another in 1874. A century later, the descendants of Gauss's 'indirect method' solve the largest systems in engineering — the ones no factorisation can touch.
The idea: rewrite so that each equation gives one unknown in terms of the others. Equation reads , so
If we knew the other we would know . We do not — so use the current guess for them, compute a new , and repeat. Each sweep through the equations costs one pass over the nonzeros of : for a sparse matrix, and no fill-in, ever.
💡Jacobi and Gauss–Seidel
Jacobi: compute every new from the old values only. All updates are independent — ideal for parallel hardware.
Gauss–Seidel: sweep through and use each new value the moment it is computed:
It needs only one copy of and usually converges faster — but each update depends on the previous one, so it is inherently sequential.
Splitting. Both methods write with easy to solve with, and iterate
Write (diagonal, strictly lower, strictly upper). Jacobi takes ; Gauss–Seidel takes . Subtract the exact equation and the error obeys
ρ(T), the spectral radius, is the largest |eigenvalue| of the iteration matrix. Asymptotically the error shrinks by a factor ρ per sweep — lesson 2-3's fixed-point iteration, now in n dimensions.
Derivation
Why the largest eigenvalue decides
What we need about eigenvalues (Unit 6 shows how to compute them). A nonzero vector with is an eigenvector: only stretches it, by the eigenvalue . Applying times stretches it by . For the matrices of this unit, independent eigenvectors exist, so any vector can be written as a combination of them.
The error after sweeps. Write the starting error as . Each sweep multiplies by , so
Every term goes to zero exactly when its . If even one , a starting error along never dies — so convergence for every start needs all of them below 1: . After many sweeps the term with the largest is the last one left, and each further sweep multiplies the error by about . One more correct digit then costs sweeps.
💡When are they guaranteed to converge?
- If is strictly diagonally dominant — in every row — both Jacobi and Gauss–Seidel converge.
- If is symmetric positive definite, Gauss–Seidel converges.
- For the matrices of the Laplace and heat equations (weakly dominant, irreducible), both converge, and for the standard five-point grid : Gauss–Seidel needs exactly half the sweeps of Jacobi.
Derivation
Diagonal dominance makes Jacobi a contraction
Jacobi's iteration matrix is : row holds off the diagonal and 0 on it. Its -norm is the largest absolute row sum (lesson 3-2):
and the inequality is exactly strict diagonal dominance. Then every sweep shrinks the largest error component:
so the error falls at least geometrically — the contraction mapping argument of lesson 2-3, in dimensions. No eigenvalues are needed. (For Gauss–Seidel the proof is a little longer but the conclusion is the same.)
📐Temperature in a plate
A square plate, top edge held at 100 °C and the other three at 0 °C. The steady temperature satisfies Laplace's equation; with the five-point stencil each interior temperature is the average of its four neighbours — and a Gauss–Seidel sweep just replaces each value by that average. By symmetry the exact centre temperature is 25 °C.
Stopping when no value changes by more than , Gauss–Seidel needs 151 sweeps on a grid, 554 on and 2005 on . Halve the spacing and the work per sweep goes up 4×, and the number of sweeps goes up nearly 4×. For the model problem , so : each sweep removes less of the error the finer the grid.
Derivation
The eigenvalues of the second-difference matrix, and
Take the 1-D matrix with unknowns at , , and guess that its eigenvectors are sampled sine waves, for . Row of is
The identity , with and , turns the two outer terms into :
The boundary rows work too, because the sine vanishes at and . So the eigenvalues are , from about up to almost 4.
Jacobi. The diagonal is 2, so , whose eigenvalues are . The largest in magnitude is (for , and for ). On the 2-D five-point grid the eigenvectors are products of sines, the eigenvalues add, the diagonal is 4, and the same calculation gives .
The cost. By Taylor, , and , so a digit costs about sweeps — proportional to . Halving quadruples the sweeps. That the slowest mode is the smoothest one, , is the key to multigrid in lesson 4-4. (David Young proved that for this whole class of matrices; we use his result without proof.)
the unique end of science is the honor of the human mind
🕰Relaxation by hand
In 1910 Lewis Fry Richardson computed the stresses in a masonry dam by iterating finite-difference equations on a grid — the first serious engineering use of the idea. In the 1930s and 1940s Richard Southwell's 'relaxation method' turned it into a craft: human computers scanned a grid for the largest residual and 'relaxed' it by hand, guided by experience. Gauss's 'half asleep' was optimistic, but the method needed no matrices at all — only the stencil.
💡Where you will use this
CFD and Hydraulics: Gauss–Seidel sweeps are the 'smoothers' inside every multigrid pressure solver. Geotechnical Engineering: seepage and consolidation on large grids. Power Systems: the earliest load-flow programs (before Newton) used Gauss–Seidel iteration on the bus voltages. Heat transfer: the five-point stencil and its 3-D seven-point cousin are the first thing to try for steady conduction.
📚Further reading
- Yousef Saad, Iterative Methods for Sparse Linear Systems (2nd ed., SIAM, 2003), chapter 4, 'Basic Iterative Methods' — Jacobi, Gauss–Seidel and SOR as splittings, with convergence proofs.
- Randall LeVeque, Finite Difference Methods for Ordinary and Partial Differential Equations (SIAM, 2007), chapter 4, 'Iterative Methods for Sparse Linear Systems' — the model Poisson problem and its spectral radii, worked out as here.
- Richard Varga, Matrix Iterative Analysis (Prentice-Hall, 1962; 2nd ed., Springer, 2000) — the classical theory, including diagonal dominance and irreducibility.
↓But there is a problem
Gauss–Seidel works, needs almost no memory and never fills in. But on a fine grid it crawls: for a grid it needs about 24,000 sweeps for each additional decimal digit.
In 1950 a Harvard doctoral student, David Young, asked a simple question. Gauss–Seidel corrects each value by exactly the amount its equation demands. What happens if you correct it by more than that — deliberately overshoot?
The answer turned 24,000 sweeps into about 120.