Solving Subset Sum with Dynamic Programming and F#
The
Subset Sum (Main72)
problem, officially published in
SPOJ, is about computing the sum of all integers that can be
obtained from the summations over any subset of the given
set (of integers). A naïve solution would be to derive all
the subsets of the given set, which unfortunately would
result in
time complexity, given that
is the number of elements in the set. This post outlines a
more efficient (pseudo-polynomial) solution to this problem using
Dynamic Programming
and
F#. Additionally, we post
C#
code of the solution...(read more)