Originally posted by: SystemAdmin
Hi guys!
I am solving my problem using column generation method and program in C++ collaborate with CPLEX.
I posted my code and solution below. It looks something wrong with my code... If use the variable value to calculate the objective value, it should be 0(zero) but the solver get objective 15...
Code IloObjective ReducedCost = IloAdd(MyOpt, IloMaximize(env,0));
ReducedCost.setLinearCoefs(VarsInSubObj, ParametersInSub);
cout<<ReducedCost<<endl;
MySolver.solve();
cout<<"Var "<<Ai[i].getName()<<MySolver.getValue(Ai[i])<<endl;
cout<<"Problem "<<argv[1]<<" Reduced cost is "<<MySolver.getObjValue()<<"============================"<<endl;
Output obj23 = (-10 * A(1) + -5 * A(2) + -5 * A(3) + -5 * A(4) + 10 * A(1) + 5 * A(2) , IloObjective, Maximize);
Var A(0)1
Var A(1)1
Var A(2)1
Var A(3)0
Var A(4)0
Var A(5)1
Problem p1.2.c.txt Reduced cost is 15============================
R there anyone has any idea?
Thank you!
Tracy
#CPLEXOptimizers#DecisionOptimization