Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
Expand all | Collapse all

cplex.status = 1 but no solution ?

  • 1.  cplex.status = 1 but no solution ?

    Posted 03/14/19 08:55 PM

    Originally posted by: K__U


    Hi,

    I have MILP problem with one binary and three continuous decision variable. 

    With another subproblem I am generating a solution to my binary decision variable and adding it to the model with below codes:

    for (var i in thisOplModel.SetCoverFinalSolution){
                opl5.Z[i.tup7][i.tup6][i.tup8].LB=1;  //Open period from set cover force main problem to LB >> 1
                }
       
    for (var x=1;x<=9;x++){
          for (var j in opl5.DC){
               for    (var p in opl5.Period){
                        if(opl5.Z[x][j][p].LB!=1){opl5.Z[x][j][p].UB=0}
                }    
          }
    }     

    Without these UB and LB declarations model runs properly,

    but with these bounds, I couldn't get an objective value and model stops running. What might be the reason ?

     

            cplex5.solve()
            writeln(opl5.printConflict()); 
            writeln("cplex5.status",cplex5.status);
            writeln("ObjFunct FullModel:",cplex5.getObjValue());    >>>>>>>> This is the line with problem 

     

    Engine Log:

    I checked the status of the model with below comment:

    CPXPARAM_Advance                                   2
    CPXPARAM_TimeLimit                                 12000
    CPXPARAM_WorkMem                                20000
    CPXPARAM_MIP_Tolerances_MIPGap       0.01
    CPXPARAM_MIP_Strategy_File                   3
    CPXPARAM_MIP_Limits_TreeMemory        10000
    Tried aggregator 1 time.
    MIP Presolve eliminated 587922 rows and 541196 columns.
    Reduced MIP has 2078 rows, 6504 columns, and 14710 nonzeros.
    Reduced MIP has 0 binaries, 0 generals, 0 SOSs, and 0 indicators.
    Presolve time = 8.72 sec. (2224.89 ticks)
    Tried aggregator 1 time.
    Reduced MIP has 2078 rows, 6504 columns, and 14710 nonzeros.
    Reduced MIP has 0 binaries, 0 generals, 0 SOSs, and 0 indicators.
    Presolve time = 0.03 sec. (7.53 ticks)
    MIP emphasis: balance optimality and feasibility.
    MIP search method: dynamic search.
    Parallel mode: deterministic, using up to 6 threads.
    Root relaxation solution time = 0.05 sec. (34.67 ticks)

            Nodes                                         Cuts/
       Node  Left     Objective  IInf  Best Integer    Best Bound    ItCnt     Gap

    *     0     0      integral     0   2.74910e+08   2.74910e+08     2334    0.00%
    Elapsed time = 9.16 sec. (2396.93 ticks, tree = 0.00 MB, solutions = 1)

    Root node processing (before b&c):
      Real time             =    9.27 sec. (2414.42 ticks)
    Parallel b&c, 6 threads:
      Real time             =    0.00 sec. (0.00 ticks)
      Sync time (average)   =    0.00 sec.
      Wait time (average)   =    0.00 sec.
                              ------------
    Total (root+branch&cut) =    9.27 sec. (2414.42 ticks)

     

    Scripting Log:

      No conflicts available.

    cplex5.status1
    // Script execution failed with status -2.

     

    Problems:

    Description    Resource    Path    Location    Type
    Exception from IBM ILOG CPLEX: CPLEX Error  1217: No solution exists.  
     

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: cplex.status = 1 but no solution ?

    Posted 03/15/19 03:57 AM

    Hi,

    Without your entire model I cannot be sure but I think that

    if(opl5.Z[x][j][p].LB!=1){opl5.Z[x][j][p].UB=0}

    is in a loop so by changing the UB you could make the model infeasible and then when you ask for the LB next iteration you get into the error you got.

    A workaround for that is to store all LB you need in a temporary array and then do a loop to change all UB you need

    regards

    https://www.linkedin.com/pulse/low-barrier-entry-optimization-through-cplex-alex-fleischer/


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: cplex.status = 1 but no solution ?

    Posted 03/15/19 11:12 AM

    Originally posted by: K__U


    Hi Alex,

     

    I commented the conflict printer line, and now the model is working without errors.

    //        writeln(opl5.printConflict()); 


    What might be the reason? 

    It is not critical at the moment, but I appreciate your answer to avoid similar problems in future coding.

     

    Thanks


    #DecisionOptimization
    #OPLusingCPLEXOptimizer