introduction to integer programming · rounding and integer programming rounding and integer...

44
OptIntro 1 / 34 Introduction to Integer Programming Eduardo Camponogara Department of Automation and Systems Engineering Federal University of Santa Catarina October 2016

Upload: others

Post on 01-Aug-2020

32 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Introduction to Integer Programming · Rounding and Integer Programming Rounding and Integer Programming Issue I The rounding strategy does not work. I The following counter-example

OptIntro 1 / 34

Introduction to Integer Programming

Eduardo Camponogara

Department of Automation and Systems EngineeringFederal University of Santa Catarina

October 2016

Page 2: Introduction to Integer Programming · Rounding and Integer Programming Rounding and Integer Programming Issue I The rounding strategy does not work. I The following counter-example

OptIntro 2 / 34

Summary

Introduction

Rounding and Integer Programming

Applications

Modeling Strategies

Page 3: Introduction to Integer Programming · Rounding and Integer Programming Rounding and Integer Programming Issue I The rounding strategy does not work. I The following counter-example

OptIntro 3 / 34

Introduction

Summary

Introduction

Rounding and Integer Programming

Applications

Modeling Strategies

Page 4: Introduction to Integer Programming · Rounding and Integer Programming Rounding and Integer Programming Issue I The rounding strategy does not work. I The following counter-example

OptIntro 4 / 34

Introduction

Integer Problem

Integer Linear Problem (IP):

PL : max cTx

s.t. Ax ≤ b,

x ∈ Zn

Page 5: Introduction to Integer Programming · Rounding and Integer Programming Rounding and Integer Programming Issue I The rounding strategy does not work. I The following counter-example

OptIntro 5 / 34

Introduction

Mixed-Integer (Linear) Problem

Mixed-Integer Linear Problem (MILP):

IP : max cTx

s.t. Ax ≤ b,

x = (xC, xI)

xC ≥ 0

xI ∈ Zn

Page 6: Introduction to Integer Programming · Rounding and Integer Programming Rounding and Integer Programming Issue I The rounding strategy does not work. I The following counter-example

OptIntro 6 / 34

Introduction

Integer Problems

There are several classes of integer problems

I Integer (Linear) Problem

I Mixed-Integer (Linear) Problem

I Linear Binary Problem

I Combinatorial Optimization Problem

Page 7: Introduction to Integer Programming · Rounding and Integer Programming Rounding and Integer Programming Issue I The rounding strategy does not work. I The following counter-example

OptIntro 7 / 34

Rounding and Integer Programming

Summary

Introduction

Rounding and Integer Programming

Applications

Modeling Strategies

Page 8: Introduction to Integer Programming · Rounding and Integer Programming Rounding and Integer Programming Issue I The rounding strategy does not work. I The following counter-example

OptIntro 8 / 34

Rounding and Integer Programming

Rounding and Integer Programming

Questao: Why not use Linear Programming?

I We could disregard the constraints on binary variables.

I Obtain an optimal solution x? for the resulting linear program.

I And then round x? such as to obtain a solution to the integerprogram.

Page 9: Introduction to Integer Programming · Rounding and Integer Programming Rounding and Integer Programming Issue I The rounding strategy does not work. I The following counter-example

OptIntro 8 / 34

Rounding and Integer Programming

Rounding and Integer Programming

Questao: Why not use Linear Programming?

I We could disregard the constraints on binary variables.

I Obtain an optimal solution x? for the resulting linear program.

I And then round x? such as to obtain a solution to the integerprogram.

Page 10: Introduction to Integer Programming · Rounding and Integer Programming Rounding and Integer Programming Issue I The rounding strategy does not work. I The following counter-example

OptIntro 9 / 34

Rounding and Integer Programming

Rounding and Integer Programming

Issue

I The rounding strategy does not work.

I The following counter-example clarifies the issue:

max x1 + 0.6x2s.t. : 50x1 + 31x2 ≤ 250

3x1 − 2x2 ≥ −4

with being x1, x2 ≥ 0 and integer.

I An optimal solution to LP, x = (376193 ,950193) = (1.94, 4.92),

could be rounded to obtain the solution x = (2, 4).

I But this solution is quite “far” from the optimal solutionx? = (5, 0).

Page 11: Introduction to Integer Programming · Rounding and Integer Programming Rounding and Integer Programming Issue I The rounding strategy does not work. I The following counter-example

OptIntro 9 / 34

Rounding and Integer Programming

Rounding and Integer Programming

Issue

I The rounding strategy does not work.

I The following counter-example clarifies the issue:

max x1 + 0.6x2s.t. : 50x1 + 31x2 ≤ 250

3x1 − 2x2 ≥ −4

with being x1, x2 ≥ 0 and integer.

I An optimal solution to LP, x = (376193 ,950193) = (1.94, 4.92),

could be rounded to obtain the solution x = (2, 4).

I But this solution is quite “far” from the optimal solutionx? = (5, 0).

Page 12: Introduction to Integer Programming · Rounding and Integer Programming Rounding and Integer Programming Issue I The rounding strategy does not work. I The following counter-example

OptIntro 9 / 34

Rounding and Integer Programming

Rounding and Integer Programming

Issue

I The rounding strategy does not work.

I The following counter-example clarifies the issue:

max x1 + 0.6x2s.t. : 50x1 + 31x2 ≤ 250

3x1 − 2x2 ≥ −4

with being x1, x2 ≥ 0 and integer.

I An optimal solution to LP, x = (376193 ,950193) = (1.94, 4.92),

could be rounded to obtain the solution x = (2, 4).

I But this solution is quite “far” from the optimal solutionx? = (5, 0).

Page 13: Introduction to Integer Programming · Rounding and Integer Programming Rounding and Integer Programming Issue I The rounding strategy does not work. I The following counter-example

OptIntro 10 / 34

Rounding and Integer Programming

Rounding and Integer Programming

1 2 3 4 5

1

2

3

4

5

(376/193, 950/193)

Fecho convexo

dos pontos inteiros

x2

x*

x1

Page 14: Introduction to Integer Programming · Rounding and Integer Programming Rounding and Integer Programming Issue I The rounding strategy does not work. I The following counter-example

OptIntro 11 / 34

Applications

Summary

Introduction

Rounding and Integer Programming

Applications

Modeling Strategies

Page 15: Introduction to Integer Programming · Rounding and Integer Programming Rounding and Integer Programming Issue I The rounding strategy does not work. I The following counter-example

OptIntro 12 / 34

Applications

Fundamentals of Integer Programming

Applications

I Several problems of academic and practical relevance can beformulated in integer programming.

I Examples:

I combinatorial problems found in graph theory (set covering,maximum clique);

I problems in logic (satisfiability problem); andI problems in logistics.

Page 16: Introduction to Integer Programming · Rounding and Integer Programming Rounding and Integer Programming Issue I The rounding strategy does not work. I The following counter-example

OptIntro 12 / 34

Applications

Fundamentals of Integer Programming

Applications

I Several problems of academic and practical relevance can beformulated in integer programming.

I Examples:

I combinatorial problems found in graph theory (set covering,maximum clique);

I problems in logic (satisfiability problem); andI problems in logistics.

Page 17: Introduction to Integer Programming · Rounding and Integer Programming Rounding and Integer Programming Issue I The rounding strategy does not work. I The following counter-example

OptIntro 13 / 34

Applications

Fundamentals of Integer Programming

Airline Crew Scheduling

I Allocation of flight crews subject to physical, temporal, andwork-related constraints.

I High economic impact on airline companies.

I Given flight legs for a type of airplane, the problem is toallocate weekly crews to cyclic flight routes.

Page 18: Introduction to Integer Programming · Rounding and Integer Programming Rounding and Integer Programming Issue I The rounding strategy does not work. I The following counter-example

OptIntro 14 / 34

Applications

Travel Salesman Problem

Background

I Choose an order for a travel salesman to leave his home city,let us say city 1, visit the remaining n− 1 cities precisely once,and then return to the home city.

I The distance traveled should be as short as possible.

I We are given a set of n cities.

I cij is the cost (distance) to travel from city i to city j .

Page 19: Introduction to Integer Programming · Rounding and Integer Programming Rounding and Integer Programming Issue I The rounding strategy does not work. I The following counter-example

OptIntro 14 / 34

Applications

Travel Salesman Problem

Background

I Choose an order for a travel salesman to leave his home city,let us say city 1, visit the remaining n− 1 cities precisely once,and then return to the home city.

I The distance traveled should be as short as possible.

I We are given a set of n cities.

I cij is the cost (distance) to travel from city i to city j .

Page 20: Introduction to Integer Programming · Rounding and Integer Programming Rounding and Integer Programming Issue I The rounding strategy does not work. I The following counter-example

OptIntro 15 / 34

Applications

Travel Salesman Problem

Background

I The problem is to find the shortest route (circuit) that visitseach city precisely once and whose travel distance is minimum.

I Applications are found in vehicle routing, welding of electroniccircuits, and garbage collection.

Page 21: Introduction to Integer Programming · Rounding and Integer Programming Rounding and Integer Programming Issue I The rounding strategy does not work. I The following counter-example

OptIntro 16 / 34

Applications

Travel Salesman Problem

Defining variables

xij =

{1 if salesman travels from city i to city j0 otherwise

Page 22: Introduction to Integer Programming · Rounding and Integer Programming Rounding and Integer Programming Issue I The rounding strategy does not work. I The following counter-example

OptIntro 17 / 34

Applications

Travel Salesman Problem

Defining constraints

a) The salesman departs from city i exactly once:

n∑j=1

xij = 1 i = 1, . . . , n

b) The salesman arrives at city j exactly once:

n∑i=1

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

Page 23: Introduction to Integer Programming · Rounding and Integer Programming Rounding and Integer Programming Issue I The rounding strategy does not work. I The following counter-example

OptIntro 18 / 34

Applications

Travel Salesman Problem

Defining constraints

c) Connectivity constraints:∑i∈S

∑j /∈S

xij ≥ 1 ∀S ⊂ N, S 6= ∅

or subtour elimination:∑i∈S

∑j∈S, j 6=i

xij ≤ |S | − 1 ∀S ⊆ N, 2 ≤ |S | ≤ n − 1

Page 24: Introduction to Integer Programming · Rounding and Integer Programming Rounding and Integer Programming Issue I The rounding strategy does not work. I The following counter-example

OptIntro 19 / 34

Applications

Travel Salesman Problem

S N − S

Page 25: Introduction to Integer Programming · Rounding and Integer Programming Rounding and Integer Programming Issue I The rounding strategy does not work. I The following counter-example

OptIntro 20 / 34

Applications

Travel Salesman Problem

Defining the objective

minn∑

i=1

n∑j=1

cijxij

Page 26: Introduction to Integer Programming · Rounding and Integer Programming Rounding and Integer Programming Issue I The rounding strategy does not work. I The following counter-example

OptIntro 21 / 34

Modeling Strategies

Summary

Introduction

Rounding and Integer Programming

Applications

Modeling Strategies

Page 27: Introduction to Integer Programming · Rounding and Integer Programming Rounding and Integer Programming Issue I The rounding strategy does not work. I The following counter-example

OptIntro 22 / 34

Modeling Strategies

Modeling Fixed Costs

Modeling Fixed Cost

We wish to model the nonlinear function given by:

h(x) =

{f + px if 0 < x ≤ c0 if x = 0

Page 28: Introduction to Integer Programming · Rounding and Integer Programming Rounding and Integer Programming Issue I The rounding strategy does not work. I The following counter-example

OptIntro 23 / 34

Modeling Strategies

Modeling Fixed Costs

Modeling Fixed Cost

f

c

h(x)

x

Page 29: Introduction to Integer Programming · Rounding and Integer Programming Rounding and Integer Programming Issue I The rounding strategy does not work. I The following counter-example

OptIntro 24 / 34

Modeling Strategies

Modeling Fixed Costs

Modeling Fixed Cost

I Variables:

y =

{1 if x > 00 if x = 0

I Constraints and objective function:

h(x) = fy + pxx ≤ cy

y ∈ {0, 1}

I Model valid only for minimization.

Page 30: Introduction to Integer Programming · Rounding and Integer Programming Rounding and Integer Programming Issue I The rounding strategy does not work. I The following counter-example

OptIntro 25 / 34

Modeling Strategies

Modeling Disjunctions

Discrete Alternatives and Disjunctions

I A promising area in theory and practice is disjunctiveprogramming, that is, models and algorithms based ondisjunctions.

I To understand disjunctive programming, suppose that x ∈ Rn

satisfies:0 ≤ x ≤ u and

(aT1 x ≤ b1) or (aT2 x ≤ b2)(1)

I x must satisfy one of the linear constraints, not necessarilyboth constraints.

Page 31: Introduction to Integer Programming · Rounding and Integer Programming Rounding and Integer Programming Issue I The rounding strategy does not work. I The following counter-example

OptIntro 25 / 34

Modeling Strategies

Modeling Disjunctions

Discrete Alternatives and Disjunctions

I A promising area in theory and practice is disjunctiveprogramming, that is, models and algorithms based ondisjunctions.

I To understand disjunctive programming, suppose that x ∈ Rn

satisfies:0 ≤ x ≤ u and

(aT1 x ≤ b1) or (aT2 x ≤ b2)(1)

I x must satisfy one of the linear constraints, not necessarilyboth constraints.

Page 32: Introduction to Integer Programming · Rounding and Integer Programming Rounding and Integer Programming Issue I The rounding strategy does not work. I The following counter-example

OptIntro 26 / 34

Modeling Strategies

Modeling Disjunctions

Discrete Alternatives and Disjunctions

The feasible region of a disjunction with two constraints: noticethat the feasible region is nonconvex.

x2

x1

a2Tx = b2Regiao Factivel

a1Tx = b1

Page 33: Introduction to Integer Programming · Rounding and Integer Programming Rounding and Integer Programming Issue I The rounding strategy does not work. I The following counter-example

OptIntro 27 / 34

Modeling Strategies

Modeling Disjunctions

Discrete Alternatives and Disjunctions

How do we represent the disjunction (1) in mixed-integer linearprogramming.

I Let M = maxi=1,2{aTi x − bi : 0 ≤ x ≤ u}.I Fist, we introduce two binary variables, y1 and y2, whose

semantics is explained below:

y1 =

{1 if x satisfies aT1 x ≤ b10 otherwise

y2 =

{1 if x satisfies aT2 x ≤ b20 otherwise

Page 34: Introduction to Integer Programming · Rounding and Integer Programming Rounding and Integer Programming Issue I The rounding strategy does not work. I The following counter-example

OptIntro 27 / 34

Modeling Strategies

Modeling Disjunctions

Discrete Alternatives and Disjunctions

How do we represent the disjunction (1) in mixed-integer linearprogramming.

I Let M = maxi=1,2{aTi x − bi : 0 ≤ x ≤ u}.I Fist, we introduce two binary variables, y1 and y2, whose

semantics is explained below:

y1 =

{1 if x satisfies aT1 x ≤ b10 otherwise

y2 =

{1 if x satisfies aT2 x ≤ b20 otherwise

Page 35: Introduction to Integer Programming · Rounding and Integer Programming Rounding and Integer Programming Issue I The rounding strategy does not work. I The following counter-example

OptIntro 28 / 34

Modeling Strategies

Modeling Disjunctions

Discrete Alternatives and Disjunctions

Given the above variables, we can introduce the completeformulation:

aT1 x ≤ b1 + M(1− y1)aT2 x ≤ b2 + M(1− y2)

y1 + y2 = 1y1, y2 ∈ {0, 1}

0 ≤ x ≤ u

Page 36: Introduction to Integer Programming · Rounding and Integer Programming Rounding and Integer Programming Issue I The rounding strategy does not work. I The following counter-example

OptIntro 29 / 34

Modeling Strategies

Modeling Disjunctions

Discrete Alternatives and Disjunctions

I Disjunctions appear in scheduling problems.

I Tasks 1 and 2 must be processed in a given machine, but notsimultaneously.

I Let pi be the processing time of task i and ti the timeprocessing begins.

I Then, we can express temporal precedence of one task inrelation to the other by a disjunction:

(t1 + p1 ≤ t2) or (t2 + p2 ≤ t1)

Page 37: Introduction to Integer Programming · Rounding and Integer Programming Rounding and Integer Programming Issue I The rounding strategy does not work. I The following counter-example

OptIntro 29 / 34

Modeling Strategies

Modeling Disjunctions

Discrete Alternatives and Disjunctions

I Disjunctions appear in scheduling problems.

I Tasks 1 and 2 must be processed in a given machine, but notsimultaneously.

I Let pi be the processing time of task i and ti the timeprocessing begins.

I Then, we can express temporal precedence of one task inrelation to the other by a disjunction:

(t1 + p1 ≤ t2) or (t2 + p2 ≤ t1)

Page 38: Introduction to Integer Programming · Rounding and Integer Programming Rounding and Integer Programming Issue I The rounding strategy does not work. I The following counter-example

OptIntro 30 / 34

Modeling Strategies

Modeling Variable Product

Power of Binary Variables

I The power function xp, p ∈ N+, with x ∈ {0, 1} is nonlinear.I Notice that xp = x since:

I xp = 0 if x = 0 andI xp = 1 and x = 1.

I Thus, it is possible to linearize the term xp.

Page 39: Introduction to Integer Programming · Rounding and Integer Programming Rounding and Integer Programming Issue I The rounding strategy does not work. I The following counter-example

OptIntro 30 / 34

Modeling Strategies

Modeling Variable Product

Power of Binary Variables

I The power function xp, p ∈ N+, with x ∈ {0, 1} is nonlinear.I Notice that xp = x since:

I xp = 0 if x = 0 andI xp = 1 and x = 1.

I Thus, it is possible to linearize the term xp.

Page 40: Introduction to Integer Programming · Rounding and Integer Programming Rounding and Integer Programming Issue I The rounding strategy does not work. I The following counter-example

OptIntro 31 / 34

Modeling Strategies

Modeling Variable Product

Product of Binary Variables

I Consider the term y = x1x2x3, in which xi ∈ {0, 1}.I The nonlinear term can be reformulated as:

y ≤ x1

y ≤ x2

y ≤ x3

y ≥ x1 + x2 + x3 − 2

y ≥ 0

x1, x2, x3 ∈ {0, 1}

Page 41: Introduction to Integer Programming · Rounding and Integer Programming Rounding and Integer Programming Issue I The rounding strategy does not work. I The following counter-example

OptIntro 31 / 34

Modeling Strategies

Modeling Variable Product

Product of Binary Variables

I Consider the term y = x1x2x3, in which xi ∈ {0, 1}.I The nonlinear term can be reformulated as:

y ≤ x1

y ≤ x2

y ≤ x3

y ≥ x1 + x2 + x3 − 2

y ≥ 0

x1, x2, x3 ∈ {0, 1}

Page 42: Introduction to Integer Programming · Rounding and Integer Programming Rounding and Integer Programming Issue I The rounding strategy does not work. I The following counter-example

OptIntro 32 / 34

Modeling Strategies

Modeling Variable Product

Sign Function: sign(x)

I The function sign(·) can be modeled using a binary variable.

I Assuming that |x | ≤ M, then:

x ≤ Mz ,

x ≥ −M(1− z),

sign(x) = (2z − 1),

z ∈ {0, 1}

Page 43: Introduction to Integer Programming · Rounding and Integer Programming Rounding and Integer Programming Issue I The rounding strategy does not work. I The following counter-example

OptIntro 33 / 34

Modeling Strategies

Modeling Variable Product

Some Challenges

Can you model the following functions in mixed-integer linearprogramming?

I y = max{x1, x2}?I y = |x |?

Page 44: Introduction to Integer Programming · Rounding and Integer Programming Rounding and Integer Programming Issue I The rounding strategy does not work. I The following counter-example

OptIntro 34 / 34

Modeling Strategies

Modeling Variable Product

Integer Programming

I Thank you for attending this lecture!!!