Hi everyone,
I'm using Heuristic callback using .NET with CPLEX 12.9. During the callback, I improve the current solution and use setSolution() method to inject my solution as the new incumbent solution. However, CPLEX seems not to accept my solution. More precisely, I do the following:
- The problem is a large MIP. During the callback, I use setBounds(vars, vals, vals) method to change the values of integer/binary variables to heuristic values. The setBounds() is not necessarily called only once and not necessarily contains all integer/binary variables, but I make sure that all integer/binary variables in my model are eventually integer and binary, respectively. I call the method many times. But before using setBounds(), I call GetFeasibilities() to make sure that none of the variables are implied.
- After making sure that the heuristic solution is feasible (i.e., the status all integer/binary variables are either integer feasible or implied) and it is better than the current incumbent solution, I use setSolution(vars, vals, obj) to inject the heuristic solution. However, CPLEX seems not to accept the solution. I say this because I check whether my injected solution is passed to the incumbentCallback. The injected solution is not passed.
- I do not call setSolution() more than once per callback invocation. In fact I don't inject the heuristic solution if it is worse than the preceding injected solutions.
That said, I am suspicious that the problem may be due to SOS constraints in my model. Although I couldn't find any reference to it in the documentation, a reply to
this post hints it. Does anyone have an idea on that?
Thanks in advance.
------------------------------
Faruk Akin
------------------------------
#DecisionOptimization