classical knapsack problem

Instead of searching an optimal solution in increasing order of bag size,why can’t we try every possible
item combination and pick the one which best matches our constraints?

We can try all the possibilities and pick the best one as you said. But doing so requires exponential time.

2 Likes