Next: Empirical Tests Using Algorithm
Up: Solving Subset Sum Problems
Previous: Previous Empirical Methods
Using Seysen's
Algorithm to Solve Subset Sum Problems
In both [26] and [33] the LLL algorithm was used almost
exclusively to perform the required lattice basis reductions. Given the
existence of Seysen's basis reduction algorithm and knowledge as to how
it performs relative to LLL, it is natural to wonder how Seysen's
algorithm could be applied to solving subset sum problems. We know from
some of the comparisons performed between LLL and Seysen's algorithm in
Chapter 2 that Seysen's algorithm tends to perform
fewer row operations than LLL. If we used Seysen's algorithm then as
part of an attack on subset sum problems, we should be able to perform
more reduction operations (or other work) without increasing the overall
execution time of our method.
There are also theoretical and empirical reasons to suspect that
Seysen's algorithm alone will not perform well on subset sum
problems. Seysen's algorithm was originally suggested for
simultaneously reducing a lattice and its dual lattice, not for
finding the shortest vector in a lattice. If a lattice and its dual
are of comparable size, the Seysen algorithm is not likely to perform
row operations that generate short vectors in one lattice if that
move increases the lengths of vectors in the dual lattice. If the
vectors in the dual are significantly larger than those in the prime
lattice, Seysen's algorithm may actually produce vectors larger than
those originally input. Also, the algorithm's operation is not
dependent on the ordering of the basis vectors, which means that the
benefits gained by running LLL multiple times on different
randomizations of the subset sum lattice disappear.
These predicted benefits and deficiencies of the Seysen algorithm
suggest that the best place to use Seysen is at the beginning of our
attempt to solve a subset sum problem. The initial subset sum lattice
L has primal basis vectors which are much larger than those in the
dual; this favors the generation of shorter vectors in L and longer
vectors in L*. Also, as Seysen tends to perform many fewer row moves
than LLL to reach the same reduced lattice basis, using Seysen's
algorithm initially will reduce the total number of multiprecision row
moves as compared to using only LLL. Once Seysen's algorithm stops at a
local minimum, we can use LLL and other techniques to further reduce
just the primal lattice L and look for short vectors.
Figure 3-4:
Overview of Algorithm SL
 |
Figure 3-4 shows the basic outline of the SL
(Seysen-Lovász) algorithm. We start with the initial lattice basis
suggested in [26]. If the weights of the subset sum problem are
sufficiently large, then the lengths of the basis vectors in L will be
much greater than the corresponding lengths of the basis vectors in the
dual lattice L*. We apply the Seysen algorithm to the L,L*
self-dual pair of lattice bases, using a greedy algorithm
(Section 2.1.2) to choose at each step the pair of
basis vectors
to be reduced. The measure function
S(A) is the one suggested by Seysen [38]:
When computing the change in S(A) for each pair of vectors
,
is always set to its
maximum value of:
Let LS1 be the lattice basis which is produced by this (first)
application of the Seysen algorithm.
Recall that the goal of the SL algorithm is to find a basis vector
which describes the solution to the given subset sum problem. In
[26,33] the desired solution vector
was always of the
form
(e1,...,en) with ei equal to either 0 or a fixed constant
.
We will call all such vectors
Type-I solution
vectors, to designate them from another class of solution vectors which
will appear below. At the completion of the first Seysen reduction in
the SL algorithm, it is possible that lattice basis LS1
contains a Type-I solution vector. If so, then we are finished, and
Algorithm SL halts. We assume that LS1 does not contain a
Type-I solution vector, and continue with the next stage of the algorithm.
The algorithms of [26,33] searched for short vectors of the
form
in the LLL-reduced bases, where
for
and
is
any fixed integer. One of the problems with these methods is that
often the short vectors produced by LLL reduction had
;
that is, the sum
was not of the form s+yt and did
not describe any relation involving the target subset sum. One
method of reducing the probability that LLL (or Seysen) will include
a vector of this form in the reduced basis is to scale the ai and
s by some constant factor N, which increases the length of any vector
having a nonzero en+1 by about
if N is
sufficiently large. However, this approach has the drawback that it
increases the size of numbers which are already quite large and
require multi-precision arithmetic. We suggest another method for
elimination from consideration all lattice vectors with
:
GCD-reduction.
The idea behind GCD-Reduction is to perform row moves on the lattice basis so
that the entire
column contains exactly one
nonzero element, the GCD of the weights
.
If (for
example) vector
contains the GCD, we can remove
from the basis and remove the
column completely from the lattice basis. This reduces what was an
(n+1)-dimension lattice to an n-dimension lattice, and guarantees
that any lattice vector generated by reducing this basis would have
had its
component equal to 0 in the
(n+1)-dimension space.
Implementing GCD-Reduction is easy. The basic algorithm we use was described
by Brun [9]. Basis vectors are sorted in order of
decreasing bi,n+1. Then
is repeatedly subtracted
from
until
b2,n+1 > b1,n+1. The vectors are then
resorted in order of decreasing bi,n+1 and the process loops. In
reality, only vector
needs to be inserted into the
previously generated order. This can be performed very fast by using
an auxiliary pointer array; the actual basis vectors don't even need
to be moved around. Eventually, the only nonzero element in the
will be b1,n+1, at which point both the
vector
and all
can be
removed from the lattice.
We apply GCD-Reduction to the lattice basis LS1 output by the first
application of Seysen's algorithm. We do not use GCD-Reduction on the original
lattice basis L because the resulting lattice basis matrix would be
quite dense (which means the Seysen algorithm will take longer to run)
and the vectors in the dual lattice would also be much larger. After
GCD-Reduction is applied to basis LS1 (yielding output basis LG in n
dimensions) we again search for the presence of a Type-I solution
vector. Assuming we do not find such a vector, the Seysen algorithm is
applied to LG to reduce the lattice to a local minimum of the measure
function S(A). Call this lattice LS2, the output of the second
Seysen application.
For small values of n (
), it is possible that LS2
will contain a Type-I solution vector. For larger values of n and
sufficiently high densities d, however, it is unlikely that the
Seysen-GCD-Reduction-Seysen portion of the algorithm will have found the desired
vector. Thus we begin the second portion of the algorithm: the LLL
phase.
Figure 3-5:
Algorithm SL: LLL-Phase
 |
Figure 3-5 shows the first level of detail in the
LLL-phase of Algorithm SL. The input to this phase of the
algorithm is the lattice basis LS2 which was the result of the
second application of Seysen reduction. We now take advantage of the
theoretical improvements in the density bound given in [12]
and Section 3.2 above. (The introduction of the
``one-half'' vector is delayed until after the Seysen stage of Algorithm
SL has completed to increase the sparsity of the lattice bases
which are Seysen-reduced.) We extend the
lattice described by
LS2 into a lattice in
by adding an
component to each of the basis vectors
:
The new
component of each basis vector is simply the
sum of the first n components. To complete the extension, we need to
add one more vector to the lattice basis. New basis vector
is defined as follows:
For
,
the
component is the sum of the
first n terms minus
.
The
correction is needed
because otherwise the
column of the basis would be
dependent. Let
designate this extended lattice.
With the introduction of vector
we have also introduced a
second class of solution vectors. If
is a Type-I solution
vector for a subset sum problem with
elements in the subset,
then there now exists a Type-II vector in the lattice of the
form
Also, if
was a solution vector of the n-dimensional lattice,
in the extended lattice
vector
will be
transformed into
where en+1
equals
times the number of elements in the subset which sums to
s. Thus, during the LLL phase of Algorithm SL, we search for
both extended Type-I solution vectors and Type-II solution vectors.
The structure of the LLL phase of Algorithm SL is based upon the
successful attacks of [26,33]. Lagarias and Odlyzko showed
that using LLL multiple times on random orderings of the input basis
improved the chances of finding a solution vector. Thus, Algorithm
SL initially tries to reduce lattice
,
and upon failure
randomizes
and tries again. This process continues
until a total of
reduction attempts have been made
(
and
random orderings of
).
In [26]
,
but there is nothing special about that
particular value.
Figure 3-6:
Algorithm SL: LLL-Loop Structure
 |
Recall from Section 3.3 above that the
Radziszowski-Kreher approach, while setting
,
repeatedly
called LLL in conjunction with Weight-Reduction and Sort
(Sort just sorts the basis vectors by length.). They showed
that repeated iterations of the LLL-Weight-Reduction-Sort
loop shown in Figure 3-2 yielded better results than a single
application of LLL. Algorithm SL incorporates this approach,
applying a number of iterations of LLL-Weight-Reduction-
Sort before giving up and trying a new randomization of
(Figure 3-5). Each ordering of
passes
though up to
iterations of the loop before Algorithm SL
gives up. As stated above, in [33]
,
or
if all the vectors in the lattice were of length
.
Again,
there is nothing special about these particular values. Theoretically,
one could choose
and
to be quite large. Any practical
algorithm, though, would probably want to use reasonable constants for
both
and
.
Although both [26] and [33] run the LLL algorithm with the
parameter
,
Lenstra, Lenstra, and Lovász show that y
may be any value in the range
[27]. For
,
LLL will only exchange vectors in the lattice
(Equation 1.2) for relatively large differences between
vectors
and
.
As
,
the
amount of improvement required to trigger the LLL exchange step decreases,
and LLL will swap vectors and continue running for minimal improvement.
Thus, larger values of y will likely lead to improved results, but LLL
will also take longer to run. This suggests that instead of running the
entire LLL algorithm with y = 0.99, as was done previously, a version
of LLL which started with
and adjusted it upwards
as the algorithm ran might work just as well but require fewer row
operations [18].
Figure 3-7:
Algorithm SL: LLL(x) Internal Structure
 |
Algorithm SL uses a version of the LLL algorithm which varies the
parameter y among a finite number of values.
Figure 3-6 shows what happens each time SL calls
LLL-Loop. For subset sum problems with n < 90, each call to LLL
passes through six stages (i.e. six distinct values for
y)3.1. Upon entry to each stage, the
y parameter is updated, and LLL-reduction is performed upon the
lattice basis using the new y value (see Figure 3-7).
Let
and
represent respectively
the lattice bases input to and output from an application of the LLL
algorithm with y = y0. We now compute the boolean value of the
following expression:
 |
(3.7) |
(This decision point is represented by the diamond in
Figure 3-7.)
If the boolean value of Equation 3.7 is TRUE,
then the Weight-Reduction procedure is applied, the Sort
procedure is invoked, and the output is input again into LLL with
y=y0. Thus, we perform LLL-Weight-Reduction-Sort loops
until either the length of the shortest vector in the lattice has
increased after LLL-reduction, or if the length of the shortest vector
has remained constant and the length of the longest vector has not
decreased3.2.
By using the recursive structure in Figure 3-7 and the
termination condition represented by Equation 3.7, we
attempt to have the LLL algorithm perform as many reduction steps as
possible with small values of y0. We delay increasing the value of
y until LLL fails to make any improvement in the length of the largest
vector in the lattice basis. In this way we restrict the set of row
swaps and moves which LLL will consider, which improves the running time
of the algorithm. Initially, for y small (say y < 0.75) LLL will
only consider row moves which will ``significantly'' reduce the current
lattice basis. Later, for values of
,
LLL will consider
any row move which reduces the lattice.
For n < 90, six specific y values are used: 0.2578125, 0.625, 0.75,
0.875, 0.9375, and 0.9921875. These values were chosen for two reasons.
First, all of the numbers have exact fractional binary representations
in double-precision floating point. This meant that error would not be
introduced into the LLL algorithm by performing arithmetic operations on
y. Second, experiments with small subset sum problems (
)
showed that the number of row moves performed by LLL for each of the
four middle values were approximately equal. That is, work was evenly
distributed across all intermediate stages represented in
Figure 3-6. (The endpoint values 0.2578125 and 0.9921875
were fixed). For
,
three additional values were used:
0.34375, 0.4375, and 0.53125. These values evenly divide the interval
[0.2578124,0.625] into four equal pieces. As discussed in
Section 3.5 below, our initial implementation of
the LLL algorithm did not work correctly for lattice bases with
because of rounding error introduced into the computations. We were
able to reduce the effects of rounding error to acceptable levels by
modifying the LLL algorithm itself and by introducing the 0.34375,
0.4375 and 0.53125 stages into the algorithm.
We have detailed the operation of Algorithm SL, a combination of
the Seysen and the Lenstra-Lenstra-Lovász basis reduction algorithms
which also utilizes the GCD-Reduction, Half-Vector, Weight-Reduction,
and Sort heuristics. In the next section we present the results
of our experiments with this algorithm and show how the combination of
these techniques greatly increases the range of subset sum problems
which may be solved.
Next: Empirical Tests Using Algorithm
Up: Solving Subset Sum Problems
Previous: Previous Empirical Methods
Brian A. LaMacchia
1999-10-30