Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Same simple LP but different solution status

    Posted 11/07/11 09:22 PM

    Originally posted by: SystemAdmin


    I observed that if I set 0/1 for binary variables of an cplex object then I solve; the first time it displays solution and the corresponding objective value; the second time; it displays no solution. Even I create new cplex model and then set same 0/1 values on the second model.

    for(int a=0;a<g.nbNodes;a++)
    for(int b=0;b<g.nbNodes;b++)
    freCpy[a][b]=fre[a][b];
    FixVariablesValue(g,fre,cplexObj);
    cplexObj.cplex.solve();

    if (cplexObj.cplex.getStatus()!=IloAlgorithm::Feasible && cplexObj.cplex.getStatus()!=IloAlgorithm::Optimal)
    {
    cout<<"No solution for this design"<<endl;

    }
    else
    {
    FixVariablesValue(g,freCpy,cplexObj); //resolve again
    cplexObj.cplex.solve();
    if (cplexObj.cplex.getStatus()!=IloAlgorithm::Feasible && cplexObj.cplex.getStatus()!=IloAlgorithm::Optimal)
    {
    cout<<"solution existed!"<<endl;
    exit(0);
    }
    else
    {
    cout<<"No solution!"<<endl; //this line is displayed
    }
    cout<<"Final objective value:"<<cplexObj.cplex.getObjValue()<<endl; //this line is display also
    }

    Please help me to understand and handle it. I just checked in windows and linux, same behaviour.

    Thanks,
    #DecisionOptimization
    #MathematicalProgramming-General


  • 2.  Re: Same simple LP but different solution status

    Posted 11/07/11 10:22 PM

    Originally posted by: SystemAdmin


    it is my logic error in if/then. copy / paste error. It takes me 2-3 hours to recognize that. So bad.
    #DecisionOptimization
    #MathematicalProgramming-General