Originally posted by: SystemAdmin
[mamba said:]
Hi all,
I am trying to implement a kind of branch-and-bound-algorithm (in java using cplex) for a special integer problem. After solving the relaxed problem, I want to branch on a noninteger variable, say x(i) = 0.5. Since x(i) is binary, I want to add to my LP problem a constraint of the form x(i) = 1. I tried to do this with the following code:
IloRange newEquation = myModel.getCplex().Eq ( x(i), 1);
myModel.getCplex().add(newEquation);
I also tried the following:
IloAddable newEquation = myModel.getCplex().addEq( x(i), 1);
And finally I tried to set the lower bounds of x(i) = 1
But for any reason this is not working, cplex is doing nothing, when I solve my problem, x(i) still has value 0.5 (or anything else but NOT 1) and I have no idea why.
Maybe you have an idea why this is not working.
Thanks for your help,
Melanie
#CPLEXOptimizers#DecisionOptimization