Gauss reduction repeatedly subtracts a rounded projection and puts the shorter vector first. For a rank-two Euclidean lattice, the final first vector is a shortest nonzero vector.

The two operations

  1. Order the basis so that ∥b1∥≤∥b2∥\|b_1\|\le\|b_2\|.
  2. Set m=round⁡(⟨b2,b1⟩/∥b1∥2)m=\operatorname{round}(\langle b_2,b_1\rangle/\|b_1\|^2) and replace b2b_2 by b2−mb1b_2-mb_1.
  3. If the new second vector is strictly shorter, swap the two vectors and repeat from step 2. Otherwise stop. Either choice at a rounding tie satisfies the final coefficient bound.

Subtraction and swapping are unimodular basis changes. Each continuing swap strictly decreases the length of the first vector. A bounded ball contains finitely many lattice points, so the swaps terminate.

Reduce the shared skew basis

Take b1=(2,0)b_1=(2,0) and b2=(6,3)b_2=(6,3). The projection coefficient is 12/4=312/4=3. Subtract 3b13b_1 to obtain (0,3)(0,3). The two lengths are 2 and 3, so the algorithm stops.

If you start with the same pair reversed, the initial ordering step swaps them. In either order the output spans the same area-6 lattice.

Why the first vector is shortest

At termination write b2=μb1+b2⊥b_2=\mu b_1+b_2^\perp, with ∣μ∣≤1/2|\mu|\le1/2 and ∥b2∥≥∥b1∥\|b_2\|\ge\|b_1\|. The perpendicular component has squared length at least 3∥b1∥2/43\|b_1\|^2/4.

From Gauss to LLL

LLL uses the same rounded subtraction in Gram–Schmidt coordinates. Its swap condition compares two consecutive projected vectors with a configurable Lovász parameter. This gives a polynomial-time approximation guarantee in higher dimensions. See the LLL worked example.