2

I was wondering given a very small set of items, a medium and a very large what the best algorithms (Dynamic Programming, Greedy, Branch and Bound) are and their efficiencies.

I am pretty sure If I have four items(with different weights) and a capacity of 3000, Dynamic Programming might not be the best solution, given the complexity O(nW), but even Greedy doesn't give an optimal solution, so how does the size influence the algorithm to choose between these three?

Edoardo Moreni
  • 408
  • 2
  • 10
  • 24
  • I think that with good bounds,B&B will be sufficient, even with 30k items. If you post any code I'll help you in everything you need. – rpax May 24 '14 at 11:42
  • 1
    If you always want optimal solution for large W then it is difficult to achieve as knapsack is NP-complete. –  Jan 05 '15 at 06:49

0 Answers0