Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Conditional epgap, tilim, intsollim

    Posted 03/16/19 09:36 AM

    Originally posted by: K__U


    Hi,

     

    I am solving multiple MILP sub-problems generated from my main model. Some of these problems are solvable to optimality in the defined time limit (cplex.tilim=90).

    However, in some problems the specified time limit stops the model even before an integer solution is found. 

     

    Is it possible to define conditional stopping criteria or order for these settings?

    Something like:
    Run the model for %1 optimality gap (cplex.epgap=0.01) OR  for maximum 90 seconds (cplex.tilim = 90). If the model could not generate an integer solution at the end of 90 seconds,then  keep running until an integer solution (cplex.intsollim=1) is found.

     

    Thanks


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Conditional epgap, tilim, intsollim

    Posted 03/18/19 12:49 PM

    Hi,

    let me give you a small example out of the warehouse example in CPLEX_Studio129\opl\examples\opl\warehouse

    int Fixed        = 100;
    int NbWarehouses = 100;
    int NbStores     = 20000;

    assert( NbStores > NbWarehouses );

    range Warehouses = 1..NbWarehouses;
    range Stores     = 1..NbStores;
    int Capacity[w in Warehouses] =
      NbStores div NbWarehouses +
      w % ( NbStores div NbWarehouses );
    int SupplyCost[s in Stores][w in Warehouses] =
      1 + ( ( s + 10 * w ) % 100 );
    dvar int Open[Warehouses] in 0..1;
    dvar float Supply[Stores][Warehouses] in 0..1;
    dexpr int TotalFixedCost = sum( w in Warehouses ) Fixed * Open[w];
    dexpr float TotalSupplyCost = sum( w in Warehouses, s in Stores )  SupplyCost[s][w] * Supply[s][w];
    minimize TotalFixedCost + TotalSupplyCost;

    subject to {
      forall( s in Stores )
        ctStoreHasOneWarehouse:
          sum( w in Warehouses )
            Supply[s][w] == 1;
      forall( w in Warehouses )
        ctOpen:
          sum( s in Stores )
            Supply[s][w] <= Open[w] * Capacity[w];
    }

    main
    {
    thisOplModel.generate();
    cplex.tilim=30;
    cplex.epgap=0.01;
    if (!cplex.solve())
    {
     writeln("no solution found so now we ll stop after the first solution");
     cplex.intsollim=1;
     cplex.tilim=10000000;
     cplex.solve();
    }

    writeln("Objective = ",thisOplModel.TotalFixedCost + thisOplModel.TotalSupplyCost);

    }

     

    gives

     

    no solution found so now we ll stop after the first solution
    Objective = 118000

    regards

     

    https://www.linkedin.com/pulse/making-decision-optimization-simple-alex-fleischer/


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: Conditional epgap, tilim, intsollim

    Posted 03/18/19 01:51 PM

    Originally posted by: K__U


    Thanks, Alex ! Your example works great.


    One more question: 

    Is the second cplex.solve() triggering a new solution from scratch or continuing the existing solution?

     

    Regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: Conditional epgap, tilim, intsollim

    Posted 03/19/19 02:57 AM

    Hi

    continuing the existing solution.

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer