artificial-intelligence

Definition

Constraint Satisfaction Problem

A constraint satisfaction problem consists of three main components:

  1. A finite set of variables
  2. Associated domains for each variable: Each variables has a non-empty domain of possible values it can take.
  3. A finite set of constraints:

A constraint between a subset of variables is defined as a subset of the Cartesian product of their domains This means a constraint lists all the allowed combinations of values for the variables it involves. For example, a constraint might be , meaning and cannot have the same value.

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.