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

}

}