Constraint Satisfaction Problem

We can break down a Constraint Satisfaction Problem (CSP) into:

  • a finite set of variables defines all elements that need to be given a value in the problem
  • a set of domains defines what possible values can be assigned to each variable
  • a set of constraints rules that dictate a relation between variables in each constraint is a pairing of scope and relation

A CSP solution is an instance of all variables in using vales in that satisfies all constraints in .

Link to original

Example: Map Colouring

In this example, we want to colour all the regions of this map with a different colour.

Example: -Queens CSP

None of the queens can be in a position where they can be captured by another queen on a board.

We can pick a finite set of variables which are all possible cells. A set of domains of either or , whether there is a queen or not. And a set of constraints that define no adjacent / diagonal cells can both contain a queen.