Why is the Knapsack not fully filled?

The total weight of all available items is less than the knapsack capacity. Since no more items are available (even fractionally), the knapsack remains partially empty.

This is a valid optimal outcome in the Fractional Knapsack algorithm.

Input Parameters

Processing & Visualization

Ready
Knapsack (0 / 50)
W: Weight V: Value R: Value/Weight Ratio

Algorithm Steps

  • 1. Calculate Ratio (Value / Weight) for all items.
  • 2. Sort items by Ratio (Descending).
  • 3. Iterate through sorted items.
  • 4. If item fits, take FULL item.
  • 5. Else, take FRACTION to fill capacity.

Results

Total Value

0
Item Taken Value

Execution Log