8.1. The alldifferent_except_0 constraint
8.1.1. Definition
8.1.2. The implemented AllDifferentExcept
Constraint* Solver::MakeAllDifferentExcept(const std::vector<IntVar*>&
vars,
int64 escape_value) {
int escape_candidates = 0;
for (int i = 0; i < vars.size(); ++i) {
escape_candidates += (vars[i]->Contains(escape_value));
}
if (escape_candidates <= 1) {
return MakeAllDifferent(vars);
} else {
return RevAlloc(new AllDifferentExcept(this, vars, escape_value));
}
}
8.1.3. Use
8.1.4. A first example: The Partial Latin Square Extension Problem (PLSE)
Footnote