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. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.