Can you feed OR-tools solver external data inbetween different solutions it finds?

Viewed 65

I'm trying to solve a complex variant of a min-SAT problem. So far in the process I have two subproblems, both giving solution values that need to be considered in the objective function. However, only one of the two problems do I solve with the OR-tools cp_model module. The other is solved by an external algorithm. Now, ideally I would do the following:

  1. cp-solver findes a solution to the first subproblem,
  2. pause the solver,
  3. solve the second subproblem with an external algorithm, taking as argument the solution found by the cp-solver,
  4. feed the result of the external algorithm back to the cp-solver,
  5. cp-solver now considers as the objective value the sum of the solution it itself found to first subproblem and the solution that was found by the external algorithm,
  6. cp-solver goes to the next iteration and repeats steps 1-6 for a new assignment

So my question is: is there a functionality for Google OR-tools that lets me do something like steps 1-6 where the solver runs in cooperation with external algorithms and is fed values accordingly? I'm new to using this module so I'm unaware of what terms I could search for on Google to find what I need. Thanks a lot my friends. Best regards, 30centimeter.

1 Answers

In the cp-sat solver, solve() is stateless and a black box. The only thing you can do is modify the model and resolve.

Related