Skip to content
CoreSource checked

Gauss-Seidel Method

Solves linear systems by updating variables immediately as new values are available.

Quick Facts

Compact metadata for implementation and discovery.

Category
Numerical Methods
Difficulty
Intermediate
Family
Iterative Linear Solver
Tier
Core
Status
Verified
Review
Source Checked
Sources
1
Formulas
1
Relationships
5
Code example
Not ready
Visualization
Ready

Overview

Gauss-Seidel is an iterative linear solver that uses the newest values within the same iteration.

Core Concepts

numeric approximationmatrix operationresidual updateiterative linear solverconvergence checkerror control

Quick facts

Complexity

Runtime and memory behavior at a glance.

Best

O(n^2)

Average

O(t n^2)

Worst

O(t n^2)

Space

O(n)

When to Use

  • Use Gauss-Seidel Method when you need to sweep through variables in order.
  • Use it for sparse systems with inputs like linear system.
  • Use it when an approximate numeric result is acceptable and the input assumptions are satisfied.
  • Use it when the Iterative Linear Solver tradeoff is acceptable for the problem size.

When Not to Use

  • Avoid it when rounding error, ill-conditioning, or convergence failure would hide the real answer.
  • Avoid it when O(t n^2) worst-case behavior is too costly for the expected input size.
  • Avoid it when the required output is not approximate solution vector.

What It Does

  • Sweeps through variables in order
  • Uses updated values as soon as they are computed

Use Cases

  • Sparse systems
  • Numerical simulation grids
  • Iterative refinement

Inputs

  • Linear system
  • Initial guess
  • Stopping tolerance

Outputs

  • Approximate solution vector

Key Formulas (1)

Gauss-Seidel update

xi next = (bi − ∑(Aij · xj for j ≠ i)) / Aii
x_i_next = (b_i - sum(A_ij * x_j for j != i)) / A_ii

Updates each variable using the newest available values during the sweep.

Pseudocode

  1. 1.Choose an initial solution vector
  2. 2.Visit each variable in order
  3. 3.Compute its new value using latest available values
  4. 4.Overwrite the old value immediately
  5. 5.Repeat until residual is small

Canonical Example

Input
equation = x^2 - 9 = 0 or matrix system Ax = b
Output
approximate numeric solution
Explanation
Gauss-Seidel Method: The method iteratively or algebraically approximates the requested mathematical result.

Implementation Notes

  • Keep the input contract explicit: Linear system; Initial guess; Stopping tolerance.
  • Use this step as the implementation spine: Choose an initial solution vector.
  • Then preserve the next state change: Visit each variable in order.
  • Prefer trusted numeric libraries for matrix operations once the concept is validated.
  • Use small examples with known answers to verify the numeric update before scaling up.

Common Pitfalls

  • Gauss-Seidel can converge faster than Jacobi but is less naturally parallel.
  • Ignoring singular or ill-conditioned inputs can produce unstable numeric results.
  • Stopping based only on iteration count instead of checking residual, tolerance, or error.
  • Returning approximate solution vector without handling empty, invalid, or boundary inputs.

Interactive Mechanism Walkthrough

Iterative Convergence & State Trajectory

Show variables updating one by one and influencing later updates.

Gauss-Seidel Method mechanism walkthrough step 1 of 5x₀x₁x₂x*
Step 1 of 5: Choose an initial solution vector
sequential-linear-updates

Notes

Gauss-Seidel Method operates in O(t n^2) time and O(n) space within the Iterative Linear Solver family. Key governing relation: x_i_next = (b_i - sum(A_ij * x_j for j != i)) / A_ii. Often compared with Jacobi Method and Conjugate Gradient.

Sources (1)

What each reference supports for this entry.

Templates for the Solution of Linear Systems

Book

Netlib/SIAM reference for iterative linear solvers including Jacobi, Gauss-Seidel, and conjugate gradient.

Open source

Explore Next

Good next jumps from the relationship graph, ranked for useful discovery.

Improves onJacobi Method

Gauss-Seidel reuses newly updated values within the same iteration.

SOR adds a relaxation factor to Gauss-Seidel updates.

Tags

Numerical MethodsLinear AlgebraIterative Solver