Hi, I'm trying to get information during the solution process (more specifically, at each time the lazy constraint callback is called) about the added lazy constraints. I read that is not possible to export the model during the solution process. Can I read at least the number of global added constraints during the solution process? Regards,

Hugo Braga.

asked 07 Apr '16, 15:47

HugoBraga's gravatar image

HugoBraga
112
accept rate: 0%


In C++, you can retrieve the number of added cuts using a lazy/user cut callback via cplex.getNcuts(IloCplex::CutUser). You can also implement your own counter within the callback you have already implemented (this could come in handy if you have both a lazy and an user cut callbacks).

Regarding exporting the model, I'm not sure this would satisfy your needs but perhaps you could export the added lazy cuts to a text file while in the callback and then add all of the added lazy cuts to an export of the initial model.

link

answered 07 Apr '16, 17:00

Ehsan's gravatar image

Ehsan ♦
4.8k31122
accept rate: 16%

Thank you Ehsan.

Let me explain the problem I'm facing. I'm adding some lazy constraints to my model and I think that some of them aren't being respected before CPLEX produces a MIP solution. Can I have access to the pool of lazy constraints evaluated by CPLEX? In other words, I want to check what constraints are being checked by CPLEX.

Regards,

Hugo.

(13 Apr '16, 14:46) HugoBraga

1) How do you add the lazy cuts? Do you use a lazy constraint callback or the addLazyConstraint() method? In any case, you should be able to check for lazy cut violation manually. In the former case (i.e., adding lazy cuts derived from a separation method), you can add an incumbent callback to check a newly-found incumbent for feasibility using the same separation method as the lazy constraint callback. In the latter case, you could pass the optimal MIP solution to a new model consisting only of the lazy cuts to see whether it's feasible or not.

(13 Apr '16, 16:22) Ehsan ♦

2) In case of using a callback, add the cuts using the command add(lazyCtr, IloCplex::UseCutForce). This would ensure that CPLEX doesn't purge the cut if it determines that the cut is ineffective.

(13 Apr '16, 16:22) Ehsan ♦
Your answer
toggle preview

Follow this question

By Email:

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

By RSS:

Answers

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

Tags:

×191
×27
×8

Asked: 07 Apr '16, 15:47

Seen: 1,112 times

Last updated: 13 Apr '16, 16:22

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