When using a generic callback in the "relaxation" context, it is fairly clear how to get values of the primal variables in the LP relaxation (along with a bunch of other stuff), but I can't seem to find a mechanism (at least in the Java API) for getting the values of the dual variables in the LP relaxation. If we need duals for node LPs, do we have to go back to legacy callbacks?

Thanks, Paul

  • $\begingroup$ Did you have a look on ibm.com/developerworks/community/forums/html/… ? $\endgroup$ – Oguz Toragay Apr 13 '20 at 22:12
  • $\begingroup$ Which version of CPLEX are you using? The java API is not always the best CPLEX experience :/ $\endgroup$ – Tue Christensen Apr 14 '20 at 7:55
  • $\begingroup$ I'm using 12.10, the latest version. I agree that there's some "granular" stuff for which you need the C API, but I find Java generally better for my sanity than C or C++. $\endgroup$ – prubin Apr 14 '20 at 21:27
  • $\begingroup$ @OguzToragay Thanks, but I'm afraid that doesn't help. The .getDual() method gets duals from a solved model. I'm looking to get them at tree nodes, after the tree LP is solved but while the MIP solver is still running. $\endgroup$ – prubin Apr 14 '20 at 21:30

At the moment (CPLEX 12.10) querying duals in a relaxation context is not supported. You may want to file a request for enhancement for CPLEX to try to get this into one of the next versions.

This is however something that may be more difficult than it seems at first glance. For example, duals would have to be provided for the original model and there a number of presolve reductions that will make uncrushing duals very hard or even impossible.

EDIT: In fact, you will never be able to get duals for the original model since that would require forming the dual of a MIP. So the best you could ever get are duals for the presolved model.

  • $\begingroup$ Thanks Daniel. It was a one-time desire, and I found a way forward without the duals, so I won't be filing a request. That said, I would not be surprised if people developing node heuristics might want the duals of the node LPs. $\endgroup$ – prubin Apr 18 '20 at 16:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.