Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Unwanted behaviour with IloModel Setparam

    Posted 06/25/10 12:59 PM

    Originally posted by: SystemAdmin


    I want to obtain a solution of the relaxed problem. I do not want my program runs so long so I set the time limit is , for example, 60 seconds.

    cplex.setParam(IloCplex::TiLim,60); //60 seconds
            //cplex.setParam(IloCplex::NodeLim,1); //for some instances, execution time for node 0 is too much.
             
            cplex.solve();
            
            env.out()<<"Best lower bound = "<<cplex.getBestObjValue();
            
    //The lines of codes are not executed??? I see nothing in the console.
    if (cplex.getStatus() == IloAlgorithm::Infeasible)
            {
                    env.out() << "No Solution" << endl;
            }
            else
            {
                    env.out()<<" Objective value = " << cplex.getObjValue()<<endl;
            }
    


    I run the model:

    C:\ILOG\CPLEX121\examples\x86_windows_vs2008\stat_mta>warehouse.exe 1
    Tried aggregator 1 time.
    MIP Presolve eliminated 0 rows and 1 columns.
    Reduced MIP has 4248 rows, 45828 columns, and 137484 nonzeros.
    Reduced MIP has 228 binaries, 0 generals, 0 SOSs, and 0 indicators.
    Presolve time = 0.17 sec.
    MIP emphasis: balance optimality and feasibility.
    MIP search method: dynamic search.
    Parallel mode: deterministic, using up to 2 threads.
    Root relaxation solution time = 4.42 sec.

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

    0 0 103342.8956 145 103342.8956 8366
    0 0 121204.0740 169 Cuts: 735 11181
    0 0 128232.6272 149 Cuts: 905 13970
    0 0 131384.5147 160 Cuts: 708 16704

    Flow cuts applied: 752
    Flow path cuts applied: 467
    Multi commodity flow cuts applied: 3

    Root node processing (before b&c):
    Real time = 59.91
    Parallel b&c, 2 threads:
    Real time = 0.00
    Sync time (average) = 0.00
    Wait time (average) = 0.00

    Total (root+branch&cut) = 59.91 sec.
    Best lower bound = 131385
    bold
    This application has requested the Runtime to terminate it in an unusual way.
    Please contact the application's support team for more information.
    bold

    And these lines of code do not run:

    if (cplex.getStatus() == IloAlgorithm::Infeasible)
            {
                    env.out() << "No Solution" << endl;
            }
            else
            {
                    env.out()<<" Objective value = " << cplex.getObjValue()<<endl;
            }
    


    Could you explain for me the reasons which lead to the unwanted behavior. It runs well (no error messages) if I do not set the time limit.

    Thanks for your explanation.

    Lessi.
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Unwanted behaviour with IloModel Setparam

    Posted 06/25/10 03:33 PM

    Originally posted by: SystemAdmin


    When I run this program under Linux environment, it throws an exception:

    Total (root+branch&cut) = 60.17 sec.
    • terminate called after throwing an instance of 'IloCplex::Exception' *
    Best lower bound = 133345*Abort*

    Thanks for your suggestion.
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Unwanted behaviour with IloModel Setparam

    Posted 06/25/10 03:42 PM

    Originally posted by: SystemAdmin


    I added try catch pair to catch an exception and it turns out that currently, there is no solution, so the line :

    env.out()<<" Objective value = " << cplex.getObjValue()<<endl;

    raises an exception.
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Unwanted behaviour with IloModel Setparam

    Posted 06/25/10 05:31 PM

    Originally posted by: SystemAdmin


    It might be better to test whether getStatus returns Feasible or Optimal and ask for the objective value only in those cases.

    /Paul
    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Unwanted behaviour with IloModel Setparam

    Posted 06/25/10 05:54 PM

    Originally posted by: SystemAdmin


    Thanks, I have done exactly the things you suggested.

    Lessi.
    #CPLEXOptimizers
    #DecisionOptimization