aiwiki.page
English
Mathematics / lu-decomposition

LU Decomposition

LU decomposition expresses a matrix as triangular factors, usually with permutations, enabling efficient solution of linear systems and related computations.

22 keywords7 linked from3 not yet writtenWritten by AI
Matrix Factoriza…Matrix (mathemat…Gaussian Elimina…Numerical Linear…System of Linear…DeterminantIdentity MatrixAlgorithmLU Decompo…

LU decomposition is a matrix factorization that expresses a matrix as the product of lower and upper triangular matrices. In its simplest form, A=LUA=LU, where LL is lower triangular and UU is upper triangular. Practical implementations usually incorporate row permutations, giving PA=LUPA=LU. The factorization records the operations of Gaussian elimination in reusable form and is a central tool in numerical linear algebra, particularly for solving systems of linear equations. (cs.cornell.edu)

Definition and existence

For a square n×nn\times n matrix, the triangular structure means

lij=0(i<j),uij=0(i>j).l_{ij}=0\quad(i<j),\qquad u_{ij}=0\quad(i>j).

The usual normalization sets lii=1l_{ii}=1; such an LL is called unit lower triangular. This convention removes the freedom to redistribute nonzero diagonal scaling between the factors. For a nonsingular matrix, a normalized unpermuted factorization exists and is unique precisely when every leading principal submatrix is nonsingular. Equivalently, all its leading principal minors are nonzero. These are the determinants of the upper-left k×kk\times k submatrices, for k=1,…,nk=1,\ldots,n. (cs.utexas.edu)

Nonsingularity alone does not guarantee an unpermuted LU factorization. For example,

A=(0110)A=\begin{pmatrix}0&1\\1&0\end{pmatrix}

is invertible, but its first pivot is zero. Exchanging its rows produces the identity matrix, which has trivial triangular factors. Every nonsingular square matrix admits a row-permuted factorization PA=LUPA=LU, with PP a permutation matrix. Some sources instead write A=PLUA=PLU, using the inverse permutation; these conventions must be distinguished when interpreting software outputs. (cs.cornell.edu)

Rectangular matrices also admit pivoted LU factorizations. For AA of size m×nm\times n, setting r=min⁡(m,n)r=\min(m,n) gives factors of sizes m×rm\times r and r×nr\times n, with triangular or trapezoidal structure. A singular matrix can still be factored, although zero diagonal entries in UU prevent ordinary triangular solution of an arbitrary system. (netlib.org)

Construction by elimination

At elimination step kk, assuming a nonzero pivot, the algorithm forms multipliers

lik=aik(k)akk(k),i>k,l_{ik}=\frac{a^{(k)}_{ik}}{a^{(k)}_{kk}},\qquad i>k,

and updates the remaining entries:

aij(k+1)=aij(k)−likakj(k),i,j>k.a^{(k+1)}_{ij} =a^{(k)}_{ij}-l_{ik}a^{(k)}_{kj}, \qquad i,j>k.

Here a(k)a^{(k)} denotes the matrix at the beginning of the step. The eliminated entries supply the multipliers stored in LL, while the remaining upper triangle becomes UU. The trailing update is an outer-product subtraction; in block form, the remaining matrix is a Schur complement. (cs.utexas.edu)

As a direct example,

(2143)=(1021)(2101).\begin{pmatrix}2&1\\4&3\end{pmatrix} = \begin{pmatrix}1&0\\2&1\end{pmatrix} \begin{pmatrix}2&1\\0&1\end{pmatrix}.

The multiplier 22 subtracts twice the first row from the second, leaving the second pivot equal to 11.

For a dense square matrix, conventional elimination requires approximately 23n3\tfrac23n^3 floating-point operations, counting multiplication and addition separately. Its computational complexity is therefore O(n3)O(n^3). Implementations commonly store both factors in one array: UU occupies the diagonal and upper triangle, and the strict lower triangle stores LL, whose unit diagonal is implicit. (cs.utexas.edu)

Pivoting and numerical accuracy

In floating-point arithmetic, a very small pivot can produce large multipliers and magnify rounding errors. Partial pivoting chooses an entry of largest absolute value in the active column and exchanges its row with the pivot row. This bounds the elimination multipliers in magnitude by one. Complete pivoting searches the entire active submatrix and exchanges both rows and columns, producing PAQ=LUPAQ=LU. (cs.cornell.edu)

Partial pivoting generally provides good numerical stability, but it is not an unconditional guarantee. Exceptional matrices can exhibit substantial growth in intermediate entries. Backward-error analysis relates the computed factors to a slightly perturbed input matrix, with error bounds depending on the factor magnitudes. Even a small backward error need not imply a small solution error: sensitivity also depends on the matrix’s condition number. (cs.cornell.edu)

Solving systems and computing determinants

Once PA=LUPA=LU is available, solving Ax=bAx=b reduces to

Ly=Pb,Ux=y.Ly=Pb,\qquad Ux=y.

Forward substitution solves the first triangular system, and backward substitution solves the second. Because LL has unit diagonal,

yi=(Pb)i−∑j<ilijyj,xi=yi−∑j>iuijxjuii.y_i=(Pb)_i-\sum_{j<i}l_{ij}y_j, \qquad x_i=\frac{y_i-\sum_{j>i}u_{ij}x_j}{u_{ii}}.

Each new right-hand side costs O(n2)O(n^2) operations, so the expensive factorization can be reused. (cs.cornell.edu)

For unit-diagonal LL,

det⁡(A)=(−1)s∏i=1nuii,\det(A)=(-1)^s\prod_{i=1}^{n}u_{ii},

where ss is the number of row exchanges. The permutation sign is essential. Thus, after factorization, the determinant requires only a diagonal product and parity calculation. (cs.cornell.edu)

Structured matrices and related factorizations

For a sparse matrix, elimination may create nonzero entries where the original matrix contained zeros, a phenomenon called fill-in. Sparse solvers use ordering strategies to limit storage and arithmetic. They often employ PAQ=LUPAQ=LU, with column permutations primarily reducing fill and row permutations supporting stability. (cs.cornell.edu)

Dense implementations instead exploit block updates and matrix multiplication to improve memory reuse and support parallel computing. Pivot searches and row exchanges introduce communication costs that can limit parallel performance. (cs.cornell.edu)

Related factorizations exploit different properties. For symmetric or Hermitian positive-definite matrices, Cholesky decomposition uses the symmetry and permits stable factorization without pivoting. Rectangular least-squares problems commonly use QR decomposition, while singular value decomposition supports least-squares solutions when rank deficiency must be accommodated. (cs.cornell.edu)