artificial-intelligence

Definition

Constraint Satisfaction Problem

A constraint satisfaction problem is an instance consisting of:

  1. A finite set of variables
  2. A finite domain of values
  3. A finite set of constraints

Each constraint is a pair where:

  1. is a tuple of variables called the scope
  2. is an -ary relation specifying the admissible assignments to the variables in

An assignment satisfies the instance if for every constraint with , one has . The constraint satisfaction problem asks whether there exists an assignment satisfying all constraints.

Types of Constraints

Unary Constraint

A unary constraint restricts the domain of a single variable. For example means must be 1, 3, or 5.

Binary Constraint

A binary constraint restricts the values of a pair of variables. For example, means if is 1, then must be 2, or if is 3, must be 5.

Constraint Satisfaction Problem

A state is defined by a set of variables , each of which has an associated domain of possible values. The goal test is a set of constraints that specify allowable combinations for values of subsets of these variables.

Essentially, you have a problem defined by variables, the possible values those variables can take, and a set of rules (constraints) that must be satisfied by any valid combination of values.

In standard search problem, a state is often treated as a “black box” with no discernible internal structure from the algorithm’s perspective. The algorithm can only interact with states using problem-specific routines like a successor function, a heuristic function, and a goal test.

CSPs, on the other hand, have a more structured and standardised representation for states and the goal test. This structure allows for the development of search algorithms that can exploit this common representation and use general-purpose heuristics rather than problem-specific ones.