CSP Flashcards

1
Q

Provide the formal definition of a constraint satisfaction problem (CSP)

A

CSP Definition:

  • Set of variables X={X_1,…,X_n }
  • Set of domains D={D_1,…,D_n }
    • D_i consists of a set of allowable values for variable X_i.
    • In many cases the domain is assumed to be the same for all variables
  • Set of constraints C={c_i=(scope_i, rel_i)│i=1,…,h}
    • scope_i: subset of X, the variables that are constrained by c_i
    • rel_i: is a relation and tells us which simultaneous assignments of values to variables in scope_i are allowed.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Dare la definizione di soluzione di un CSP

A

State: defined by an assignment of values to some or all of the variables.

Assignment can be:

  • Consistent: it does not violate any constraints
  • Complete: every variable is assigned
  • Partial: only some of the variables are assigned

Solution: a consistent and complete assignment

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Che cosa `e un vincolo globale? Fare un esempio.

A

Global: involve an arbitrary number of variables

e.g., Alldiff, which says that all of the variables involved in the constraint must have different values.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Constraints involving more than three variables are more expressive than constraints involving only two variables? Motivate your answer.

A

No because every CSP can be translated into a binary CSP,

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Descrivere l’euristica MRV (minimum remaining values) per i problemi di soddisfacimento di vincoli. Tale euristica viene anche chiamata euristica First-Fail.

A

Backtracking search: Depth-first search for CSPs with single variable assignments.
It chooses values for a not assigned variable at each level and backtracks when a variable has no legal values left to assign.

Minimum remaining values (MRV) heuristic: chooses the variable with the fewest legal values. It will fail earlier.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Descrivere l’euristica di grado (degree heuristic).

A

Backtracking search: Depth-first search for CSPs with single variable assignments.
It chooses values for a not assigned variable at each level and backtracks when a variable has no legal values left to assign.

Degree heuristic: chooses the variable involved in the most constraints with unassigned variables. Reduce the branching factor.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Assume there is a binary constraint between the variables X and Y. What does it mean that X is arc consistent w.r.t. Y?

A

It means that for each value x in the domain of X, there is some value y in the domain of Y that satisfies the constraint between X and Y.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How can we enforce X to be arc-consistency w.r.t. Y?

A

Remove all the values x in the domain of X for which there is no corresponding value y in the domain of Y that satisfies the constraint between X and Y.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the possible outcomes of the arc consistency algorithm? Explain also how these outcomes are related to the set of the solutions.

A
  • At least one domain could be empty, in which case there is no solution
  • Each domain could have a single value, in which case there is a unique solution
  • Or some domains could have multiple values.

If the domains are multiple, there cannot be no solution, can be one solution or can be multiple

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Consider the case where the arc consistency algorithm applied to a CSP terminates and some domains have multiple values. Is there guaranteed to be a solution? Justify the answer.

A

arc consistency only prune the search space, sometimes, in some lucky case, you can have as outcome a solution, if the domain of every variable is a singleton, or a failure, if at least one domain is empty, but the arc consistency never ensure the solution.

An example could be the arc consisten csp in the figure, that does not have a solution.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Provide an example of a constraint satisfaction problem which is arc consistent but with no solution.

A

3 variables: A,B,C

Domain for each ={1,2}

Constraint: A!=B, B!=C, C!=A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What does it mean that a two-variable set {Xi;Xj} in a CSP is path-consistent with respect to a third variable Xm.

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Indicare quando il grafo dei vincoli `e un albero.

A

A constrained graph is a tree when any two variables are connected by only one path.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Definizione di directed arc consistency

A

A CSP is defined to be directed arc-consistent (DAC) under an ordering of variables X_1,X_2,…,X_n iff every X_i is arc-consistent with each X_j for j>i

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Che cosa `e la tree width di una tree decomposition?

A

A constraint graph allows for several tree decompositions.

Aim: to select decomposition with the subproblems as small as possible

Tree width of a tree decomposition = s-1, where s is the size of largest sub-problem

Tree width of a graph w= the minimum tree width among all its tree decompositions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly