m2 oro: advanced integer programming...

26
M2 ORO: Advanced Integer Programming Sophie Demassey Mines Nantes - TASC - INRIA/LINA CNRS UMR 6241 [email protected] September 19, 2011 Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / Class details Motivation for Integer Linear Programming Part I Introduction Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L1: introduction Class details Motivation for Integer Linear Programming Today’s lecture: 1 Class details 2 Motivation for Integer Linear Programming Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L1: introduction Class details Motivation for Integer Linear Programming content, prerequisites & objectives lectures, grading & lecturer Outline 1 Class details content, prerequisites & objectives lectures, grading & lecturer 2 Motivation for Integer Linear Programming Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L1: introduction

Upload: dodan

Post on 23-Jul-2018

221 views

Category:

Documents


0 download

TRANSCRIPT

M2 ORO: Advanced Integer Programming

Sophie Demassey

Mines Nantes - TASC - INRIA/LINA CNRS UMR [email protected]

September 19, 2011

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming /

Class detailsMotivation for Integer Linear Programming

Part I

Introduction

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L1: introduction

Class detailsMotivation for Integer Linear Programming

Today’s lecture:

1 Class details

2 Motivation for Integer Linear Programming

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L1: introduction

Class detailsMotivation for Integer Linear Programming

content, prerequisites & objectiveslectures, grading & lecturer

Outline

1 Class detailscontent, prerequisites & objectiveslectures, grading & lecturer

2 Motivation for Integer Linear Programming

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L1: introduction

Class detailsMotivation for Integer Linear Programming

content, prerequisites & objectiveslectures, grading & lecturer

what will this class be about ?

modeling

with discrete variables and linearconstraints

some tipsmany examples

solving

(mixed) integer linear programswith branch-and-bound methods

preprocessingrelaxationsbranching rules

tightening

bounds with cutting-planesbasic theory of polyedraspecific classes of validinequalities

splitting up

large-scale problems with LPdecomposition techniques

column-generationLagrangian relaxationBender’s decomposition

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L1: introduction

Class detailsMotivation for Integer Linear Programming

content, prerequisites & objectiveslectures, grading & lecturer

what should you already know ?

undergraduate mathematics

linear algebralogicproof techniques

basics of linear programming

linear modelconvex polyhedra, simplex,duality,

basics of complexity

time/space complexityaverage/worst caseproblem classes P/NP/NP-C

computer programming

language(s) with objectsdebuggingperformance tests

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L1: introduction

Class detailsMotivation for Integer Linear Programming

content, prerequisites & objectiveslectures, grading & lecturer

what should you be able to do afterward ?

from the specifications of a complex problem:

formulate a “good” mathematical model

select and combine “appropriate” LP-basedsolution techniques

use solvers and tune them for improvedperformance

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L1: introduction

Class detailsMotivation for Integer Linear Programming

content, prerequisites & objectiveslectures, grading & lecturer

what will happen ?

participate please !

19 sep-14 nov: 9 interactive lectures+exercises1: introduction 2-4: modeling

5-6: searching 7-8: bounding9: decompositions

every monday morning 9h30-12h30, EMN room A119-B113.

sep 19, sep 26: room A119+ sep 28 : wednesday morning 9h30-12h30, room A119oct 3, oct 10, oct 17, oct 24, nov 7, nov 14: room B113

one final in-class exam

3h: nov 21

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L1: introduction

Class detailsMotivation for Integer Linear Programming

content, prerequisites & objectiveslectures, grading & lecturer

readings

L. Wolsey, Integer Programming, 1998, Wiley.G. Nemhauser and L. Wolsey, Integer and CombinatorialProgramming, 1988, Wiley.C. Papadimitriou and K. Steiglitz, Combinatorial Optimization,1982, Prentice-Hall.V. Chvátal, Linear Programming, 1983, Freeman.

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L1: introduction

Class detailsMotivation for Integer Linear Programming

content, prerequisites & objectiveslectures, grading & lecturer

whoami ?

http://www.emn.fr/z-info/sdemasse/

studied Maths (commutative algebra)got a Ph.D. in C.S. (combinatorial optimization)now associate professor at École des Mines de Nantes,researcher in the Constraints group of LINA CNRS UMR 6241interested in hybridations of constraint programming and integerlinear programmingnon native-English speaker... tell if you don’t understand me !

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L1: introduction

Class detailsMotivation for Integer Linear Programming

definitionsdealing with integers

Outline

1 Class details

2 Motivation for Integer Linear Programmingdefinitionsdealing with integers

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L1: introduction

Class detailsMotivation for Integer Linear Programming

definitionsdealing with integers

Definitions

optimization is...

a branch of mathematics that studies real-life systems where:there is an objective to achieve and constraints to satisfy

mathematical model is...an abstract representation of a system given asmathematical relations over a set of variables

mixed integer linear program is...

a mathematical model of an optimization problem where:the objective is to minimize or maximize a linear expressionall constraints are linear equalities and inequalitiessome variables have integer or binary values

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L1: introduction

Class detailsMotivation for Integer Linear Programming

definitionsdealing with integers

Definitions

Mixed Integer Linear Program (MILP): some variables have integervaluesInteger Linear Program (ILP or IP): all variables have integer valuesBinary Integer Linear Program (BILP or BIP): all variables havebinary values

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L1: introduction

Class detailsMotivation for Integer Linear Programming

definitionsdealing with integers

Quizz...

programming

1 what does programming mean in mathematical programming ?

LP and convexity

1 define: convex set, convex hull, (convex) polyhedron, polytope2 show that the set P of the feasible solutions of an LP is convex3 show that if P is a non-empty polyhedron then one of its vertex is

an optimal solution4 cite algorithms for solving LP

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L1: introduction

Class detailsMotivation for Integer Linear Programming

definitionsdealing with integers

Mixed Integer Linear Program (MILP)

MILP (standard form)

maxn�

j=1

cjxj +p�

k=1

hkyk (1)

s.t.n�

j=1

aijxj +p�

k=1

gikyk ≤ bi ∀i ∈ {1, 2, . . . ,m}, (2)

xj ∈ Z+ ∀j ∈ {1, 2, . . . , n}, (3)yk ∈ R+ ∀k ∈ {1, 2, . . . , p}. (4)

instance: c ∈ Qn, h ∈ Qp, a ∈ Qm×n, g ∈ Qm×p

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L1: introduction

Class detailsMotivation for Integer Linear Programming

definitionsdealing with integers

Mixed Integer Linear Program (MILP)

MILP (standard vectorial form)

max { cx+ hy | ax+ gy ≤ b, x ∈ Zn+, y ∈ Rp

+ }

solution ∈ { (x, y) | x ∈ Zn+, y ∈ Rp

+ }feasible solution ∈ { (x, y) | ax+ gy ≤ b, x ∈ Zn

+, y ∈ Rp+ }

optimal solution ∈ argmax{cx+ hy | ax+ gy ≤ b, x ∈ Zn+, y ∈ Rp

+}fractional solution ∈ argmax{cx+ hy | ax+ gy ≤ b, x ∈ Rn

+, y ∈ Rp+}

optimum = max { cx+ hy | ax+ gy ≤ b, x ∈ Zn+, y ∈ Rp

+ }

Usually, solving a MILP is to find an optimal solutionSometimes, one may be only interested in the optimum value or in agood feasible solution

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L1: introduction

Class detailsMotivation for Integer Linear Programming

definitionsdealing with integers

Mixed Integer Linear Program (MILP)

IP with two variables x, y ∈ Z+ (graphic representation)

feasible region of LP

fractional solution

optimal solution

x

y

cost

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L1: introduction

Class detailsMotivation for Integer Linear Programming

definitionsdealing with integers

Modeling with integers

many optimization problems are combinatorial:

look for an object from a finite or countably infinite setex: an integer (number of trains), a set (part of staff), apermutation (order of tasks), a graph (path in a network)the physical entities are indivisible and must be associated todiscrete variablesex: train, employee, task, arcthe constraints are nonlinear and can be modeled using0-1 (binary) variablesex: yes/no decisions (employee x is assigned or not), logicalconditions (if train x is scheduled then rail track y is occupied atime t), nonlinear cost (set-up costs of tasks)

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L1: introduction

Class detailsMotivation for Integer Linear Programming

definitionsdealing with integers

Modeling with integers

a combinatorial optimization problem is...

formally defined by

minS⊆N{�

j∈S

cj | S ∈ F }

given:a finite set Na set F of subsets of Na vector of weights c ∈ RN

P(N) is the space of solutions (the search space)F is the set of feasible solutions of the COP

−→ many combinatorial problems can properly be modeled as MILP

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L1: introduction

Class detailsMotivation for Integer Linear Programming

definitionsdealing with integers

How hard is integer programming ?

how hard is LP ?LP∈ P

the ellipsoid algorithm is polynomial-timethe simplex algorithm is practical (even if non-polynomial)

how hard is MILP ?MILP is NP − complete in the strong sense

no known (pseudo)polynomial-time algorithm for solving MILPno known general practical algorithm for large MILP

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L1: introduction

Class details

Motivation for Integer Linear Programming

definitions

dealing with integers

LP relaxation

IP is much harder than LP ?

Why not solve the LP relaxation and round the solutions to the closest

integer ?

solving the associated LP relaxation results in a upper bound to

the optimal solution to the MILP (for maximization)

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L1: introduction

Class detailsMotivation for Integer Linear Programming

definitionsdealing with integers

Why not solve the LP relaxation and round the solutions ?

because, in many cases:the optimum value of the LP relaxation is far from that of the IPone need a solution and not only the optimum value:

rounding an optimal solution of LP gives an integer solution but notnecessarily a feasible solution of IProunding may result in a feasible solution far from optimal

often even worse for BIP: (0.5, 0.5, . . .) can be a fractional solutionbut gives no information

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L1: introduction

Class detailsMotivation for Integer Linear Programming

definitionsdealing with integers

Quizz...

Rouding the fractional solution

1 draw and solve the following IP and its LP relaxation

max x+ 0.64y

s.t. 50x+ 31y ≤ 250

3x− 2y ≥ −4

x, y ∈ Z+

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L1: introduction

Class detailsMotivation for Integer Linear Programming

definitionsdealing with integers

Then, how to solve a MILP ?

with the simplex (or any LP) algorithm !

alone (if the fractional solution is integer)with cutting-planes (to shrink the LP polyhedron)with branch-and-bound (intelligent enumeration of the solutions)with decomposition (separation of the subproblems)

these are generic algorithms, they can be combined, they can beadapted to specific classes of problems

BUT no general algorithm is known that is practical for any large MILP

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L1: introduction

Class detailsMotivation for Integer Linear Programming

definitionsdealing with integers

Then, how to solve a MILP ?

we will see these methods in the later lecturesfirst we need to know how to model as MILPa typical MILP can have many formulationsnot all formulations are created equal

then we need to find the good formulations

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L1: introduction

Class detailsMotivation for Integer Linear Programming

definitionsdealing with integers

Quizz...

combinatorial

1 what is the nature of LP: a continuous or combinatorialoptimization problem ?

2 describe a MILP where a fractional solution is an optimal solution3 prove that solving the associated LP relaxation results in a upper

bound to the optimal solution to the MILP (for maximization)

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L1: introduction

Modeling with discrete variablesModeling with binary variables

Part II

Modeling with Integers (I)

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L2: modeling

Modeling with discrete variablesModeling with binary variables

Outline

3 Modeling with discrete variables

4 Modeling with binary variables

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L2: modeling

Modeling with discrete variablesModeling with binary variables

Modeling with discrete variables

combinatorial problems

In many optimization problems, some physical entities are indivisibleand one need to find:

count: the number of elements in a finite discrete setselection: one (best) element out of a finite discrete setorder: a permutation of a list of elementsschedule: a timed permutationgraph: a subtructure in a given graph

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L2: modeling

Modeling with discrete variablesModeling with binary variables

Modeling with discrete variables

combinatorial problems

indivisible entities must be associated to discrete variablesmapping: discrete ↔ non-negative integer Z+

feasibility and optimality conditions can often be modeled aslinear functions of the discrete variables

Examples of classes of combinatorial problems...

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L2: modeling

Modeling with discrete variablesModeling with binary variables

Modeling scheduling problems

scheduling

decide when to commit resources between a variety of possibletaskstasks are partially ordered and associated to shared resourcesorder and date their executionproduction process (jobs/machines), computing(processes/processors), project managementdiscrete variables:

assign a task to a time period (ex: starting time of a job)count the load of a resource at each timemodel the relative order of two tasks

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L2: modeling

Modeling with discrete variablesModeling with binary variables

Modeling timetabling problems

Timetabling

decide how to commit resources between a variety of possibletaskstasks are associated to time periodscoordinate the resources to execute a taskassign a valid sequence of tasks to each resourcetransport (flight/airplane), workplace (shift/nurse), school(class/teacher& room)discrete variables:

assign a task to a resource (ex: shift of a nurse)model the in/compatibility of 2 resources at some timemodel a sequence of tasksassign a sequence of tasks to a resource

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L2: modeling

Modeling with discrete variablesModeling with binary variables

Modeling routing problems

Routing

selecting paths in a network along which to send network trafficdifferent travelling measures: cost, load, distance, timeassign vehicles to pathscapacity, precedence between nodes, time windows, etc.discrete variables:

assign a node to a vehiclemodel the relative order of 2 nodes in a pathmodel a pathcount the cost or weight of a pathassign a path to a vehicle

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L2: modeling

Modeling with discrete variablesModeling with binary variables

Modeling placement problems

packing and geometric placement

assign items to containers and place them in 1D, 2D or 3D withoutoverlappingdifferent packing measures: profit, size, weightminimize the number of containers or the total gap, maximize theprofit of the packed itemssome items are incompatible or must be at a given distancethe lenghts on some dimension can be cumulatedmanufacturing (cut of paper, steel), transport and stock, locationand sizing, puzzlesdiscrete variables:

assign an item to a containerassign a container to a set of itemscount the load of a containerassign an item to a coordinate

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L2: modeling

Modeling with discrete variablesModeling with binary variables

Modeling with discrete variables

some other classes of combinatorial problems:

network design, configuration, geometrical tiling, satisfiability,frequency allocation, phylogenetic, coloring, localization, motionplanning,...

Many real-world problems are composed of subproblems of thepreceding classes, ex:

job scheduling and human resourcesvehicle routing and packing 3D

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L2: modeling

Modeling with discrete variablesModeling with binary variables

logical/numeric conditionnon-linear value functionsoutline

Outline

3 Modeling with discrete variables

4 Modeling with binary variableslogical/numeric conditionnon-linear value functionsoutline

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L2: modeling

Modeling with discrete variablesModeling with binary variables

logical/numeric conditionnon-linear value functionsoutline

Modeling with binary variables

boolean condition as a 0-1 variable

decision: is item j selected ?assignment: is item j assigned to value i ?value indicator: is variable x positive (or x ≥ α) ?condition indicator: does constraint c hold ?

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L2: modeling

Modeling with discrete variablesModeling with binary variables

logical/numeric conditionnon-linear value functionsoutline

Modeling with binary variables

logical/numeric condition as a linear combination of 0-1 variables

(exclusive) disjunction: (either) δ1 or δ2dependency: if δ1 then δ2

exclusive alternative: exactly 1 out of ncounter or bound: exactly/at least/at most k out of n

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L2: modeling

Modeling with discrete variablesModeling with binary variables

logical/numeric conditionnon-linear value functionsoutline

Modeling with binary variables

non-linear value functions with 0-1 variables

set-up value: f(x) = either a(x) or a(x) + b

discrete values: f(x) = fi if x = i

piecewise linear: f(x) linear on [ai−1, ai]

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L2: modeling

Modeling with discrete variablesModeling with binary variables

logical/numeric conditionnon-linear value functionsoutline

Modeling yes/no decision

Example: Integer Knapsack Problem

Given n items with associated values cjand weights wj and a knapsack ofcapacity K; find a subset of items ofmaximum value to pack (the total weightdoes not exceed K).

is item j selected ?0-1 decision variable:

xj = 1 iff j is selected.

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L2: modeling

Modeling with discrete variablesModeling with binary variables

logical/numeric conditionnon-linear value functionsoutline

Modeling yes/no decision

Integer Knapsack Problem

maxn�

j=1

cjxj (5)

s.t.n�

j=1

wjxj ≤ K (6)

xj ∈ {0, 1} j = 1, . . . , n (7)

xj = 1 iff item j is selected

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L2: modeling

Modeling with discrete variablesModeling with binary variables

logical/numeric conditionnon-linear value functionsoutline

Modeling multiple choice (1 out of n)

Example: Weighted Matching Problem

Given n tasks and m resources associated topreferences cij for assigning task i to resource j;find an assignment of tasks to resources thatmaximize the sum of the preferences.

is task i assigned to resource j?0-1 decision variable: xij = 1 iff i is assigned to j

i is assigned to exactly one resource j.constraint:

xij = 1 ⇐⇒ xik = 0, ∀k �= j

linearized as:m�

j=1

xij = 1

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L2: modeling

Modeling with discrete variablesModeling with binary variables

logical/numeric conditionnon-linear value functionsoutline

Modeling multiple choice (1 out of n)

Weighted Matching Problem

maxn�

i=1

m�

j=1

cijxij (8)

s.t.m�

j=1

xij = 1 i = 1, . . . , n (9)

xij ∈ {0, 1} i = 1, . . . , n; j = 1, . . . ,m (10)

xij = 1 iff task i is assigned to resource j

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L2: modeling

Modeling with discrete variablesModeling with binary variables

logical/numeric conditionnon-linear value functionsoutline

Modeling dependency (if-then)

Example: Uncapacitated Facility Location Problem

Given n potential facility locations and m

customers to serve from one facility, associatedto costs cj for opening facility j and dij for servingcustomer i from facility j; find a subset oflocations to open facilities that minimizes the cost(opening and service).

is facility j opened ?0-1 decision variable: xj = 1 iff j is open

is customer i served from facility j? i is served from exactly one j.0-1 decision variable: yij = 1 iff i is served from jconstraint:

�mj=1 yij = 1

if customer i is served from facility j then j is open.constraint:

yij = 1 =⇒ xj = 1linearized as:

yij ≤ xj

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L2: modeling

Modeling with discrete variablesModeling with binary variables

logical/numeric conditionnon-linear value functionsoutline

Modeling dependency (if-then)

Uncapacitated Facility Location Problem

minn�

j=1

cjxj +n�

j=1

m�

i=1

dijyij (11)

s.t.n�

j=1

yij = 1 i = 1, . . . ,m (12)

yij ≤ xj j = 1, . . . , n; i = 1, . . . ,m (13)xj ∈ {0, 1} j = 1, . . . , n (14)yij ∈ {0, 1} j = 1, . . . , n; i = 1, . . . ,m (15)

xj = 1 iff facility j is openedyij = 1 iff customer i is served from facility j

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L2: modeling

Modeling with discrete variablesModeling with binary variables

logical/numeric conditionnon-linear value functionsoutline

Modeling exclusive disjunction (either-or)

Example: Scheduling Problem 1||Cmax

Find a minimal makespan schedule of n taskswith durations pi ∈ Z∗

+ on one machine, i.e.no two tasks are executed simultaneously.

starting time of task j ?integer variable: sj ∈ Z∗

+

is task j preceding task i ?0-1 indicator variable: xij = 1 iff sj − si ≥ pilinearized constraint (let M =

�nj=1 pj):

sj − si ≥ Mxij + (pi −M)

either i precedes j or j precedes i.constraint: xij = 1 ⇐⇒ xji = 0linearized as:

xij + xji = 1

note: xij = 1 ⇐ sj − si ≥ pi is a consequence of the two

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L2: modeling

Modeling with discrete variablesModeling with binary variables

logical/numeric conditionnon-linear value functionsoutline

Modeling dependency (either-or)

Scheduling Problem 1||Cmax

min sn+1 (16)s.t. sn+1 ≥ sj + pj j = 1, . . . , n (17)

sj − si ≥ Mxij + (pi −M) i, j = 1, . . . , n (18)xij + xji = 1 i, j = 1, . . . , n; i < j (19)sj ∈ Z+ j = 1, . . . , n+ 1 (20)xij ∈ {0, 1} i, j = 1, . . . , n (21)

sj starting time of task j

xij = 1 iff task i is preceding task j

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L2: modeling

Modeling with discrete variablesModeling with binary variables

logical/numeric conditionnon-linear value functionsoutline

Quizz...

scheduling problem

1 what is the complexity of the preceding scheduling problem ?2 propose a method to solve it3 is it necessary to set variables s integer ?

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L2: modeling

Modeling with discrete variablesModeling with binary variables

logical/numeric conditionnon-linear value functionsoutline

Modeling discrete values

Example: Knapsack Problem with Variable CapacityA knapsack is available in m different capacities Ki

(increasing) at different values Ci (decreasing: it ispreferable to carry a smal weight); find the packingof n items with values cj and weights wj in oneknapsack that maximizes the total value of the pack(items+sack)

is item j selected ?0-1 decision variable: xj = 1 iff j is selected

is configuration (Ki, Ci) chosen ? choose exactly one.0-1 decision variable: yi = 1 iff i is chosenthe knapsack cost is

�mi=1 Ciyi and capacity

�mi=1 Kiyi

with constraint:�m

i=1 yi = 1

Special Ordered Set of type 1 (SOS1)

a sequence {y1, . . . , ym} of positive variables in which no more thanone member is non-zero in any feasible solution.

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L2: modeling

Modeling with discrete variablesModeling with binary variables

logical/numeric conditionnon-linear value functionsoutline

Modeling discrete values

Knapsack Problem with Variable Capacity

maxn�

i=1

Ciyi +m�

j=1

cjxj (22)

s.t.m�

j=1

wjxj ≤n�

i=1

Kiyi (23)

n�

i=1

yi = 1 (24)

xj ∈ {0, 1} j = 1, . . . ,m (25)yi ∈ {0, 1} i = 1, . . . , n (26)

xj = 1 iff item j is selectedyi = 1 iff configuration (Ki, Ci) is selected

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L2: modeling

Modeling with discrete variablesModeling with binary variables

logical/numeric conditionnon-linear value functionsoutline

Modeling discrete values

Knapsack Problem with Variable Capacity

maxn�

i=1

Ciyi +m�

j=1

cjxj (22)

s.t.m�

j=1

wjxj ≤n�

i=1

Kiyi (23)

SOS1(y1, . . . , ym) (24)xj ∈ {0, 1} j = 1, . . . ,m (25)yi ∈ {0, 1} i = 1, . . . , n (26)

Most solvers allow you to specify SOS1and implement a specialized solution algorithm (branching)

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L2: modeling

Modeling with discrete variablesModeling with binary variables

logical/numeric conditionnon-linear value functionsoutline

Modeling a set-up value

Example: linear cost function with set-up

f : [0, U ] ⊆ R+ → R+

f(x) =

�0 if x = 0

ax+ b if 0 < x ≤ U

is variable x positive ?0-1 decision variable: δ = 1 iff x > 0linearized constraint:

δ ≤ x ≤ Uδ

the cost becomes the linear function:

f(x) = ax+ bδ

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L2: modeling

Modeling with discrete variablesModeling with binary variables

logical/numeric conditionnon-linear value functionsoutline

Quizz...

Intervals

1 represent graphically the set of solutions defined by: y ∈ {0, 1},x ∈ {0, . . . , U}, y = 1 ⇐⇒ x > 0 and deduce a linearization

2 idem for y = 1 ⇐⇒ x > a with 0 < a < U

3 idem for y = 1 ⇐⇒ a < x ≤ b with 0 < a < b < U

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L2: modeling

Modeling with discrete variablesModeling with binary variables

logical/numeric conditionnon-linear value functionsoutline

Modeling a piecewise linear function

useful to approximate some real cost functions

Example: piecewise linear cost function

Let real numbers a0 < a1 < · · · < an and acost function f : [a0, an] ⊆ R+ → R+ that iscontinuous and linear on each interval[ai−1, ai]

convexity of (f on) each interval: x ∈ [ai−1, ai] =⇒ ∃λi−1,λi > 0 st(λi−1+λi = 1) ∧ (x = λi−1ai−1+λiai) ∧ (f(x) = λi−1f(ai−1)+λif(ai))

x =�

i

λiai with one or two consecutive nonzero λj’s

Special Ordered Set of type 2 (SOS2)

a sequence {λ0, . . . ,λn} of positive variables in which not more thantwo consecutive members may be nonzero in a feasible solution.

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L2: modeling

Modeling with discrete variablesModeling with binary variables

logical/numeric conditionnon-linear value functionsoutline

Modeling a piecewise linear function

Example: piecewise linear cost function

minn�

i=0

λif(ai) (27)

s.t. x =n�

i=0

λiai (28)

SOS2(λ0, . . . ,λn) (29)n�

i=0

λi = 1 (30)

λi ≥ 0 i = 0, . . . , n (31)x ∈ S (32)

Even if variables are fractional, this is an integer program !

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L2: modeling

Modeling with discrete variablesModeling with binary variables

logical/numeric conditionnon-linear value functionsoutline

Quizz...

Question

1 linearize the following problem:

SOS2(λ0, . . . ,λn) (33)0 ≤ λi ≤ Ui i = 0, . . . , n (34)

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L2: modeling

Modeling with discrete variablesModeling with binary variables

logical/numeric conditionnon-linear value functionsoutline

Modeling with binary variables: Outline 1

boolean condition as a 0-1 variable

indicator linearizationδ = 1 ⇐⇒ x > 0, x ∈ Z+ δ ≤ x ≤ Uδδ = 1 ⇐⇒ x > a (a+ �)δ ≤ x ≤ a+ (U − a)δδ = 1 ⇐⇒ a ≤ x < b need 2 indicatorsδ = 1 =⇒ Ay ≥ a Ay ≥ m+ (a−m)δδ = 0 =⇒ Ay ≥ a Ay ≥ m+ (a−m)(1− δ)δ = 1 =⇒ Ay < b Ay ≤ M + (b+ �−M)δAy ≥ b =⇒ δ = 0 Ay ≤ M + (b+ �−M)δ

with x ∈ [0, U ] ⊆ R+, Ay ∈ [m,M ] ⊆ R and indicator δ ∈ {0, 1}

It is often not necessary to enforce equivalence ( ⇐⇒ ) betweenthe indicator and the condition: one-sense implication ( =⇒ ) canbe enough (and simplier)

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L2: modeling

Modeling with discrete variablesModeling with binary variables

logical/numeric conditionnon-linear value functionsoutline

Modeling with binary variables: Outline 2

logical/numeric condition as a linear combination of 0-1 variables

condition example linearizationexclusive disjunction either c or c δ = 1 ⇐⇒ c

exclusive disjunction either c1 or c2 δ1 + δ2 = 1disjunction c1 or c2 δ1 + δ2 ≥ 1dependency if c1 then c2 δ2 ≥ δ1exclusive alternative exactly 1 out of n

�ni=1 δi = 1

counter exactly k out of n�n

i=1 δi = k

bound at least k out of n�n

i=1 δi ≥ k

bound at most k out of n�n

i=1 δi ≤ k

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L2: modeling

Modeling with discrete variablesModeling with binary variables

logical/numeric conditionnon-linear value functionsoutline

Modeling with binary variables: Outline 3

non-linear value function with 0-1 variables

set-up value:f(x) = a(x) ∨ a(x) + b

f(x) = a(x) + bδ

discrete values:f(x) = fi if x = i

f(x) =�

i δifiwith SOS1(δi)

piecewise linear:linear on [ai−1, ai]

f(x) =�

i δif(ai)with SOS2(δi)

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L2: modeling

Modeling with discrete variablesModeling with binary variables

logical/numeric conditionnon-linear value functionsoutline

How to model as a MILP

Given an problem instance

identify and differentiate data (constant) and unknowns(variables)define a set of variablesuse these variables to define the feasibility constraints and theobjective function (even non-linear)define an additional or alternative set of variables to modelnon-linear or missing constraintsensure that the feasible solutions correspond to this model

It is not always easy to define a first set of variables:

identify the class of your problem and look for the literature to findusual formulationsfor COP, identify the groud set N and use an incidence vectorx ∈ {0, 1}N : xj = 1 iff j ∈ S

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L2: modeling

alternative modelsimproving models

good IP models

Part III

Improving Models

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L3: modeling

alternative modelsimproving models

good IP models

better models ?formulation strengtheasy problems

Outline

5 alternative modelsbetter models ?formulation strengtheasy problems

6 improving models

7 good IP models

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L3: modeling

alternative modelsimproving models

good IP models

better models ?formulation strengtheasy problems

alternative MILP

a discrete set of solutions can be modeled as different IPshaving either:

the same variables but different constraintsdifferent variables and constraints

how to choose between two models ?

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L3: modeling

alternative modelsimproving models

good IP models

better models ?formulation strengtheasy problems

criteria for good models

a good model

small-size: polynomial number of constraints/variablesflexible: about slight changes of the problemeasy LP: the LP relaxation is solved faststructured: call for decompositioneffective LP: the LP relaxation value is close to the optimum

These criteria may be complementary, ex:small =⇒ easy LP

or contradictory, ex:easy LP / effective LPsmall / structured

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L3: modeling

alternative modelsimproving models

good IP models

better models ?formulation strengtheasy problems

criteria for good models

a good model

small-size: polynomial number of constraints/variablesflexible: about slight changes of the problemeasy LP: the LP relaxation is solved faststructured: call for decompositioneffective LP: the LP relaxation value is close to the optimum

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L3: modeling

alternative modelsimproving models

good IP models

better models ?formulation strengtheasy problems

formulation strength

Let X ⊆ Zn a discrete set, e.g. the feasible solution set of an IP.

formulation strength

a formulation for X is any polyhedron P ⊆ Rn such that X = P ∩ Zn

conv(X) is the strongest formulation of X:the optimum of a linear program over conv(X) is at an extreme pointthe extreme points of conv(X) all lie in Xmax{cx | x ∈ X} = max{cx | x ∈ conv(X)}the second program can be solved in polynomial time

characterizing conv(X) is as hard as solving the IP

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L3: modeling

alternative modelsimproving models

good IP models

better models ?formulation strengtheasy problems

explicit convex hull

There are a number of problems for which conv(X) can easily becharacterized

assignment problemspanning tree problemmatching problem

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L3: modeling

alternative modelsimproving models

good IP models

better models ?formulation strengtheasy problems

totally unimodular matrix

(P ) = max{ cx | Ax ≤ b, x ∈ Zn+ }

basic feasible solutions of the LP relaxation (P̄ ) take the form:x̄ = (x̄B , x̄N ) = (B−1

b, 0) where B is a square submatrix of (A, Im)

Cramer’s rule: B−1 = B∗/det(B) where B

∗ is the adjoint matrix(made of products of terms of B)Proposition: if (P ) has integral data (A, b) and if det(B) = ±1 then x̄

is integral

DefinitionA matrix A is totally unimodular (TU) if every square submatrix hasdeterminant +1, −1 or 0.

Proposition

If A is TU and b is integral then any optimal solution of (P̄ ) is integral.

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L3: modeling

alternative modelsimproving models

good IP models

better models ?formulation strengtheasy problems

totally unimodular matrix

How to recognize TU ?

Sufficient conditionA matrix A is TU if

all the coefficients are +1, −1 or 0each column contains at most 2 non-zero coefficientthere exists a partition (M1,M2) of the set M of rows such thateach column j containing two non zero coefficients satisfies�

i∈M1aij −

�i∈M2

aij = 0.

Proposition

A is TU ⇐⇒ At is TU ⇐⇒ (A, Im) is TU

where At is the transpose matrix, Im the identitiy matrix

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L3: modeling

alternative modelsimproving models

good IP models

better models ?formulation strengtheasy problems

Quizz: easy problems

Capacitated Transhipment Problem

Given a digraph G = (V,A) with either (positive) demand or (negative)supply bi at each node i ∈ V , arc capacities hij , and unit flow costs cijfor all (i, j) ∈ A. Find a feasible integer flow that satisfies all thedemands at minimum cost.

1 model as an IP2 analyze this problem

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L3: modeling

alternative modelsimproving models

good IP models

better models ?formulation strengtheasy problems

Answer

Capacitated Transhipment Problem

min�

(i,j)∈A

cijxij

s.t.�

j∈δ+(i)

xij −�

j∈δ−(i)

xij = bi i ∈ V

xij ≤ hij (i, j) ∈ A

xij ∈ Z+ (i, j) ∈ A

xij = 1 is the flow value on arc (i, j) ∈ A

δ+(i) and δ−(i) are the sets of successors and predecessors ofi ∈ V , resp.

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L3: modeling

alternative modelsimproving models

good IP models

better models ?formulation strengtheasy problems

Answer

Capacitated Transhipment Problem

The matrix is�

M

IA

�with M ∈ {0, 1,−1}V ×A the incidence matrix

of the graph and IA the identity matrixeach column xij in M has coefficients:

arij =

1 in row r = i

−1 in row r = j

0 in all other rows r

the rows of M can be partitioned as M1 = M and M2 = ∅ suchthat:

�r∈M1

arij −�

r∈M2arij = (1+ (−1))− 0 = 0 for all column xij

M is TU then the matrix of the IP is TUif demands b and capacities h are all integral then any optimumnetwork flow is integral.

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L3: modeling

alternative modelsimproving models

good IP models

better models ?formulation strengtheasy problems

Quizz: easy problems

Weighted Matching Problem

Given n tasks and m resources associated topreferences cij for assigning task i to resource j;find an assignment of tasks to resources thatmaximizes the sum of the preferences.

Assignment problem

Special case where n = m and each resource is assigned to exactlyone task.

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L3: modeling

alternative modelsimproving models

good IP models

better models ?formulation strengtheasy problems

Answer

Assignment Problem

it is a special case of the transshipment (min-cost flow) problemwhere the graph is bipartite: V = Tasks ∪Resources,A = Tasks×Resources, capacities are all equal to 1, demands are1 at a node-task and -1 at a node-resource

other special minimum cost flow problems:the shortest s− t path problemthe maximum s− t flow problem

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L3: modeling

alternative modelsimproving models

good IP models

better models ?formulation strengtheasy problems

Answer

Weighted Matching Problem

maxn�

i=1

m�

j=1

cijxij (35)

s.t.m�

j=1

xij = 1 i = 1, . . . , n (36)

xij ≤ 1 i = 1, . . . , n; j = 1, . . . ,m (37)xij ∈ Z+ i = 1, . . . , n; j = 1, . . . ,m (38)

the matrix�

M

In×m

�is TU since each column xij of M has at most

one non-zero coefficient:

arij =

�1 in row r = i

0 in all other rows r

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L3: modeling

alternative modelsimproving models

good IP models

strengthening constraintsadding constraintschanging variables

Outline

5 alternative models

6 improving modelsstrengthening constraintsadding constraintschanging variables

7 good IP models

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L3: modeling

alternative modelsimproving models

good IP models

strengthening constraintsadding constraintschanging variables

stronger formulation: formal definition

A typical IP is not easy:P ⊆ conv(X) � P̄

the closer P̄ is to conv(X) (in the direction of c), the better

DefinitionGiven two formulations P1 and P2 of a same ILP,

P1 is at least as strong as P2 if P1 ⊆ P2

P1 is stronger than P2 if P1 � P2

P1 is ideal or integral if P1 = conv(X)

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L3: modeling

alternative modelsimproving models

good IP models

strengthening constraintsadding constraintschanging variables

Quizz: strengthening constraints

Uncapacitated Facility Location Problem

Given n potential facility locations and m

customers to serve from one facility, associatedto costs cj for opening facility j and dij for servingcustomer i from facility j; find a subset oflocations to open facilities that minimizes the cost(opening and service).

1 model this problem as a BIP2 derive a second model by aggregating the dependency

constraints3 compare the size and the strength of the two models

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L3: modeling

alternative modelsimproving models

good IP models

strengthening constraintsadding constraintschanging variables

Answer: disaggregated model

Uncapacitated Facility Location Problem

minn�

j=1

cjxj +n�

j=1

m�

i=1

dijyij

s.t.n�

j=1

yij = 1 i = 1, . . . ,m

yij ≤ xj j = 1, . . . , n; i = 1, . . . ,m

xj ∈ {0, 1}, yij ∈ {0, 1} j = 1, . . . , n; i = 1, . . . ,m

xj = 1 iff facility j is opened, yij = 1 iff customer i is served from j

size: O(nm) in model 1

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L3: modeling

alternative modelsimproving models

good IP models

strengthening constraintsadding constraintschanging variables

Answer: aggregated model

Uncapacitated Facility Location Problem

minn�

j=1

cjxj +n�

j=1

m�

i=1

dijyij

s.t.n�

j=1

yij = 1 i = 1, . . . ,m

m�

i=1

yij ≤ mxj j = 1, . . . , n

xj ∈ {0, 1}, yij ∈ {0, 1} j = 1, . . . , n; i = 1, . . . ,m

size: O(nm) in model 1 and O(n+m) in model 2but model 1 is stronger than model 2 (prove it):ex: m = n = 40, standard LP-based B&B solving times:2 seconds with model 1, >14h with model 2

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L3: modeling

alternative modelsimproving models

good IP models

strengthening constraintsadding constraintschanging variables

Avoid Big M’s

P = {(x, y) ∈ R+ × Z+ | x ≤ My, x ≤ u, y ∈ {0, 1} }P̄ = {(x, y) ∈ R+ × R+ | x ≤ My, x ≤ u, y ≤ 1 }conv(P ) = {(x, y) ∈ R+ × R+ | x ≤ uy, y ≤ 1 }

tightening big M

if M = u then P̄ = conv(P )

smaller is the big M, stronger is the formulation

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L3: modeling

alternative modelsimproving models

good IP models

strengthening constraintsadding constraintschanging variables

Quizz: adding constraints

Perfect Matching Problem

Given a set of n people that need to be paired in teams of two, a costcij for each team composed of 2 persons i and j, the problem is tominimize the cost pairing over all teams.

the problem can be represented by the complete graph Kn

nodes i ∈ N represent people, edges e ∈ E represent pairings

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L3: modeling

alternative modelsimproving models

good IP models

strengthening constraintsadding constraintschanging variables

Answer

Perfect Matching Problem

min�

e∈E

cexe

s.t.�

e∈E|i∈e

xe = 1 i = 1, . . . , n

xe ∈ {0, 1} e ∈ E

xe = 1 iff the endpoints of e are matchednote that the matrix is usually not TU

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L3: modeling

alternative modelsimproving models

good IP models

strengthening constraintsadding constraintschanging variables

Valid inequality for matching

this formulation can be extremely weak, example:

the optimum of the instance above-left has value L+ 2

the LP relaxation optimum (above-right) has value 3

we can add inequality:

x24 + x35 ≥ 1

it is a valid inequality: satisfied by every feasible solutionit is a cutting-plane: satisfied by every feasible solution, butviolated by the current fractional solution

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L3: modeling

alternative modelsimproving models

good IP models

strengthening constraintsadding constraintschanging variables

Odd-set inequalities

The cutset of a subset S of nodes:

δ(S) = {{i, j} ∈ E | i ∈ S, j �∈ S}

if |S| is odd then every perfect matching contains at least oneedge from δ(S)

hence each odd cutset induces a possible valid inequality:�

e∈δ(S)

xe ≥ 1

Edmonds’ theorem tells that the model with all odd set inequalitiesis integralbut its size is exponentialthe valid inequalities can be generated on the fly: cutting-planesalgorithm

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L3: modeling

alternative modelsimproving models

good IP models

strengthening constraintsadding constraintschanging variables

Quizz: changing variables (1)

Uncapacitated Lot-Sizing Problem (ULS)

The problem is to decide a production plan for a n-period horizon for asingle product. The basic model can be viewed as having data:ft the fixed cost of producing in period t;pt the unit production cost in period t;ht the unit storage cost in period t;dt the demand in period t.The production plan must satisfy the demand with a minimum cost.

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L3: modeling

alternative modelsimproving models

good IP models

strengthening constraintsadding constraintschanging variables

Natural formulation of ULS

Uncapacitated Lot-Sizing Problem

minn�

t=1

ftyt +n�

t=1

ptxt +n�

t=1

htst

s.t. st−1 + xt = dt + st t = 1, . . . , n

xt ≤ Myt t = 1, . . . , n

yt ∈ {0, 1} t = 1, . . . , n

st, xt ≥ 0 t = 1, . . . , n

s0 = 0

xt is the amount produced in period t

st the stock at the end of period t

yt = 1 iff production occurs in period t.M =

�nt=1 dt is a weak upper bound on xt

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L3: modeling

alternative modelsimproving models

good IP models

strengthening constraintsadding constraintschanging variables

Extended formulation of ULS

let zit model the amount produced in period i designated tosatisfy demand in period t ≥ i

the production lot xi is splitted into smaller pieces:

xi =n�

t=i

zit

with tighter dependency constraints:

zit ≤ dtyi i = 1, . . . , n; t = i, . . . , n

demands can now be modeled as:t�

i=1

zit = dt t = 1, . . . , n

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L3: modeling

alternative modelsimproving models

good IP models

strengthening constraintsadding constraintschanging variables

Extended formulation of ULS

Uncapacitated Lot-Sizing Problem

minn�

t=1

ftyt +n�

i=1

n�

t=i

pizit +n�

i=1

n�

t=i+1

t−1�

j=i

hjzit

s.t.t�

i=1

zit = dt t = 1, . . . , n

zit ≤ dtyi i = 1, . . . , n; t = i, . . . , n

yt ∈ {0, 1} t = 1, . . . , n

zit ≥ 0 i = 1, . . . , n; t = i, . . . , n

zit is the amount produced in period i to satisfy the demand inperiod t

yt = 1 iff production occurs in period t

we can prove that this formulation is integral

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L3: modeling

alternative modelsimproving models

good IP models

strengthening constraintsadding constraintschanging variables

Selecting from a set

Set-{Partitioning, Covering, Packing}Given a ground set N of items and a set J ⊆ 2N

of subsets of N , select subsets in J such thateach item i appears in

exactly one (partitioning)at least one (covering)at most one (packing)

selected subset.

Define aij = 1 iff item i belongs to subset j ∈ J .

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L3: modeling

alternative modelsimproving models

good IP models

strengthening constraintsadding constraintschanging variables

Selecting from a set

Set Covering Problem

min�

s∈S

csxs (39)

s.t.�

s∈S

aisxs ≥ 1 i = 1, . . . , n (40)

xs ∈ {0, 1} s ∈ S (41)

ais = 1 iff item i belongs to s (constant)xs = 1 iff set s is selected (variable)

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L3: modeling

alternative modelsimproving models

good IP models

strengthening constraintsadding constraintschanging variables

Quizz: changing variables (2)

Bin-Packing Problem (1D-BP)

m items have to be packed each into one of the n availablecontainers. Each item j has a weight wj and all containers have thesame capacity c. The problem is to find a packing in a minimumnumber of containers so as the total weights of the items in eachcontainer does not exceed the capacity.

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L3: modeling

alternative modelsimproving models

good IP models

strengthening constraintsadding constraintschanging variables

Compact formulation of 1D-BP

Bin-Packing Problem

minn�

i=1

yi

s.t.m�

j=1

wjxij ≤ cyi i = 1, . . . , n

n�

i=1

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

xij ∈ {0, 1} i = 1, . . . , n; j = 1, . . . ,m

yi ∈ {0, 1} i = 1, . . . , n

yi = 1 if container i is usedxij if item j is packed in container i

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L3: modeling

alternative modelsimproving models

good IP models

strengthening constraintsadding constraintschanging variables

another formulation of 1D-BP

Consider N the set of items and S ⊆ 2N defined by:

s ∈ S ⇐⇒ s �= ∅ ∧�

j∈s

wj ≤ c

1D-BP is to select subsets in S such that each item j appears inexactly one subset.

Set-partitioning formulation

min�

s∈S

xs

s.t.�

s∈S

ajsxs = 1 j = 1, . . . , n

xs ∈ {0, 1} s ∈ S

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L3: modeling

alternative modelsimproving models

good IP models

strengthening constraintsadding constraintschanging variables

set-partitioning formulation of 1D-BP

this model is stronger than the compact modelit requires to pre-compute S: all the patterns filling a containerthis model may contain an exponential number of variablesthe variables can be generated on the fly: column-generationalgorithm

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L3: modeling

alternative modelsimproving models

good IP models

Outline

5 alternative models

6 improving models

7 good IP models

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L3: modeling

alternative modelsimproving models

good IP models

contrast with LP

in LP, the same problem can also have multiple formulationsin LP, conventional wisdom is that bigger formulations take longerto solvein IP, the size of the formulation does not determine how difficultthe IP is (ex: 1D-BP, ULS)decomposition methods allow to handle exponential-size models:progressive cutting-planes/column generationthe main criterium for a good IP model is the quality of the LPrelaxation

Sophie Demassey, TASC, EMN-INRIA/LINA Université de Nantes / M2 ORO / Advanced Integer Programming / L3: modeling