Constraint Programming
What is Constraint Programming?
Constraint Programming: You don't write a search algorithm — you describe variables, their domains, and the constraints between them (equations, inequalities, logical relations). A constraint solver explores the space and returns assignments that satisfy everything, or proves none exist. Constraint programming is a way of solving problems by describing the rules instead of writing the search. You define variables, the values each may take, and the constraints between them. A solver then finds assignments that satisfy everything, or proves that none exist.
Frequently asked questions about Constraint Programming
How is Constraint Programming used in practice?
It fits planning and scheduling problems well: staff rosters, timetables, delivery routes and production planning. Writing a custom algorithm for these is hard, and every new rule changes the whole thing. With a solver, a new rule is just another constraint.
What should you keep in mind with Constraint Programming?
Tools include Google OR-Tools, MiniZinc and Choco. For business software, it is worth knowing this exists. When a client asks for a planning tool with many conflicting rules, a solver is often much more reliable than a hand-written algorithm, and easier to adjust when the rules change.
At a glance
| Category | Programming paradigms |
|---|---|
| Explained by | Reinier de la Parra |
| Updated |