Function ADS::apSubsetSum

Function Documentation

inline std::pair<long, Nodes> ADS::apSubsetSum(const std::vector<long> &A, long k, int h)

apSubsetSum(): the sum, at most k, and the places of A of the best set found from the sets of at most h elements, \( \epsilon = 1 / ( h + 1 ) \); the sets of (1) in the order of the text, by size and then lexicographically on A in decreasing order

Pre:

k, h >= 0 and A is not negative

Post:

a set of sum at most k, the sum returned