0

Using C++, I have two sets of binary decision variables, y[i] and x[i][j]:

    IloNumVarArray y = CreateNumVarArray(env, int1, "y", 0, 1, ILOINT); 
    NumVarMatrix x(env, int1);
    for (IloInt i = 0; i < int1; ++s) {
        x[i] = IloNumVarArray(env, int2, 0, 1, ILOINT);
    }

When branching, I want y[i] variables to be branched first.

I looked for "strong branching" related topics in CPLEX Parameters Reference Manual, but could not find anything useful.

avariant
  • 2,234
  • 5
  • 25
  • 33
Ozan Aksu
  • 17
  • 2

1 Answers1

0

You can rely on priorities within cplex.

See OPL example https://github.com/AlexFleischerParis/zooopl/blob/master/zoopriorities.mod

int nbKids=300;
float costBus40=500;
float costBus30=400;
 
dvar int+ nbBus40;
dvar int+ nbBus30;

execute
{
  nbBus40.priority=100;
  nbBus30.priority=0;
}
 
minimize
 costBus40*nbBus40  +nbBus30*costBus30;
 
subject to
{
 40*nbBus40+nbBus30*30>=nbKids;
} 

You can do the same with all CPLEX apis

Alex Fleischer
  • 9,276
  • 2
  • 12
  • 15