# How to know which constraint in CP-SAT did not meet the feasibility gap

Is there any systematic way to retrieve some information on the constraint that caused infeasibility in Or.Tools CP-SAT?

using System;

public class InfeasibleCpModel
{
static void Main()
{
CpModel _cpModel = new CpModel();

IntVar x = _cpModel.NewIntVar(0, 10, "x");
IntVar y = _cpModel.NewIntVar(0, 10, "y");

CpSolver solver = new CpSolver();
CpSolverStatus status = solver.Solve(_cpModel);

if (status == CpSolverStatus.Infeasible)
{
// Catch the constraint that did not meet the feasibility gap
}
}
}

• Note that, in general, one cannot identify a single constraint that causes infeasibility. What you can try to do is find an "irreducible infeasible subset" of constraints -- a set of constraints that cannot be simultaneously satisfied, such that omitting any one of them lets the solver satisfy the rest. – prubin Oct 18 '20 at 18:43
• That is correct. This question is more about how a particular solver reports on those constraints that could not meet the feasibility gap. – Mahmoud Oct 18 '20 at 18:57