Made this as proto - but of course i can see many missing parts
(made by Google Gemini)
Let's validate your approach to solving the Shortest Vector Problem (SVP) for the given 2D lattice.
Your method is a brute-force enumeration, and I'll break down its validity, its limitations, and how it relates to standard algorithms.
Your Method Summarized
First, let's formalize what you're doing.
-
Lattice Basis: You are given two basis vectors that define the lattice:
Goal: The goal is to find a non-zero lattice vector
, where
and
are integers, such that its length (Euclidean norm)
is minimized.
-
Your Algorithm: You are systematically checking all possible integer combinations of
and
within an expanding search radius.
Round 1: Test all
.
Round 2: Test all
.
Round 3: Test all
, and so on.
Validation ✅
Your approach is conceptually correct. It is guaranteed to eventually find the shortest non-zero vector in the lattice.
By definition, every vector in the lattice can be expressed as an integer linear combination of the basis vectors. The shortest vector must have some integer coefficients . As you increase the search bounds of your "rounds," you will eventually test those specific coefficients and find the shortest vector.
In your example, you correctly identified that the vectors and
are the shortest vectors found in your first two rounds.
Length:
This is indeed the correct shortest non-zero vector for this lattice.
Limitations & Analysis ❌
While your method works for this small 2D example, it has a critical flaw that makes it unusable for most practical purposes: it is extremely inefficient.
1. The Curse of Dimensionality
The core problem is its complexity. In each "round" , you test all coefficients in the range
.
For a 2D lattice, the number of vectors to check is
.
For an
-dimensional lattice, this becomes
.
The number of combinations grows exponentially with the dimension .
Your 2D Case (Round 2, k=2): You checked
vectors. This is trivial for a computer.
A 30D Case (Round 1, k=1): You would need to check
(200 trillion) vectors. This is computationally infeasible.
Lattices used in cryptography can have hundreds of dimensions, making this brute-force approach impossible.
2. No Stopping Guarantee
You don't know when to stop. How many rounds do you need to run to be sure you have the shortest vector? The coefficients for the shortest vector might be very large. Stopping after "Round 3" gives you the shortest vector found so far, but provides no guarantee that it's the true shortest vector of the entire lattice.
How SVP is Solved in Practice
Your method is a basic version of enumeration. Modern algorithms are much more sophisticated.
Lattice Basis Reduction (e.g., LLL Algorithm): Before searching, the first step is almost always to "reduce" the basis. Algorithms like LLL (Lenstra–Lenstra–Lovász) find a new basis for the same lattice whose vectors are shorter and more orthogonal. The first vector of an LLL-reduced basis is often a very good approximation of the shortest vector. This is a polynomial-time algorithm and is fundamental to lattice cryptography.
Smarter Enumeration (e.g., Kannan, Fincke-Pohst): These algorithms don't search a simple cube of coefficients. They use the geometric structure of the lattice (specifically, the Gram-Schmidt orthogonalization) to intelligently prune the search space. They can prove that certain branches of the search tree cannot possibly contain a shorter vector, allowing them to skip checking billions of combinations.
Sieving Algorithms: For high dimensions, sieving algorithms are the state-of-the-art for solving exact SVP. They work by generating a large list of lattice vectors and repeatedly combining them to find shorter and shorter ones.
Conclusion
Your approach is an excellent way to understand the fundamental definition of SVP. It is correct in principle and works for tiny examples.
However, its exponential complexity makes it completely impractical for the high-dimensional lattices used in modern applications like cryptography. It's like trying to find the lowest point on Earth by checking the elevation of every single square meter—you'll get there eventually, but there are far more intelligent ways to search.
(CVP)
Yes, your method and calculations for this CVP instance are perfectly valid. You've correctly applied the brute-force enumeration approach.
Let's break it down.
Problem Setup
Lattice Basis:
,
Target Vector:
Method: For integer coefficients
, generate the lattice vector
and find the one that minimizes the distance
.
Verification of Your Result
You correctly identified that within your search space (Round 2), the closest vector is found with coefficients .
Lattice Vector:
.
Difference Vector:
.
Distance:
.
Your calculated distance of 0.81 is correct (rounded).
Why You Cannot Be Sure (The Limitation)
You are absolutely right to state: "but we are not sure 0.81 is the closest distance".
This is the fundamental limitation of brute-force enumeration. Your search works like shining a flashlight in a dark, infinite room. You've found the lowest point within the circle of light (your "Round 2"), but you have no guarantee that an even lower point doesn't exist just outside of it. You would need to keep expanding your search rounds indefinitely to be certain.
Finding the True Solution (A Smarter Way)
For low dimensions, we can find the solution without an exhaustive search. The trick is to find which "lattice parallelogram" the target vector falls into.
-
Express t in terms of the basis: We want to find real numbers x1,x2 such that t=x1b1+x2b2.
From the first row, we see immediately that x1=2.4.
Substituting into the second row: 5.3=3(2.4)+4x2⟹5.3=7.2+4x2⟹4x2=−1.9⟹x2=−0.475.
-
Identify Candidate Coefficients: The target vector is at "coordinates"
in our lattice system. The closest integer point must be one of the corners of the parallelogram that contains this point. We find these by rounding
and
up and down:
This gives us just four candidate pairs to check:
,
,
, and
.
-
Test the Candidates:
Coeffs (2, 0):
. Distance
. (This is the one you found!)
Coeffs (2, -1):
. Distance =
.
Coeffs (3, 0):
. Distance =
.
-
Coeffs (3, -1): v=3b1−1b2=(39)−(04)=(35).
Distance = ∥(3−2.45−5.3)∥=∥(0.6−0.3)∥=0.36+0.09=0.45≈0.671.
Conclusion 👍
Your validation request is spot on. Your method works, your calculations are correct, and your skepticism about the result is entirely justified.
Your brute-force search was on the right track but stopped just short. The true closest lattice vector is , with a distance of approximately 0.671. This was found with
, which was outside the bounds of your "2nd round".