Op Tim Ization

download Op Tim Ization

of 44

Transcript of Op Tim Ization

  • Antoni Guasch 1

    OPTIMIZATION OF

    INDUSTRIAL PROCESSES

  • Antoni Guasch 2

    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 3

    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 4

    Bibliography & Software

    Atenea documentation

    Web links

    Airline operations and schedulling, Massoud Bazargan, Ashgate, 2on Edition

    AMPL software for mathematical programming

  • Antoni Guasch 5

    Decision problems

    Distinct Characteristics of Strategic, Tactical, and Operational Decisions

  • Antoni Guasch 6

    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 7

    Optimum (global), optimal and locally optimum solutions

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

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

  • Antoni Guasch 8

    Classification of Optimization models

    Optimization

    Continuous

    Discrete

    Discrete or Combinatorial Optimization

    deals mainly with problems where we have to

    choose an optimal solution from a finite (or

    sometimes countable) number of

    possibilities.

    As opposed to discrete optimization, the

    variables used in the objective function can

    assume real values, e.g., values from

    intervals of the real line

  • Antoni Guasch 9

    Continuous optimization example

  • Antoni Guasch 10

    Continuous optimization problem

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

  • Antoni Guasch 11

    Continuous optimization models

    Continuous

    Optimization

    Constrained

    Unconstrained

    Nonlinear equations Nonlinear least squares Global optimization Nondifferentiable optimization

    Linear programming (LP) Nonlinear constrained Network programming

    Jump to Introduction to AMPL

  • Antoni Guasch 12

    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 13

    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 14

    Software: AMPL ID

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

  • Antoni Guasch 15

    Example linear model: prod0.mod

    Optimization => Continuous => Constrained => Linear Programming

    Linear objective function

    Linear constraints

  • Antoni Guasch 16

    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 17

    Example linear model: prod0.mod

    An steel company must decide how to allocate next weeks time on a rolling mill. The mill can produce bands and coils. The mills 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 18

    Example linear model: prod0.mod

    Time constraint

  • Antoni Guasch 19

    Example linear model: prod0.mod

    25 + 30 = profit

    Xc =

    30

    25

    30

  • Antoni Guasch 20

    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 21

    Example linear model: prod.mod

    Algebraic

    notation

  • Antoni Guasch 22

    Example linear model: prod.mod

    Algebraic notation

    Look at 04-tut1.pdf ampl

    tutorial file from page 7 to 10

  • Antoni Guasch 23

    Example linear model: prod.mod

    Prod.mod

    Prod.dat

  • Antoni Guasch 24

    Example linear model: prod0.mod

  • Antoni Guasch 25

    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 26

    Maria wants to travel from Diamond to Einstein. The quickest route takes 31 minutes.

    Highlight this route (http://www.oecd.org/pisa/test/)

    Discrete optimization example

  • Antoni Guasch 27

    Discrete optimization models

    Discrete

    Integer Programming (IP)

  • Antoni Guasch 28

    Network flows and integer programming models

    Basic elements of a network (graph)

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

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

    Nodes

    Arcs, links or branches

  • Antoni Guasch 29

    Network terminology

    i j

    i j

    i j

    = 100

    Flow: The amount of goods, vehicles, flights, passengers and so on that move from one node to

    another.

    Directed flow: flow only allowed in one direction

    Undirected flow: flow allowed in both directions

    Arc capacity: the maximum amount of flow that can be sent through an arc.

  • Antoni Guasch 30

    Network terminology

    i Supply node: Node with a positive net flow. I.e. input flow > output flow.

    Demand node: Node with a negative net flow

    Transshipment node: node with 0 net flow

    115

    i

    50

    i

    0

  • Antoni Guasch 31

    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 32

    Shortest path problem

  • Antoni Guasch 33

    Shortest path problem

    , = 1 ,

    0

  • Antoni Guasch 34

    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 35

    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 36

    Shortest path problem (SPP) general mathematical model

    M = set of nodes i,j,k = index of nodes , = t of flow along arc (i,j)

    m = destination node

    , = 1 ,

    0

    Minimize ,,

    1, =1 j 1

    , - , = 0 , 1

    , =1 i

    Sets

    Index

    Parameters

    Decision variables

    Objective function

    Constraints

  • Antoni Guasch 37

    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 38

    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 39

    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 40

    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 41

    Minimum cost flow problem

    1 3

    2 4

    5

    6

    7

    75

    75

    50

    60

    40

    5

    8

    7

    4

    1

    5

    8

    3 4

    5

  • Antoni Guasch 42

    Minimum cost flow problem

    # variables definition

    var X13 integer;

    var X14 integer;

    # more variables ...

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

    subject to N1constraint: X13+X14

  • Antoni Guasch 43

    Minimum cost flow problem: general mathematical form

    M = set of nodes i,j,k = index of nodes , = t of flow along arc (i,j)

    = . = (, )

    = (, )

    , =

    Minimize ,,

    , - , =

    , , ,

    Sets

    Index

    Parameters

    Decision variables

    Objective function

    Constraints

  • Antoni Guasch 44

    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