Algorithm Search⌘K

Proofs: Gauss-Seidel method

These are the human proofs of Gauss-Seidel method, at full length.

The number of Gauss-Seidel sweeps for a diagonally dominant matrix full

This proof shows: sweeps.worst, time.worst.

Exact arithmetic, strictly row diagonally dominant AA, q=∥GJ∥∞<1q = \|G_J\|_\infty < 1 and 0<ε<10 < \varepsilon < 1.

Claim. After k∗=⌈ln⁡(1/ε)/ln⁡(1/q)⌉k^\ast = \lceil \ln(1/\varepsilon) / \ln(1/q) \rceil sweeps, ∥ek∗∥∞≤ε∥e0∥∞\|e_{k^\ast}\|_\infty \le \varepsilon \|e_0\|_\infty. (If q=0q = 0, AA is diagonal and one sweep gives e1=0e_1 = 0.)

Proof. Theorem 4 of the correctness proof gives ∥ek∥∞≤ηk∥e0∥∞≤qk∥e0∥∞\|e_k\|_\infty \le \eta^k \|e_0\|_\infty \le q^k \|e_0\|_\infty, and qk∗≤εq^{k^\ast} \le \varepsilon as in the Jacobi count. □\square

Cost. A sweep (lines L5 to L7) does, for row ii with ziz_i nonzeros, zi−1z_i - 1 multiplications, at most zi−2z_i - 2 additions, one subtraction and one division: 2zi2 z_i flops, 2z2z in total. Line L2 does 2z2z more and line L3 does nn comparisons. So each pass of the outer loop costs O(z)O(z) (as z≥nz \ge n), and k∗k^\ast of them cost O(zln⁡(1/ε)/ln⁡(1/q))O(z \ln(1/\varepsilon) / \ln(1/q)). The only extra storage is the residual rr, Θ(n)\Theta(n). □\square

■\blacksquare

Convergence of the Gauss-Seidel method full

This proof shows: correctness, termination.

Notation of the page: A=D+L+UA = D + L + U with aii≠0a_{ii} \ne 0, M=D+LM = D + L, G=GGS=−M−1UG = G_{GS} = -M^{-1} U, c=M−1bc = M^{-1} b. One execution of lines L5 to L7 maps xkx_k to xk+1x_{k+1} with

xk+1,i=1aii(bi−∑j<iaijxk+1,j−∑j>iaijxk,j),i=1,…,n,x_{k+1, i} = \frac{1}{a_{ii}} \Bigl( b_i - \sum_{j < i} a_{ij} x_{k+1, j} - \sum_{j > i} a_{ij} x_{k, j} \Bigr), \qquad i = 1, \ldots, n,

because when row ii is processed, the entries j<ij < i already hold the new values and the entries j>ij > i still hold the old ones. Multiplying by aiia_{ii} and collecting terms: (D+L)xk+1=b−Uxk(D + L) x_{k+1} = b - U x_k, that is xk+1=Gxk+cx_{k+1} = G x_k + c.

Theorem 1 (fixed point and error recursion). Ax=bA x = b if and only if x=Gx+cx = G x + c. If Ax=bA x = b, then ek+1=Geke_{k+1} = G e_k, and xk→xx_k \to x for every x0x_0 if and only if ρ(G)<1\rho(G) < 1.

Proof. x=Gx+c  ⟺  (D+L)x=b−Ux  ⟺  Ax=bx = G x + c \iff (D + L) x = b - U x \iff A x = b. Subtracting, ek+1=Geke_{k+1} = G e_k. The last claim is the general criterion for ek=Gke0e_k = G^k e_0, proved as Theorem 2 of the Jacobi correctness proof. □\square

Theorem 2 (one coordinate update, symmetric positive definite AA). Let AA be symmetric positive definite, Ax=bA x = b, and let y′y' differ from yy only in entry ii, with yi′=(bi−∑j≠iaijyj)/aiiy'_i = (b_i - \sum_{j \ne i} a_{ij} y_j)/a_{ii}. Let ρi=(b−Ay)i\rho_i = (b - A y)_i. Then ∥x−y′∥A2=∥x−y∥A2−ρi2/aii\|x - y'\|_A^2 = \|x - y\|_A^2 - \rho_i^2 / a_{ii}.

Proof. yi′−yi=(bi−∑jaijyj)/aii=ρi/aiiy'_i - y_i = (b_i - \sum_j a_{ij} y_j)/a_{ii} = \rho_i / a_{ii}, so y′=y+teiy' = y + t e_i with t=ρi/aiit = \rho_i / a_{ii} (eie_i the unit vector). With d=x−yd = x - y, ∥d−tei∥A2=∥d∥A2−2teiTAd+t2aii\|d - t e_i\|_A^2 = \|d\|_A^2 - 2 t e_i^T A d + t^2 a_{ii} by symmetry. Since Ad=b−AyA d = b - A y, eiTAd=ρie_i^T A d = \rho_i, and the right side is ∥d∥A2−2ρi2/aii+ρi2/aii\|d\|_A^2 - 2 \rho_i^2 / a_{ii} + \rho_i^2 / a_{ii}. □\square

Theorem 3 (convergence for symmetric positive definite AA). If AA is symmetric positive definite, then ∥Gv∥A<∥v∥A\|G v\|_A < \|v\|_A for every real v≠0v \ne 0, hence ∥G∥A<1\|G\|_A < 1 and ρ(G)<1\rho(G) < 1. So Gauss-Seidel converges for every x0x_0, and ∥ek∥A\|e_k\|_A decreases monotonically.

Proof. Apply one sweep to the system Ay=0A y = 0 (solution 00) from y=vy = v. By the formula above the sweep produces GvG v, and by Theorem 2 each of the nn coordinate updates does not increase ∥y∥A\|y\|_A. If ∥Gv∥A=∥v∥A\|G v\|_A = \|v\|_A, then every update had ρi=0\rho_i = 0, so no update changed yy, and at the moment row ii was processed y=vy = v and (Av)i=−ρi=0(A v)_i = -\rho_i = 0. So Av=0A v = 0 and v=0v = 0. Thus ∥Gv∥A<∥v∥A\|G v\|_A < \|v\|_A for v≠0v \ne 0. The function v↦∥Gv∥Av \mapsto \|G v\|_A is continuous on the compact set {∥v∥A=1}\{\|v\|_A = 1\}, so its maximum ∥G∥A\|G\|_A is attained and is below 1. For any norm, ρ(G)=lim⁡k∥Gk∥1/k≤∥G∥\rho(G) = \lim_k \|G^k\|^{1/k} \le \|G\| (Gelfand's formula, valid for the operator norm of a real matrix on Rn\mathbb{R}^n since all norms on the finite-dimensional space of matrices are equivalent). So ρ(G)≤∥G∥A<1\rho(G) \le \|G\|_A < 1. Monotonicity is ∥ek+1∥A=∥Gek∥A<∥ek∥A\|e_{k+1}\|_A = \|G e_k\|_A < \|e_k\|_A for ek≠0e_k \ne 0. □\square

Theorem 4 (strict row diagonal dominance). Let αi=∑j<i∣aij∣/∣aii∣\alpha_i = \sum_{j < i} |a_{ij}| / |a_{ii}|, βi=∑j>i∣aij∣/∣aii∣\beta_i = \sum_{j > i} |a_{ij}| / |a_{ii}|, and suppose αi+βi<1\alpha_i + \beta_i < 1 for all ii. Let η=max⁡iβi/(1−αi)\eta = \max_i \beta_i / (1 - \alpha_i) and q=max⁡i(αi+βi)q = \max_i (\alpha_i + \beta_i). Then η≤q<1\eta \le q < 1 and ∥ek+1∥∞≤η∥ek∥∞\|e_{k+1}\|_\infty \le \eta \|e_k\|_\infty.

Proof. βi≤(αi+βi)(1−αi)\beta_i \le (\alpha_i + \beta_i)(1 - \alpha_i) is equivalent to 0≤αi(1−αi−βi)0 \le \alpha_i (1 - \alpha_i - \beta_i), which holds; so βi/(1−αi)≤αi+βi≤q\beta_i / (1 - \alpha_i) \le \alpha_i + \beta_i \le q. From (D+L)ek+1=−Uek(D + L) e_{k+1} = -U e_k, ek+1,i=−(∑j<iaijek+1,j+∑j>iaijek,j)/aiie_{k+1, i} = -\bigl(\sum_{j < i} a_{ij} e_{k+1, j} + \sum_{j > i} a_{ij} e_{k, j}\bigr)/a_{ii}. We show ∣ek+1,i∣≤η∥ek∥∞|e_{k+1, i}| \le \eta \|e_k\|_\infty by induction on ii. If it holds for all j<ij < i, then ∣ek+1,i∣≤αiη∥ek∥∞+βi∥ek∥∞|e_{k+1, i}| \le \alpha_i \eta \|e_k\|_\infty + \beta_i \|e_k\|_\infty, and αiη+βi≤η\alpha_i \eta + \beta_i \le \eta because βi≤η(1−αi)\beta_i \le \eta (1 - \alpha_i). The case i=1i = 1 has α1=0\alpha_1 = 0. □\square

Theorem 5 (one sweep in floating point). In the floating point model with (n+1)u<1(n + 1) u < 1, the computed sweep satisfies (D+L+ΔL)x^k+1+(U+ΔU)x^k=b+Δb(D + L + \Delta L) \hat x_{k+1} + (U + \Delta U) \hat x_k = b + \Delta b with ∣ΔL∣≤γn+1∣L∣|\Delta L| \le \gamma_{n+1} |L|, ∣ΔU∣≤γn+1∣U∣|\Delta U| \le \gamma_{n+1} |U| and ∣Δb∣≤γn+1∣b∣|\Delta b| \le \gamma_{n+1} |b|, for any order of summation in line L6.

Proof. In line L6 each term aijxja_{ij} x_j is formed with one rounding and then takes part in at most n−2n - 2 additions; line L7 adds a subtraction and a division. So x^k+1,i=(bi(1+η0)−∑j≠iaijxj(1+ηj))/aii\hat x_{k+1, i} = \bigl(b_i (1 + \eta_0) - \sum_{j \ne i} a_{ij} x_j (1 + \eta_j)\bigr)/a_{ii} with each 1+ηj1 + \eta_j a product of at most n+1n + 1 factors (1+δ)±1(1 + \delta)^{\pm 1}, so ∣ηj∣≤γn+1|\eta_j| \le \gamma_{n+1} (Higham, Lemma 3.1). Multiply by aiia_{ii} and set (ΔL)ij=aijηj(\Delta L)_{ij} = a_{ij} \eta_j for j<ij < i, (ΔU)ij=aijηj(\Delta U)_{ij} = a_{ij} \eta_j for j>ij > i, (Δb)i=biη0(\Delta b)_i = b_i \eta_0. □\square

Theorem 6 (termination and output). The pseudocode stops after at most kmax⁡k_{\max} sweeps. If it returns CONVERGED, the residual computed in line L2 for the returned xx satisfies ∥r∥∞≤tol⋅∥b∥∞\|r\|_\infty \le \text{tol} \cdot \|b\|_\infty.

Proof. The outer loop has kmax⁡+1k_{\max} + 1 iterations and line L4 returns in the last one. Only line L3 returns CONVERGED, after testing that inequality for the current xx, which no line changes before the return. □\square

■\blacksquare

Back to Gauss-Seidel method