Finding elements of an aggregate
Paul Zimmermann
Paul.Zimmermann at loria.fr
Thu Apr 3 12:37:41 CEST 2008
> Date: Wed, 02 Apr 2008 12:10:50 +0200
> From: <sarma at centrum.cz>
>
> Hello,
> I am solving the following problem: with a given aggregate number and a set of values, I am looking for an algorithm to find all possible combinations of values from the given set whose sum equals to the given aggregate. All values are big numbers thus gmp seems to be the right choice; however I can't find an algorithm efficient in cases when the number of values within the set amounts to several hundred. So I'd like to ask if anyone could point me in the right direction - which algorithm to choose, what pproach to take? Has anyone done anything similar? Thank you.
> Mac
http://en.wikipedia.org/wiki/Subset_sum_problem
Paul Zimmermann
More information about the gmp-discuss
mailing list