CSP Flashcards
(44 cards)
Discrete CSP
If all the variables have countable domains (finite and infinite domains)
Continuous CSP
If domain is uncountable
Time complexity
Linear constraints are solvable in polynomial time (nd). Non linear is exponential (d^n)
Types of constraints
Unary
Binary
Higher order
Preferences (Soft)
Example of crypt arithmetic puzzles
SEND+MORE=MONEY
When are auxiliary variables used
When there are higher order constraints >=5
Higher-order constraints can be transformed into equi-satisfiable binary constraints using auxiliary variables.
What is a binary CSP?
A CSP where each constraint is binary or unary
What is a constraint graph
The graph formed from binary CSP (A CSP where each constraint is binary or unary) whose nodes are variables and edges are constraints
Examples of real world CSP
- Job scheduling
- Class timetabling
- Queens or Rook placement on chess board
- Assignment problems
Define Constraint network
A constraint network is a triple <V, D, C>
Variables, Domains, and constraints (relations on the domain of the variables)
Satisfying constraints
If the assignment is consistent with all the constraints
What is a consistent and total assignment
If the assignment holds tru for all variables and respects all the constraints - Consistent
If all variables are assigned - Total
How to view CSP as search problem
We can view a constraint network as a search problem, if we take the states as the variable assignments, the actions as assignment extensions, and the goal states as consistent assignments.
โทIdea: Every constraint network induces a single state problem.
Given a constraint network
๐พ :=ใ๐,๐ท,Cใ,
then ฮ ๐พ :=ใ๐ฎ๐พ,๐๐พ,๐ฏ๐พ,โ๐พ,๐ข๐พใis called the search problem induced by ๐พ, iff
โทStates ๐ฎ๐พ are variable assignments
โทActions ๐๐พ: extend ๐โ๐ฎ๐พ by a pair ๐ฅโฆ๐ฃ not conflicted with ๐.
โทTransition model ๐ฏ(๐,๐)=๐,๐ฅโฆ๐ฃ (extended assignment)
โทInitial state โ๐พ: the empty assignment ๐.
โทGoal states ๐ข๐พ: the total assignments
Backtracking search in CSP
DFS for CSP with single variable assignment extension. It is the basic uninformed algorithm for CSPs. It can solve the ๐-queens problem for โ๐,25
How to make backtracking better?
Heuristics: Minimum Remaining Values (Which Variable) and Least Constraining Value Heuristic (Value Ordering)
Minimum Remaining Values (Which Variable)
The minimum remaining values (MRV) heuristic for backtracking search always chooses the variable with the fewest legal values, i.e. a variable ๐ฃ that given an initial assignment ๐ minimizes its domain count.
Why does MRV work?
By choosing a most constrained variable ๐ฃ first, we reduce the branching factor (number of sub trees generated for ๐ฃ) and thus reduce the size of our search tree.
Explain degree heuristic
Used as a tie breaker in MRV. The degree heuristic in backtracking search always chooses a most constraining variable, i.e. given an initial assignment ๐ always pick a variable ๐ฃ with
maximum constraints. By choosing a most constraining variable first, we detect inconsistencies earlier on and thus reduce the size of our search tree.
Least Constraining Value Heuristic (Value Ordering)
Given a variable ๐ฃ, the least constraining value heuristic chooses the least constraining value for ๐ฃ: the one that rules out the fewest values in the remaining variables, i.e. for a given initial assignment ๐ and a chosen variable ๐ฃ pick a value ๐โ๐ท๐ฃ that minimizes the domain count
Constraint Propagation
Constraint propagation (inference in constraint networks) is deriving additional constraints, that follow from the already known constraints, i.e. that are satisfied in all solutions.
We say that two constraint networks
๐พ:=ใ๐,๐ท,๐ถใand ๐พโ:=ใ๐,๐ทโ,๐ถโใsharing the same set of variables are equivalent, (๐พโโก๐พ), if they have the same solutions.
Explain tightness in Constraint Networks
Tighter means the constraints or allowed values in one network (ฮณโฒ) are stricter or more limiting compared to the other network (ฮณ).
Constraint Propagation is tightening up without losing solutions
What are the conditions for ฮณโฒ to be tighter than ฮณ
Domain: The domain of ฮณโฒ is a subset of ฮณ (so the domain could have same or lesser number of values)
Constraints: The constrains of ฮณโฒ are either a subset of ฮณ and new constraints can be added to ฮณโฒ that are not part of ฮณ
Equivalent Constraint Networks
Let ๐พ and ๐พโ be constraint networks such that ๐พโโก๐พ and๐พโโ๐พ. Then ๐พโ has the same solutions as, but fewer consistent assignments than, ๐พ.
โทโคณ๐พโ is a better encoding of the underlying problem.
โทTwo equivalent constraint networks
What are the inference methods on constraint networks?
Forward checking, arc consistency and decomposition