DELAPARRA
Index
Color
NL
Category: Programming paradigms

Constraint Programming

Explained by Updated

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.

Definition source Coders Lingo, CC BY 4.0

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

CategoryProgramming paradigms
Explained by
Updated

More Programming paradigms terms

All terms starting with C

Skills

Download all skills (zip)

Manuals

Related services

Need any help?

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.