Part3 2 Algorithm Full
Part3 2 Algorithm Full
Prescriptive Analytics
Discrete Optimization 2
IEDA 3010
Discrete Optimization - Algorithm
Dr. Jin QI
Department of Industrial Engineering and Decision Analytics
Hong Kong University of Science and Technology
IEDA 3010
Prescriptive Analytics
Discrete Optimization 2
Introduction
• “Natural solutions” for IP problems include
– Solve LP relaxations and round the non-integer values to
integers, since IP problems are LP problems with integer
restrictions
– Exhaustive enumeration, since pure IP problems with a
bounded feasible region have a finite number of feasible
solutions
2
gramming problems, sometimes it is tempting to use the appro
IEDA 3010
ply applying the simplex method to the LP Prescriptive Analyticsand then
relaxation
values to integers in the resulting solution. ThisOptimization
Discrete approach 2 may
Maximize Z ! x2,
subject to
1
"x1 # x2 $ %%
2
1
"x1 # x2 $ 3%%
2
and
x1 & 0, x2 & 0
x1, x2 are integers.
As Fig. 11.2 shows, the optimal solution for the LP relaxation
3 is
1_464-536.qxd 11/19/08 08:33 AM Page 490
IEDA 3010
Prescriptive Analytics
Discrete Optimization 2
3
( , 2)
2
2
URE 11.2
ample of an IP problem Feasible region for
the optimal solution the LP relaxation
LP relaxation cannot
nded in any way that
feasibility. 0 1 2 3 4 x1
4
example of an IP problem Feasible region for
ere the optimal solution the LP relaxation IEDA 3010
the LP relaxation cannot Prescriptive Analytics
Discrete Optimization 2
rounded in any way that
ains feasibility. 0 1 2 3 4
LP relaxation and rounding
• Even if an optimal LP solution
integer solution. In fact, itismay
rounded
even be far from optimal in terms
successfully,jective
it may be far
function. Thisfrom
fact isoptimal
illustrated by the following problem:
Maximize Z ! x1 " 5x2,
subject to
x1 " 10x2 # 20
x1 # 2
and
x1 $ 0, x2 $ 0
x1, x2 are integers.
Because there are only two decision variables, this problem can b
as shown in Fig. 11.3. Either the graph or the simplex method m
the optimal solution for the LP relaxation is x1 ! 2, x2 ! 5%95%, with
IEDA 3010
Prescriptive Analytics
Discrete Optimization 2
LP11.6relaxation and
THE BRANCH-AND-BOUND rounding
TECHNIQUE AND ITS APPLICATION
x2
Optimal IP solution
3
1
RE 11.3 Rounded solution
mple where rounding
mal solution for the
ation is far from
for the IP problem. 0 1 2 3 x1
6 types
for various combinatorial problems such as IP problems. Three prominent
IEDA 3010
Prescriptive Analytics
Discrete Optimization 2
Exhaustive enumeration
• Unlike LP problems, optimal solutions are not
necessarily corner points of the feasible region
– The number of feasible solutions may be huge
7
IEDA 3010
Prescriptive Analytics
Discrete Optimization 2
Branch-and-Bound Method
• Basic idea: divide and conquer
– Divide
• Partition the entire set of feasible solutions into smaller and
smaller subsets (branching)
– Conquer
• Bound how good the best solution in the subset can be
(bounding)
• Discard the subset if its bound indicates that it cannot possibly
contain an optimal solution for the original problem (fathoming)
8
and smaller subsets. The conquering ( fathoming) is done partially by bo
the best solution in the subset can be and then discardingIEDA the
3010 subset if it
Prescriptive Analytics
that it cannot possibly contain an optimal solution for the
Discrete original
Optimization 2 prob
We shall now describe in turn these three basic steps—branchin
B&B for Binary IP Problems
fathoming—and illustrate them by applying a branch-and-bound algori
type example (the California Manufacturing Co. problem) presented in
peated here (with the constraints numbered for later reference).
Maximize Z ! 9x1 " 5x2 " 6x3 " 4x4,
subject to
(1) 6x1 " 3x2 " 5x3 " 2x4 # 10
(2) 3 " 3x2 " 5x3 " 2x4 # 1
(3) $x1 " 3x3 # 0
(4) x1 "$x2 " 5x3 " x4 # 0
and
(5) xj is binary, for j ! 1, 2, 3, 4.
Branching
When you are dealing with binary variables, the most straightforward w
set of feasible solutions into subsets is to fix the value of one of9the var
492 CHAPTER 11 INTEGER PROGRAMMING
IEDA 3010
Prescriptive Analytics
Discrete Optimization 2
some success to a variety of OR problems, but it is especia
cation to IP problems.
B&B for Binary IP Problems The basic concept underlying the branch-and-bound tec
quer. Since the original “large” problem is too difficult to be
into smaller and smaller subproblems until these subproblem
• Bounding viding (branching) is done by partitioning the entire set of f
and smaller subsets. The conquering ( fathoming) is done par
– LP relaxation
(5) 0 xj 1,the best forsolution
j = in1,the
2,subset
3, 4 can be and then discarding the
(x , x , x , xthat
) it cannot
= 5 possibly contain an optimal solution for
, 1, 0, 1 , with Z = 16 1 the o
– LP solution 1 2 3 4 6 now describe in turn these three basic
We shall 2 steps
5 – 1LP, valuewith Z = 16 1
4 ) = 6 , 1, 0,
fathoming—and illustrate them by applying a branch-and-b
2 type example (the California Manufacturing Co. problem) p
und for whole – Bound
problem: Z 16 peated here (with the constraints numbered for later referen
Maximize Z ! 9x1 " 5x2 " 6x3 " 4x4,
subject to
(1) 6x1 " 3x2 " 5x3 " 2x4 # 10
(2) 3 " 3x2 " 5x3 " 2x4 # 1
(3) $x1 " 3x3 # 0
(4) x1 "$x2 " 5x3 " x4 # 0
and
(5) xj is binary, for j ! 1, 2, 3, 4.
10
IEDA 3010
Prescriptive Analytics
Discrete Optimization 2
All
x1 = 1
11
and Fix x1 ! 0 so the resulting subproblem reduces to
(5) xj is binary, for j ! 1, 2, 3, 4. Maximize Z ! 5x2 " 6x3 " IEDA
4x4, 3010
Prescriptive Analytics
subject to Discrete Optimization 2
Branching
(1) 3x2 " 5x3 " 2x4 # 10
When you are dealing with binary variables, the most straightforward wayx3to"partition
x4 # the
B&B for Binary IP Problems
x1 ! 0 for one subset and at x1 ! 1 for the other subset. (4)
(2)
set of feasible solutions into subsets is to fix the value of(3)
one of the variables
Doing this
x3 (say,#x1)0at
1
13
IEDA 3010
Prescriptive Analytics
Discrete Optimization 2
x1 = 0
9
(0, 1, 0, 1)
All
16
(⅚, 1, 0, 1) x1 = 1
16
(1, ⅘, 0, ⅘)
14
IEDA 3010
Prescriptive Analytics
Discrete Optimization 2
Branching
x1
variable
Sub1
F(1)
x1 = 0
9 = Z*
(0, 1, 0, 1)
All = incumbent
16
(⅚, 1, 0, 1) Sub2
x1 = 1
16
(1, ⅘, 0, ⅘)
16
IEDA 3010
Prescriptive Analytics
Discrete Optimization 2
17
Fix x1 ! 1, x2 ! 0 so the resulting subproblem reduces to
ping around in the branching tree by selecting the subproblem with the best bound.
Maximize Z ! 9 " 6x3 " 4x4,
IEDA 3010
Completing the Example Prescriptive Analytics
subject to
The pattern for the remaining iterations will be quite similar to that for the first iteration de- Discrete Optimization 2
(1) 5x3 " 2x4 # 4
scribed above except for the ways in which fathoming occurs. Therefore, we shall summa-
(2) x3 " x4 # 1
Iteration 2
rize the branching and bounding steps fairly briefly and then focus on the fathoming step.
(3) x3 #1
Iteration 2. The only remaining subproblem corresponds to the (4)x1 ! 1 node inx4Fig.
# 011.6,
so we shall branch from this node to create the two new subproblems (5) given below.
xj is binary, for j ! 3, 4.
Subproblem 3: Subproblem 4:
Fix x1 ! 1, x2 ! 0 so the resulting subproblem reduces to Fix x1 ! 1, x2 ! 1 so the resulting subproblem reduces to
Maximize Z ! 9 " 6x3 " 4x4, Maximize Z ! 14 " 6x3 " 4x4,
subject to subject to
(1) 5x3 " 2x4 # 4 (1) 5x3 " 2x4 # 1
(2) x3 " x4 # 1 (2) x3 " x4 # 1
(3) x3 # 1 (3) x3 # 1
(4) x4 # 0 (4) x4 # 1
(5) xj is binary, for j ! 3, 4. (5) xj is binary, for j ! 3, 4.
Subproblem 4: The LP relaxations of these subproblems are obtained by addin
LPxrelaxation:
Fix LP relaxation:
1 ! 1, x2 ! 1 so the resulting subproblem reduces to straint shown below into the relaxed version of constraint (5). Their o
(5) 0 xj 1, for j = 3, 4 are
(5)shown
0 below.
xj 1, for j = 3, 4
Maximize Z ! 14 " 6x3 " 4x4,
Optimal solution: Optimal solution:
subject to
(x1 , x2 , x3 , x4 ) = 1, 0, 45 , 0 , with Z = 13 45 (x1LP
, x2relaxation
, x3 , x4 ) of
= subproblem
1, 1, 0, 12 3:, (5) x1 $ 1, x2 # 0, and
with Z = 16
(1) Z5x≤ for j ! 1, 2, 3, 4.
Bound: 3"132x4 # 1 Bound: Z ≤ 16
(2) x3 " x4 # 1
(3) x3 #1
(4) x4 # 1
(5) xj is binary, for j ! 3, 4.
18
The LP relaxations of these subproblems are obtained by adding the additional con-
IEDA 3010
Prescriptive Analytics
Discrete Optimization 2
Branching
x1 x2
variable
Sub1
F(1)
x1 = 0
9 = Z*
(0, 1, 0, 1)
All Sub3
= incumbent
x2 = 0
16 13
(⅚, 1, 0, 1) Sub2 (1, 0, ⅘, 0)
x1 = 1
16
Sub4
x2 = 1
16
(1, 1, 0, ½)
19
the existence of an optimal solution). Alas, test 3 fails as well, because both optimal so-
lutions include variables with noninteger values.
Figure 11.7 shows the resulting branching tree at this point. The lack of an F to the IEDA 3010
hil76299_ch11_464-536.qxd 11/19/08 08:33 AM Page 498
right of either new node indicates that both remain unfathomed. Prescriptive Analytics
Discrete Optimization 2
Iteration 3. So far, the algorithm has created four subproblems. Subproblem 1 has been
fathomed, and subproblem 2 has been replaced by (separated into) subproblems 3 and 4,
Iteration 3
but these last two remain under consideration. Because they were created simultaneously,
but subproblem 4 (x1 ! 1, x2 ! 1) has the larger bound (16 % 13), the next branching is
done from the (x1, x2) ! (1, 1) node
498in the branching tree, which CHAPTER
creates the11following
INTEGER PROGRAMMING
new subproblems (where constraint 3 disappears because it does not contain x4).
Subproblem 5: Subproblem 6:
Fix x1 ! 1, x2 ! 1, x3 ! 0 so the resulting subproblem reduces to Fix x1 ! 1, x2 ! 1, x3 ! 1 so the resulting subproblem reduces to
Maximize Z ! 14 & 4x4, Maximize Z ! 20 " 4x4,
subject to subject to
(1) 2x4 $ 1 (1) 2x4 # $4
(2), (4) x4 $ 1 (twice) (2) x4 # $0
(5) x4 is binary. (4) x4 # $1
(5) x4 is binary.
LP relaxation:
Variable: x1 x2 LPThe corresponding LP relaxations have the relaxed version of constraint
relaxation:
timal solution, and the bound (when it exists) shown below.
er (5) 0 x4 1 (5) 0 x4 1
branch- x1 = 0 F(3) LP relaxation of subproblem 5:
or the Optimal solution: Optimal solution: None since no feasible
9 ! Z* (5) x1 % 1, x2 % 1, x3 # 0, and 0 # xj # 1
1, 0, 12
(x1 , x2 , x3 ,(0,x41,)0,=1) !1,incumbent , with Z = 16 solution for j ! 1, 2, 3, 4.
All
Bound: Z ≤ 16 Bound: None
! "
x2 = 0 1
Optimal solution: (x , x , x , x ) ! 1, 1, 0, && ,
1 2 3 4 w
2
16
13 Bound: Z # 16.
x1 = 1
( )
1, 0, 4 , 0
5 LP relaxation of subproblem 6:
16 (5) x1 % 1, x2 % 1, x3 % 1, and 0 # xj # 1
x2 = 1 for j ! 1, 2, 3, 4.
Optimal solution: None since there are no feasib
16
(1, 1, 0, 12 ) Bound: None
20
For both of these subproblems, the relaxed version of constraint (5) has the eff
IEDA 3010
Prescriptive Analytics
Discrete Optimization 2
Branching
x1 x2 x3
variable
Sub1
F(1)
x1 = 0
9 = Z*
(0, 1, 0, 1)
All Sub3
= incumbent
x2 = 0
16 13
(⅚, 1, 0, 1) Sub2 (1, 0, ⅘, 0) Sub5
x1 = 1 x3 = 0
16 16
Sub4
x2 = 1 (1, 1, 0, ½)
16
Sub6
F(3)
x3 = 1
21
IEDA 3010
Prescriptive Analytics
Discrete Optimization 2
22
IEDA 3010
Prescriptive Analytics
Discrete Optimization 2
Branching
x1 x2 x3 x4
variable
Sub1
F(1)
x1 = 0
9
Sub7 F(1)
All Sub3 F(2) x4 = 0
x2 = 0 14 = Z*
16 13 (1, 1, 0, 0)
(⅚, 1, 0, 1) Sub2 (1, 0, ⅘, 0) Sub5 = incumbent
x1 = 1 x3 = 0 (optimal)
16 16
Sub4
x2 = 1 (1, 1, 0, ½)
Sub8
16 F(3)
Sub6 x4 = 1
F(3)
x3 = 1
23
IEDA 3010
Prescriptive Analytics
Discrete Optimization 2
B&BAnfor Mixed
MIP Example. IPnowProblems
We will illustrate this algorithm by applying it to th
ing MIP problem:
Maximize Z ! 4x1 " 2x2 # 7x3 " x4,
subject to
x1 # 5x3 $ 10
x1 # x2 " x3 $ 1
6x1 " 5x2 " 2x4 $ 0
"x1 5x2 # 2x3 " 2x4 $ 3
and
xj % 0, for j ! 1, 2, 3, 4
xj is an integer, for j ! 1, 2, 3.
Note that the number of integer-restricted variables is I ! 3, so x4 is the only co
variable.
26
IEDA 3010
Prescriptive Analytics
Discrete Optimization 2
27
IEDA 3010
Prescriptive Analytics
Discrete Optimization 2
Sub1
x1 ≤ 1
14⅕
(1, 1⅕, 1⅘, 0)
All
14¼
(1¼, 1½, 1¾, 0) Sub2
F(3)
x1 ≥ 2
28
IEDA 3010
Prescriptive Analytics
Discrete Optimization 2
29
IEDA 3010
Prescriptive Analytics
Discrete Optimization 2
30
IEDA 3010
Prescriptive Analytics
Discrete Optimization 2
32
IEDA 3010
Prescriptive Analytics
Discrete Optimization 2
Summary
• Branching
– BIP: fix the branching variable to either 0 or 1
– MIP: dispatch the branching variable to two ranges
• Ranges are determined by its value in the LP optimal solution
• Bounding
– BIP: rounding down non-integer values
– MIP: rounding down may not be necessary
• Fathoming:
– Test 1
• BIP: LP optimal solution has integer values for all variables
• MIP: LP optimal solution has integer values for the integer-
restricted variables
– Test 2: bound ≤ Z*
– Test 3: no feasible solutions 33