Constraint satisfaction problem Flashcards

1
Q

Describe the constraint satisfaction problem.

A

In the constraint satisfaction problem, we have some nodes 1 .. .n with domain D_1 .. .D_n.

The domain can be both discrete and continuous.

The problem has constraints, often written as the edges between nodes, eg.
C(1,3) = x_1+x_3> 10
C(2,3) = x_2 - x_3 = 10

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

What are some applications of the constraint satisfaction problem?

A
  • Timetabling
  • Graph coloring problem
  • N-queen problem
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Describe min-conflicts method in pseudo code.

A

Number_of_tries = 0;
while ( Number_of_constrained_violated > 0 AND Number_of_tries < MAX_Tries ) DO
__Select at a random a variable X that violates a constraint;
__For each value of X DO
____Determine the value of the selected variable that results in the
____highest gain ;
__End for
__Update the solution if it is beter than the previous one;
__Number_of_tries += 1;
End While

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

Describe the GCSP (greedy CSP) in pseudo code.

A

Number_of_tries = 0;

while ( Number_of_constrained_violated > 0 AND Number_of_tries < MAX_Tries ) DO
__For each variable in the set of variables DO
____/* Selects the variable which will produce the higehst gain */
____Select at random a value ;
____Determine the gain;
____Keep the best gain sofar;
__End for
__Select the variable having the higest gain
__Update the solution ;
__Number_of_tries += 1;
End While

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

Describe the multilevel CSP algorithm in pseudo code.

A

For ( level = Number_of_Levels ; level > 0 ; level–) /* Number of levels )
Start:
__Number_of_tries = 0;
__while ( Number_of_constrained_violated > 0 AND Number_of_tries < MAX_Tries )
__Start:
____Select at random a specified number of variables ;
__/* Number of variables = Number of Levels */
____Choose at random a value for each choosen variable;
____Calculate the gain;
____Update the solution if the current solution is better than the
____previous one;
____Number_of_tries += 1;
__End
END

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