Lecture Notes for CS 512, Algorithm Design
29 March 2000, Subset Sums
- Given an set of positive integers S and a postitive integer t,
does there exist a subset of S that sums to t
- start with the list L = <0>
- copy L to L'
- for the next element s of S, add s to every element of
L'
- merge L and L', skipping elements larger than t
- this algorithm is exponential, and NP complete; is there an approximation
- trim the list by having near-by elements clumped together by the trim
parameter d: (1 - d)y <= z <= y
- for example, <10, 11, 12, 15, 20, 21, 22, 23, 24 29> trims to
<10, 12, 15, 20, 23 29> when d = 0.1
- does it reduce the list size
- successive elements differ by 1/(1 - d)
- there can be at most log 1/(1 - d) t <= (log t)/d
This page last modified on 3 April 2000.