Professional Documents
Culture Documents
Branch & Bound: A New Algorithm Paradigm
Branch & Bound: A New Algorithm Paradigm
Input
Capacity K
n items with weights wi and values vi
Goal
Output a set of items S such that
the sum of weights of items in S is at most K
and the sum of values of items in S is maximized
Greedy Does Not Work
wA = 2 vA = $40
wB = vB = $50
wC = 1.98 vC = $100
wD = 5 vD = $95
wE = 3 vE = $30
B B
C C C C
D D D D D D D D
E E E E E E E E E E E E E E E E
B B
C C C C
D D D D D D D D
E E E E E E E E E E E E E E E E
We have n=4 items. Their respective profits are (p1, p2, p3 p4 )={10, 10,
12, 18} and associated weights are (w1,w2,w3,w4) = {2,4,6,9}. Given
knapsack capacity is M=15 units.
If the bounds match, then an optimal solution has been found. Otherwise, the
feasible region is divided into two or more regions, which together cover the
whole feasible region.