Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Problem with Pool of solutions cplex

    Posted 04/09/11 06:29 AM

    Originally posted by: dbaena


    Hi,
    I'm using cplex 12 and I want to solve a MIP problem with limit time. When i get the limit time I want to know each integer solution found (feasible of course) of this problem and keep the best integer (and x solution).

    I did it using it:

    if ((status == CPX_STAT_ABORT_TIME_LIM) || (status == CPXMIP_SOL_LIM))
    {
        nsols=cplex.getSolnPoolNsolns();
        if (nsols>0)
        {
     
            //feasible_sol_found
            cout << "abort time limit with feasible solution found " << endl;
           // get new best solution
           
           BestNode=Inf;
           cout << nsols << " integer solutions found" << endl;
           for (int i=0;i<nsols;i++)
           {
             ObjValue = cplex.getObjValue(i);
             if ( ObjValue < BestNode)
             { 
                BestNode = ObjValue;
                cplex.getValues(xtil,vars,i);
             }//end_if
    }//end_for
    

    using SolutionPool of cplex. However, I am having several problems. For example I do:

    cplex.getObjValue(i) //
    and I obtain a value that is not according with value of variables in xtil:
    cplex.getValues(xtil,vars,i)...

    I don't know what happen...

    Thanks a lot!
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Problem with Pool of solutions cplex

    Posted 04/11/11 06:00 PM

    Originally posted by: SystemAdmin


    What do you mean exactly? Are you saying that the value you get from cplex.getObjValue(i) does not match (up to numerical tolerances) the value that you calculate yourself, taking the x vector from cplex.getValues(xtil,vars,i) and the objective function coefficients from your model?
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Problem with Pool of solutions cplex

    Posted 04/12/11 03:52 PM

    Originally posted by: dbaena


    Thanks Tobias,

    Finally I do it (get the best integer solution) using IloIncumbentCallback.

    However, my problem with Pool solution was that (I think, because I observe that there isn't enough information about it):

    cplex.getObjValue(0) --> Best Incumbent, Best integer solution found
    cplex.getValues(x,vars,0) --> Values does not match with objective value of cplex.getObjValue(0).

    The rest of positions is OK.

    Thanks a lot.
    #CPLEXOptimizers
    #DecisionOptimization