Slides Intro - Dipartimento di Informatica

Introduzione al corso RO2
LM Ingegneria Gestionale
Laura Galli
Dipartimento di Informatica
Largo B. Pontecorvo 3, 56127 Pisa
[email protected]
http://www.di.unipi.it/~galli
29 Settembre 2014
Ricerca Operativa 2
Laurea Magistrale in Ingegneria Gestionale
Universit`
a di Pisa
A.A. 2014/15
L. Galli
Corso di Ricerca Operativa 2
-
Laurea Magistrale in Ingegneria Gestionale
Universit`
a di Pisa
1 / 25
Conoscenze richieste
Corso di base di Ricerca Operativa
• Programmazione Lineare
• Algoritmo del Simplesso
• Dualit`
a
• Programmazione Lineare su grafi
• Cammino minimo
• Flusso massimo
• Flusso di costo minimo
L. Galli
Corso di Ricerca Operativa 2
-
Laurea Magistrale in Ingegneria Gestionale
Universit`
a di Pisa
2 / 25
Obiettivo e argomenti del corso
Obiettivo
Lo scopo del corso `e quello di fornire gli strumenti teorico-algoritmici necessari per
modellare e risolvere problemi di Programmazione Intera (IP), che sorgono nella
gestione di sistemi complessi, quali la produzione industriale o la gestione di
servizi. Il tema principale del corso `e il concetto di (ri)-formulazione.
Argomenti
• Cenni sulla complessit`
a computazionale
• Teoria e metodi di Programmazione Lineare Intera
• Modellazione e risoluzione di alcuni classici problemi di ottimizzazione
L. Galli
Corso di Ricerca Operativa 2
-
Laurea Magistrale in Ingegneria Gestionale
Universit`
a di Pisa
3 / 25
Il processo decisionale
complessit`
a
propriet`
a modello (analisi poliedrale)
Teoria
var. continue/intere
funz. lineari/non lineari
1 o pi`
u obiettivi
Algoritmo
Modello
esatto/euristico/approx.
general purpose/ad hoc
Problema
L. Galli
Corso di Ricerca Operativa 2
-
Laurea Magistrale in Ingegneria Gestionale
Universit`
a di Pisa
4 / 25
Riferimenti
Laura Galli
Dipartimento di Informatica
Largo B. Pontecorvo 3 - 56127 Pisa
Edificio C - 2◦ piano - stanza 345 DN
tel. 050 2212715
e-mail: [email protected]
ricevimento: gioved`ı 17.00-19.00
Orario del corso
• luned`ı 13.30-15.30 aula F4
• marted`ı 10.30-13.30 aula F4
L. Galli
Corso di Ricerca Operativa 2
-
Laurea Magistrale in Ingegneria Gestionale
Universit`
a di Pisa
5 / 25
Materiale per il corso
Pagina web del corso
http://www.di.unipi.it/optimize/Courses/
Ricerca Operativa II (LM Ingegneria Gestionale)
Testi e appunti
• lezioni alla lavagna...
• ...materiale fornito durante il corso
• Appunti RO
• M. Pappalardo, M. Passacantando, Ricerca Operativa, Edizioni Plus, 2010.
L. Galli
Corso di Ricerca Operativa 2
-
Laurea Magistrale in Ingegneria Gestionale
Universit`
a di Pisa
6 / 25
Dettagli del corso
Learning is better if you participate
• Math on the blackboard...take notes!
• Italian & English
• I may call on you during the class (GASP !!!)
• Readings...
• Homeworks...
• Plz always check out the AVVISI section of the course web page before the
class!
L. Galli
Corso di Ricerca Operativa 2
-
Laurea Magistrale in Ingegneria Gestionale
Universit`
a di Pisa
7 / 25
Grading
Esame
• Prova scritta sugli argomenti trattati.
• I contenuti dell’esame sono quelli del corso dell’anno accademico a cui si
riferisce l’appello, anche per gli studenti che avessero seguito il corso in anni
precedenti.
• Non `
e permesso l’uso di appunti, libri etc.
• La consegna di una prova scritta annulla le prove scritte consegnate in
precedenza.
• Academic Integrity: if you cheat, you make me sad :-( and sick :-S
L. Galli
Corso di Ricerca Operativa 2
-
Laurea Magistrale in Ingegneria Gestionale
Universit`
a di Pisa
8 / 25
Let’s start
Today’s outline
• About this class: done X
• IP: Why would you possibly care?
• IP warm up: First definitions, Modeling with IP
Homework (due next time we meet!)
• Be nice: send me an email with your name and surname. Thx!
L. Galli
Corso di Ricerca Operativa 2
-
Laurea Magistrale in Ingegneria Gestionale
Universit`
a di Pisa
9 / 25
Programming ??? I hate Programming !!!
Question
What does “programming” mean?
L. Galli
Corso di Ricerca Operativa 2
-
Laurea Magistrale in Ingegneria Gestionale
Universit`
a di Pisa
10 / 25
Programming ??? I hate Programming !!!
Question
What does “programming” mean?
Answer
Planning.
L. Galli
Corso di Ricerca Operativa 2
-
Laurea Magistrale in Ingegneria Gestionale
Universit`
a di Pisa
11 / 25
Programming ??? I hate Programming !!!
Question
What does “programming” mean?
Answer
Planning.
MP
Mathematical Programming (optimization) is the selection of a best element
(with regard to some criteria) from some set of available alternatives.
L. Galli
Corso di Ricerca Operativa 2
-
Laurea Magistrale in Ingegneria Gestionale
Universit`
a di Pisa
12 / 25
Mathematical Optimization
MP
Literally, these are “mathematical models for planning”. Also called optimization
models.
MP
The essential element is the existence of an objective.
MP
Some classifications of mathematical programs:
• Linear/nonlinear
• Convex/nonconvex
• Discrete/continuous
• Stochastic/deterministic
L. Galli
Corso di Ricerca Operativa 2
-
Laurea Magistrale in Ingegneria Gestionale
Universit`
a di Pisa
13 / 25
Programming with Integers ?!?!
IP
Integer Programming is about decision making with integers. More precisely,
decision making in which some of the decisions may take only certain integer
values.
Question
Why would you ever want to program with integers?
L. Galli
Corso di Ricerca Operativa 2
-
Laurea Magistrale in Ingegneria Gestionale
Universit`
a di Pisa
14 / 25
Programming with Integers ?!?!
Question
Why would you ever want to program with integers?
Answer
If the variable is associated with a physical entity that is indivisible, then it must
be integer.
L. Galli
Corso di Ricerca Operativa 2
-
Laurea Magistrale in Ingegneria Gestionale
Universit`
a di Pisa
15 / 25
Programming with Integers ?!?!
Question
Why would you ever want to program with integers?
Answer
If the variable is associated with a physical entity that is indivisible, then it must
be integer.
Important
• Sometimes a continuous approximation to the discrete (integer) decision is
accurate enough for practical purposes...
• but in many cases it is not! /
L. Galli
Corso di Ricerca Operativa 2
-
Laurea Magistrale in Ingegneria Gestionale
Universit`
a di Pisa
16 / 25
Binary
0-1 Variables
We can use 0-1 (binary) variables for a variety of purposes.
• Modeling yes/no decisions.
• Enforcing disjunctions.
• Enforcing logical conditions.
• Modeling fixed costs.
• Modeling piecewise linear functions.
In most of these cases the continuous approximation to the discrete decision is not
accurate enough for practical purposes. /
L. Galli
Corso di Ricerca Operativa 2
-
Laurea Magistrale in Ingegneria Gestionale
Universit`
a di Pisa
17 / 25
MIP
Mixed-Integer Linear Programming Problem: (MILP)
max {c T x + hT y | A x + G y ≤ b, x ∈ Zn+ , y ∈ Rp+ }
• Instance: c ∈ Rn , h ∈ Rp , A ∈ Rm×n , G ∈ Rm×p
• MATH NOTATION QUIZ
• What the heck is Rp+ ?
• What the heck is Zn+ ?
• What is the objective function?
• What are the decision variables? How many?
• What are the constraints? How many?
• What is the feasibile region? Can you guess what it is like?
L. Galli
Corso di Ricerca Operativa 2
-
Laurea Magistrale in Ingegneria Gestionale
Universit`
a di Pisa
18 / 25
Integer Programming Classes
• We call the problem mixed integer programming due to the presence of
continuous variables
• In some problems x are allowed to take on values only 0 or 1
• Such variables are called binary.
• Integer Programs involving only binary variables are called binary integer
programs (BIPs). (x ∈ Bn )
• (Pure) Integer Programming
• G , h, y not present: max {c T x | A x ≤ b, x ∈ Zn+ }
• Mixed 0 − 1 Programming
• x ∈ Bn . G , h, y present: max {c T x + hT y | A x + G y ≤ b, x ∈ Bn+ , y ∈ Rp+ }
• Linear Programming (!)
• c, A, x not present: max {hT y | G y ≤ b, y ∈ Rp+ }
L. Galli
Corso di Ricerca Operativa 2
-
Laurea Magistrale in Ingegneria Gestionale
Universit`
a di Pisa
19 / 25
Solutions
• A solution is an assignment of values to variables.
• A solution can hence be thought of as an n-dimensional vector.
• A feasible solution is an assignment of values to variables such that all the
constraints are satisfied.
• The objective function value of a solution is obtained by evaluating the
objective function at the given point.
• An optimal solution (assuming maximisation) is one whose objective function
value is greater than or equal to that of all other feasible solutions.
• Note that a math program may not have a feasible solution.
• Question: What are the different ways in which this can happen?
L. Galli
Corso di Ricerca Operativa 2
-
Laurea Magistrale in Ingegneria Gestionale
Universit`
a di Pisa
20 / 25
General Comments
• Note that many textbooks consider maximization problems by default.
• Many people (myself included) often consider minimization as the default, so
be ready to be confused.
• One further assumption we will make, and never mention again, is that the
input data is rational. e.g. (c ∈ Qn )
• This is an important assumption since with irrational data, certain “intuitive”
results no longer hold. Such as what?
• A computer can only understand rational data anyway, so this is not an
unreasonable assumption.
• Note that you implicitly assumed this in your linear programming course
anyway!
L. Galli
Corso di Ricerca Operativa 2
-
Laurea Magistrale in Ingegneria Gestionale
Universit`
a di Pisa
21 / 25
How Hard is Integer Programming?
• Solving general integer programs can be much more difficult than solving
linear programs.
• This is more than just an empirical statement
• There is a whole theory surrounding it
• You will learn some of the gory details
• There is no polynomial-time algorithm for solving general MIPs.
• Solving the associated linear programming relaxation results in an upper
bound on the optimal solution to the MIP (assuming maximization).
• In general, an optimal solution to the LP relaxation does not tell us much
about an optimal solution to the MIP.
• Why does solving the LP relaxation not necessarily yield a good solution?
• Rounding to a feasible integer solution may be difficult or impossible.
• Rounding may result in a solution far from optimal.
• The optimal solution to the LP relaxation can be arbitrarily far away from the
optimal solution to the MIP.
• We can bound the difference between the optimal solution to the LP and the
optimal solution to the MIP. How?
L. Galli
Corso di Ricerca Operativa 2
-
Laurea Magistrale in Ingegneria Gestionale
Universit`
a di Pisa
22 / 25
Integer Programming and Convexity
• The feasible region of an integer program is nonconvex.
• The nonconvexity is of a rather special form, though all forms of
nonconvexity are in some sense equivalent.
• Although the feasible set is nonconvex, there is a convex set over which we
can optimize in order to get a solution. Why?
• The challenge is that we do not know how to describe that set.
• Even if we knew the description, it would in general be way too large to write
down explicitly.
• Integer variables can be used to express other forms of nonconvexity, as we
will see later on.
L. Galli
Corso di Ricerca Operativa 2
-
Laurea Magistrale in Ingegneria Gestionale
Universit`
a di Pisa
23 / 25
Basic Themes
Our goal will be to expose the geometrical structure of the feasible region (at
least near the optimal solution). We can do this by:
• Outer approximation
• Inner approximation
• Division
An important component of the algorithms we consider will be mechanisms for
computing bounds by either:
• Relaxation
• Duality
When all that fails, we will employ a basic principle: divide large, difficult
problems into smaller ones:
• Logic (conjunction/disjuntion)
• Implicit enumeration
• Decomposition
L. Galli
Corso di Ricerca Operativa 2
-
Laurea Magistrale in Ingegneria Gestionale
Universit`
a di Pisa
24 / 25
Combinatorial Optimization
• A combinatorial optimization problem: COP = (N, F) consists of
• A finite ground set N
• A finite set F ⊆ 2N of feasible solutions
• Costs cj ∀ j ∈ N
P
• The cost of F ∈ F is c(F ) =
j∈F cj
• The combinatorial optimization problem is then max {c(F ) | F ∈ F}
• Many COPs can be written as IPs...
• We’ll see some examples soon...stay tuned!
L. Galli
Corso di Ricerca Operativa 2
-
Laurea Magistrale in Ingegneria Gestionale
Universit`
a di Pisa
25 / 25