Lecture 3.a - Exact Methods PDF
Lecture 3.a - Exact Methods PDF
Lectures 3.a
Heuristic Optimization Methods:
Overview of exact methods
Slides prepared by Nina Skorin-Kapov
Zavod za telekomunikacije 2
Some exact methods:
University of Zagreb, Croatia
Zavod za telekomunikacije 3
Outline
University of Zagreb, Croatia
Zavod za telekomunikacije 4
Linear programming (LP)
University of Zagreb, Croatia
Zavod za telekomunikacije 5
LP Example
University of Zagreb, Croatia
Zavod za telekomunikacije 6
LP Example – LP formulation
University of Zagreb, Croatia
Objective
Max 2.25x1 + 4x2
Function
s.t. x1 < 7
Problem specific
x1 + 2x2 < 10
constraints
x1 + x 2 < 8
Zavod za telekomunikacije 7
LP Example: Graphical Solution
University of Zagreb, Croatia
8
7 x1 = 7
6
Feasible points
5 for first constraint
4
3
2
(7, 0)
1
x1
1 2 3 4 5 6 7 8 9 10
Zavod za telekomunikacije 8
LP Example: Graphical Solution
University of Zagreb, Croatia
8
7
(0, 5)
6
5 x1 + 2x2 = 10
4
3 Feasible points
2 for second constraint
(10, 0)
1
x1
1 2 3 4 5 6 7 8 9 10
Zavod za telekomunikacije 9
LP Example: Graphical Solution
University of Zagreb, Croatia
Zavod za telekomunikacije 10
LP Example 1: Graphical Solution
University of Zagreb, Croatia
8 x1 + x2 = 8
7
6 x1 = 7
5
4
3
Feasible x1 + 2x2 = 10
2
Region
1
x1
1 2 3 4 5 6 7 8 9 10
Zavod za telekomunikacije 11
LP Example: Graphical Solution
University of Zagreb, Croatia
8
7
6 (0, 4.5) Possible objective Function line
5 2.25x1 + 4x2 = 18
4
3
2 Feasible
1 Region (8, 0)
x1
1 2 3 4 5 6 7 8 9 10
Zavod za telekomunikacije 12
LP Example: Graphical Solution
University of Zagreb, Croatia
Zavod za telekomunikacije 13
LP Example: Graphical Solution
University of Zagreb, Croatia
8 Objective
7 function grows
6
5 Obj. function =
20
4
18
3 16
2 Feasible
1 Region
x1
1 2 3 4 5 6 7 8 9 10
Zavod za telekomunikacije 14
LP Example: Graphical Solution
University of Zagreb, Croatia
Optimal solution
x2
Maximum
8
Objective Function Line
7 2.25x1 + 4x2 = 21.5
6
5 Optimal Solution
4
(x1 = 6, x2 = 2)
3
2
Feasible
1
Region
x1
1 2 3 4 5 6 7 8 9 10
Zavod za telekomunikacije 15
Solving linear programs
University of Zagreb, Croatia
Zavod za telekomunikacije 17
Simplex
University of Zagreb, Croatia
Zavod za telekomunikacije 18
Interior point methods
University of Zagreb, Croatia
Zavod za telekomunikacije 19
Outline
University of Zagreb, Croatia
Zavod za telekomunikacije 20
Integer linear programming (ILP or IP)
University of Zagreb, Croatia
Zavod za telekomunikacije 21
Why is IP more difficult than LP: Example
University of Zagreb, Croatia
max 3 x1 + 2 x2
subject to : x2
3 x1 + x2 9 -x1 + x2 < 1
x1 + 3 x2 7 5
3x1 + x2 < 9
− x1 + x2 1
4
x1 , x2 0, x1 , x2 integer Max 3x1 + 2x2
3
Optimum LP (2.5,1.5)
2
x1 + 3x2 < 7
Solution space = 1
feasible solutions x1
are the integer 1 2 3 4 5 6 7
points in the
shaded region
Zavod za telekomunikacije 22
Why is IP more difficult than LP: Example
University of Zagreb, Croatia
Zavod za telekomunikacije 23
Why is IP more difficult than LP: Example
University of Zagreb, Croatia
Zavod za telekomunikacije 24
LP-relaxation
University of Zagreb, Croatia
Zavod za telekomunikacije 25
Outline
University of Zagreb, Croatia
Zavod za telekomunikacije 26
Branch and Bound
University of Zagreb, Croatia
Zavod za telekomunikacije 28
Example – IP formulation & LP-relaxation
University of Zagreb, Croatia
Initialization:
Max Z=2x1 + 3x2 1. Solve the LP-
s.t. 195x1 +273x2 < 1365 relaxation
4x1 + 40x2 < 140
x1 < 4
Solution to the LP-
Drop the x1 > 0 and x2 > 0 relaxation:
integrality x1, x2 integer Z=14.66
constraints (x1, x2)=(2.44, 3.26)
IP!
Zavod za telekomunikacije 29
Root node
University of Zagreb, Croatia
Initialization:
2. Find a feasible solution
E.g., rounding:
rounding
(x1, x2)=(2.44, 3.26) (x1, x2)=(2, 3)
Z = 13
Check feasibility:
195x1 +273x2 < 1365
4x1 + 40x2 < 140 Incumbent
x1 < 4 solution
Z*=13
x1 > 0 and x2 > 0
Zavod za telekomunikacije 31
Branching
University of Zagreb, Croatia
Zavod za telekomunikacije 32
Branching
University of Zagreb, Croatia
Choose 1 Original
branching UB=14 problem 1
variable (x1,x2)=
x1=2.44 (2.44,3.26)
x1 2 x1 3
Subproblem 3
Subproblem 2
2 3
Zavod za telekomunikacije 33
Subproblems
University of Zagreb, Croatia
s.t. 195x1 +273x2 < 1365 s.t. 195x1 +273x2 < 1365
4x1 + 40x2 < 140 4x1 + 40x2 < 140
x1 < 4 x1 < 4
x1 < 2 x1 ≥ 3
x1 > 0 and x2 > 0 x1 > 0 and x2 > 0
x1, x2 integer x1, x2 integer
New
constraints
Zavod za telekomunikacije 34
Subproblems
University of Zagreb, Croatia
Solve LP-relaxation of
Subproblem 2:
Z=13.9
Subproblem 2 (SP2) (x1, x2)=(2, 3.3)
Max Z=2x1 + 3x2
Since the coefficients in Z are
s.t. 195x1 +273x2 < 1365 integral→ Upper bound on SP2
4x1 + 40x2 < 140 UB(SP2)=13
x1 < 4
x1 < 2
2
x1 > 0 and x2 > 0
UB=13
x1, x2 integer (x1, x2)=
(2, 3.3)
Zavod za telekomunikacije 35
Subproblems
University of Zagreb, Croatia
Solve LP-relaxation of
Subproblem 3:
Subproblem 3 (SP3) Z=14.52
(x1, x2)=(3, 2.86)
Max Z=2x1 + 3x2
Zavod za telekomunikacije 36
1st Branching Iteration
University of Zagreb, Croatia
1
UB(IP)=14 Z*=13
(x1,x2)=
(2.44,3.26)
x1 2 x1 3
2 3
UB=13 UB=14
(x1, x2)= (x1, x2)=
(2, 3.3) (3, 2.86)
Zavod za telekomunikacije 37
Fathoming tests
University of Zagreb, Croatia
Zavod za telekomunikacije 38
Node 2 – fathoming tests
University of Zagreb, Croatia
FATHOMING TESTS
1. LP-relaxation infeasible Z*=13
2. UB(node)of a node ≤ Z*
3. OPT(node) found
2
1. LP solution feasible UB=13
2. UB(SP2)=13 ≤ Z*=13 (x1, x2)=
(2, 3.3)
Conquered by test 2 :
The best solution to subproblem
2 is 13, and we already found CONQUERED
such a solution so it’s a waste of
time to look for another
Zavod za telekomunikacije 39
Node 3 – fathoming tests
University of Zagreb, Croatia
FATHOMING TESTS
1. LP-relaxation infeasible Z*=13
2. UB(node)of a node ≤ Z*
3. OPT(node) found
3
UB=14
1. LP solution feasible (x1, x2)=
2. UB(SP3)=14 ≤ Z*=13 (3, 2.86)
3. LP solution is not integral
Zavod za telekomunikacije 40
2nd Branching Iteration
University of Zagreb, Croatia
1 Z*=13
UB(IP)=14
(x1,x2)=
(2.44,3.26)
Choose
branching
2 3 variable.
UB=13 UB=14 x1 is integral,
(x1, x2)= (x1, x2)= so choose
(2, 3.3) (3, 2.86) x2=2.86
x2 2 x2 3
4 5
Zavod za telekomunikacije 41
New Subproblems
University of Zagreb, Croatia
s.t. 195x1 +273x2 < 1365 s.t. 195x1 +273x2 < 1365
4x1 + 40x2 < 140 4x1 + 40x2 < 140
x1 < 4 x1 < 4
x1 ≥ 3 x1 ≥ 3
x2 < 2 x2 ≥ 3
x1 > 0 and x2 > 0 x1 > 0 and x2 > 0
x1, x2 integer x1, x2 integer
Constraints New
from SP3 constraints
Zavod za telekomunikacije 42
New Subproblems
University of Zagreb, Croatia
Solve LP-relaxation of
Subproblem 4 (SP4) Subproblem 4:
Z=14
Max Z=2x1 + 3x2 (x1, x2)=(4,2)
Zavod za telekomunikacije 43
New Subproblems
University of Zagreb, Croatia
Subproblem 5 (SP5)
Solve LP-relaxation of
Max Z=2x1 + 3x2 Subproblem 5→ No solution!
s.t. 195x1 +273x2 < 1365
4x1 + 40x2 < 140
x1 < 4 5
x1 ≥ 3 No solution,
x2 ≥ 3 LP-relax
x1 > 0 and x2 > 0 infeasible
x1, x2 integer INFEASIBLE!!!
Zavod za telekomunikacije 44
2nd Branching Iteration
University of Zagreb, Croatia
1
UB(IP)=14 Z*=13
(x1,x2)=
(2.44,3.26)
2 3
UB=13 UB=14
(x1, x2)= (x1, x2)=
(2, 3.3) (3, 2.86)
x2 2 x2 3
4 5
UB=14 No solution,
(x1, x2)= LP-relax
(4,2) infeasible
Zavod za telekomunikacije 45
Node 4 – fathoming tests
University of Zagreb, Croatia
FATHOMING TESTS
1. LP-relaxation infeasible
Z*=13
2. UB(node)of a node ≤ Z*
3. OPT(node) found
4
UB=14
1. LP solution feasible (x1, x2)=
2. UB(SP4)=14 ≤ Z*=13 (4,2)
3. LP solution is integral
Conquered by test 3
Solution to the LP-relaxation = CONQUERED
14 is better than incumbent Z*=14
solution Z* =13 → new Z*=14
Zavod za telekomunikacije 46
Node 5 – fathoming tests
University of Zagreb, Croatia
FATHOMING TESTS
1. LP-relaxation infeasible Z*=14
2. UB(node)of a node ≤ Z*
3. OPT(node) found
5
No solution,
1. LP solution infeasible LP-relax
infeasible
Conquered by test 1
CONQUERED
Zavod za telekomunikacije 47
2nd Fathoming Iteration
University of Zagreb, Croatia
1
UB(IP)=14
Z*=14 When all nodes
(x1,x2)=
(2.44,3.26)
are conquered→
STOP.
Z* is the optimal
2 3
UB=13 UB=14
solution to the
(x1, x2)= (x1, x2)= original IP
(2, 3.3) (3, 2.86)
x2 2 x2 3
4 5
UB=14 No solution,
(x1, x2)= LP-relax
(4,2) infeasible
Zavod za telekomunikacije 48
Branch and Bound algorithm
University of Zagreb, Croatia
1. Initialization
1. Solve LP-relaxation of the original problem; get UB on IP problem
2. Find any feasible itegral solution (e.g. rounding) → Z*
2. Branching iterations
1. Branching
1. Choose an unconquered node n (e.g. the last created or with max UB)
2. Choose a branching variable xi (e.g. furthest from integer at node n)
3. Make 2 new nodes (subproblems) with constraints:
xi xi (LP ) xi xi (LP )
2. Solve LP-relaxation of new subproblems and find their UBs
3. Perform fathoming tests to try to conquer the new nodes
3. Optimality check
1. If there are unconquered nodes, go to Step 2. Otherwise, STOP and
Z* is the optimal solution
Zavod za telekomunikacije 49
Branch and Cut
University of Zagreb, Croatia
Zavod za telekomunikacije 50