A method for solving a constraint satisfaction problem (CSP) comprises
identifying a first illegal combination associated with at least one
variable, wherein the first illegal combination contradicts at least one
constraint; grouping the first illegal combination with a second illegal
combination, in response to determining that the first and second illegal
combinations contradict the same constraint; identifying at least one
failure explanation for each group of illegal combinations, wherein the
failure explanation is associated with at least one illegal combination
in said group to provide a reason for a contradicted constraint
associated with the illegal combination; assigning a value to each
variable in the given domain to solve the CSP within the limitations
defined by the constraints in a solution path; and generating a result,
in response to determining that at least one assigned value to a variable
contradicts a constraint.