Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • 1
    This looks like a linear (or may be dynamic) programming problem, the guys at: math.stackexchange.com/?as=1 may be able to point you to a mathematically sound algorithm for it. Although such algorithms provide optimal solutions they require some background in the subject. Commented Apr 25, 2012 at 20:25
  • @EmmadKareem: It definitely isn't linear programming (dynamic programming means something completely different). It might be integer linear programming, but I don't see how to write the cost function as linear and even if it was, integer linear programming is NP-hard anyway. Commented Apr 26, 2012 at 7:51