Successive over-relaxation

In numerical linear algebra, the method of successive over-relaxation (SOR) is a variant of the Gauss–Seidel method for solving a linear system of equations, resulting in faster convergence. A similar method can be used for any slowly converging iterative process.

It was devised simultaneously by David M. Young Jr. and by Stanley P. Frankel in 1950 for the purpose of automatically solving linear systems on digital computers. Over-relaxation methods had been used before the work of Young and Frankel. An example is the method of Lewis Fry Richardson, and the methods developed by R. V. Southwell. However, these methods were designed for computation by human calculators, requiring some expertise to ensure convergence to the solution which made them inapplicable for programming on digital computers. These aspects are discussed in the thesis of David M. Young Jr.

Formulation
Given a square system of n linear equations with unknown x:


 * $$A\mathbf x = \mathbf b$$

where:


 * $$A=\begin{bmatrix} a_{11} & a_{12} & \cdots & a_{1n} \\ a_{21} & a_{22} & \cdots & a_{2n} \\ \vdots & \vdots & \ddots & \vdots \\a_{n1} & a_{n2} & \cdots & a_{nn} \end{bmatrix}, \qquad \mathbf{x} = \begin{bmatrix} x_{1} \\ x_2 \\ \vdots \\ x_n \end{bmatrix}, \qquad  \mathbf{b} = \begin{bmatrix} b_{1} \\ b_2 \\ \vdots \\ b_n \end{bmatrix}.$$

Then A can be decomposed into a diagonal component D, and strictly lower and upper triangular components L and U:


 * $$A=D+L+U, $$

where
 * $$D = \begin{bmatrix} a_{11} & 0 & \cdots & 0 \\ 0 & a_{22} & \cdots & 0 \\ \vdots & \vdots & \ddots & \vdots \\0 & 0 & \cdots & a_{nn} \end{bmatrix}, \quad L = \begin{bmatrix} 0 & 0 & \cdots & 0 \\ a_{21} & 0 & \cdots & 0 \\ \vdots & \vdots & \ddots & \vdots \\a_{n1} & a_{n2} & \cdots & 0 \end{bmatrix}, \quad U = \begin{bmatrix} 0 & a_{12} & \cdots & a_{1n} \\ 0 & 0 & \cdots & a_{2n} \\ \vdots & \vdots & \ddots & \vdots \\0 & 0 & \cdots & 0 \end{bmatrix}. $$

The system of linear equations may be rewritten as:


 * $$(D+\omega L) \mathbf{x} = \omega \mathbf{b} - [\omega U + (\omega-1) D ] \mathbf{x} $$

for a constant &omega; > 1, called the relaxation factor.

The method of successive over-relaxation is an iterative technique that solves the left hand side of this expression for x, using the previous value for x on the right hand side. Analytically, this may be written as:


 * $$ \mathbf{x}^{(k+1)} = (D+\omega L)^{-1} \big(\omega \mathbf{b} - [\omega U + (\omega-1) D ] \mathbf{x}^{(k)}\big)=L_{\omega} \mathbf{x}^{(k)}+\mathbf{c}, $$

where $$\mathbf{x}^{(k)}$$ is the kth approximation or iteration of $$\mathbf{x}$$ and $$\mathbf{x}^{(k+1)}$$ is the next or k + 1 iteration of $$\mathbf{x}$$. However, by taking advantage of the triangular form of (D+&omega;L), the elements of x(k+1) can be computed sequentially using forward substitution:


 * $$ x^{(k+1)}_i = (1-\omega)x^{(k)}_i + \frac{\omega}{a_{ii}} \left(b_i - \sum_{ji} a_{ij}x^{(k)}_j \right),\quad i=1,2,\ldots,n. $$

This can again be written analytically in matrix-vector form without the need of inverting the matrix $$(D+\omega L)$$:


 * $$ \mathbf{x}^{(k+1)} = (1-\omega)\mathbf{x}^{(k)} + \omega D^{-1} \big( \mathbf{b} - L \mathbf{x}^{(k+1)} - U \mathbf{x}^{(k)} \big). $$

Convergence


The choice of relaxation factor &omega; is not necessarily easy, and depends upon the properties of the coefficient matrix. In 1947, Ostrowski proved that if $$A$$ is symmetric and positive-definite then $$\rho(L_\omega)<1$$ for $$0<\omega<2 $$. Thus, convergence of the iteration process follows, but we are generally interested in faster convergence rather than just convergence.

Convergence Rate
The convergence rate for the SOR method can be analytically derived. One needs to assume the following Then the convergence rate can be expressed as
 * the relaxation parameter is appropriate: $$ \omega \in (0,2) $$
 * Jacobi's iteration matrix $$ C_\text{Jac}:= I-D^{-1}A $$ has only real eigenvalues
 * Jacobi's method is convergent: $$ \mu := \rho(C_\text{Jac}) < 1 $$
 * the matrix decomposition $$ A=D+L+U $$ satisfies the property that $$ \operatorname{det}(\lambda D + zL + \tfrac{1}{z}U) = \operatorname{det}(\lambda D + L + U) $$ for any $$z\in\mathbb{C}\setminus\{0\}$$ and $$\lambda\in\mathbb{C}$$.

\rho(C_\omega) = \begin{cases} \frac{1}{4} \left( \omega \mu + \sqrt{\omega^2 \mu^2-4(\omega-1)} \right)^2\,, & 0 < \omega \leq \omega_\text{opt} \\ \omega -1\,, & \omega_\text{opt} < \omega < 2 \end{cases} $$ where the optimal relaxation parameter is given by

\omega_\text{opt} := 1+ \left( \frac{\mu}{1+\sqrt{1-\mu^2}} \right)^2 = 1 + \frac{\mu^2}{4} + O(\mu^3)\,. $$ In particular, for $$\omega = 1$$ (Gauss-Seidel) it holds that $$\rho(C_\omega)=\mu^2=\rho(C_\text{Jac})^2$$. For the optimal $$\omega$$ we get $$\rho(C_\omega)=\frac{1-\sqrt{1-\mu^2}}{1+\sqrt{1-\mu^2}} = \frac{\mu^2}{4} + O(\mu^3)$$, which shows SOR is roughly four times more efficient than Gauss–Seidel.

The last assumption is satisfied for tridiagonal matrices since $$Z(\lambda D + L + U)Z^{-1}=\lambda D + zL + \tfrac{1}{z}U$$ for diagonal $$Z$$ with entries $$Z_{ii}=z^{i-1}$$ and $$ \operatorname{det}(\lambda D + L + U) = \operatorname{det}(Z(\lambda D + L + U)Z^{-1}) $$.

Algorithm
Since elements can be overwritten as they are computed in this algorithm, only one storage vector is needed, and vector indexing is omitted. The algorithm goes as follows:

Inputs: $A$, $b$, $ω$ Output: $φ$ Choose an initial guess $φ$ to the solution repeat until convergence for $i$ from 1 until $n$ do set $σ$ to 0 for $j$ from 1 until $n$ do if $j$ &ne; $i$ then set $σ$ to $σ + a_{ij} φ_{j}$ end if end ($j$-loop) set $φ_{i}$ to $(1 − ω)φ_{i} + ω(b_{i} − σ) / a_{ii}$ end ($i$-loop) check if convergence is reached end (repeat)


 * Note: $$(1-\omega)\phi_i + \frac{\omega}{a_{ii}} (b_i - \sigma)$$ can also be written $$\phi_i + \omega \left( \frac{b_i - \sigma}{a_{ii}} - \phi_i\right)$$, thus saving one multiplication in each iteration of the outer for-loop.

Example
We are presented the linear system



\begin{align} 4x_1 - x_2 -  6x_3 + 0x_4 &=   2, \\ -5x_1 - 4x_2 + 10x_3 + 8x_4 &= 21, \\ 0x_1 + 9x_2 + 4x_3 - 2x_4 &= -12, \\ 1x_1 + 0x_2 - 7x_3 + 5x_4 &=  -6. \end{align} $$

To solve the equations, we choose a relaxation factor $$\omega = 0.5$$ and an initial guess vector $$\phi = (0, 0, 0, 0)$$. According to the successive over-relaxation algorithm, the following table is obtained, representing an exemplary iteration with approximations, which ideally, but not necessarily, finds the exact solution, (3, &minus;2, 2, 1), in 38 steps.

A simple implementation of the algorithm in Common Lisp is offered below.

A simple Python implementation of the pseudo-code provided above.

Symmetric successive over-relaxation
The version for symmetric matrices A, in which


 * $$ U=L^T,\,$$

is referred to as Symmetric Successive Over-Relaxation, or (SSOR), in which


 * $$P=\left(\frac{D}{\omega}+L\right)\frac{\omega}{2-\omega}D^{-1}\left(\frac{D}{\omega}+U\right),$$

and the iterative method is


 * $$\mathbf{x}^{k+1}=\mathbf{x}^k-\gamma^k P^{-1}(A\mathbf{x}^k-\mathbf{b}),\ k \ge 0.$$

The SOR and SSOR methods are credited to David M. Young Jr.

Other applications of the method
A similar technique can be used for any iterative method. If the original iteration had the form


 * $$x_{n+1}=f(x_n)$$

then the modified version would use


 * $$x^\mathrm{SOR}_{n+1}=(1-\omega)x^{\mathrm{SOR}}_n+\omega f(x^\mathrm{SOR}_n).$$

However, the formulation presented above, used for solving systems of linear equations, is not a special case of this formulation if $x$ is considered to be the complete vector. If this formulation is used instead, the equation for calculating the next vector will look like


 * $$ \mathbf{x}^{(k+1)} = (1-\omega)\mathbf{x}^{(k)} + \omega L_*^{-1} (\mathbf{b} - U\mathbf{x}^{(k)}),$$

where $$L_* = L + D$$. Values of $$\omega>1$$ are used to speed up convergence of a slow-converging process, while values of $$\omega<1$$ are often used to help establish convergence of a diverging iterative process or speed up the convergence of an overshooting process.

There are various methods that adaptively set the relaxation parameter $$\omega$$ based on the observed behavior of the converging process. Usually they help to reach a super-linear convergence for some problems but fail for the others.