Branch and Bound Approach

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.

Notes:

Standard Branch and Bound Approach Problems

1. 0/1 Knapsack Problem

Problem:

Given two integer arrays val[0..n-1] and wt[0..n-1] that represent values and weights associated with n items respectively.

Find out the maximum value subset of val[] such that sum of the weights of this subset is smaller than or equal to Knapsack capacity W.

Approach-1: Greedy
Approach-2: Dynamic Programming (DP)
Approach-3: Brute-Force

Approach-4: Backtracking

Approach-5: Branch and Bound

Finding Bound for every node
Algorithm:
Illustration:

Input: // First element in every pair is weight of item and second is value of item Item arr[] = [(2, 40), (3.14, 50), (1.98, 100), (5, 95), (3, 30)] Knapsack Capacity W = 10

Output: Maximum possible profit = 235

Implementation:








Output:

Complexity:




← Previous: Randomized Algorithms

Next: Miscellaneous Algorithmic Problems →