The LenstraâÂÂLenstraâÂÂLovász (LLL) lattice basis reduction algorithm is a polynomial time lattice reduction algorithm invented by Arjen Lenstra, Hendrik Lenstra and László Lovász in 1982. Given a basis with n-dimensional integer coordinates, for a lattice L (a discrete subgroup of R<sup>n</sup>) with , the LLL algorithm calculates an LLL-reduced (short, nearly orthogonal) lattice basis in time where is the largest length of under the Euclidean norm, that is, .
The original applications were to give polynomial-time algorithms for factorizing polynomials with rational coefficients, for finding simultaneous rational approximations to real numbers, and for solving the integer linear programming problem in fixed dimensions.
The precise definition of LLL-reduced is as follows: Given a basis
define its GramâÂÂSchmidt process orthogonal basis
and the Gram-Schmidt coefficients for any .
Then the basis is LLL-reduced if there exists a parameter in such that the following holds:
Here, estimating the value of the parameter, we can conclude how well the basis is reduced. Greater values of lead to stronger reductions of the basis. Initially, A. Lenstra, H. Lenstra and L. Lovász demonstrated the LLL-reduction algorithm for . Note that although LLL-reduction is well-defined for , the polynomial-time complexity is guaranteed only for in .
The LLL algorithm computes LLL-reduced bases. There is no known efficient algorithm to compute a basis in which the basis vectors are as short as possible for lattices of dimensions greater than 4. However, an LLL-reduced basis is nearly as short as possible, in the sense that there are absolute bounds such that the first basis vector is no more than times as long as a shortest vector in the lattice, the second basis vector is likewise within of the second successive minimum, and so on.
An early successful application of the LLL algorithm was its use by Andrew Odlyzko and Herman te Riele in disproving the Mertens conjecture.
The LLL algorithm has found numerous other applications in MIMO detection algorithms and cryptanalysis of public-key encryption schemes: knapsack cryptosystems, RSA with particular settings, NTRUEncrypt, and so forth. The algorithm can be used to find integer solutions to many problems.
In particular, the LLL algorithm forms a core of one of the integer relation algorithms. For example, if it is believed that r=1.618034 is a (slightly rounded) root to an unknown quadratic equation with integer coefficients, one may apply LLL reduction to the lattice in spanned by and . The first vector in the reduced basis will be an integer linear combination of these three, thus necessarily of the form ; but such a vector is "short" only if a, b, c are small and is even smaller. Thus the first three entries of this short vector are likely to be the coefficients of the integral quadratic polynomial which has r as a root. In this example the LLL algorithm finds the shortest vector to be [1, -1, -1, 0.00025] and indeed has a root equal to the golden ratio, 1.6180339887....
Let be a -LLL-reduced basis of a lattice . From the definition of LLL-reduced basis, we can derive several other useful properties about .
The following description is based on , with the corrections from the errata.
INPUT a lattice basis b<sub>1</sub>, b<sub>2</sub>, ..., b<sub>n</sub> in Z<sup>m</sup> a parameter ô with 1/4 < ô < 1, most commonly ô = 3/4 PROCEDURE B<sup>*</sup> <- GramSchmidt({b<sub>1</sub>, ..., b<sub>n</sub>}) = {b<sub>1</sub><sup>*</sup>, ..., b<sub>n</sub><sup>*</sup>}; and do not normalize ü<sub>i,j</sub> <- InnerProduct(b<sub>i</sub>, b<sub>j</sub><sup>*</sup>)/InnerProduct(b<sub>j</sub><sup>*</sup>, b<sub>j</sub><sup>*</sup>); using the most current values of b<sub>i</sub> and b<sub>j</sub><sup>*</sup> k <- 2; while k <= n do for j from kâÂÂ1 to 1 do if |ü<sub>k,j</sub>| > 1/2 then b<sub>k</sub> <- b<sub>k</sub> â âÂÂü<sub>k,j</sub>âÂÂb<sub>j</sub>; Update B<sup>*</sup> and the related ü<sub>i,j</sub><nowiki/>'s as needed. (The naive method is to recompute B<sup>*</sup> whenever b<sub>i</sub> changes: B<sup>*</sup> <- GramSchmidt({b<sub>1</sub>, ..., b<sub>n</sub>}) = {b<sub>1</sub><sup>*</sup>, ..., b<sub>n</sub><sup>*</sup>}) end if end for if InnerProduct(b<sub>k</sub><sup>*</sup>, b<sub>k</sub><sup>*</sup>) > (ô â ü<sup>2</sup><sub>k,kâÂÂ1</sub>) InnerProduct(b<sub>kâÂÂ1</sub><sup>*</sup>, b<sub>kâÂÂ1</sub><sup>*</sup>) then k <- k + 1; else Swap b<sub>k</sub> and b<sub>kâÂÂ1</sub>; Update B<sup>*</sup> and the related ü<sub>i,j</sub><nowiki/>'s as needed. k <- max(kâÂÂ1, 2); end if end while return B the LLL reduced basis of {b<sub>1</sub>, ..., b<sub>n</sub>} OUTPUT the reduced basis b<sub>1</sub>, b<sub>2</sub>, ..., b<sub>n</sub> in Z<sup>m</sup>
Let a lattice basis , be given by the columns of
then the reduced basis is
which is size-reduced, satisfies the Lovász condition, and is hence LLL-reduced, as described above. See W. Bosma. for details of the reduction process.
Likewise, for the basis over the complex integers given by the columns of the matrix below,
then the columns of the matrix below give an LLL-reduced basis.
LLL is implemented in