logical-constraints
Write yes/no business rules as correct linear constraints in a mixed-integer model, then prove them right by enumeration. Use whenever a model needs if-then or only-if logic, either/or choices, at most k or exactly one of a set, AND/OR conditions, a fixed cost that applies only when something is used, a minimum batch size, min, max or absolute-value terms, deciding which shift or time slot a value falls in, big-M, indicator or binary variables, or linearising a product of variables. Also use when a MIP returns plans that break a rule everyone believed was modelled, or runs slowly because of a huge big-M.
Pinned to revision a18d88341e79, so it is the text this page describes rather than whatever the author pushed since.
Files
- skills/logical-constraints/SKILL.md
- skills/logical-constraints/references/patterns.md
- skills/logical-constraints/scripts/truth_table.py
Every link opens the file at its source, pinned to the revision this page describes.