News for hackers. Stuff that matters.
Re:programming challenge by uncompetence on Sunday October 17, 2010 @03:49AM (#1799885)
If you treated this as a variant on the backpack problem, you run into trouble as you can't properly memoize or use dynamic programming. You use 'timesteps' as the size of the 'knapsack' since the number of balls is unbounded. At each timestep, you cannot determine the the optimal solution to the subproblem and you'd have to save every possible ball combination.

TL;DR - It gets to be a pretty messy/bad backpack and should probably be solved another way

Re:programming challenge by jules on Sunday October 17, 2010 @06:32AM (#1800057)
Integer linear programming!