Sie sind auf Seite 1von 44

OPTIMIZATION OF

INDUSTRIAL PROCESSES

Antoni Guasch
1
Objective

Optimization is the art and science of allocating scarce resources to the best
possible effect. Optimization techniques are called into play every day in industrial
planning problems, industrial design, resource allocation, scheduling, decision-
making, etc. For example: how does an airliner know how to route its planes and
schedule its crews at minimum cost; while meeting constraints on airplane flight
hours between maintenance and maximum flight time for crews? Another example
could be how to schedule body cars into a painting line such as the planned
production can be achieved? The main goals of this course will be:

1) recognize problems that can be tackled using the tools of applied optimization,
2) formulate optimization problems correctly and appropriately,
3) solve optimization problems, primarily by selecting and applying the correct
solvers.

Antoni Guasch
2
Objective

This year the focus will be on Airline Operations and Scheduling. Many of
optimization problems in this area are common to other application areas:

• Network flows
• Flight scheduling
• Fleet assignment
• Aircraft routing
• Crew scheduling
• Manpower planning
• Fuel management systems
• Gate assignment

Antoni Guasch
3
Bibliography & Software

• Atenea documentation

• Web links

• Airline operations and schedulling, Massoud Bazargan, Ashgate,


2on Edition

• AMPL software for mathematical programming

Antoni Guasch
4
Decision problems

Distinct Characteristics of Strategic, Tactical, and Operational Decisions

Antoni Guasch
5
Optimization

In mathematics, computer science, or management science, mathematical


optimization (alternatively, optimization or mathematical programming) is the
selection of a best element (with regard to some criteria) from some set of available
alternatives.

In the simplest case, an optimization problem consists of maximizing or minimizing


a real function by systematically choosing input values from within an allowed set
and computing the value of the function. The generalization of optimization theory
and techniques to other formulations comprises a large area of applied mathematics.
More generally, optimization includes finding "best available" values of some
objective function given a defined domain (or a set of constraints), including a
variety of different types of objective functions and different types of domains.

http://en.wikipedia.org/wiki/Optimization

Antoni Guasch
6
Optimum (global), optimal and locally optimum solutions

. (http://en.wikipedia.org/wiki/Global_optimum)

. (http://en.wikipedia.org/wiki/Local_optimum)

Antoni Guasch
7
Classification of Optimization models

Discrete or Combinatorial Optimization


deals mainly with problems where we have to
choose an optimal solution from a finite (or
Discrete sometimes countable) number of
possibilities.

Optimization
As opposed to discrete optimization, the
variables used in the objective function can
Continuous assume real values, e.g., values from
intervals of the real line

Antoni Guasch
8
Continuous optimization example

Antoni Guasch
9
Continuous optimization problem

http://en.wikipedia.org/wiki/Optimization_problem

Antoni Guasch
10
Continuous optimization models

• Nonlinear equations
• Nonlinear least squares
Unconstrained
• Global optimization
• Nondifferentiable optimization
Continuous
Optimization
• Linear programming (LP)
• Nonlinear constrained
Constrained • Network programming

Jump to Introduction to AMPL

Antoni Guasch
11
AMPL

• The AMPL book is available free for downloading from


http://www.ampl.com/BOOK/download.html

• AMPL download: Go to the Web page


http://www.ampl.com/DOWNLOADS/index.html to download AMPL.
Follow the instructions of the page. We plan to use the solvers CPLEX and
MINOS with are included in the amplcml.zip zip archive. So, you do not
need to install additional solvers.

• AMPL IDE download: The AMPL Integrated Development Environment,


AMPL IDE, provides a simple and straightforward enhanced modeling
interface for AMPL users. Commands are typed at an AMPL prompt in the
usual way, and all installed solvers can be accessed.

Antoni Guasch
12
Software: AMPL

Lets try AMPL. Execute ampl.exe at the AMPL folder and try

• model : reads the file into AMPL


• solve : to have AMPL translate your linear program, sends it to
a linear program solver, and then return the answer
• MINOS 5.5 : indicates that AMPL uses version 5.5 of a solver
called MINOS

Antoni Guasch
13
Software: AMPL ID

Lets try AMPL ID. Execute amplide.exe at the amplide folder

Antoni Guasch
14
Example linear model: prod0.mod

Optimization => Continuous => Constrained => Linear Programming

Linear objective function

Linear constraints

Antoni Guasch
15
Example linear model: prod0.mod

Syntax:

• Each variable is named in a var statement


• Each constraint by a statement that begins with subject to and a name like
X_limit or Time for the constraint
• Multiplication requires an explicit * operator
• ≦ relation is written <=

Antoni Guasch
16
Example linear model: prod0.mod

An steel company must decide how to allocate next week’s time on a rolling mill. The mill can
produce bands and coils. The mill’s two products come off the rolling line at different rates.
Tons per hour: Bands 200; Coils 140
and they also have different profitabilities:
Profit per ton: Bands $25; Coils $30
To further complicate matters, the following weekly production amounts are the most that
can be justified in light of the currently booked orders:
Maximum tons: Bands 6,000; Coils 4,000
The question facing the company is as follows: If 40 hours of production time are available
this week, how many tons of bands and how many tons of coils should be produced
to bring in the greatest total profit?

Antoni Guasch
17
Example linear model: prod0.mod

Time constraint

Antoni Guasch
18
Example linear model: prod0.mod

25𝑋𝑏 + 30𝑋𝑐 = profit


𝑝𝑟𝑜𝑓𝑖𝑡 25
Xc = − 𝑋𝑏
30 30

Antoni Guasch
19
Example linear model: prod0.mod

Solving the linear program reduces to answering


the following question: Among all profit lines that
intersect the feasible region, which is highest and
furthest to the right? The answer is the middle line,
which just touches the region at one of the corners.

Antoni Guasch
20
Example linear model: prod.mod

Algebraic
notation

Antoni Guasch
21
Example linear model: prod.mod

Algebraic notation

Look at 04-tut1.pdf” ampl


tutorial file from page 7 to 10

Antoni Guasch
22
Example linear model: prod.mod

Prod.mod

Prod.dat

Antoni Guasch
23
Example linear model: prod0.mod

Antoni Guasch
24
Atenea milestone #1

Select a continuous optimization model, code it in AMPL and obtain the


solution.

Write a report with:

• Group names. Maximum of three persons in each group


• Description of the problem
• Classification of the problem: linear or nonlinear, constrained or not
constrained, differentiable or not, ….
• AMPL code with comments on the code
• Results and conclusions

Deadline: before the second class. A group may be chosen randomly to


present the problem in the second class.

Antoni Guasch
25
Discrete optimization example

Maria wants to travel from Diamond to Einstein. The quickest route takes 31 minutes.
Highlight this route (http://www.oecd.org/pisa/test/)

Antoni Guasch
26
Discrete optimization models

Integer Programming (IP)

Discrete

Antoni Guasch
27
Network flows and integer programming models

Basic elements of a network (graph)

Arcs, links or branches

Nodes

http://en.wikipedia.org/wiki/Graph_theory
http://en.wikipedia.org/wiki/Flow_network

Antoni Guasch
28
Network terminology

𝑋𝑖𝑗 = 100 𝑝𝑎𝑠𝑠𝑒𝑛𝑔𝑒𝑟𝑠


• Flow: The amount of goods, vehicles, flights,
i j passengers and so on that move from one node to
another.

i j • Directed flow: flow only allowed in one


direction

i j • Undirected flow: flow allowed in both


directions

• Arc capacity: the maximum amount of flow that


can be sent through an arc.

Antoni Guasch
29
Network terminology

115

i • Supply node: Node with a positive net flow. I.e.


input flow > output flow.

−50

i • Demand node: Node with a negative net flow

i • Transshipment node: node with 0 net flow

Antoni Guasch
30
Network terminology

• Path: Sequence of different arcs that connect two nodes. In the


first network there are to pahts that connect node 7 with node
9.

• Source: First node of the path (7)

• Destination: Last node of the path (9)

• Cycle: A sequence of directed arcs that starts and finish at the


same node. The second network has two cycles.

• Connected network: here are two distinct notions of


connectivity in a directed network. A directed network is weakly
connected if there is an undirected path between any pair of
vertices, and strongly connected if there is a directed path
between every pair of vertices. An undirected network is
connected if there is a path from any point to any other point in
the network
Antoni Guasch
31
Shortest path problem

Antoni Guasch
32
Shortest path problem

1 𝑖𝑓 𝑎𝑟𝑐 𝑖, 𝑗 𝑖𝑠 𝑝𝑎𝑟𝑡 𝑜𝑓 𝑡ℎ𝑒 𝑠𝑜𝑙𝑢𝑡𝑖𝑜𝑛


𝑋𝑖,𝑗 =
0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒

Antoni Guasch
33
Shortest path problem

# PINEAPPLE1.MOD
var X12 binary;
var X13 binary;
var X14 binary;
var X25 binary;
var X26 binary;
var X35 binary;
var X36 binary;
var X37 binary;
var X46 binary;
var X47 binary;
var X58 binary;
var X68 binary;
var X78 binary;
minimize Distance: 105*X12+75*X13+65*X14+45*X25+56*X26+71*X35+48*X36+63*X37...;
subject to Source: X12+X13+X14=1;
subject to Destination: X58+X68+X78=1;
subject to Tras2: X12-X25-X26=0;
subject to Tras3: X13-X35-X36-X37=0;
subject to Tras4: X14-X46-X47=0;
subject to Tras5: X25+X35-X58=0;
subject to Tras6: X26+X36+X46-X68=0;
subject to Tras7: X37+X47-X78=0;

Antoni Guasch
34
Shortest path problem

ampl: model pineapple1.mod;


ampl: solve;
MINOS 5.5: ignoring integrality of 13 variables
MINOS 5.5: optimal solution found.
5 iterations, objective 174

ampl: option solver cplex;


ampl: solve;
CPLEX 12.6.0.0: optimal integer solution; objective 174
0 MIP simplex iterations
0 branch-and-bound nodes
ampl: display Distance;
Distance = 174
ampl: display X14, X46, X68;
X14 = 1
X46 = 1
X68 = 1

Antoni Guasch
35
Shortest path problem (SPP) general mathematical model

M = set of nodes Sets

i,j,k = index of nodes Index

𝑐𝑖,𝑗 = 𝑐𝑜𝑠t of flow along arc (i,j)


Parameters
m = destination node

1 𝑖𝑓 𝑎𝑟𝑐 𝑖, 𝑗 𝑖𝑠 𝑝𝑎𝑟𝑡 𝑜𝑓 𝑡ℎ𝑒 𝑝𝑎𝑡ℎ


𝑥𝑖,𝑗 =
0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒 Decision variables

Minimize 𝑖∈𝑀 𝑗∈𝑀 𝑐𝑖,𝑗 𝑥𝑖,𝑗 Objective function

𝑗∈𝑀 𝑥1,𝑗 =1 j≠ 1
𝑗∈𝑀 𝑥𝑖,𝑗 - 𝑘∈𝑀 𝑥𝑘,𝑖 = 0 ∀𝑖, 𝑖 ≠ 1 𝑎𝑛𝑑 𝑖 ≠ 𝑚 Constraints
𝑖∈𝑀 𝑥𝑖,𝑗 =1 i≠ 𝑚

Antoni Guasch
36
Shortest path problem (SPP) general mathematical model

# PINEAPPLE2.MOD
set M; # intersections
param entr symbolic in M; # entrance to road network
param exit symbolic in M, <> entr; # exit from road network
set FLIGHTS within (M diff {exit}) cross (M diff {entr});
param time {FLIGHTS} >= 0; # times to travel roads
var Use {(i,j) in FLIGHTS} binary; # 1 iff (i,j) in shortest path

minimize Total_Time: sum {(i,j) in FLIGHTS} time[i,j] * Use[i,j];

subject to Start: sum {(entr,j) in FLIGHTS} Use[entr,j] = 1;


subject to End: sum {(i,exit) in FLIGHTS} Use[i,exit] = 1;
subject to Balance {k in M diff {entr,exit}}:
sum {(i,k) in FLIGHTS} Use[i,k] = sum {(k,j) in FLIGHTS} Use[k,j];

data;
set M := m1 m2 m3 m4 m5 m6 m7 m8;
param entr := m1 ;
param exit := m8 ;

param: FLIGHTS: time :=


m1 m2 105,m1 m3 75
m1 m4 75,m2 m5 45
m2 m6 56,m3 m5 45
m3 m6 48,m3 m7 63
m4 m6 44,m4 m7 57
m5 m8 88,m6 m8 65
m7 m8 76;

Antoni Guasch
37
Shortest path problem (SPP): general mathematical model

ampl: model pineapple2.mod;


ampl: option solver cplex;
CPLEX 12.6.0.0: optimal integer solution; objective 184
0 MIP simplex iterations
0 branch-and-bound nodes
ampl: display Use;
Use :=
m1 m2 0
m1 m3 0
m1 m4 1
m2 m5 0
m2 m6 0
m3 m5 0
m3 m6 0
m3 m7 0
m4 m6 1
m4 m7 0
m5 m8 0
m6 m8 1
m7 m8 0
;
Antoni Guasch
38
Shortest path problem (SPP): additional class work

9 80

30

Add the new node in the previous two models and obtain the solution

Antoni Guasch
39
Minimum cost flow problem

The minimum-cost flow problem is to


find the cheapest possible way of sending
a certain amount of flow through a flow
network. Solving this problem is useful for
real-life situations involving networks
with costs associated (e.g.
telecommunications networks), as well as
in other situations where the analogy is not
so obvious, such as where to locate
warehouses

http://en.wikipedia.org/wiki/Minimum-
cost_flow_problem

Antoni Guasch
40
Minimum cost flow problem

5 50
1
5
75 1 3 5

8 8 60
6
7 3
4
75 2 4
4
5
7 40

Antoni Guasch
41
Minimum cost flow problem

This a draft of a specific optimization model

# variables definition
var X13 integer;
var X14 integer;
# more variables ...

minimize Cost: 5*X13+8*X14+7*X23...;

subject to N1constraint: X13+X14<=75;


# more node constraints ...

# all flights in/out from node 4 have a


# limit of 50 tons (maximum)
subject to Limit14: X14<=50;
subject to Limit24: X24<=50;
# more capacity constraints ...

Antoni Guasch
42
Minimum cost flow problem: general mathematical form

M = set of nodes Sets

i,j,k = index of nodes Index


𝑐𝑖,𝑗 = 𝑈𝑛𝑖𝑡 𝑐𝑜𝑠t of flow along arc (i,j)
𝑏𝑖 = 𝐴𝑚𝑜𝑢𝑛𝑡 𝑜𝑓 𝑠𝑢𝑝𝑝𝑙𝑦 𝑜𝑟 𝑑𝑒𝑚𝑎𝑛𝑑 𝑓𝑜𝑟 𝑛𝑜𝑑𝑒 𝑖.
𝐿𝑖𝑗 = 𝐿𝑜𝑤𝑒𝑟 𝑏𝑜𝑢𝑛𝑑 𝑜𝑛 𝑓𝑙𝑜𝑤 𝑡ℎ𝑟𝑜𝑢𝑔ℎ 𝑎𝑟𝑐 (𝑖, 𝑗) Parameters
𝑈𝑖𝑗 = 𝑈𝑝𝑒𝑟 𝑏𝑜𝑢𝑛𝑑 𝑜𝑛 𝑓𝑙𝑜𝑤 𝑡ℎ𝑟𝑜𝑢𝑔ℎ 𝑎𝑟𝑐 (𝑖, 𝑗)
Decision variables
𝑥𝑖,𝑗 = 𝑎𝑚𝑜𝑢𝑛𝑡 𝑜𝑓 𝑓𝑙𝑜𝑤 𝑓𝑟𝑜𝑚 𝑛𝑜𝑑𝑒 𝑖 𝑡𝑜 𝑛𝑜𝑑𝑒 𝑗

Minimize 𝑖∈𝑀 𝑗∈𝑀 𝑐𝑖,𝑗 𝑥𝑖,𝑗 Objective function

𝑗∈𝑀 𝑥𝑖,𝑗 - 𝑘∈𝑀 𝑥𝑘,𝑖 = 𝑏𝑖 ∀𝑖 ∈ 𝑀


Constraints
𝐿𝑖,𝑗 ≤ 𝑥𝑖,𝑗 ≤ 𝑈𝑖,𝑗

Antoni Guasch
43
Atenea milestone #2

Build a model for the minimum cost flow problem presented before using
general mathematical form

Write a report with:

• Group names. Maximum of three persons in each group


• Description of the problem
• AMPL code with comments on the code
• Results and conclusions

Antoni Guasch
44

Das könnte Ihnen auch gefallen