IIRC this is the knapsack problem and is NP-complete.  So just pick
a reasonable subset and burn.

Henry Rich 

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of bill lam
> Sent: Saturday, May 05, 2007 11:55 AM
> To: Programming forum
> Subject: [Jprogramming] Knapsack problem?
> 
> I want to burn data files to dvd of 4.5G
>     ?.20#1000
> 146 755 79 852 854 439 660 257 60 594 246 478 713 318 151 92 
> 178 260 90 862
> 
> how to find the subset of numbers such that their sum is 
> nearest but not 
> exceeding 4500?
> 
> -- 
> regards,
> bill
> ----------------------------------------------------------------------
> For information about J forums see 
> http://www.jsoftware.com/forums.htm

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to