08-02-2008, 10:35 PM
|
Banned
|
Join Date: Feb 2007
Posts: 1,002
|
|
This problem is NP-complete, so it's impossible to do it in polynomial time.
The runtime is actually O(n**m) if you check all conditions. The best way to attack the problem would most likely be dynamic programming. |
|
|