6 Mixed-Integer Linear Programming.pdf

download 6 Mixed-Integer Linear Programming.pdf

of 18

Transcript of 6 Mixed-Integer Linear Programming.pdf

  • 8/11/2019 6 Mixed-Integer Linear Programming.pdf

    1/18

    Floudas: Nonlinear and Mixed-Integer OptimizationChapter 5

    Mixed-Integer Linear Programming

    Cheng-Liang Chen

    PSELABORATORY

    Department of Chemical EngineeringNational TAIWAN University

    Chen CL 1

    Modeling with 0 1 VariablesApplication: select among process units i P U

    Let yi=

    1 if unit i is selected

    0 if unit i is NOT selectedi P U

    Selectone & only oneunit iPU

    yi = 1

    Selectat most oneunit iPU

    yi 1

    Selectat least oneunit iPU

    yi 1

    Chen CL 2

    Modeling with 0 1 VariablesApplication: select unit i if unit j is selected

    yi= 1 if unit i P Uis selected, 0 otherwise

    If unit j is selected (yj = 1)

    then unit i should be selected too (yi= 1)

    Others: not defined

    yj yi 0 (check it)

    Derivation: yi= 1 Pi is true; yj = 1 Pj is true

    Pj Pi Pj Pi (?)

    (1 yj) + yi 1 (?)

    yj yi 0

    Chen CL 3

    Propositional Logic Expressions

    NEGATION denoted as

    AND denoted as

    OR denoted as

    EXCLUSIVE OR denoted as

    Modeling with 0 1 Variables:

    yi =

    1 if clause Pi is true

    0 if clause Pi is false

    P1 P2 P1 P2 P1 P2 P1 P2 P1 P1 P2 P1 P2

    1 1 1 1 1 0 1 0

    1 0 0 1 0 0 0 1

    0 1 0 1 1 1 1 1

    0 0 0 0 1 1 1 0

    Note: P1 P2 is equivalent to P1 P2

  • 8/11/2019 6 Mixed-Integer Linear Programming.pdf

    2/18

    Chen CL 4

    Modeling with 0 1 Variables

    Proposition Mathematical Representation

    1. P1 P2 P3 y1+ y2+ y3 1

    2. P1 P2 P3

    y1 1

    y2 1

    y3 1

    3. P1 P2 (P1 P2) 1 y1+ y2 1 (y1 y2 0)

    4.

    (P1 P2)

    (P1 P2) (P2 P1)

    (P1 P2) (P2 P1)

    y1 y2 0

    y2 y1 0or y1= y2

    5. (P1 P2 P3)

    (P1 P3) (P2 P3)

    y1 y3 0

    y2 y3 0

    6. P1 P2 P3 (exactly one) y1+ y2+ y3= 1

    Chen CL 5

    Blending Products Including Discrete Batch Sizes

    The Batch Plant

    Unit 1 has a max capacity of8, 000lb/day, and unit 2 of10, 000lb/day

    To make1.0 lb of product 1 requires 0.4 lb ofA and 0.6 lb ofBTo make1.0 lb of product 2 requires 0.3 lb ofB and 0.7 lb ofC

    A maximum of6, 000 lb/day ofB is available (no limit on A and C)

    Net revenue of product 1 is $0.16/lb, and of product2 is $0.20/lb

    Each product must be made in batches of2, 000lb

    Q: How much of products 1 and 2 should be produced per day ?

    Chen CL 6

    Blending Products Including Discrete Batch Sizes

    MILP Formulation

    x1, x2 thousands of pounds per dayfor products1and2

    max f= 160x1+ 200x2

    s.t. 0.6x1+ 0.3x2 6

    xi= 2yi

    0 2000y1 8000

    0 2000y2 10000

    yi: integers (0, 1, 2, . . .)

    Chen CL 7

    Blending Products Including Discrete Batch Sizes

    Solution

    (y1, y2) = (2, 5) f = 2.8 103

  • 8/11/2019 6 Mixed-Integer Linear Programming.pdf

    3/18

    Chen CL 8

    Design of A Chemical Complex

    Proposed Chemical complex

    Objective: to maximize profit

    Should chemical C be produced, and if so how much ?

    Which process to build (II and III are exclusive) ?

    How to obtain chemical B ?

    Chen CL 9

    Design of A Chemical ComplexData

    Cost fixed ($) Variable ($/ton raw material)

    Process I 1000 250

    Process II 1500 400

    Process III 2000 550

    Price A 500/ton

    B 950/ton

    C 1800/ton

    Conversions Process I 90% of A to B

    Process II 82% of B to C

    Process III 95% of B to C

    Constraints Maximum supply of A: 16 tons/hr

    Maximum demand of C: 10 tons/hr

    Chen CL 10

    Design of A Chemical Complex

    Notation

    YI = 1 if process I is selected and 0 if not

    YII = 1 if process II is selected and 0 if not

    YIII = 1 if process III is selected and 0 if not

    P A purchases of A (tons/hr)

    P B purchases of B (tons/hr)

    SC sales of C (tons/hr)

    BI production rate of B in process I (tons/hr)

    BII consumption rate of B in process II (tons/hr)

    BIII consumption rate of B in process III (tons/hr)

    CII production rate of C in process II (tons/hr)

    CIII production rate of C in process III (tons/hr)

    Chen CL 11

    Design of A Chemical ComplexFormulation

    MB for B, C: BI+ P B = BI I+ BIII

    CI I+ CIII = SC

    Balance around I,II,III: BI = 0.9P A

    CI I = 0.82BI I

    CIII = 0.95BIII

    Process can operate if built P A 16Y I

    BI I (10/0.82)Y II

    BIII (10/0.95)Y I I I

    Demand limitation: SC 10

    II and III are exclusive: Y II+ Y I I I 1

    Profit to be maximized: J =

    investment and operating costs

    (1000Y I+ 250PA + 1500Y II+400BII+ 2000YIII + 550BIII)

    (500PA + 950PB) raw materials

    +1800SC sales

    Model Size: 9 constraints; 8 continuous variables, 3binary variables

  • 8/11/2019 6 Mixed-Integer Linear Programming.pdf

    4/18

    Chen CL 12

    Design of A Chemical Complex

    GAMS Code

    $TITLE Design of a Chemical Complex

    $offsymxref offsymlist

    *filename: COMPLEX.gms

    option optcr=0, limrow=0, limcol=0;

    BINARY VARIABLES

    YI denotes selection of process I when equal to one

    YII denotes selection of process II when equal to one

    YIII denotes selection of process III when equal to one ;

    POSITIVE VARIABLES

    PA purchases of A (tons per hr)

    PB purchases of B (tons per hr)

    SC sales of C (tons per hr)

    BI production rate of B in process I (tons per hr)

    BII consumption rate of B in process II (tons per hr)

    BIII consumption rate of B in process III (tons per hr)CII production rate of C in process II (tons per hr)

    CIII production rate of C in process II (tons per hr) ;

    VARIABLE PROFIT objective function ;

    EQUATIONS

    E1 select at most one of process II and III

    E2 mass balance for B

    Chen CL 13

    E3 mass balance for C

    E4 mass balance around process I

    E5 mass balance around process II

    E6 mass balance around process III

    E7 no purchases of A unless process I is selected

    E8 no production of BII unless process II is selected

    E9 no production of BIII unless process III is selected

    OBJ objective function definition ;

    E1 .. YII + YIII =L= 1 ;

    E2 .. BI + PB =E= BII + BIII ;E3 .. CII + CIII =E= SC ;

    E4 .. BI =E= 0.9 * PA ;

    E5 .. CII =E= 0.82 * BII ;

    E6 .. CIII =E= 0.95 * BIII ;

    E7 .. PA =L= 16 * YI ;

    E8 .. BII =L= (10/0.82) * YII ;

    E9 .. BIII =L= (10/0.95) * YIII ;

    * constraint (10) for max demand of C is declared as an upper bound here

    SC.UP = 10 ;

    O BJ .. PR OF IT =E = - ( 1 000 * YI + 2 50 * PA+ 15 00 * YI I + 4 00 * BII

    + 2 000 * Y II I + 5 50 * B II I )

    - 500 * PA - 950 * PB

    + 1800 * SC ;

    MODEL COMPLEX /ALL/ ;

    SOLVE COMPLEX USING MIP MAXIMIZING PROFIT ;

    Chen CL 14

    Design of A Chemical Complex

    Results

    J = 459.3 $/hr

    P A = 13.55 tons/hr

    select process I and II

    Chen CL 15

    Planning of A Chemical Complex

    Problem Description

  • 8/11/2019 6 Mixed-Integer Linear Programming.pdf

    5/18

    Chen CL 16

    Decide:

    Which process to build (2 and 3 are not excluded) ? How to obtain chemical 2 ? How much should be produced of product 3 ?

    Objective: to maximize net present value over a long range horizon consisting

    of3 time periods of2, 3 and 5 years length

    Assume:

    Prices, demands, and cost coefficients remain constant during each timeperiod

    Capacity expansions of the processes are allowed at the beginning of eachtime period

    No limit of expansion frequencies, a limit on amount of money that can beinvested at each time period for expansions (20, 30, and 40 m$ for periods

    1, 2, 3) The size of expansion may not exceed 100 kton/yr

    Chen CL 17

    Planning of A Chemical Complex

    Data

    Fixed investment coefficients (105$/ton)

    Period1 Period 2 Period 3

    Process1 85 95 112

    Process2 73 82 102

    Process3 110 125 148

    Variable investment coefficients (102$/ton)

    Period1 Period 2 Period 3

    Process1 1.38 1.56 1.78

    Process2 2.72 3.22 4.60

    Process3 1.76 2.34 2.84

    Operating Expenses coefficients (102$/ton of main product)

    Period1 Period 2 Period 3

    Process1 0.4 0.5 0.6

    Process2 0.6 0.7 0.8

    Process3 0.5 0.6 0.7

    Chen CL 18

    Prices (102$/ton)

    Period1 Period 2 Period 3

    Chemical 1 4.0 5.24 7.32

    Chemical 2 9.6 11.52 13.52

    Chemical 3 26.2 29.2 35.2

    Upper bounds for Purchase/Sales (kton/yr)

    Period1 Period 2 Period 3

    Chemical 1 6 7.5 8.6

    Chemical 2 20 25.5 30

    Chemical 3 65 75 90

    Mass balance coefficients (to main product)

    Chemical 1 Chemical 2 Chemical3

    Process 1 1.11 1

    Process 2 1.22 1

    Process 3 1.05 1

    Miscellaneous data

    Existing capacity

    kton/yr

    Salvage value

    factor

    Working capital

    factor

    Process 1 0.1 0.15

    Process 2 50 0.1 0.15

    Process 3 0.1 0.15

    Interest rate = 10%, Tax rate = 45%, Depreciation method: straight line

    Chen CL 19

    Planning of A Chemical Complex

    Formulation

    Index notation

    i process i= 1, NP

    j chemical j = 1, NC

    market = 1, NM

    t time period t= 1, NT

  • 8/11/2019 6 Mixed-Integer Linear Programming.pdf

    6/18

    Chen CL 20

    Plant capacities

    Qit: total available capacity of process i in period t, t = 1, NT

    Qi0: existing capacity at time t = 0

    QEit: capacity expansion of process i installed in period t

    QELit, QEUit : lower/upper bounds for capacity expansions

    yit= {0, 1}: occurrence of expansions

    yitQELit QEit QE

    Uityit

    yit= 0, 1 i= 1, NP t= 1, NT

    Qit= Qi,t1+ QEit i= 1, NP t= 1, NT

    Chen CL 21

    Amount of chemicals being consumed and produced

    Amounts of chemicals being consumed and produced

    Li: index set of streams corresponding to inputs/outputs of process i

    Wijt 0 i= 1, NP, j Li t= 1, NT

    Stream mi Li: main product produced by process i, capacity

    limitation

    Wimit Qit i= 1, N P t= 1, NT

    Note: Wimit= 0 if shut-down

    Material balances in each plant (use constant characteristics of processi and chemical j )

    Wijt = ijWimit i= 1, NP, j Li t= 1, N T

    Chen CL 22

    Purchases and sales ofN Cnodes of chemicals

    (aL,Ujt , dL,Ujt : loewr/upper bounds for availabilities and demands)

    aLjt Pjt aUjt

    dLjt Sjt dUjt

    j = 1, N C, = 1, N M, t= 1, NT

    Mass balances on chemicals nodeI(j): index set of plants which consume chemical j

    O(j): index set of plants which produce chemicalj

    NM=1

    Pjt+

    kO(j)

    Wkt =NM=1

    Sjt +

    kI(j)

    Wkt j = 1, NC , t= 1, NT

    Chen CL 23

    Net present value of the project

    it, it variable and fixed terms for the investment costs

    it unit operating cost

    jt, jt prices of sales and purchases of chemicalj in market

    NP V = NTt=1

    NPi=1

    (itQEit+ ityit) NTt=1

    NPi=1

    itWimit

    +NTt=1

    NCj=1

    NM=1

    (jtSjt jtPjt)

  • 8/11/2019 6 Mixed-Integer Linear Programming.pdf

    7/18

    Chen CL 28 Chen CL 29

  • 8/11/2019 6 Mixed-Integer Linear Programming.pdf

    8/18

    Chen CL 28

    TABLE ALPHA(I,T) variable investement coefficient

    * (1e2 $/ton)

    1 2 3

    1 1.38 1.56 1.78

    2 2.72 3.22 4.6

    3 1.76 2.34 2.84

    TABLE BETA(I,T) fixed investement coefficient

    * (1e5 $)

    1 2 3

    1 85 95 1122 73 82 102

    3 110 125 148

    TABLE DELTA(I,T) operating expenses per unit of main product

    * (1e2 $ /ton)

    1 2 3

    1 0.4 0.5 0.6

    2 0.6 0.7 0.8

    3 0.5 0.6 0.7

    TABLE LAM(J,K,T) cost for purchase of one unit of chemical

    * (1e2 $/ton)

    * values should be left to zero if chemical J is not available

    * f ro m ma rk et K d ur in g pe ri od T

    1 2 3

    1.1 4. 5.24 7.32

    2.1 9.6 11.52 13.52

    3.1

    Chen CL 29

    T AB LE PL B( J, K, T) pu rc ha se l ow er b ou nd s

    * (kton/yr)

    * both lower and upper bounds should be left to zero

    * if chemical J is unavailable from market K during period T

    1 2 3

    1.1

    2.1

    3.1

    TABLE PUB(J,K,T) purcase upper bounds

    * (kton/yr)* both upper and lower bound should be left to zero

    * if chemical J is unavailable from market K during period T

    1 2 3

    1.1 6. 7.5 8.6

    2.1 20 25.5 30.

    3.1

    T AB LE GA MM A( J, K, T) sa le p ri ce s

    * (1e2 $/ton)

    * values should be left to zero if chemical J is not

    * desired by market K during period T

    1 2 3

    1.1

    2.1

    3.1 26.20 29.20 35.20

    TABLE SLB(J,K,T) sales lower bounds

    * (kton/yr)

    * both lower and upper bounds should be left to zero

    Chen CL 30

    * if chemical J is not desired by market K during period T

    1 2 3

    1.1

    2.1

    3.1

    TABLE SUB(J,K,T) sales upper bounds

    * (kton/yr)

    * both upper and lower bounds should be left to zero

    * if chemical J is not desired by market K during period T

    1 2 3

    1.1

    2.13.1 65 75 90

    *

    * parameter evaluations

    *

    PARAMETERS

    EP epsilon

    ALPHAR(I,T) fixed investement coefficient depreciated etc

    BETAR(I,T) variable investement coefficient depreciated etc ;

    EP = 0.0001;

    SCALAR FX project lifetime;

    SCALARS Z1,Z2,INTER1;

    PARAMETERS X(T),C1(I,T),C2(T),T1(T),T2(I,T),T3(I,T),T4(I),SCOEFF(T);

    X(1)=0 ; LOOP (T $ (ORD(T) NE CARD(T)) , X(T+1) = X(T)+LENP(T) ) ;

    FX=SUM(T,LENP(T));

    Chen CL 31

    INTER1=1/(1+INTR);

    LOOP(T,

    Z1=X(T)+1 ;

    C2(T)=SUM (TT $((ORD(TT) GE Z1) AND (ORD(TT) LE FX)),INTER1**ORD(TT))

    );

    T1(T)=-INTER1**X(T);

    T2(I,T)=WCAPF(I)*(T1(T)+INTER1**FX);

    T3(I,T)=(1-SVALF(I))*TAX*C2(T)/(FX-X(T));

    T4(I)=SVALF(I)*INTER1**FX;

    C1(I,T)=T1(T)+T2(I,T)+T3(I,T)+T4(I);

    ALPHAR(I,T)=-ALPHA(I,T)*C1(I,T);

    BETAR(I,T)=-BETA(I,T)*C1(I,T);

    LOOP(T $ (ORD(T) NE CARD(T)) , Z1=X(T)+1 ; Z2=X(T+1) ; SCOEFF(T)=SUM(TT

    $ ((ORD(TT) GE Z1) AND (ORD(TT) LE Z2)) , INTER1**ORD(TT))*(1-TAX)

    );

    LOOP(T $ (ORD(T) EQ CARD(T)), Z1=X(T)+1 ; Z2=FX ; SCOEFF(T)=SUM(TT $

    ((ORD(TT) GE Z1) AND (ORD(TT) LE Z2)), INTER1**ORD(TT) )*(1-TAX)

    ) ;

    LAM(J,K,T)=SCOEFF(T)*LAM(J,K,T);

    GAMMA(J,K,T)=SCOEFF(T)*GAMMA(J,K,T);

    DELTA(I,T)=SCOEFF(T)*DELTA(I,T);

    *

    * model definition

    VARIABLES Q(I,T) capacities

    QE(I,T) capacity expansions

    Y(I,T) integer decision variables

    Chen CL 32 Chen CL 33

  • 8/11/2019 6 Mixed-Integer Linear Programming.pdf

    9/18

    Chen CL 32

    W(I,*,T) flow rates

    S(J,K,T) sales

    P(J,K,T) purchases

    NPV net present value;

    POSITIVE VARIABLES Q,QE,W,S,P;

    BINARY VARIABLES Y;

    EQUATIONS CELBD(I,T) capacity expansion lower bounds

    CEUBD(I,T) capacity expansion upper bounds

    CAPBL(I,T) capacity balances PRCP(I,T) production cannot exceed capacity

    PBAL(I,J,T) balances around processes

    * constraints will be given as lower and upper bounds

    BAL(J,T) balances for chemicals

    OBJ net present value definition

    NEXP(I) limitation of number of expansions

    INVBD(T) bound on investment at each time period ;

    SET JM(I,*) ; ALIAS (J,JP) ; JM(I,J) = YES $ (ORD(J) EQ JMM(I)) ;

    CELBD(I,T) $ QELB(I,T) .. Y(I,T)*QELB(I,T) =L= QE(I,T);

    CEUBD(I,T) $ (QEUB(I,T) NE INF) .. QE(I,T) =L= QEUB(I,T)*Y(I,T);

    CAPBL(I,T) .. Q(I,T) =E= EXCAP(I) $ (ORD(T) EQ 1) + Q(I,T-1) + QE(I,T);

    PRCP(I,T) .. SUM(J $ JM(I,J), W(I,J,T)) =L= Q(I,T);

    * equations are given as lower and upper bounds on the variables

    Chen CL 33

    P.LO(J,K,T) $ PLB(J,K,T) = PLB(J,K,T);

    P.UP(J,K,T) $ (PUB(J,K,T) AND (PUB(J,K,T) NE INF)) = PUB(J,K,T);

    S.LO(J,K,T) $ SLB(J,K,T) = SLB(J,K,T);

    S.UP(J,K,T) $ (SUB(J,K,T) AND (SUB(J,K,T) NE INF)) = SUB(J,K,T);

    PBAL(I,J,T) $ MI(I,J)

    .. W(I,J,T) =E= ABS(MI(I,J))*SUM(JP $ JM(I,JP), W(I,JP,T));

    BAL(J,T) .. SUM( K, P(J,K,T) $ LAM(J,K,T) - S(J,K,T) $ GAMMA(J,K,T) )

    =E= SUM ( I, SIGN(MI(I,J)) * W(I,J,T) );

    OBJ .. NPV =E= - SUM ( (I,T), ALPHAR(I,T)*QE(I,T) + BETAR(I,T)*Y(I,T)

    + DELTA(I,T)*SUM(J $ JM(I,J), W(I,J,T) ) )

    + SUM ( (J,K,T), GAMMA(J,K,T)*S(J,K,T) - LAM(J,K,T)*P(J,K,T) );

    NEXP(I) $ (LNEXP(I) LT NPER) .. SUM(T, Y(I,T)) =L= LNEXP(I);

    INVBD(T) $(LINVEST(T) NE INF) .. SUM ( I, ALPHA(I,T)*QE(I,T) +

    BETA(I,T)*Y(I,T) ) =L= LINVEST(T);

    * obtain solution using branch and bound

    *

    MODEL MULT/ALL/;

    SOLVE MULT MAXIMIZING NPV USING MIP;

    DISPLAY NPV.L, Y.L, QE.L, Q.L, W.L, S.L, P.L ;

    Chen CL 34

    Planning of A Chemical Complex

    Result

    Period1 Period 2 Period3

    Process 1 Capacity 7.75 7.75 7.75

    Production 5.41 6.76 7.75

    Process 2 Capacity 50.0 50.0 50.0Production 20.82 0 0

    Process 3 Capacity 0 35.95 35.95

    Production 0 30.72 35.95

    Chen CL 35

    Multi-product Batch Plant SchedulingBatch Scheduling and Planning Problems

    A principal feature of batch plants is the production of multiple products using

    the same set of equipment

    The total time required to produce a set of batches (makespan or cycle time)depends on the sequence of production to minimize the makespan

    Chen CL 36 Chen CL 37

  • 8/11/2019 6 Mixed-Integer Linear Programming.pdf

    10/18

    Multi-product Batch Plant Scheduling

    A 4-products 3-units Plant

    Units

    Products u1 u2 u3

    p1 (i=1) 3.5 4.3 8.7

    p2 (i=2) 4.0 5.5 3.5

    p3 (i=3) 3.5 7.5 6.0

    p4 (i=4) 12. 3.5 8.0

    Multi-product Batch Plant Scheduling

    MILP Formulation

    N, M numbers of products and units

    Cj,k the time forj th slot of product leavingk unitti,k processing time forith product (pi) in kth unit (t3,2= 7.5h)

    j,k processing time forj th slot of product in kth unit

    jth slot of product cannot leave unit uk until it is processed, and it must haveleft unit u(k-1)

    Cj,k Cj,k1+ j,k j = 1, N , k= 2, M (1)

    jth slot of product cannot leave unit uk, until (j 1)th slot of product has leftand the former has been processed (C0,k= 0)

    Cj,k Cj1,k+ j,k j = 1, N , k= 1, M (2)

    Chen CL 38

    jth slot of product cannot leave unit uk, until the downstream unit u(k+1) isfree ((j 1)th slot of product has left)

    Cj,k Cj1,k+1 j = 1, N , k= 1, M 1 (3)

    Note: Eq.s (3), Cj,k1 Cj1,k Eq.s (1) and (3) imply Eq.s (2) for k = 2, M

    Only one product in every slot j of the sequenceXi,j= 1 ifith product (product pi) is in slot j of the sequence(If product pi is in slot j , then Xi,j = 1and Xi,1 = . . . = Xi,j1= Xi,j+1 = . . . = Xi,N = 0)

    X1,j+ X2,j+ . . . + XN,j = 1 j = 1, N (4)

    Every product should occupy only one slot in the sequence

    Xi,1+ Xi,2+ . . . + Xi,N= 1 i= 1, N (5)

    For any given set ofXi,j (production sequence)ifith product is in slotj (Xi,j= 1), then the processing time ofjth-slot product

    Chen CL 39

    in unitk isti,k

    j,k= X1,jt1,k+ X2,jt2,k+ . . . + XN,jtN,k j = 1, N , k= 1, M

    MILP formulation:

    min CN,M

    s.t. Eq.s 3,4,5

    Cj,k Cj,k1+Ni=1

    Xi,jti,k j = 1, N k = 2, M

    Cj,k Ci1,k+Ni=1

    Xi,jti,k j = 1, N

    Cj,k 0 and Xi,j binary

    Chen CL 40 Chen CL 41

  • 8/11/2019 6 Mixed-Integer Linear Programming.pdf

    11/18

    Multi-product Batch Plant Scheduling

    GAMS Code

    $TITLE Multiproduct Batch Plant Scheduling

    $OFFUPPER

    $OFFSYMXREF OFFSYMLIST

    OPTION SOLPRINT = OFF;

    * Define product and unit index sets

    SETS PI Product batches to be produced /p1*p4/

    UK Four batch processing units in the plant /u1*u3/

    J Slots for products in the sequence /1*4/;

    ALIAS (I, J);

    * Define and initialize problem data

    TABLE T(PI,UK) Processing times of products on unit UK in h

    u1 u2 u3

    p1 3.5 4.3 8.7

    p2 4.0 5.5 3.5

    p3 3.5 7.5 6.0p4 12.0 3.5 8.0

    PARAMETER TMIN(UK) Minimum of the processing times of products on UK;

    TMIN(UK) = SMIN(PI, T(PI,UK));

    PARAMETER TP(PI,UK) Processing times of products above TMIN on UK;

    TP(PI,UK) = T(PI,UK) - TMIN(UK);

    SCALAR N Number of products to be produced

    M Number of units in the plant;

    N = CARD(PI);

    M = CARD(UK);

    * Define optimization variables

    VARIABLES X(PI,J) Product PI is in sequence slot J

    C(I,UK) Completion time of the product in sequence slot I on unit UK

    MSPAN Makespan or total time to produce all products;

    POSITIVE VARIABLES C;

    BINARY VARIABLES X;

    * Define constraints and objective functionEQUATIONS OBJFUN Minimize makespan

    ONEPRODUCT(J) Only one product should be in each slot

    ONESLOT(PI) Only one slot should be assigned to each product

    CEQ1(I,UK) Completion time recurrence Eqs. 8

    CEQ2(I,UK) Completion time recurrence Eqs. 7

    CEQ3(I,UK) Completion Time recurrence Eqs. 3;

    OBJFUN.. MSPAN =E= SUM((I,UK) $(ORD(I) EQ N AND ORD(UK) EQ M), C(I,UK));

    ONEPRODUCT(J).. SUM(PI, X(PI,J)) =E= 1;

    ONESLOT(PI).. SUM(J, X(PI,J)) =E= 1;

    CEQ1(I,"u1").. C(I,"u1") =G= C(I-1,"u1") $(ORD(I) GT 1) +

    TMIN("u1") + SUM(PI, TP(PI,"u1")*X(PI,I));

    CEQ2(I,UK) $(ORD(UK) GT 1)..

    C(I,UK) =G= C(I,UK-1) + TMIN(UK) + SUM(PI, TP(PI,UK)*X(PI,I));

    CEQ3(I,UK) $(ORD(I) GT 1 AND ORD(UK) LT M).. C(I,UK) =G= C(I-1,UK+1);

    * Define model and solve

    MODEL SCHEDULE /ALL/;

    SOLVE SCHEDULE USING MIP MINIMIZING MSPAN;

    DISPLAY X.L, C.L, MSPAN.L;

    Chen CL 42

    Multi-product Batch Plant SchedulingThe Optimal Schedule

    X1,1= X2,4= X3,2= X4,3= 1, others = 0 product p1 is in slot j = 1, product p2 is in slot j = 4, to produce products in sequence: p1 - p3 - p4 - p2

    Unit1 is processing during [0, 3.5] h. When p1 leaving u1 at t = 3.5 h, u1 starts processing p3 ([3.5, 7]) U1 holds p3 during [7, 7.8] because u2 is still processing p1

    The finished batches of p1, p3, p2, and p4 are completed at times16.5 h, 23.3 h, 31.3 h, and 34.8 h (minimum makespan is 34.8 h)

    Chen CL 43

    Mathematical Description for MILP

    min cTx + dTy

    s.t. Ax + By b

    x 0, x X Rn

    y {0, 1}q

    x a vector ofn continuous variables

    y a vector ofq 0 1 variables

    c,d (n 1), (q 1)vectors of parameters

    A,B matrices of appropriate dimensions

    b a vector ofp inequalities

    Chen CL 44 Chen CL 45

  • 8/11/2019 6 Mixed-Integer Linear Programming.pdf

    12/18

    Mathematical Description: Remark 1

    A linear objective function and linear constraints in x and y

    A mixed set of variables (continuous x and 0 1 y)

    d= 0,B= 0 linear programming LP problem

    c= 0,A= 0 integer linear programming ILPproblem

    Major difficulty: combinatorial nature of domain ofy variables

    Any choice of0 or 1 for elements ofy results in a LPproblem on x variables

    Enumerating fully all possible combinations of0 1 variables for elements ofy 2q possible combinations !

    Outline of MILPAlgorithms

    Branch and Bound Methods

    A binary tree to represent 0 1 combinations to partition feasible region into sub-domains systematically

    Valid upper and lower bounds are generated at different levels ofthe binary tree

    Chen CL 46

    Outline of MILPAlgorithms

    Cutting Plane Methods

    New constraints (cuts) are generated and added which reduce

    the feasible region until a 0 1 optimal solution is obtained

    Decomposition Methods

    Mathematical structure of the models is exploited via variable

    partitioning, duality, and relaxation methods

    Logic-Based Methods

    Disjunctive constraints or symbolic inference techniques are

    utilized which can be expressed in terms of binary variables

    Chen CL 47

    Branch and Bound Methods

    Basic Notion 1: Separation

    Separation:Let an MILP model be denoted as (P) and let itsset of feasible solutions be denoted as F S(P). A set

    of subproblems (P1), . . . , (Pn) of (P) is defined as aseparationof(P) if the following conditions hold:

    A feasible solution of any of the subproblems(P1), . . . , (Pn) is a

    feasible solution of(P); and

    Every feasible solution of(P)is a feasible solution ofexactly one

    of the subproblems

    Chen CL 48 Chen CL 49

  • 8/11/2019 6 Mixed-Integer Linear Programming.pdf

    13/18

    Branch and Bound Methods

    Basic Notion 1: Separation

    Remark 1:

    The above conditions imply that the FSs of the

    subproblemsF S(P1), . . . , F S (Pn)are a partition of theFSs of(P), that is F S(P)

    original problem(P)is called a parent node problemsubproblems are called children node problems

    Branch and Bound Methods

    Basic Notion 1: Separation

    Remark 2: how to separate (P) into (P1), . . . , (Pn) ?

    Most frequently used way:Considering contradictory constraints on a single binary variable

    min 3y1 2y2 3y3+ 2x1

    s.t. y1+ y2+ y3+ x1 2

    5y1+ 3y2+ 4y3+ 10x1 10x1 0 y1, y2, y3= 0, 1

    =

    min 3y1 2y2 3y3+ 2x1

    s.t. y1+ y2+ y3+ x1 2

    5y1+ 3y2+ 4y3+ 10x1 10

    y1= 0

    x1 0 0 y2, y3 1

    min 3y1 2y2 3y3+ 2x1

    s.t. y1+ y2+ y3+ x1 2

    5y1+ 3y2+ 4y3+ 10x1 10

    y1= 1

    x1 0 0 y2, y3 1

    Chen CL 50

    Branch and Bound Methods

    Basic Notion 2: Relaxation

    Relaxation:

    An optimization problem, denoted as (RP), is defined

    as a relaxation of problem (P) if the set of feasible

    solutions of(P)is a subset of the set of feasible solutionsof(RP)

    F S(P) F S(RP)

    Chen CL 51

    Branch and Bound Methods

    Basic Notion 2: Relaxation

    Remark 1:The above definition implies the following relationshipsbetween problem (P) and the relaxed problem (RP)

    If(RP)has no feasible solution, then(P)has no feasible solution; Let the optimal solution of(P) be zPand the optimal solution

    of(RP) be zRP. Then (for minimization problem)

    zRP zP

    That is, the solution of relaxed problem (RP) provides a lower

    boundon the solution of problem (P) Ifan optimal solution of(RP) is feasible for problem (P),

    thenit is an optimal solution of(P)

  • 8/11/2019 6 Mixed-Integer Linear Programming.pdf

    14/18

    Chen CL 56

    G l B h d B d F kChen CL 57

    G l B h d B d F k

  • 8/11/2019 6 Mixed-Integer Linear Programming.pdf

    15/18

    General Branch and Bound Framework

    Step 4: Relaxation

    Select a relaxation (RCS) of the current candidate subproblem

    (CS), solve it and denote its solution by zRCS

    Step 5: Fathoming apply the three fathoming criteria FC1: If (RCS) is infeasible, then the current (CS) has no

    feasible solution. Go to step 2

    FC2: IfzRCS z, then current (CS) has no feasible solution

    better than the incumbent. Go to step 2

    FC3: If optimal solution of (RCS) is feasible for (CS) (eg,

    integral), then it is an optimal solution of(CS).

    If zRCS z, then record this solution as the new incumbent

    (z =zRCS). Go to step 2

    General Branch and Bound Framework

    Step 6: Separation

    Separate the current candidate subproblem (CS) and add its

    children nodes to the list of candidate subproblems. Go to step

    2

    Remark 1:

    In step 1, one can use prior knowledge on an upper

    bound and initialize the incumbent to such an upper

    bound

    Remark 2: Node Selection

    Depth-first search (Last-In-First-Out)

    Breadth-first search

    Chen CL 58

    Branch and Bound Based on LinearProgramming Relaxation

    Chen CL 59

    MILP

    min cTx + dTy

    s.t. Ax + By b

    x 0, x X Rn

    y {0, 1}3

    (RCS)01=

    z(RCS)01

    min cTx+ dTy

    s.t. Ax+ By b

    x 0, x X Rn

    0 y1, y2, y3 1

    (RCS)11

    =z(RCS)11

    min cTx + dTy

    s.t. Ax+ By b

    x 0, x X Rn

    y1= 0; 0 y2, y3 1

    (RCS)12

    =z(RCS)12

    min cTx+ dTy

    s.t. Ax+ By b

    x 0, x X Rn

    y1= 1; 0 y2, y3 1

    (RCS)01 z(RCS)01: (LP relaxation of the MILP )

    a lower bound on optimal solution of the MILP

    (optimal and terminate if all y sare 0 1)

    (RCS)11 z(RCS)11: (LP relaxation of the (CS))an upper bound on the solution of(RCS)11

    Chen CL 60

    B h d B d B d LiChen CL 61

    BB M th d B d LP R l ti

  • 8/11/2019 6 Mixed-Integer Linear Programming.pdf

    16/18

    Branch and Bound Based on Linear

    Programming Relaxation: Illustration

    min 2x1 3y1 2y2 3y3

    s.t. x1+ y1+ y2+ y3 2

    10x1+ 5y1+ 3y2+ 4y3 10

    x1 0

    y1, y2, y3= 0, 1

    relax of=root node

    min 2x1 3y1 2y2 3y3

    s.t. x1+ y1+ y2+ y3 2

    10x1+ 5y1+ 3y2+ 4y3 10

    x1 0

    0 y1, y2, y3 1

    x1 = 0

    (y1, y2, y3) = (0.6, 1, 1)

    z = 6.8

    BB Method Based on LPRelaxation:

    Illustration The MILP problem:

    minx,y

    2x1 3y1 2y2 3y3

    s.t. x1+ y1+ y2+ y3 2

    10x1+ 5y1+ 3y2+ 4y3 10

    x1 0

    y1, y2, y3 {0, 1}

    Relaxed problem:minx,y

    2x1 3y1 2y2 3y3

    s.t. x1+ y1+ y2+ y3 2

    10x1+ 5y1+ 3y2+ 4y3 10x1 0

    y1, y2, y3 [0, 1]

    z = 6.8, x1= 0, y= [0.6, 1, 1]6.8< z = +=separate problem into subproblems 1,2

    Chen CL 62

    BB Method Based on LPRelaxation:Illustration

    Consider breadth first search, at level 1:

    Relaxed problem of subproblem 1:

    minx,y

    2x1 3y1 2y2 3y3

    s.t. x1+ y1+ y2+ y3 2

    10x1+ 5y1+ 3y2+ 4y3 10

    x1 0

    y1 = 0

    y2, y3 [0, 1]

    z= 5, x1= 0, y= [0, 1, 1]

    optimal solution of (RP) is feasible for problem (P), and5< z = + z = 5

    Chen CL 63

    BB Method Based on LPRelaxation:Illustration

    Consider breadth firstsearch, at level 1:

    Relaxed problem of subproblem 2:

    minx,y

    2x1 3y1 2y2 3y3

    s.t. x1+ y1+ y2+ y3 2

    10x1+ 5y1+ 3y2+ 4y3 10

    x1 0

    y1 = 1

    y2, y3 [0, 1]

    z = 6.667, x1= 0, y= [1, 0.333, 1]

    6.667< z

    = 5 = separate subproblem 2 into subproblems 3,4

    Chen CL 64

    BB Method Based on LP RelaxationChen CL 65

    BB Method Based on LP Relaxation

  • 8/11/2019 6 Mixed-Integer Linear Programming.pdf

    17/18

    BB Method Based on LPRelaxation:

    Illustration At level 2:

    Relaxed problem of subproblem 3:

    minx,y

    2x1 3y1 2y2 3y3

    s.t. x1+ y1+ y2+ y3 2

    10x1+ 5y1+ 3y2+ 4y3 10

    x1 0

    y1 = 1

    y2 = 0

    y3 [0, 1]

    z= 6, x1= 0, y= [1, 0, 1]optimal solution of (RP) is feasible for problem (P), and6< z = 5 z = 6

    BB Method Based on LPRelaxation:

    Illustration At level 2:

    Relaxed problem of subproblem 4:

    minx,y

    2x1 3y1 2y2 3y3

    s.t. x1+ y1+ y2+ y3 2

    10x1+ 5y1+ 3y2+ 4y3 10

    x1 0

    y1 = 1

    y2 = 1

    y3 [0, 1]

    z = 6.5, x1= 0, y= [1, 1, 0.5]6.5< z = 6 =separate subproblem 4 into subproblems 5,6

    Chen CL 66

    BB Method Based on LPRelaxation:Illustration

    At level 3:

    Subproblem 5minx,y

    2x1 3y1 2y2 3y3

    s.t. x1+ y1+ y2+ y3 2

    10x1+ 5y1+ 3y2+ 4y3 10

    x1 0

    y1 = 1

    y2 = 1

    y3 = 0

    z= 5, x1= 0, y= [1, 1, 0]optimal solution of (RP) is feasible for problem (P), and

    5> z = 6 Stop

    Chen CL 67

    BB Method Based on LPRelaxation:Illustration

    At level 3:

    Subproblem 6:minx,y

    2x1 3y1 2y2 3y3

    s.t. x1+ y1+ y2+ y3 2

    10x1+ 5y1+ 3y2+ 4y3 10

    x1 0

    y1 = 1

    y2 = 1

    y3 = 1

    Infeasible=Stop

    Chen CL 68

    Branch and Bound Based on LinearChen CL 69

    Branch and Bound Based on Linear

  • 8/11/2019 6 Mixed-Integer Linear Programming.pdf

    18/18

    Branch and Bound Based on LinearProgramming Relaxation: Illustration

    Binary Tree for Breadth First Search

    Branch and Bound Based on LinearProgramming Relaxation: IllustrationBinary Tree for Depth First Search with Backtracking

    Chen CL 70

    Thank You for Your Attention

    Questions Are Welcome