SOLVING INTEGER LINEAR PROGRAMS

93
SOLVING INTEGER LINEAR PROGRAMS 1. Solving the LP relaxation. 2. How to deal with fractional solutions?

Transcript of SOLVING INTEGER LINEAR PROGRAMS

Page 1: SOLVING INTEGER LINEAR PROGRAMS

SOLVING INTEGER LINEAR PROGRAMS 1. Solving the LP relaxation. 2. How to deal with fractional solutions?

Page 2: SOLVING INTEGER LINEAR PROGRAMS

Integer Linear Program: Example max �x1 � 2x2 � 0.5x3 � 0.2x4 � x5 + 0.6x6

s.t. x1 + 2x2 � 1

x1 + x2 + 3x6 � 1

x1 + x2 + x6 � 1

x3 � 3x4 � 1

x3 � 2x4 � 5x5 � 1

x4 + 3x5 � 4x6 � 1

x2 + x5 + x6 � 1

0 x1, x2, · · · , x6 10

x1, . . . , x6 2 Z

Page 3: SOLVING INTEGER LINEAR PROGRAMS

Solving ILPs var x1 integer >= 0, <= 10; var x2 integer >= 0, <= 10; var x3 integer >= 0, <= 10; var x4 integer >= 0, <= 10; var x5 integer >= 0, <= 10; var x6 integer >= 0, <= 10; maximize obj: -x1- 2* x2 -0.5*x3- 0.2* x4 - x5 +0.5* x6; c1: x1 + 2 * x2 >= 1; c2: x1 + x2 + 3* x6 >= 1; c3: x1 + x2 + x6 >= 1; c4: x3 - 3* x4 >= 1; c5: x3 - 2* x4 -5* x5 >= 1; c6: x4 + 3* x5 -4 *x6 >= 1; c7: x2 + x5 + x6 >= 1; solve; display x1, x2,x3, x4, x5, x6; end;

Page 4: SOLVING INTEGER LINEAR PROGRAMS

Solution Original ILP LP Relaxation

x1.val = 0 x2.val = 1 x3.val = 4 x4.val = 1 x5.val = 0 x6.val = 0 Optimal Value: -4.2

x1.val = 0.333333333333333 x2.val = 0.666666666666667 x3.val = 2.66666666666667 x4.val = 0 x5.val = 0.333333333333333 x6.val = 0 Optimal Value: -3.333333

Page 5: SOLVING INTEGER LINEAR PROGRAMS

Case-1: Both LP and ILP are feasible.

Opt. Solution of ILP

Opt. Solution of LP relaxation

Page 6: SOLVING INTEGER LINEAR PROGRAMS

Solving ILPs Solve LP relaxation of the ILP. Case-1: LP relaxation solution satisfies integrality constraint. Case-2: LP relaxation solution does not satisfy the integrality constraint.

Page 7: SOLVING INTEGER LINEAR PROGRAMS

Dealing with Case-2 Branch and Bound Cutting Plane Method.

1

2

Page 8: SOLVING INTEGER LINEAR PROGRAMS

BRANCH-AND-BOUND: BASIC IDEA

Page 9: SOLVING INTEGER LINEAR PROGRAMS

Integer Linear Program: Example max �x1 � 2x2 � 0.5x3 � 0.2x4 � x5 + 0.6x6

s.t. x1 + 2x2 � 1

x1 + x2 + 3x6 � 1

x1 + x2 + x6 � 1

x3 � 3x4 � 1

x3 � 2x4 � 5x5 � 1

x4 + 3x5 � 4x6 � 1

x2 + x5 + x6 � 1

0 x1, x2, · · · , x6 10

x1, . . . , x6 2 Z

Page 10: SOLVING INTEGER LINEAR PROGRAMS

Step #1: Solve the LP relaxation Solving the LP relaxation.

x1.val = 0.333333333333333 x2.val = 0.666666666666667 x3.val = 2.66666666666667 x4.val = 0 x5.val = 0.333333333333333 x6.val = 0 Optimal Value (LP relaxation): -3.333333

Page 11: SOLVING INTEGER LINEAR PROGRAMS

Step #2: Choose a branch variable

x1.val = 0.333333333333333 x2.val = 0.666666666666667 x3.val = 2.66666666666667 x4.val = 0 x5.val = 0.333333333333333 x6.val = 0 Optimal Value (LP relaxation): -3.333333

Choose a variable that

should be integer

Page 12: SOLVING INTEGER LINEAR PROGRAMS

Step #3: Branching Constraints max �x1 � 2x2 � 0.5x3 � 0.2x4 � x5 + 0.6x6

s.t. x1 + 2x2 � 1

x1 + x2 + 3x6 � 1

x1 + x2 + x6 � 1

x3 � 3x4 � 1

x3 � 2x4 � 5x5 � 1

x4 + 3x5 � 4x6 � 1

x2 + x5 + x6 � 1

0 x1, x2, · · · , x6 10

Original Problem

Original Problem Constr. +

( x3 <= 2 )

Original Problem Constr. +

( x3 >= 3 )

b1 b2

Page 13: SOLVING INTEGER LINEAR PROGRAMS

Visualization

x3 >= 3 x3 <= 2

Page 14: SOLVING INTEGER LINEAR PROGRAMS

Branch-and-Bound

Original Problem (LP Relaxation)

Orig. Problem +

xj bsjc

Orig. Problem +

xj � dsje

P1

P2

P0

Non Integral Solution

xj : sj

Orig. Problem

xj bsjc

xk btkc

Orig. Problem

xj bsjc

xk � dtke

P3

P4

xk : sk

Page 15: SOLVING INTEGER LINEAR PROGRAMS

Branch-And-Bound: Operations Branch-And-Bound Tree: Nodes are ILP instances.

P0

P1 P2

P5 P6 P3 P4

P7 P8

P “Regular” Node

Leaves

Page 16: SOLVING INTEGER LINEAR PROGRAMS

Branch-And-Bound Tree 7 Regular Node (to be explored) Leaf node Leaf node m Leaf node

P0

P1 P2

P5 P6 P3 P4

P7 P8 Leaves

P0

P3

P4

P5

Expand Node

Page 17: SOLVING INTEGER LINEAR PROGRAMS

Expanding a Node 1.  Solve the LP relaxation for the node ILP.

2.  Three cases: 1.  Infeasible. 2.  Integral Solution. 3.  Fractional Solution.

Regular Node (unexplored) LP relaxation solution

Page 18: SOLVING INTEGER LINEAR PROGRAMS

Case-1: Infeasible LP relaxation. •  LP relaxation is infeasible.

Regular Node (unexplored)

Infeasible Leaf Node

Page 19: SOLVING INTEGER LINEAR PROGRAMS

Case-2: LP relaxation yields integral solution •  LP relaxation solution is integral: ILP solution = LP solution.

Regular Node (unexplored)

Integral Leaf Node

bestObjective := max (lpOptimum, bestObjective)

Page 20: SOLVING INTEGER LINEAR PROGRAMS

Case-3: LP relaxation yields a fractional solution •  LP relaxation yields a fractional solution.

Regular Node (unexplored)

LP relaxation solution: x1: … x2: … x3: … … Opt. Solution: optSolution

Regular Node (unexplored)

Regular Node (unexplored)

Regular Node (explored)

xj bsjc xj � dsje

Page 21: SOLVING INTEGER LINEAR PROGRAMS

Optimal Pruning

Regular Node (explored)

LP relaxation solution: x1: … x2: … x3: … … Opt. Solution: optSolution optSolution <= bestObjective?

Page 22: SOLVING INTEGER LINEAR PROGRAMS

Optimal Pruning

P0

P1 P2

P5 P6 P3 P4

P7 P8

bestObjective

optSolution <= bestObjective

Page 23: SOLVING INTEGER LINEAR PROGRAMS

Branch-And-Bound Initial Node

Original ILP (unexplored

node)

bestObjective := -Infinity

Page 24: SOLVING INTEGER LINEAR PROGRAMS

BRANCH-AND-BOUND (EXAMPLE)

Page 25: SOLVING INTEGER LINEAR PROGRAMS

Original Problem var x1 integer >= 0, <= 10; var x2 integer >= 0, <= 10; var x3 integer >= 0, <= 10; var x4 integer >= 0, <= 10; var x5 integer >= 0, <= 10; var x6 integer >= 0, <= 10; maximize obj: -x1 - 2* x2 -0.5 * x3 - 0.2* x4 - x5 +0.5* x6; c1: x1 + 2 * x2 >= 1; c2: x1 + x2 + 3* x6 >= 1; c3: x1 + x2 + x6 >= 1; c4: x3 - 3* x4 >= 1; c5: x3 - 2* x4 -5* x5 >= 1; c6: x4 + 3* x5 -4 *x6 >= 1; c7: x2 + x5 + x6 >= 1; solve; display x1, x2,x3, x4, x5, x6; end;

Page 26: SOLVING INTEGER LINEAR PROGRAMS

Original ILP integer solution

x1.val = 0 x2.val = 1 x3.val = 4 x4.val = 1 x5.val = 0 x6.val = 0 Optimal Value: -4.200000

LP relaxation

x1.val = 0.333333333333333 x2.val = 0.666666666666667 x3.val = 2.66666666666667 x4.val = 0 x5.val = 0.333333333333333 x6.val = 0 Optimal Value: -3.333333

Page 27: SOLVING INTEGER LINEAR PROGRAMS

Initial Node

Original Problem (p0.ampl)

bestObjective := - Infinity x1.val = 0.333333333333333 x2.val = 0.666666666666667 x3.val = 2.66666666666667 x4.val = 0 x5.val = 0.333333333333333 x6.val = 0 Optimal Value: -3.333333

p1.ampl p2.ampl

x3 <= 2 x3 >= 3

Page 28: SOLVING INTEGER LINEAR PROGRAMS

Tree #1

Original Problem (p0.ampl)

bestObjective := - Infinity

p1.ampl p2.ampl

x3 <= 2 x3 >= 3

p1.ampl Infeasible!

p2.ampl x1.val = 0.4 x2.val = 0.55 x3.val = 3 x4.val = 0 x5.val = 0.4 x6.val = 0.05

Page 29: SOLVING INTEGER LINEAR PROGRAMS

BnB Tree p0

p1 p2

p3 p4

p3.ampl x1.val = 1 x2.val = 0 x3.val = 4.57142857142857 x4.val = 0 x5.val = 0.714285714285714 x6.val = 0.285714285714286 Optimal Value: -3.857143

p5 p6 p6.ampl x1.val = 1 x2.val = 0 x3.val = 5 x4.val = 0.333333333333333 x5.val = 0.666666666666667 x6.val = 0.333333333333333 Optimal Value: -4.066667

p7 p8

p8.ampl x1.val = 1 x2.val = 0 x3.val = 6 x4.val = 0 x5.val = 1 x6.val = 0.5 Optimal Value: -4.750000

Page 30: SOLVING INTEGER LINEAR PROGRAMS

BnB Tree p0

p1 p2

p3 p4

p5 p6

p7 p8

p4.ampl x1.val = 0 x2.val = 1 x3.val = 3 x4.val = 0.666666666666667 x5.val = 0.111111111111111 x6.val = 0 Optimal Value: -3.744444

p9 p10

p9.ampl x1.val = 0 x2.val = 1 x3.val = 4 x4.val = 1 x5.val = 0 x6.val = 0 Optimal Value: -4.2

p9

bestObjective = -4.2

p8.ampl x1.val = 1 x2.val = 0 x3.val = 6 x4.val = 0 x5.val = 1 x6.val = 0.5 Optimal Value: -4.750000

p8

Page 31: SOLVING INTEGER LINEAR PROGRAMS

BnB Tree p0

p1 p2

p3 p4

p5 p6

p7 p8

p9 p10 p9

bestObjective = -4.2

p8

p10.ampl x1.val = 0 x2.val = 1 x3.val = 3 x4.val = 0 x5.val = 0.333333333333333 x6.val = 0 Optimal Value: -3.833333 p11 p12

p12.ampl x1.val = 0 x2.val = 1 x3.val = 6 x4.val = 0 x5.val = 1 x6.val = 0.5 Optimal Value: -5.750000 p12

Page 32: SOLVING INTEGER LINEAR PROGRAMS

BnB Final Tree p0

p1 p2

p3 p4

p5 p6

p7 p8

p9 p10 p9

bestObjective = -4.2

p8 p11 p12 p12

x1.val = 0 x2.val = 1 x3.val = 4 x4.val = 1 x5.val = 0 x6.val = 0 Optimal Value: -4.200000

Page 33: SOLVING INTEGER LINEAR PROGRAMS

BRANCH-AND-BOUND METHOD Heuristics

Page 34: SOLVING INTEGER LINEAR PROGRAMS

BnB choices to be made • Which unexplored regular leaf node should I expand?

• How to choose the branching variables?

• Other tricks: •  Randomized rounding to find an integer solution?

•  Carrying out BnB at the dictionary level.

Page 35: SOLVING INTEGER LINEAR PROGRAMS

BRANCH-AND-BOUND Choice of unexplored node to expand

Page 36: SOLVING INTEGER LINEAR PROGRAMS

General Situation

Unexplored “frontier”

Which node should I examine first?

Page 37: SOLVING INTEGER LINEAR PROGRAMS

Branch-and-bound p0

p1 p2

p3 p4

p5 p6

p7 p8

Unexplored Nodes Q: Which one should

we examine first?

Page 38: SOLVING INTEGER LINEAR PROGRAMS

Goal • Minimize the number of nodes explored in the tree. • Which node should I expand first: •  Yield integral solutions. •  Improve the value of bestObjective.

Page 39: SOLVING INTEGER LINEAR PROGRAMS

Unexplored Node Selection Heuristic • Deepest node first. •  Select the node that has largest depth in the tree to explore first.

•  Best LP relaxation solution. •  Select the node whose LP relaxation has the best answer.

•  Breadth First •  Search breadth-first.

Page 40: SOLVING INTEGER LINEAR PROGRAMS

In Practice… •  ILPs come from some problem domain: •  eg., We are converting a minimum cost vertex cover computation to ILP.

•  Selection heuristics are best found by experimenting with a large set of problems from the domain.

•  There is no general rule, unfortunately.

Page 41: SOLVING INTEGER LINEAR PROGRAMS

BRANCH-AND-BOUND Choosing the branch variable

Page 42: SOLVING INTEGER LINEAR PROGRAMS

BnB Tree p0

p1 p2

p3 p4

p3.ampl x1.val = 1 x2.val = 0 x3.val = 4.57142857142857 x4.val = 0 x5.val = 0.714285714285714 x6.val = 0.285714285714286 Optimal Value: -3.857143

p5 p6 p6.ampl x1.val = 1 x2.val = 0 x3.val = 5 x4.val = 0.333333333333333 x5.val = 0.666666666666667 x6.val = 0.333333333333333 Optimal Value: -4.066667

p7 p8

p8.ampl x1.val = 1 x2.val = 0 x3.val = 6 x4.val = 0 x5.val = 1 x6.val = 0.5 Optimal Value: -4.750000

Page 43: SOLVING INTEGER LINEAR PROGRAMS

Original Problem var x1 integer >= 0, <= 10; var x2 integer >= 0, <= 10; var x3 integer >= 0, <= 10; var x4 integer >= 0, <= 10; var x5 integer >= 0, <= 10; var x6 integer >= 0, <= 10; maximize obj: -x1 - 2* x2 -0.5 * x3 - 0.2* x4 - x5 +0.5* x6; c1: x1 + 2 * x2 >= 1; c2: x1 + x2 + 3* x6 >= 1; c3: x1 + x2 + x6 >= 1; c4: x3 - 3* x4 >= 1; c5: x3 - 2* x4 -5* x5 >= 1; c6: x4 + 3* x5 -4 *x6 >= 1; c7: x2 + x5 + x6 >= 1; solve; display x1, x2,x3, x4, x5, x6; end;

Page 44: SOLVING INTEGER LINEAR PROGRAMS

BnB Final Tree p0

p1 p2

p3 p4

p5 p6

p7 p8

p9 p10 p9

bestObjective = -4.2

p8 p11 p12 p12

x1.val = 0 x2.val = 1 x3.val = 4 x4.val = 1 x5.val = 0 x6.val = 0 Optimal Value: -4.200000

Page 45: SOLVING INTEGER LINEAR PROGRAMS

Initial Node

Original Problem (p0.ampl)

bestObjective := - Infinity x1.val = 0.333333333333333 x2.val = 0.666666666666667 x3.val = 2.66666666666667 x4.val = 0 x5.val = 0.333333333333333 x6.val = 0 Optimal Value: -3.333333

p1.ampl p2.ampl

x3 <= 2 x3 >= 3

Page 46: SOLVING INTEGER LINEAR PROGRAMS

What if we chose a different branch variable..?

Original Problem (p0.ampl)

bestObjective := - Infinity

x5 <= 0 x5 >= 1

x1.val = 0.333333333333333 x2.val = 0.666666666666667 x3.val = 2.66666666666667 x4.val = 0 x5.val = 0.333333333333333 x6.val = 0 Optimal Value: -3.333333

q1.ampl (integer feasible)

q2.ampl

bestObjective := -4.2

x1.val = 0 x2.val = 0.5 x3.val = 6 x4.val = 0 x5.val = 1 x6.val = 0.5 Optimal Value: -4.750000 q2.ampl

Page 47: SOLVING INTEGER LINEAR PROGRAMS

How to select a branch variable? •  There are heuristics… •  But it is a hard problem, in general. •  User specifies a variable ordering or priority.

•  Solver heuristics: •  Choose fractional solution closest to an integer value? •  Choose binary (0-1) variables preferentially? •  Random choice?

•  The choice of a branch variable is very important.

•  There is no single “best heuristic”.

•  Often, some expertise with the problem domain informs the heuristic.

Page 48: SOLVING INTEGER LINEAR PROGRAMS

BRANCH-AND-BOUND At the dictionary level

Page 49: SOLVING INTEGER LINEAR PROGRAMS

Thus far • Use LP solver as a black box. •  This lecture: •  Consider how to fold branch-and-bound in a dictionary setup.

BnB Node (Solve LP relaxation) Final dictionary

Child # 1 Child # 2

Can I reuse the final dictionary?

Page 50: SOLVING INTEGER LINEAR PROGRAMS

View from the dictionary

BnB Node (Solve LP relaxation) Final dictionary

Child # 1

xj bsjc

xB b · · ·

z c0 +cN|xN

xB b · · ·w · · ·z c0 +cN

|xN

Claim: Dictionary D’ is always infeasible.

Page 51: SOLVING INTEGER LINEAR PROGRAMS

Proof (Pictorial)

x3 >= 3 x3 <= 2

Solution represented by dictionary D and D’

Page 52: SOLVING INTEGER LINEAR PROGRAMS

Example (ILP) var x1 >= 0, <= 10; var x2 >= 0, <= 10; var x3 >= 0, <= 10; maximize obj: x1 + x2 -5* x3 ; c1: -2* x1 + 7 *x2 <= 1; c2: x1 - 2 *x2 + 5* x3 <= 3; c3: x1 + x2 - 3 * x3 <= 7; solve; display x1, x2, x3; end;

x4 : 10� x1

x5 : 10� x2

x6 : 10� x3

x7 : 1 + 2x1 � 7x2

x8 : 3� x1 + 2x2 � 5x3

x9 : 7� x1 � x2 + 3x3

Slack variables are also integers.

Page 53: SOLVING INTEGER LINEAR PROGRAMS

Final Dictionary x4 4.33333333333 +0.333333x8 +0.666667x9 �0.333333x3

x5 8.66666666667 �0.333333x8 +0.333333x9 �2.666667x3

x6 10 �x3

x7 3 �3x8 +x9 �18x3

x1 5.66666666667 �0.333333x8 �0.666667x9 +0.333333x3

x2 1.33333333333 +0.333333x8 �0.333333x9 +2.666667x3

z 7.0 +0x8 �x9 �2x3

x1 � 6 x10 : �6 + x1

Page 54: SOLVING INTEGER LINEAR PROGRAMS

Dictionary After Branch x10 : �6 + x1

x4 4.3333333333 +0.333333x8 +0.666667x9 �0.333333x3

x5 8.66666666667 �0.333333x8 +0.333333x9 �2.666667x3

x6 10 �x3

x7 3 �3x8 +x9 �18x3

x1 5.66666666667 �0.333333x8 �0.666667x9 +0.333333x3

x2 1.33333333333 +0.333333x8 �0.333333x9 +2.666667x3

x10 �0.33333 �0.333333x8 �0.666667x9 +0.333333x3

z 7.0 +0x8 �x9 �2x3

Dictionary becomes primal infeasible. Back to initialization phase Simplex?

Page 55: SOLVING INTEGER LINEAR PROGRAMS

Dictionary After Branch

x4 4.3333333333 +0.333333x8 +0.666667x9 �0.333333x3

x5 8.66666666667 �0.333333x8 +0.333333x9 �2.666667x3

x6 10 �x3

x7 3 �3x8 +x9 �18x3

x1 5.66666666667 �0.333333x8 �0.666667x9 +0.333333x3

x2 1.33333333333 +0.333333x8 �0.333333x9 +2.666667x3

x10 �0.33333 �0.333333x8 �0.666667x9 +0.333333x3

z 7.0 +0x8 �x9 �2x3

Dictionary becomes primal infeasible. Dual Feasible Dictionary!! But not dual final.

Page 56: SOLVING INTEGER LINEAR PROGRAMS

How to update after branch? Parent Node

(Final Dictionary)

Child Node: 1.  Add new row. 2.  Primal Infeasible but Dual Feasible

Consider dual complement dictionary. (Feasible + but non-final)

Final dual dictionary (also final primal)

add branch constraint

Opt. Phase on dual dictionaries

LP relaxation solved for child node!

Page 57: SOLVING INTEGER LINEAR PROGRAMS

General Form Simplex Parent Node

(Final Dictionary)

Child Node: 1.  Add new row. 2.  Primal Infeasible but Dual Feasible

Consider dual complement dictionary. (Feasible + but non-final)

Final dual dictionary (also final primal)

add branch constraint

Opt. Phase on dual dictionaries

LP relaxation solved for child node!

Page 58: SOLVING INTEGER LINEAR PROGRAMS

General Form Dictionary • Give special treatment to bounds on variables.

• Modify the Simplex algorithm in two ways: •  Dictionaries now have special ways to track bounds. •  Pivoting is modified.

l x u

Page 59: SOLVING INTEGER LINEAR PROGRAMS

Branch-and-Bound with General Form Parent Node

(Final Dictionary)

Child Node: 1.  Add new row. 2.  Primal Infeasible but Dual Feasible

Simply update variable bound.

Page 60: SOLVING INTEGER LINEAR PROGRAMS

CUTTING PLANE METHOD

Page 61: SOLVING INTEGER LINEAR PROGRAMS

LP Relaxation for ILP

Opt. Solution of ILP

Opt. Solution of LP relaxation

Page 62: SOLVING INTEGER LINEAR PROGRAMS

Removing a Fractional Solution Branch and Bound Cutting Plane Method.

1

2

Page 63: SOLVING INTEGER LINEAR PROGRAMS

Cutting Plane

How do we find a cutting plane?

Page 64: SOLVING INTEGER LINEAR PROGRAMS

GOMORY-CHVATAL CUTTING PLANE Part 1: Setting up the problem.

Page 65: SOLVING INTEGER LINEAR PROGRAMS

ILP in Standard Form

max c

|x

s.t. Ax b

x � 0

x 2 ZA, b, c are all assumed to be integers.

Page 66: SOLVING INTEGER LINEAR PROGRAMS

Conversion to standard from •  Recap from LP formulations lectures: •  Equality constraints into two inequalities. •  Rewrite in case is missing:

•  Convert ≥ to ≤ by negating both sides.

• How do we make sure A, b, c are integers?

xi 7! x

+i � x

�i

xi � 0

Reasonable assumption: original problem coefficients are rationals.

Page 67: SOLVING INTEGER LINEAR PROGRAMS

Integer Coefficients. max 2x1 +0.3x2 �0.1x3

s.t. 0.1x1 �2x2 �x3 0.25

0.5x1 �2.6x2 +1.3x3 0.15

x1, x2, x3 � 0

x1, x2, x4 2 Z

max 2x1 +0.3x2 �0.1x3 ⇥10

s.t. 0.1x1 �2x2 �x3 0.25 ⇥20

0.5x1 �2.6x2 +1.3x3 0.15 ⇥100

x1, x2, x3 � 0

x1, x2, x4 2 Z

Scale constraints

+ Objective

x3

Page 68: SOLVING INTEGER LINEAR PROGRAMS

Conversion to Integer Coefficients.

max 20x1 +3x2 �x3

s.t. 2x1 �40x2 �20x3 5

50x1 �260x2 +130x3 15

x1, x2, x3 � 0

x1, x2, x4 2 Z

max 2x1 +0.3x2 �0.1x3

s.t. 0.1x1 �2x2 �x3 0.25

0.5x1 �2.6x2 +1.3x3 0.15

x1, x2, x3 � 0

x1, x2, x4 2 Z

Divide result by 10

Page 69: SOLVING INTEGER LINEAR PROGRAMS

Adding Slack Variables

max c

|x

s.t. Ax b

x � 0

x 2 Z

max c

|x

s.t. Ax+ xs = b

x,xs � 0

x,xs 2 Z

Page 70: SOLVING INTEGER LINEAR PROGRAMS

Summary • We assume problem is in LP standard form. •  Assume coefficients are rational.

•  ILP standard form: coefficients (A,b,c) are integers. •  Scale the original rational problem. •  Make sure that result is divided by scale factor for objective.

• Advantage of ILP standard form: •  Slack variables are naturally integers. •  No need for separate treatment of decision and slack variables.

Page 71: SOLVING INTEGER LINEAR PROGRAMS

CUTTING PLANE METHOD Part 2: Gomory-Chvatal Cuts

Page 72: SOLVING INTEGER LINEAR PROGRAMS

Overall method

Solve LP relaxation of the problem.

Is the solution Integral?

Done.

Yes

No Add a new cutting plane constraint.

Guarantee: No integer point is lost.

Page 73: SOLVING INTEGER LINEAR PROGRAMS

Cutting Plane Visualization

First optimum

0

0

1

1

2

2

3

3

0

0

1

1

2

2

3

3

00

1

1

2

2

3

3

Second Optimum

Third Optimum Cutting

Plane

Idea: cutting plane attempts to successively “expose” an integer optimal vertex.

Page 74: SOLVING INTEGER LINEAR PROGRAMS

Cutting Plane Method • Deriving the Cutting Plane •  Gomory-Chvatal Cuts

•  Integrating the method inside Simplex. •  Using the dual dictionary to avoid initialization phase Simplex.

Page 75: SOLVING INTEGER LINEAR PROGRAMS

GOMORY-CHVATAL CUTS

Page 76: SOLVING INTEGER LINEAR PROGRAMS

Overall Idea

max c

|x

s.t. Ax+ xs = b

x,xs � 0

x,xs 2 Z

LP Relax

Initialization Phase

Optimization Phase

Final Dictionary

1. Solve the LP relaxation using Simplex algorithm.

Page 77: SOLVING INTEGER LINEAR PROGRAMS

Final Dictionary

xB˜

b +AxN

z z0 +cN xN

Optimal solution to ILP found!!

fractional entries Derive a cutting

plane

Page 78: SOLVING INTEGER LINEAR PROGRAMS

Example: Final Dictionary x1 1.2 �3.1x2 +4.3x3 �0.5x5

x4 1 �x2 +x3 �x5

x6 2.5 +1.3x2 �2.1x3 +x5

z 1.7 �1.2x2 �2.3x3 �2.1x5

x1 = 1.2, x2 = 0, x3 = 0, x4 = 1, x5 = 0, x6 = 2.5

Page 79: SOLVING INTEGER LINEAR PROGRAMS

Cutting Plane Derivation: Step 1

x1 1.2 �3.1x2 +4.3x3 �0.5x5

x4 1 �x2 +x3 �x5

x6 2.5 +1.3x2 �2.1x3 +x5

z 1.7 �1.2x2 �2.3x3 �2.1x5

Identify row with fractional constant. Step 1

x1 = 1.2� 3.1x2 + 4.3x3 � 0.5x5x1 + 3.1x2 � 4.3x3 + 0.5x5 = 1.2

Page 80: SOLVING INTEGER LINEAR PROGRAMS

Cutting Plane Derivation: Step 2

x1 + 3.1x2 � 4.3x3 + 0.5x5 = 1.2

(x1 + 3x2 � 5x3 + 0x5)| {z }A

+ (0.1x2 + 0.7x3 + 0.5x5)| {z }B

= 1 + 0.2

A: integer B: integer + fraction B ≥ 0

A + B = 1.2

Page 81: SOLVING INTEGER LINEAR PROGRAMS

Claim

A is integer B has a fractional part. B ≥ 0 A + B = 1.2

(x1 + 3x2 � 5x3 + 0x5)| {z }A

+ (0.1x2 + 0.7x3 + 0.5x5)| {z }B

= 1 + 0.2

A B A+B Possible

1 0.2 1.2 YES

2 -0.8 1.2 No

1.1 0.1 1.2 No

4 -2.8 1.2 No

-3 4.2 1.2 Yes

-100 101.2 1.2 Yes

Conclusion: 1.  Fractional part of B is 0.2 2.  B ≥ 0.2

In other words, 1.  B – 0.2 is an integer. 2.  B - 0.2 ≥ 0

Page 82: SOLVING INTEGER LINEAR PROGRAMS

Cutting Plane x1 1.2 �3.1x2 +4.3x3 �0.5x5

x4 1 �x2 +x3 �x5

x6 2.5 +1.3x2 �2.1x3 +x5

z 1.7 �1.2x2 �2.3x3 �2.1x5

0.1x2 + 0.7x3 + 0.5x5 � 0.2

Cutting Plane:

Page 83: SOLVING INTEGER LINEAR PROGRAMS

Cutting Plane: Definition.

Final Dictionary (LP Relax)

Cutting Plane

frac(x) = x� bxc

xB1 = b1 +a11xI1 + · · · +a1jxIj + · · · +a1nxIn...

xBk = bk +ak1xI1 + · · · +akjxIj + · · · +aknxIn...

xBm = bm +am1xI1 + · · · +amjxIj + · · · +amnxIn

z = c0 +c1xI1 + · · · +cjxIj + · · · +cnxIn

bk 62 Z

frac(�ak1)xI1 + · · ·+ frac(�akn)xIn � frac(bk)

Page 84: SOLVING INTEGER LINEAR PROGRAMS

Cutting Plane

Claim: Every (integer) feasible point of the ILP satisfies the cutting plane constraint.

xB1 = b1 +a11xI1 + · · · +a1jxIj + · · · +a1nxIn...

xBk = bk +ak1xI1 + · · · +akjxIj + · · · +aknxIn...

xBm = bm +am1xI1 + · · · +amjxIj + · · · +amnxIn

z = c0 +c1xI1 + · · · +cjxIj + · · · +cnxIn

bk 62 Z

frac(�ak1)xI1 + · · ·+ frac(�akn)xIn � frac(bk)

Page 85: SOLVING INTEGER LINEAR PROGRAMS

xB1 = b1 +a11xI1 + · · · +a1jxIj + · · · +a1nxIn...

xBk = bk +ak1xI1 + · · · +akjxIj + · · · +aknxIn...

xBm = bm +am1xI1 + · · · +amjxIj + · · · +amnxIn

z = c0 +c1xI1 + · · · +cjxIj + · · · +cnxIn

bk 62 ZWe have

xBk +nX

j=1

(�akj)xIj = bk (1)

Since �akj � b�akjc and xIj � 0, we obtain

nX

j=1

(�akj)xIj �nX

j=1

b�akjcxIj

Applying this to Eq.(1) we obtain:

xBk +nX

j=1

(�akj)xIj � xBk +nX

j=1

b�akjcxIj (2)

Therefore, we get

bk � xBk +

nX

j=1

b�akjcxIj (3)

The RHS of (3) is an integer, therefore, we conclude:

bbkc � xBk +nX

j=1

b�akjcxIj (4)

Combining (4) with (1), we have,

bk � bbkc Pn

j=1(�akj � b�akjc)xIj

In other words,Pn

j=1 frac(�akj)xIj � frac(bk)

Page 86: SOLVING INTEGER LINEAR PROGRAMS

Example x1 1.2 �3.1x2 +4.3x3 �0.5x5

x4 1 �x2 +x3 �x5

x6 2.5 +1.3x2 �2.1x3 +x5

z 1.7 �1.2x2 �2.3x3 �2.1x5

0.7x2 + 0.1x3 + 0x5 � 0.5

0.2x2 + 0.3x3 + 0.1x5 � 0.7

Page 87: SOLVING INTEGER LINEAR PROGRAMS

CUTTING PLANE METHOD Updating the dictionary Setup for subsequent iterations.

Page 88: SOLVING INTEGER LINEAR PROGRAMS

Overall method

Solve LP relaxation of the problem.

Is the solution Integral?

Done.

Yes

No Add a new cutting plane constraint.

Guarantee: No integer point is lost.

Page 89: SOLVING INTEGER LINEAR PROGRAMS

Cutting Plane Example x1 1.2 �3.1x2 +4.3x3 �0.5x5

x4 1 �x2 +x3 �x5

x6 2.5 +1.3x2 �2.1x3 +x5

z 1.7 �1.2x2 �2.3x3 �2.1x5

0.1x2 + 0.7x3 + 0.5x5 � 0.2

Cutting Plane:

Page 90: SOLVING INTEGER LINEAR PROGRAMS

Adding cutting plane to dictionary x1 1.2 �3.1x2 +4.3x3 �0.5x5

x4 1 �x2 +x3 �x5

x6 2.5 +1.3x2 �2.1x3 +x5

z 1.7 �1.2x2 �2.3x3 �2.1x5

0.1x2 + 0.7x3 + 0.5x5 � 0.2

x1 1.2 �3.1x2 +4.3x3 �0.5x5

x4 1 �x2 +x3 �x5

x6 2.5 +1.3x2 �2.1x3 +x5

w1 �0.2 +0.1x2 +0.7x3 +0.5x5

z 1.7 �1.2x2 �2.3x3 �2.1x5

Page 91: SOLVING INTEGER LINEAR PROGRAMS

Cutting Plane Method • Claim: Resulting dictionary after adding cutting plane is primal

infeasible.

Dictionary Solution

Cutting Plane

Page 92: SOLVING INTEGER LINEAR PROGRAMS

Cutting Plane: Example

x1 1.2 �3.1x2 +4.3x3 �0.5x5

x4 1 �x2 +x3 �x5

x6 2.5 +1.3x2 �2.1x3 +x5

w1 �0.2 +0.1x2 +0.7x3 +0.5x5

z 1.7 �1.2x2 �2.3x3 �2.1x5

Naïve Approach: Re-solve initialization phase Simplex.

Dual dictionary is feasible but non-final.

Page 93: SOLVING INTEGER LINEAR PROGRAMS

Cutting Plane: Solving again after cut.

Final Dictionary LP relaxation.

Primal Infeasible Dual Feasible

Optimize the dual problem dictionary.

Final dictionary for Dual

Also final for primal

Cut