While the 0/1 Knapsack problem is typically solved using dynamic programming, which algorithmic approach provides an optimal solution for the Fractional Knapsack problem?
Show answer
Greedy algorithm
Fractional Knapsack can be solved optimally using a greedy approach by taking items with the highest value-to-weight ratio. 0/1 Knapsack requires dynamic programming because the greedy approach may fail to find the optimal combination of whole items.
Also asked as:
- Which algorithmic strategy yields an optimal solution for the Fractional Knapsack problem?