Hi all,

There is a set of constraints in my original integer program. When I solve the problem without them, most of the time they are not violated. Therefore I add them using the lazyconstraint callback and the results are fine (faster than solving the original ip). However when I use usercut callback together with the lazy, cplex reports non-optimal solutions as optimal.

Do you have any idea why it gives non-optimal solutions?


asked 14 Oct '17, 11:41

crookshanks89's gravatar image

accept rate: 0%

This depends on what you mean by "together with". If the lazy constraints stayed in the lazy constraint callback, and user cut callback adds unrelated cuts (or does nothing), you should still get the correct solution. If you moved any or all of the constraints from the lazy constraint callback to the user cut callback (only), but left the lazy constraint callback itself in place, I think that should work (not positive). If you moved all the constraints to the user cut callback and removed the lazy constraint callback, that would certainly explain a suboptimal solution.

User cuts are "contractually obligated" not to cut off otherwise feasible integer solutions (which your lazy constraints presumably do). The main problem with doing so is that, in conjunction with certain (dual?) fixing algorithms, they can lead CPLEX astray. Having a lazy constraint callback present tells CPLEX to turn off the bits and pieces that get confused when feasible integer solutions are cut off. So I think that the mere presence of the lazy constraint callback, even an empty one, is enough to cover you, even if some or all of the user cuts are violating their "contract".

Note that when I say the lazy constraint callback is present, I mean it has been attached to the solver (via the use() method in the C++ or Java APIs, for instance). Just having a callback class defined is not enough.


answered 14 Oct '17, 13:53

Paul%20Rubin's gravatar image

Paul Rubin ♦♦
accept rate: 19%

Thank you Prof. Rubin. I think I understand my mistake. My lazy constraints do cut some feasible integer solution and my intention to add user cuts was to see whether applying them in fractional solutions improves the solution time. I did not remove the lazy constraint callback. I have copied the same inequalities to user cut callback. So I end up with user cuts that cut some feasible integer solution. I believe that was the mistake. Now I have changed my code so that user cuts are added only at the fractional points.

(17 Oct '17, 08:30) crookshanks89

Applying the same cuts in both callbacks might be a bit wasteful, but as long as the lazy constraint callback remains attached, I do not think copying those cuts to the user cut callback is the source of your problem.

(17 Oct '17, 13:37) Paul Rubin ♦♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 14 Oct '17, 11:41

Seen: 710 times

Last updated: 17 Oct '17, 13:37

OR-Exchange! Your site for questions, answers, and announcements about operations research.