2
6.4
The approximate nearest vector problem
In this section, we use Algorithm 6.3 to produce a reduced basis of a lattice,
and then use this reduced basis to solve approximately the nearest vector
problem in
L
introduced in Eq. (6.2) In particular, let
L
be a lattice and
x
∈
Q
n
not belonging to
L
.
The nearest vector problem is
NP
hard.
Algorithm 6.4 that we present next Fnds a
b
∗
∈L
such that
k
b
∗
−
x
k≤
(2
n
−
1)
1
/
2
min
{k
b
−
x
k
:
b
∈L\{
0
}}
.
(6.12)
Algorithm 6.4 Approximate nearest vector algorithm
Input
: A reduced basis
b
1
,...,
b
n
of a lattice
L
, the GramSchmidt
orthogonalization
˜
b
1
˜
b
n
and
x
∈
Q
n
.
Output
: A vector
b
∗
satisfying Eq. (6.12) and rational multipliers
λ
i
,
i
=1
,...,n
with

λ
i
≤
1
/
2
, such that
b
∗
−
x
=
n
X
i
=1
λ
i
˜
b
i
.
Algorithm
:
1.
Set
z
n
+1
=
0
and
x
n
+1
=
x
.
2.
For
i
=
n,.
..,
1
:
(a)
Compute
σ
1
,i
,...σ
i,i
∈
Q
such that
x
i
+1
=
i
X
j
=1
σ
j,i
˜
b
j
.
(b)
Set
λ
i
=
b
σ
i,i
e−
σ
i,i
,where
b
σ
i,i
e
denotes the nearest integer
to
σ
i,i
.
(c)
Set
z
i
=
z
i
+1
+
b
σ
i,i
e
b
i
.
(d)
Set
x
i
=
x
i
+1
−b
σ
i,i
e
b
i
+
λ
i
˜
b
i
.
3.
Return
b
∗
=
z
1
and
λ
1
,...,λ
n
.
Example 6.9
We revisit Example 6.6. We have seen that the vectors
b
1
=
(1
,
1)
0
,
b
2
=(2
,
−
1)
0
constitute a reduced basis of the lattice
L
(
b
1
,
b
2
). The cor
responding GramSchmidt orthogonalization is
˜
b
1
=(1
,
1)
0
and
˜
b
2
.
5
,
−
1
.
5).
Let
x
=(7
.
5
,
3
.
0)
0
. We start the approximate nearest vector algorithm by setting
z
3
=
0
and
x
3
=
x
.W
et
h
e
ns
e
t
i
= 2 and compute multipliers
σ
1
,
2
,σ
2
,
2
such
that
x
=
σ
1
,
2
˜
b
1
+
σ
2
,
2
˜
b
2
.
This gives
σ
1
,
2
=
x
0
˜
b
1
k
˜
b
1
k
2
=5
.
25
,
and
σ
2
,
2
=
x
0
˜
b
2
k
˜
b
2
k
2
.
5
.