Skip to main content
. 2022 Oct 8;24(10):1428. doi: 10.3390/e24101428
Algorithm 3 Babai’s Nearest Plane algorithm.
  • Input: 

    lattice basis B′=[b1′,b2′,…,bm′]∈Rm×m, target vector t∈Zm

  • Output: 

    vector x∈L(B′), which satisfies ∥x−t∥≤2m/2dist(t,L(B′))

  •  1:

    Perform the LLL reduction on B′ with parameter δ=3/4.

  •  2:

    Use the Gram–Schmidt orthogonalization on the reduced basis and obtain B∗=[b1∗,b2∗,…,bm∗].

  •  3:

    b=t.

  •  4:

    for j = m, m − 1,…, 1 do

  •  5:

       b=b−ujbj′, where uj=⌈〈b,bj∗〉/〈bj∗,bj∗〉⌋;

  •  6:

    end for

  •  7:

    return t−b