Skip to content
Pebbles Ai

Pebbles Ai glossary

What is a constraint satisfaction problem (CSP)?

A constraint satisfaction problem is a task defined by variables, the values each can take and constraints that must all hold at once, such as fitting a meeting into everyone's free time. A solver searches through combinations, pruning any option that breaks a constraint, until it finds an answer or shows that none exists. Scheduling, timetabling, configuration and territory planning are classic cases.

The short answer

Key takeaways

  • A CSP has three parts: variables, domains (the allowed values) and constraints.
  • Solvers prune impossible options early instead of trying every combination.
  • Hard constraints must hold; soft constraints are preferences the solver tries to honour.
  • Constraint programming is the practice of writing problems this way for a solver.
  • Meeting scheduling and territory design are everyday go-to-market examples.

The three parts of a constraint satisfaction problem

Every constraint satisfaction problem has three parts: variables to fill, a domain of allowed values for each, and constraints that limit which combinations are acceptable. Booking a demo makes it concrete.

  • Variables: the meeting's day, start time and room.
  • Domains: the next five working days, half-hour slots and the rooms available.
  • Constraints: every attendee is free, the slot falls inside everyone's working hours and the room is not booked.

How a constraint solver searches

A constraint solver searches by assigning values one variable at a time and backing up as soon as a choice breaks a constraint, so it never explores combinations that are already impossible. Constraint propagation adds to this: after each choice, the solver removes values from other variables that can no longer work.

Simple ordering rules make a large difference, such as filling the most constrained variable first. The search ends with an assignment that meets every constraint, or with proof that no such assignment exists, which is itself a useful answer.

Hard and soft scheduling constraints

Hard scheduling constraints must hold for an answer to count, while soft constraints are preferences a solver tries to honour and can trade off. In an illustrative case, booking a demo for five people across three time zones with one room and one sales engineer, everyone's availability and the engineer's calendar are hard constraints.

Preferring a morning slot for the prospect, or avoiding Friday afternoons, are soft. Once soft constraints carry weights, the task becomes finding the best acceptable answer rather than any acceptable one, an optimisation problem solved with the same family of methods.

CSP in AI and constraint programming

CSP in AI is one of the classic problem types of symbolic AI, with its own chapter in standard textbooks and a place within automated reasoning. Constraint programming is the practical side: languages and libraries where you state variables and constraints and leave the search to a constraint solver.

Close relatives include satisfiability (SAT) solvers, which handle true-or-false variables, and the mathematical optimisation solvers used in planning and logistics.

Constraint satisfaction in sales territory planning

Sales territory planning is a constraint satisfaction problem whenever accounts must be split so that each rep's patch balances while fixed commitments hold. Named accounts stay with their owner, regions follow language or legal lines, and each patch should carry a similar workload; a solver can propose splits that meet the hard rules and balance the rest.

The limits are the usual ones. Constraints must be written down exactly, the account data must be good enough to trust, and an over-constrained plan has no solution until someone relaxes a rule. A solver's split is a starting point for the sales leader, not a decision.

From answer to product

Where Pebbles Ai fits

Clear answers

Common questions

What happens when a constraint satisfaction problem has no solution?

The solver reports that no assignment meets every constraint, often pointing to the ones in conflict. The usual fix is to relax a hard constraint or make it soft, such as widening the meeting window.

Is scheduling a constraint satisfaction problem?

Most scheduling is: who, when and where are the variables, and availability, capacity and rules are the constraints. Large schedules with preferences become optimisation problems solved by the same family of tools.

What is the difference between a CSP and an optimisation problem?

A CSP asks for any answer that meets every constraint. An optimisation problem asks for the best answer by some measure, such as the most balanced territory split, while still meeting the hard constraints.

About this page. Written by the Pebbles Ai team for people who run sales, marketing and growth. Last updated .

Your next chapter

From the term to the work

See how research, leads, outreach and email come together in one workspace.