MPB Callback for both heuristic solution and lazy constraint



Is it possible to have a callback add a heuristic solution and a constraint using MathProgBase?
It seemed unclear how to register it in that case, using setlazycallback! or setheuristiccallback!


By default, no, the callbacks need to be separate. It may or may not be possible to work around this restriction depending on what the underlying solver supports. If you generate solutions inside the lazy constraint callback, you could store them and give them to the solver in the next heuristic callback. That’s what Pajarito does.