Tarik Ouhamou
Tarik Ouhamou

Reputation: 427

Or tools cp_model know which constraint is failing

tools for a scheduling problem with a cp_model. I've added 8 constraints to the model and in cases the solution status returned is Infeasible, my question is if there is a way to know which constraint couldn't be fulfilled and was the reason to return INFEASIBLE as a status.

Any help is appreciated and thanks in advance.

Upvotes: 3

Views: 935

Answers (1)

Laurent Perron
Laurent Perron

Reputation: 11064

There are multiple methods:

  • Remove them 1 by 1 ?
  • Try to inject a known solution.
  • Minimize the size of the problem to help debugging.

If you can rewrite the model, you can look at the assumptions sample. using the same model, you can try to maximize the number of enforced constraints (instead of using assumptions).

Upvotes: 3

Related Questions