Skip to content
Prev 208123 / 398506 Next

How to choose a number subset with sum closest to x?

Oh, I have considered this, but just don't see how the problem can be cast as
LSAP. (In the example, sum of squared pairwise distances ('costs') is
minimized, whereas here I am squaring the distance of a sum from the target
number. (How do I define individual assignment's cost here?)
Thanks anyway! I will be sure to study the (longer) code snippet in that
post.

PS. Sorry, my post became duplicated.