Tag Archives: knapsack

Branch and Bound | Set 1 (Introduction with 0/1 Knapsack)

Branch and bound is an algorithm design paradigm which is generally used for solving combinatorial optimization problems. These problems typically exponential in terms of time complexity and may require exploring all possible permutations in worst case. Branch and Bound solve these problems relatively quickly. Let us consider below 0/1 Knapsack problem to understand Branch and… Read More »

Fractional Knapsack Problem

Given weights and values of n items, we need put these items in a knapsack of capacity W to get the maximum total value in the knapsack. In the 0-1 Knapsack problem, we are not allowed to break items. We either take the whole item or don’t take it. Input: Items as (value, weight) pairs… Read More »