Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.

 View Only
  • 1.  No solution

    Posted Sun November 08, 2015 11:09 AM

    Originally posted by: ACH-CHEN


    Hello,

    how to fix the following message?
    Best regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: No solution

    Posted Sun November 08, 2015 12:50 PM

    Hi,

    have you tried to label some constraints to make them soft constraints and then you could get a relaxed solution ?

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: No solution

    Posted Sun November 08, 2015 04:27 PM

    Originally posted by: ACH-CHEN


    Dear Alex thank you for reply. Would you give me more details.

    Regards

     

     the OPL model : 

    /*********************************************
     * Author: ACHRAFCHEN
     * Creation Date: 17 sept. 2015 at 15:21:33
     *********************************************/

    //Indices|Sets:
    {int} Orders=...;
    {int} Products=...;
    {int} Units=...;
    range Stages=1..3;
    //Subsets:
    {int}Us[Stages]=...;
    {int}Uo[Orders]=...;
    {int}Up[Products]=...;
    {int}Op[Products]=...;
    {int}Pb[Orders]=...;
    {int}Uu[Units]=...;
    // Parameters:

    int Rb[Orders]=...;
    int Capacity=...;
    float Tpast[Orders,Units]=...;
    int Delta=...;
    int sto[Orders,Orders]=...;
    float Qbmin[Orders,Units]=...;
    float Qbmax[Orders,Units]=...;

    int stp[Products,Products,Units]=...;
    int Rp[Products,Units]=...;
    float Demand[Products]=...;
    int Tmin[Products,Units]=...;
    int Tmax[Products,Units]=...;
    float Qpmin[Products,Units]=...;
    float Qpmax[Products,Units]=...;
    int M=100000000;
     
    //Binary variables:
    dvar int Y[Orders,Units] in 0..1;
    dvar int U[Orders,Orders,Units] in 0..1;
    dvar int Z[Products,Units] in 0..1;
    dvar int W[Products,Products,Units] in 0..1;
    dvar int V[Orders,Products] in 0..1;

    //Continuous variables:
    dvar float+ So[Orders,Stages];
    dvar float+ Co[Orders,Stages];
    dvar float+ Sp[Products,Stages];
    dvar float+ Cp[Products,Stages];
    dvar float+ Tp[Products,Units];
    dvar float+ Q[Products,Units];
    dvar float+ Cmax;

    //Objective function:
    minimize
    Cmax;

    //Constraints:
    subject to{ 
    //* Ct1*/
    forall(o in Orders)
      forall(s in 1..2)
        sum(u in Us[s] inter Uo[o]) Y[o,u]==1;
    //* Ct2*/
    forall(o in Orders)
    forall(p in Pb[o])
    forall(u in Us[2])
          Y[o,u]==sum(u1 in Uu[u] inter Up[p])Z[p,u1];
    //* Ct3*/
    forall(p in Products)
        sum(u in Us[3] inter Up[p]) Z[p,u]==1;
     //* Ct4*/
    forall(o in Orders)
    Co[o,1]==So[o,1]+Capacity/Rb[o];
     //* Ct5*/
    forall(o in Orders)
    forall(u in Us[2] inter Uo[o])
    Co[o,2]==So[o,2]+Tpast[o,u];
     //* Ct6*/
    forall( p in Products)
    forall(u in Us[3]inter Up[p])
    Q[p,u]>=Z[p,u]*Qpmin[p,u];

    forall( p in Products)
    forall(u in Us[3]inter Up[p])
    Q[p,u]<=Z[p,u]*Qpmax[p,u];

    forall( p in Products)
    forall(u in Us[3]inter Up[p])
    Tp[p,u]==Q[p,u]/Rp[p,u]>=Z[p,u]*Tmin[p,u];

    forall( p in Products)
    forall(u in Us[3]inter Up[p])
    Tp[p,u]==Q[p,u]/Rp[p,u]<=Z[p,u]*Tmax[p,u];

     //* Ct6*/
    forall( p in Products)
    forall(u in Us[3] inter Up[p])
    Cp[p,3]==Sp[p,3]+Tp[p,u];

     //* Ct7*/
    forall(o in Orders)
    forall(u in Us[2] inter Uo[o])
    Qbmin[o,u]*Y[o,u]<= sum(p in Pb[o])sum(u1 in Us[3] inter Up[p]) Q[p,u];

    forall(o in Orders)
    forall(u in Us[2] inter Uo[o])
    Qbmax[o,u]*Y[o,u]>= sum(p in Pb[o])sum(u1 in Us[3] inter Up[p]) Q[p,u];

     //* Ct8*/
    forall(ordered o1,o2 in Orders)
    So[o2,1]>=Co[o1,1]+sto[o1,o2]-M*(1-U[o1,o2,1]);

    forall(ordered o1,o2 in Orders)
    So[o1,1]>=Co[o2,1]+sto[o1,o2]-M*(1-U[o1,o2,1]);

     //* Ct8*/

    forall(ordered o1,o2 in Orders)
    forall(u in Us[2] inter Uo[o1]inter Uo[o2])
    So[o2,2]>=Co[o1,2]+sto[o1,o2]-M*(1-U[o1,o2,u])-M*(2-Y[o1,u]-Y[o2,u]);

    forall(ordered o1,o2 in Orders)
    forall(u in Us[2] inter Uo[o1]inter Uo[o2])
    So[o1,2]>=Co[o2,2]+sto[o1,o2]-M*(1-U[o1,o2,u])-M*(2-Y[o1,u]-Y[o2,u]);

     //* Ct9*/
    forall(ordered p1,p2 in Products)
    forall(u in Us[3] inter Up[p1]inter Up[p2])
    Sp[p2,3]>=Cp[p1,3]+stp[p1,p2,u]-M*(1-W[p1,p2,u])-M*(2-Z[p1,u]-Z[p2,u]);

    forall(ordered p1,p2 in Products)
    forall(u in Us[3] inter Up[p1]inter Up[p2])
    Sp[p1,3]>=Cp[p2,3]+stp[p1,p2,u]-M*(1-W[p1,p2,u])-M*(2-Z[p1,u]-Z[p2,u]);

     //* Ct10*/

    forall(p in Products)
    forall(o1,o2 in Op[p])
    forall(u in Us[2] inter Uo[o1]inter Uo[o2])
    So[o2,2]>=Co[o1,2]-M*(2-Y[o1,u]-Y[o2,u]);

    forall(p in Products)
    forall(o1,o2 in Op[p])
    forall(u in Us[2] inter Uo[o1]inter Uo[o2])
    So[o1,2]>=Co[o2,2]-M*(2-Y[o1,u]-Y[o2,u]);

     //* Ct11*/
    forall(o in Orders)
    So[o,2]==Co[o,1];

     //* Ct12*/
    forall( p in Products)
    forall( o in Op[p])
    Sp[p,3]>=Co[o,2]+Delta-M*(1-V[o,p]);

     //* Ct13*/
    forall(p in Products)
    sum(u in Us[3] inter Up[p])Q[p,u]<= Demand[p];

    //* Ct14*/
    forall(p in Products)
    Cmax >= Cp[p,3];

    };


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: No solution

    Posted Mon November 09, 2015 01:10 AM

    Hi,

    can you also attach the .dat ?

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 5.  Re: No solution

    Posted Mon November 09, 2015 03:57 AM

    Originally posted by: ACH-CHEN


    Dear Alex, please found the data file.

    If you need more information's, let me know

    Regards

    OPL data :

    /*********************************************
     * Author: ACHRAFCHEN
     * Creation Date: 8 nov. 2015 at 14:09:26
     *********************************************/

        Orders={1,2,3,4,5,6,7,8,9,10,11,12};
        Products={1,2,3,4};
        Units={1,2,3,4,5,6,7,8,9};
         Us=#[
             1:{1},
             2:{2,3},
             3:{4,5,6,7,8,9}
         ]#;
         Uo=#[
            1:{1,2,4,5,6},
            2:{1,2,4,5,6},
            3:{1,2,4,5,6},
            4:{1,3,7,8,9},
            5:{1,3,7,8,9},
            6:{1,3,7,8,9},
            7:{1,3,7,8,9},
            8:{1,3,7,8,9},
            9:{1,3,7,8,9},
            10:{1,3,7,8,9},
            11:{1,3,7,8,9},
            12:{1,3,7,8,9}
         ]#;
         Op=#[
             1:{1,2,3},
             2:{4,5,6},
             3:{7,8,9},
             4:{10,11,12}
         ]#;
        Po=#[
            1:{1},
            2:{1},
            3:{1},
            4:{2},
            5:{2},
            6:{2},
            7:{3},
            8:{3},
            9:{3},
            10:{4},
            11:{4},
            12:{4}
         ]#;
         Up=#[
             1:{4,5,6},
             2:{7,8,9},
             3:{7,8,9},
             4:{7,8,9}
         ]#;
         Uu=#[
            2:{4,5,6},
            3:{7,8,9}
         ]#;
        Rb=[1000,1000,1000,800,1000,500,1000,1000,1000,1000,1000,1000];
        Capacity=200000;
        Delta=60;
        Demand=[125000,25000,25000,12500];
        Tpast=[
             [3,0]
             [3,0]
             [3,0]
             [0,0.05]
             [0,0.05]
             [0,0.05]
             [0,0.05]
             [0,0.05]
             [0,0.05]
           ];
             sto =[
                [0,0,0, 50,50,50, 50,50,50, 50,50,50]
                [0,0,0, 50,50,50, 50,50,50, 50,50,50]
                [0,0,0, 50,50,50, 50,50,50, 50,50,50]
                
                [50,50,50, 0,0,0, 50,50,50, 50,50,50]
                [50,50,50, 0,0,0, 50,50,50, 50,50,50]
                [50,50,50, 0,0,0, 50,50,50, 50,50,50]
                
                [50,50,50, 50,50,50, 0,0,0, 50,50,50]
                [50,50,50, 50,50,50, 0,0,0, 50,50,50]
                [50,50,50, 50,50,50, 0,0,0, 50,50,50]
                
                [50,50,50, 50,50,50, 50,50,50, 0,0,0]
                [50,50,50, 50,50,50, 50,50,50, 0,0,0]
                [50,50,50, 50,50,50, 50,50,50, 0,0,0]
               ];
               
           Qbmin=[
            [500,0]
            [500,0]
            [500,0]
            [0,1000]
            [0 ,1000]
            [0 ,1000]
            [0 ,1000]
            [0 ,1000]
            [0 ,1000]
               ]; 
             Qbmax=[
            [700, 0]
            [700, 0]
            [700, 0]
            [0 ,1500]
            [0 ,1500]
            [0 ,1500]
            [0 ,1500]
            [0 ,1500]
            [0 ,1500]
               ];
     
                 Tmin=[
                [20,20,20]
                [30,30,30]
                [30,30,30]
                [30,30,30]
                    ]; 
                   Tmax=[
                [60,60,60]
                [70,70,70]
                [70,70,70]
                [70,70,70]
                        ];
                Rp=[
                [200,200,200]
                [300,300,300]
                [300,300,300]
                [300,300,300]
                    ];   
                 Qpmin=[
                [2000,2000,2000]
                [3000,3000,3000]
                [3000,3000,3000]
                [3000,3000,3000]
                        ]; 
                   Qpmax=[
                [20000,20000,20000]
                [30000,30000,30000]
                [30000,30000,30000]
                [30000,30000,30000]
                        ];  
           
            stp=#[
    //    Products 1
        1:#[
                        1:#[
                        4:0
                        5:0
                        6:0 
                             ]#
                                 
                        2:#[
                        4:0
                        5:0
                        6:0           
                             ]# 
                              
                        3:#[
                        4:0
                        5:0
                        6:0 
                        ]# 
                                  
                        4:#[
                        4:0
                        5:0
                        6:0       
                             ]#  
                   
             ]#
     //    Products 2      
           2:#[
                        1:#[
                        7:0
                        8:0
                        9:0 
                             ]#
                                 
                        2:#[
                        7:0
                        8:0
                        9:0           
                             ]# 
                              
                        3:#[
                        7:10
                        8:10
                        9:10 
                        ]# 
                                  
                        4:#[
                        7:10
                        8:10
                        9:10       
                             ]#  
                   
             ]#  
     //    Products 3        
                3:#[
                        1:#[
                        7:0
                        8:0
                        9:0 
                             ]#
                                 
                        2:#[
                        7:5
                        8:5
                        9:5          
                             ]# 
                              
                        3:#[
                        7:0
                        8:0
                        9:0 
                        ]# 
                                  
                        4:#[
                        7:10
                        8:10
                        9:10       
                             ]#  
                   
             ]# 
      //    Products 4       
                    4:#[
                        1:#[
                        7:0
                        8:0
                        9:0 
                             ]#
                                 
                        2:#[
                        7:10
                        8:10
                        9:10           
                             ]# 
                              
                        3:#[
                        7:10
                        8:10
                        9:10 
                        ]# 
                                  
                        4:#[
                        7:0
                        8:0
                        9:0       
                             ]#  
                   
             ]#       
    ]#;

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 6.  Re: No solution

    Posted Mon November 09, 2015 09:27 AM

    Hi,

    in your .mod, what about replacing

    forall( p in Products)
    forall(u in Us[3]inter Up[p])
    Tp[p,u]==
    Q[p,u]/Rp[p,u]>=Z[p,u]*Tmin[p,u];

    forall( p in Products)
    forall(u in Us[3]inter Up[p])
    Tp[p,u]==
    Q[p,u]/Rp[p,u]<=Z[p,u]*Tmax[p,u];

    which looks strange by

    forall( p in Products)
    forall(u in Us[3]inter Up[p])

    Q[p,u]/Rp[p,u]>=Z[p,u]*Tmin[p,u];

    forall( p in Products)
    forall(u in Us[3]inter Up[p]:Rp[p,u]!=0)
    Tp[p,u]==
    Q[p,u]/Rp[p,u];

    forall( p in Products)
    forall(u in Us[3]inter Up[p])
    Q[p,u]/Rp[p,u]<=Z[p,u]*Tmax[p,u];

    forall( p in Products)
    forall(u in Us[3]inter Up[p]:Rp[p,u]!=0)
    Tp[p,u]==
    Q[p,u]/Rp[p,u];

    ?

     

    regards

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 7.  Re: No solution

    Posted Mon November 09, 2015 09:57 AM

    Originally posted by: ACH-CHEN


    Dear Alex thank you, it's very helpful.

    I try the new syntaxe, please find on attached the result.

    Regards.


    #DecisionOptimization
    #OPLusingCPLEXOptimizer