Discrete Optimization: The Knapsack Problem:! Branch and Bound
Discrete Optimization: The Knapsack Problem:! Branch and Bound
Discrete Optimization: The Knapsack Problem:! Branch and Bound
Optimization
The Knapsack Problem:!
Branch and Bound
One-Dimensional Knapsack
maximize
subject to
Exhaustive Search
x x x
? ? ?
0
x1 = 1
x1 = 0
x2 = 1
x3 = 1
3
x2 = 1
x2 = 0
2
x3 = 0
3
x3 = 1
3
x2 = 0
x3 = 0
3
x3 = 1
3
x3 = 0
3
x3 = 1
3
x3 = 0
3
x x x
x x x
x x x
x x x
x x x
x x x
x x x
x x x
1 1 1
1 1 0
1 0 1
1 0 0
0 1 1
0 1 0
0 0 1
0 0 0
Branching!
split the problem into a number of
subproblems!
like in exhaustive search!
Bounding!
find an optimistic estimate of the
best solution to the subproblem!
maximization: upper bound!
minimization: lower bound
5
A Knapsack Model
maximize
subject to
45
48
35
K = 10
X2 = 1
X1 = 1
X1 = 0
$45!
5!
$128
$0!
10!
$83
X2 = 0
---!
-3!
---
X2 = 1
$45!
5!
$80
X3=1
$80!
2!
$80
8
Value!
Room!
Estimate
$0!
10!
$128
$0!
10!
$35
$48!
2!
$83
X3=0
$45!
5!
$45
X3=1
---!
-1!
---
X2 = 0
X3=0
$48!
2!
$48
A Knapsack Model
maximize
subject to
A Knapsack Model
maximize
Callebaut
!
subject to
!
!
A Knapsack Model
maximize
subject to
11
A Knapsack Model
maximize
!
subject to
!
!
!
!
In this example,!
12
A Knapsack Model
Why is correct?
yi
let xi =
vi
maximize
subject to
P
P
y
i21..j i
wi
y
i21..j vi i
K
0 yi 1 (i 2 1..j)
13
A Knapsack Model
14
45
48
35
K = 10
X2 = 1
X1 = 1
X1 = 0
$45!
5!
$92
$0!
10!
$77
X2 = 0
---!
-3!
---
$45!
5!
$80
X3=1
$80!
2!
$80
15
Value!
Room!
Estimate
$0!
10!
$92
X3=0
$45!
5!
$45
16
Citations
Stone Foundation Tablet with Inscription of Gudea - 41221 (http://commons.wikimedia.org/wiki/File:Sumerian __Stone_Foundation_Tablet_with_Inscription_of_Gudea_-_Walters_41221_-_View_A.jpg). Artist Unknown. Walters Art Museum [Public domain, CC-BY-SA-3.0
(http://creativecommons.org/licenses/by-sa/3.0 )], via Wikimedia Commons !
!
Stone Foundation Tablet with Inscription of Gudea - 41220 (http://commons.wikimedia.org/wiki/File:Sumerian_-_
Stone_Foundation_Tablet_with_an_Inscription_of_Gudea_-_Walters_41220_-_View_A.jpg). Artist Unknown. Walters Art Museum [Public domain, CC-BY-SA-3.0
(http://creativecommons.org/licenses/by-sa/3.0) via Wikimedia Commons !
!
Buddha at the Moment of Victory (http://commons.wikimedia.org/wiki/File:Thai_-_Buddha_at_the_Moment_of_Victory_-_Walters_542775.jpg ). Artist Unknown.
Walters Art Museum [Public domain, CC-BY-SA-3.0 (http://creativecommons.org/licenses/by-sa/3.0 )], via Wikimedia Commons !
!
Hoxne Hoard two gold bracelets (http://commons.wikimedia.org/wiki/File:Hoxne_Hoard_two_gold_bracelets_side.JPG) by F (http://commons.wikimedia.org/
wiki/User:F%C3%A6) [CC-BY-SA-3.0 (http://creativecommons.org/licenses/by-sa/3.0)], via Wikimedia Commons !
!
Ring with the engraved portrait of Ptolemy VI Philometor (http://commons.wikimedia.org/wiki/File:Ring_with_engraved_portrait_of_ Ptolemy_VI_Philometor_(3rd
%E2%80%932nd_century_BCE)_-_2009.jpg<http://commons.wikimedia.org/wiki/File:Ring_with_engraved_
portrait_of_Ptolemy_VI_Philometor_(3rd-2nd_century_BCE)_-_2009.jpg>) By Unknown. (Photographed by PHGCOM in 2009.) [Public domain], via Wikimedia
Commons !
!
Calice du sacre Tau (http://commons.wikimedia.org/wiki/File:Calice_du_sacre_Tau.jpg) By Vassil (http://commons.wikimedia.org/wiki/User:Vassil) (Own work)
[Public domain], via Wikimedia Commons !
17
Citations
the mask of agamemnon (http://www.flickr.com/photos/rosemania/5705122218/) by Xuan Che (http://www.flickr.com/people/rosemania/) CC BY-2.0 (http://
creativecommons.org/licenses/by/2.0/deed.en) !
!
Terracotta Warrior (http://www.flickr.com/photos/59627558@N00/4677378806/) by fixermark (http://www.flickr.com/photos/59627558@N00/) CC BY 2.0 (http://
creativecommons.org/licenses/by/2.0/deed.en)!
!
Mmmmm Chocolate [274/366] (http://www.flickr.com/photos/sackton/8041853745) by Tim Sackton (http://www.flickr.com/photos/sackton/) CC BY-SA 2.0 (http://
creativecommons.org/licenses/by-sa/2.0/deed.en)!
18