[R] How to choose a number subset with sum closest to x?

Dimitri Shvorob dimitri.shvorob at gmail.com
Sat Jan 30 12:38:13 CET 2010


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. 
-- 
View this message in context: http://n4.nabble.com/How-to-choose-a-number-subset-with-sum-closest-to-x-tp1457245p1457354.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list