introduction to integer linear...

31
Introduction to Integer Linear Programming Martin Branda Charles University in Prague Faculty of Mathematics and Physics Department of Probability and Mathematical Statistics Computational Aspects of Optimization Martin Branda (KPMS MFF UK) 2017-03-13 1 / 31

Upload: vothuan

Post on 09-Sep-2018

222 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Introduction to Integer Linear Programmingartax.karlin.mff.cuni.cz/~branm1am/download/04_Branda_ILP_2017.pdf · Introduction to Integer Linear Programming Martin Branda Charles University

Introduction to Integer Linear Programming

Martin Branda

Charles University in PragueFaculty of Mathematics and Physics

Department of Probability and Mathematical Statistics

Computational Aspects of Optimization

Martin Branda (KPMS MFF UK) 2017-03-13 1 / 31

Page 2: Introduction to Integer Linear Programmingartax.karlin.mff.cuni.cz/~branm1am/download/04_Branda_ILP_2017.pdf · Introduction to Integer Linear Programming Martin Branda Charles University

Motivation and applications

Content

1 Motivation and applications

2 Formulation and properties

3 Cutting plane method

Martin Branda (KPMS MFF UK) 2017-03-13 2 / 31

Page 3: Introduction to Integer Linear Programmingartax.karlin.mff.cuni.cz/~branm1am/download/04_Branda_ILP_2017.pdf · Introduction to Integer Linear Programming Martin Branda Charles University

Motivation and applications

Knapsack problem

Values a1 = 4, a2 = 6, a3 = 7, costs c1 = 4, c2 = 5, c3 = 11, budgetb = 10:

max3∑

i=1

cixi

s.t.

3∑i=1

aixi ≤ 10,

xi ∈ {0, 1}.

Consider = instead of ≤, 0 ≤ xi ≤ 1 and rounding instead of xi ∈ {0, 1},heuristic (ratio ci/ai ) ...

Martin Branda (KPMS MFF UK) 2017-03-13 3 / 31

Page 4: Introduction to Integer Linear Programmingartax.karlin.mff.cuni.cz/~branm1am/download/04_Branda_ILP_2017.pdf · Introduction to Integer Linear Programming Martin Branda Charles University

Motivation and applications

Why is integrality so important?

Real (mixed-)integer programming problems (not always linear)

Portfolio optimization – integer number of assets, fixed transactioncosts

Scheduling – integer (binary) decision variables to assign a job to amachine

Vehicle Routing Problems (VRP) – binary decision variables whichidentify a successor of a node on the route

...

In general – modelling of logical relations, e.g.

at least two constraints from three are fulfilled,

if we buy this asset than the fixed transaction costs increase,

...

Martin Branda (KPMS MFF UK) 2017-03-13 4 / 31

Page 5: Introduction to Integer Linear Programmingartax.karlin.mff.cuni.cz/~branm1am/download/04_Branda_ILP_2017.pdf · Introduction to Integer Linear Programming Martin Branda Charles University

Motivation and applications

Facility Location Problem

i warehouses (facilities, branches), j customers,

xij – sent (delivered, served) quantity,

yi – a warehouse is built,

cij – unit supplying costs,

fi – fixed costs of building the warehouse,

Ki – warehouse capacity,

Dj – demand.

minxij ,yi

n∑i=1

m∑j=1

cijxij +∑i

fiyi

s.t.m∑j=1

xij ≤ Kiyi , i = 1, . . . , n,

n∑i=1

xij = Dj , j = 1, . . . ,m,

xij ≥ 0, yi ∈ {0, 1}.

Martin Branda (KPMS MFF UK) 2017-03-13 5 / 31

Page 6: Introduction to Integer Linear Programmingartax.karlin.mff.cuni.cz/~branm1am/download/04_Branda_ILP_2017.pdf · Introduction to Integer Linear Programming Martin Branda Charles University

Motivation and applications

Scheduling to Minimize the Makespan

i machines, j jobs,

y – machine makespan,

xij – assignment variable,

tij – time necessary to process job j on machine i .

minxij ,y

y

s.t.

m∑i=1

xij = 1, j = 1, . . . , n,

n∑j=1

tijxij ≤ y , i = 1, . . . ,m,

xij ∈ {0, 1}, y ≥ 0.

(1)

Martin Branda (KPMS MFF UK) 2017-03-13 6 / 31

Page 7: Introduction to Integer Linear Programmingartax.karlin.mff.cuni.cz/~branm1am/download/04_Branda_ILP_2017.pdf · Introduction to Integer Linear Programming Martin Branda Charles University

Motivation and applications

Lot Sizing ProblemUncapacitated single item LSP

xt – production at period t,

yt – on/off decision at period t,

st – inventory at the end of period t (s0 ≥ 0 fixed),

Dt – (predicted) expected demand at period t,

pt – unit production costs at period t,

ft – setup costs at period t,

ht – inventory costs at period t,

M – a large constant.

minxt ,yt ,st

T∑t=1

(ptxt + ftyt + htst)

s.t. st−1 + xt − Dt = st , t = 1, . . . ,T ,

xt ≤ Myt ,

xt , st ≥ 0, yt ∈ {0, 1}.

(2)

ASS. Wagner-Whitin costs pt+1 ≤ pt + ht .

Martin Branda (KPMS MFF UK) 2017-03-13 7 / 31

Page 8: Introduction to Integer Linear Programmingartax.karlin.mff.cuni.cz/~branm1am/download/04_Branda_ILP_2017.pdf · Introduction to Integer Linear Programming Martin Branda Charles University

Motivation and applications

Lot Sizing ProblemCapacitated single item LSP

xt – production at period t,

yt – on/off decision at period t,

st – inventory at the end of period t (s0 ≥ 0 fixed),

Dt – (predicted) expected demand at period t.

pt – unit production costs at period t,

ft – setup costs at period t,

ht – inventory costs at period t,

Ct – production capacity at period t.

minxt ,yt ,st

T∑t=1

(ptxt + ftyt + htst)

s.t. st−1 + xt − Dt = st , t = 1, . . . ,T ,

xt ≤ Ctyt ,

xt , st ≥ 0, yt ∈ {0, 1}.

(3)

ASS. Wagner-Whitin costs pt+1 ≤ pt + ht .

Martin Branda (KPMS MFF UK) 2017-03-13 8 / 31

Page 9: Introduction to Integer Linear Programmingartax.karlin.mff.cuni.cz/~branm1am/download/04_Branda_ILP_2017.pdf · Introduction to Integer Linear Programming Martin Branda Charles University

Motivation and applications

Unit Commitment Problem

i = 1, . . . , n units (power plants), t = 1, . . . ,T periods,

yit – on/off decision for unit i at period t,

xit – production level for unit i at period t,

Dt – (predicted) expected demand at period t,

pmini , pmax

i – minimal/maximal production capacity of unit i ,

cit – variable production costs,

fit – (fixed) start-up costs.

minxit ,yit

n∑i=1

T∑t=1

(citxit + fityit)

s.t.

n∑i=1

xit ≥ Dt , t = 1, . . . ,T ,

pmini yit ≤ xit ≤ pmax

i yit ,

xit ≥ 0, yit ∈ {0, 1}.

(4)

Martin Branda (KPMS MFF UK) 2017-03-13 9 / 31

Page 10: Introduction to Integer Linear Programmingartax.karlin.mff.cuni.cz/~branm1am/download/04_Branda_ILP_2017.pdf · Introduction to Integer Linear Programming Martin Branda Charles University

Formulation and properties

Content

1 Motivation and applications

2 Formulation and properties

3 Cutting plane method

Martin Branda (KPMS MFF UK) 2017-03-13 10 / 31

Page 11: Introduction to Integer Linear Programmingartax.karlin.mff.cuni.cz/~branm1am/download/04_Branda_ILP_2017.pdf · Introduction to Integer Linear Programming Martin Branda Charles University

Formulation and properties

Integer linear programming

min cT x (5)

Ax ≥ b, (6)

x ∈ Zn+. (7)

Assumption: all coefficients are integer (rational before multiplying by aproper constant).

Set of feasible solution and its relaxation

S = {x ∈ Zn+ : Ax ≥ b}, (8)

P = {x ∈ Rn+ : Ax ≥ b} (9)

Obviously S ⊆ P. Not so trivial that S ⊆ conv(S) ⊆ P.

Martin Branda (KPMS MFF UK) 2017-03-13 11 / 31

Page 12: Introduction to Integer Linear Programmingartax.karlin.mff.cuni.cz/~branm1am/download/04_Branda_ILP_2017.pdf · Introduction to Integer Linear Programming Martin Branda Charles University

Formulation and properties

ILP – irrational data

Skoda (2010):

max√

2x − y

s.t.√

2x − y ≤ 0,

x ≥ 1,

x , y ∈ N.

(10)

The objective value is bounded (from above), but there is no optimalsolution.

For any feasible solution with the objective value z =√

2x∗ −⌈√

2x∗⌉

wecan construct a solution with a higher objective value...

Martin Branda (KPMS MFF UK) 2017-03-13 12 / 31

Page 13: Introduction to Integer Linear Programmingartax.karlin.mff.cuni.cz/~branm1am/download/04_Branda_ILP_2017.pdf · Introduction to Integer Linear Programming Martin Branda Charles University

Formulation and properties

ILP – irrational data

Let z =√

2x∗ −⌈√

2x∗⌉

be the optimal solution. Since −1 < z < 0, wecan find k ∈ N such that kz < −1 and (k − 1)z > −1. By settingε = −1− kz we get that −1 < z < −ε = 1 + kz < 0. Then

√2kx∗ −

⌈√2kx∗

⌉= kz + k

⌈√2x∗⌉−⌈√

2kx∗⌉

= −1− ε+ k⌈√

2x∗⌉−⌈√

2kx∗⌉

= k⌈√

2x∗⌉− 1− ε−

⌈⌈√2kx∗

⌉− 1− ε

⌉= −ε > z .

(11)

(k⌈√

2x∗⌉− 1 is integral)

Thus, we have obtained a solution with a higher objective value which is acontradiction.

Martin Branda (KPMS MFF UK) 2017-03-13 13 / 31

Page 14: Introduction to Integer Linear Programmingartax.karlin.mff.cuni.cz/~branm1am/download/04_Branda_ILP_2017.pdf · Introduction to Integer Linear Programming Martin Branda Charles University

Formulation and properties

Example

Consider set S given by

7x1 + 2x2 ≥ 5,

7x1 + x2 ≤ 28,

−4x1 + 14x2 ≤ 35,

x1, x2 ∈ Z+.

Martin Branda (KPMS MFF UK) 2017-03-13 14 / 31

Page 15: Introduction to Integer Linear Programmingartax.karlin.mff.cuni.cz/~branm1am/download/04_Branda_ILP_2017.pdf · Introduction to Integer Linear Programming Martin Branda Charles University

Formulation and properties

Set of feasible solutions, its relaxation and convex envelope

Skoda (2010)

Martin Branda (KPMS MFF UK) 2017-03-13 15 / 31

Page 16: Introduction to Integer Linear Programmingartax.karlin.mff.cuni.cz/~branm1am/download/04_Branda_ILP_2017.pdf · Introduction to Integer Linear Programming Martin Branda Charles University

Formulation and properties

Integer linear programming problem

Problem

min cT x : x ∈ S . (12)

is equivalent to

min cT x : x ∈ conv(S). (13)

conv(S) is very difficult to construct – many constraints (”strong cuts”)are necessary (there are some important exceptions).

LP-relaxation:

min cT x : x ∈ P. (14)

Martin Branda (KPMS MFF UK) 2017-03-13 16 / 31

Page 17: Introduction to Integer Linear Programmingartax.karlin.mff.cuni.cz/~branm1am/download/04_Branda_ILP_2017.pdf · Introduction to Integer Linear Programming Martin Branda Charles University

Formulation and properties

Mixed-integer linear programming

Often both integer and continuous decision variables appear:

min cT x + dT y

s.t. Ax + By ≥ b

x ∈ Zn+, y ∈ Rn′

+ .

(WE DO NOT CONSIDER IN INTRODUCTION)

Martin Branda (KPMS MFF UK) 2017-03-13 17 / 31

Page 18: Introduction to Integer Linear Programmingartax.karlin.mff.cuni.cz/~branm1am/download/04_Branda_ILP_2017.pdf · Introduction to Integer Linear Programming Martin Branda Charles University

Formulation and properties

Basic algorithms

We consider:

Cutting Plane Method

Branch-and-Bound

There are methods which combine the previous alg., e.g.Branch-and-Cut (add cuts to reduce the problem for B&B).

Martin Branda (KPMS MFF UK) 2017-03-13 18 / 31

Page 19: Introduction to Integer Linear Programmingartax.karlin.mff.cuni.cz/~branm1am/download/04_Branda_ILP_2017.pdf · Introduction to Integer Linear Programming Martin Branda Charles University

Cutting plane method

Content

1 Motivation and applications

2 Formulation and properties

3 Cutting plane method

Martin Branda (KPMS MFF UK) 2017-03-13 19 / 31

Page 20: Introduction to Integer Linear Programmingartax.karlin.mff.cuni.cz/~branm1am/download/04_Branda_ILP_2017.pdf · Introduction to Integer Linear Programming Martin Branda Charles University

Cutting plane method

Cutting plane method – Gomory cuts

1. Solve LP-relaxation using (primal or dual) SIMPLEX algorithm.

If the solution is integral – END, we have found an optimal solution,otherwise continue with the next step.

2. Add a Gomory cut (...) and solve the resulting problem using DUALSIMPLEX alg.

Martin Branda (KPMS MFF UK) 2017-03-13 20 / 31

Page 21: Introduction to Integer Linear Programmingartax.karlin.mff.cuni.cz/~branm1am/download/04_Branda_ILP_2017.pdf · Introduction to Integer Linear Programming Martin Branda Charles University

Cutting plane method

Example

min 4x1 + 5x2 (15)

x1 + 4x2 ≥ 5, (16)

3x1 + 2x2 ≥ 7, (17)

x1, x2 ∈ Zn+. (18)

Dual simplex for LP-relaxation ...

Martin Branda (KPMS MFF UK) 2017-03-13 21 / 31

Page 22: Introduction to Integer Linear Programmingartax.karlin.mff.cuni.cz/~branm1am/download/04_Branda_ILP_2017.pdf · Introduction to Integer Linear Programming Martin Branda Charles University

Cutting plane method

After two iterations of the dual SIMPLEX algorithm ...

4 5 0 0x1 x2 x3 x4

5 x2 8/10 0 1 -3/10 1/104 x1 18/10 1 0 2/10 -4/10

112/10 0 0 -7/10 -11/10

Martin Branda (KPMS MFF UK) 2017-03-13 22 / 31

Page 23: Introduction to Integer Linear Programmingartax.karlin.mff.cuni.cz/~branm1am/download/04_Branda_ILP_2017.pdf · Introduction to Integer Linear Programming Martin Branda Charles University

Cutting plane method

Gomory cuts

There is a row in simplex table, which corresponds to a non-integralsolution xi in the form:

xi +∑j∈N

wijxj = di , (19)

where N denotes the set of non-basic variables; di is non-integral. Wedenote

wij = bwijc+ fij , (20)

di = bdic+ fi , (21)

i.e. 0 ≤ fij , fi < 1. ∑j∈N

fijxj ≥ fi , (22)

or rather −∑

j∈N fijxj + s = −fi , s ≥ 0.

Martin Branda (KPMS MFF UK) 2017-03-13 23 / 31

Page 24: Introduction to Integer Linear Programmingartax.karlin.mff.cuni.cz/~branm1am/download/04_Branda_ILP_2017.pdf · Introduction to Integer Linear Programming Martin Branda Charles University

Cutting plane method

Gomory cuts

General properties of cuts (including Gomory ones):

Property 1: Current (non-integral) solution becomes infeasible (it iscut).

Property 2: No feasible integral solution becomes infeasible (it is notcut).

Martin Branda (KPMS MFF UK) 2017-03-13 24 / 31

Page 25: Introduction to Integer Linear Programmingartax.karlin.mff.cuni.cz/~branm1am/download/04_Branda_ILP_2017.pdf · Introduction to Integer Linear Programming Martin Branda Charles University

Cutting plane method

Gomory cuts – property 1

We express the constraints in the form

xi +∑j∈N

(bwijc+ fij)xj = bdic+ fi , (23)

xi +∑j∈Nbwijc xj − bdic = fi −

∑j∈N

fijxj . (24)

Current solution x∗j = 0 pro j ∈ N a x∗i = di is non-integral, i.e.0 < x∗i − bdic < 1, thus

0 < x∗i − bdic = fi −∑j∈N

fijx∗j (25)

and ∑j∈N

fijx∗j < fi , (26)

which is a contradiction with the Gomory cut.Martin Branda (KPMS MFF UK) 2017-03-13 25 / 31

Page 26: Introduction to Integer Linear Programmingartax.karlin.mff.cuni.cz/~branm1am/download/04_Branda_ILP_2017.pdf · Introduction to Integer Linear Programming Martin Branda Charles University

Cutting plane method

Gomory cuts – property 2

Consider an arbitrary integral feasible solution and rewrite the constraint as

xi +∑j∈Nbwijc xj − bdic = fi −

∑j∈N

fijxj , (27)

Left-hand side (LS) is integral, thus right-hand side (RS) is integral.Moreover, fi < 1 a

∑j∈N fijxj ≥ 0, thus RS is strictly lower than 1 and at

the same time it is integral, thus lower or equal to 0, i.e. we obtainGomory cut

fi −∑j∈N

fijxj ≤ 0. (28)

Thus each integral solution fulfills it.

Martin Branda (KPMS MFF UK) 2017-03-13 26 / 31

Page 27: Introduction to Integer Linear Programmingartax.karlin.mff.cuni.cz/~branm1am/download/04_Branda_ILP_2017.pdf · Introduction to Integer Linear Programming Martin Branda Charles University

Cutting plane method

Cutting plane methods – steps

Skoda (2010)

Martin Branda (KPMS MFF UK) 2017-03-13 27 / 31

Page 28: Introduction to Integer Linear Programmingartax.karlin.mff.cuni.cz/~branm1am/download/04_Branda_ILP_2017.pdf · Introduction to Integer Linear Programming Martin Branda Charles University

Cutting plane method

Dantzig cuts

∑j∈N

xj ≥ 1. (29)

(Remind that non-basic variables are equal to zero.)

Martin Branda (KPMS MFF UK) 2017-03-13 28 / 31

Page 29: Introduction to Integer Linear Programmingartax.karlin.mff.cuni.cz/~branm1am/download/04_Branda_ILP_2017.pdf · Introduction to Integer Linear Programming Martin Branda Charles University

Cutting plane method

After two iterations of the dual SIMPLEX algorithm ...

4 5 0 0x1 x2 x3 x4

5 x2 8/10 0 1 -3/10 1/104 x1 18/10 1 0 2/10 -4/10

112/10 0 0 -7/10 -11/10

For example, x1 is not integral:

x1 + 2/10x3 − 4/10x4 = 18/10,

x1 + (0 + 2/10)x3 + (−1 + 6/10)x4 = 1 + 8/10.

Gomory cut:

2/10x3 + 6/10x4 ≥ 8/10.

Martin Branda (KPMS MFF UK) 2017-03-13 29 / 31

Page 30: Introduction to Integer Linear Programmingartax.karlin.mff.cuni.cz/~branm1am/download/04_Branda_ILP_2017.pdf · Introduction to Integer Linear Programming Martin Branda Charles University

Cutting plane method

New simplex table

4 5 0 0 0x1 x2 x3 x4 x5

5 x2 8/10 0 1 -3/10 1/10 04 x1 18/10 1 0 2/10 -4/10 00 x5 -8/10 0 0 - 2/10 -6/10 1

112/10 0 0 -7/10 -11/10 0

Dual simplex alg. ... Gomory cut:

4/6x3 + 1/6x5 ≥ 2/3.

Dual simplex alg. ... optimal solution (2, 1, 1, 1, 0, 0).

Martin Branda (KPMS MFF UK) 2017-03-13 30 / 31

Page 31: Introduction to Integer Linear Programmingartax.karlin.mff.cuni.cz/~branm1am/download/04_Branda_ILP_2017.pdf · Introduction to Integer Linear Programming Martin Branda Charles University

Cutting plane method

Literature

G.L. Nemhauser, L.A. Wolsey (1989). Integer Programming. Chapter VI inHandbooks in OR & MS, Vol. 1, G.L. Nemhauser et al. Eds.

P. Pedegral (2004). Introduction to optimization, Springer-Verlag, New York.

S. Skoda: Resenı linearnıch uloh s celocıselnymi omezenımi v GAMSu. Bc. praceMFF UK, 2010. (In Czech)

L.A. Wolsey (1998). Integer Programming. Wiley, New York.

L.A. Wolsey, G.L. Nemhauser (1999). Integer and Combinatorial Optimization.Wiley, New York.

Martin Branda (KPMS MFF UK) 2017-03-13 31 / 31