# Decision Optimization

View Only

## reduced costs at root node relazation

• #### 1.  reduced costs at root node relazation

Posted Fri September 08, 2023 11:23 AM
Edited by Rory Keeley Fri September 15, 2023 04:29 AM

Hi everyone,

I am trying to retrieve the solution of root node relaxation using callbacks in cplex concert c++. I am particularly interested in getting the reduced costs associated with each decision variable. Unfortunately, I could not find a way to retrieve them, and it seems that I can not use the getReducedCost() method inside a callback class. Does someone has a better idea how to get them ?

Below a snap of my callback procedure.

Thanks a lot !

ILOUSERCUTCALLBACK1(rootNode, proximitySearch&, model)
{
int i, j, t;
const auto K = model.K;
const auto N = model.N;
const auto T = model.T;
auto& y = model.y;
auto& yy = model.yy;
auto& z = model.z;
auto& zz = model.zz;
if (getNnodes() == 0) {
cout << "root node relaxation accessed" << endl;
cout << "BandC Obj: " << getObjValue();
cout << " BestObj: " << getBestObjValue();
cout << " IncumbtObj: " << getIncumbentObjValue() << endl;
cout << " pseudocost: " << getDownPseudoCost(z[1][1][1]); cin.get();
for (i = 0; i < N; i++) {
for (t = 1; t <= T; t++)
{
for (auto k = 1; k <= K; k++)
{
model.z_root[i][t][k] = getValue(z[i][t][k]); double val = model.z_root[i][t][k];
for (j = 0; j < N; j++)
{
if (i != j) model.y_root[i][j][t][k] = getValue(y[i][j][t][k]);
}
}
}
}
getReducedCosts(model.y, yy);  -> this does not work

}
}

• #### 2.  RE: reduced costs at root node relazation

Posted Fri September 15, 2023 05:12 AM

Can someone help ? or provide some useful references ?

Thanks!

------------------------------
Mohamed Ben Ahmed
------------------------------

• #### 3.  RE: reduced costs at root node relazation

IBM Champion
Posted Thu September 21, 2023 02:01 PM

You might want to take a look at Daniel's second answer in this thread.

------------------------------
Paul Rubin
Professor Emeritus
Michigan State University
------------------------------

• #### 4.  RE: reduced costs at root node relazation

Posted Wed September 27, 2023 04:02 AM

Thank you Paul ! very helpful !

------------------------------
Mohamed Ben Ahmed
------------------------------