1
$\begingroup$

Is it possible to implement custom lazy callback constraints using OR-Tool's base linear solver?

Through Google's docs, I've seen their TSP examples using the constraint solver RoutingModel and it appears to have a built-in lazy callback functionality (it must since that's necessary to solve a TSP).

The problem I'm working on is like a TSP but in a goal program format, so there are a lot of extra constraints and variables related to the other goals and not just the travel to and from each node. For that reason, I'm trying to stay away from using the RoutingModel since I don't think it will work with the goal program formulation.

My previous version of this formulation was using Gurobi and I was able to create the necessary lazy callback constraints using their callback APIs, so I'm hoping to be able to achieve similar functionality.

$\endgroup$

1 Answer 1

3
$\begingroup$

So

  1. the routing library does not use a MIP solver to solve TSP/VRP... problems. So the assumptions of lazy callbacks is just false.
  2. The question of goal programming is not that clear. You should look at the routing API.
  3. The linear solver wrapper do support callbacks for Gurobi and SCIP, but if you plan on using Gurobi, you should stick to the gurobi API
  4. My recommendation if the goal part does not fit in the routing library is to use the CP-SAT solver. It offers the ConstraintProgramming circuit object to model an Hamiltonian path, as well as having built-in the MIP model with the flow formulation, and the subtour elimination cuts.
$\endgroup$
3
  • $\begingroup$ Appreciate you clearing up some of my misconceptions about OR-Tools! As is probably obvious by my question, I'm very new to OR-Tools and trying to wrap my head around how all the pieces fit together. I'm taking a closer look at the routing API now. Follow-up question for you, can you point me in the direction of an SCIP example using the callbacks? I see the Constraint.set_is_lazy() method, but am not sure how it is used in practice. $\endgroup$ Jan 4 at 15:08
  • 1
    $\begingroup$ I do not think there are examples. And it is C++ only. The callback code is in ortools/linear_solver/scip_callback.h. So a bit rough. I really recommend the routing, the CP-SAT approach :-) $\endgroup$ Jan 4 at 15:23
  • $\begingroup$ Ahh, so its not accessible through the Python API? I'll focus more on the routing approach then! Don't be surprised if you see more OR-Tools tagged questions in the near future haha $\endgroup$ Jan 4 at 16:13

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.