Tutorial Constraint Satisfaction Problems CSP Exercise 1 • Consider the following map.

Download Report

Transcript Tutorial Constraint Satisfaction Problems CSP Exercise 1 • Consider the following map.

Tutorial
Constraint Satisfaction Problems
CSP
Exercise 1
• Consider the following map. The task is to color the
map using the three colors Red, Blue, and Green, such
that no two adjacent regions take the same color.
1.
Formulate the problem as a CSP. Clearly state the variables,
domains, and constraints.
2.
Describe the topology of the constraint graph.
3.
What is the size of the search space?
4.
Color the map using:
1.
2.
3.
4.
5.
Backtracking Search with MRV heuristic.
Backtracking Search with MCV heuristic.
Backtracking Search with LCV heuristic.
Backtracking Search with Forward Checking heuristic.
Note: Variables and values are ordered as follows:
•
•
Variables: WA, NT, Q, NSW, V, SA, T
Values: Red, Blue, and Green
CSP
Exercise 2
3 colour me!
{blue, green, red}
{blue, green, red}
A
B
{blue, green, red}
C
E
{blue, green, red}
D
{blue, green, red}
H
{blue, green, red}
F
G
{blue, green, red}
{blue, green, red}
Use all heuristics including arc-propagation to solve this problem.
CSP
Exercise 3
CSP – Examination Problem
• During an examination, an invigilator has to arrange six
students in a way to make sure that the examination is
properly conducted and no one cheats. 2 students have
makeup in Artificial Intelligence, 1 student has makeup in
Database, 2 students have makeup in Mathematics, and 1
student in Physics. As shown in figure below, there exist 6
desks arranged into two rows and three columns.
Examination Problem
•
The problem for the invigilator is to arrange students so that
students having the same makeup exam should not be neighbors
(in the same column, in the same row or the same diagonal for
example - neighbors of 5 are 1, 2, 3, 4 and 6, - and neighbors of 3
are 2 (same row), 5 (same diagonal) and 6 (same column)).
1. Propose a formulation of the problem in term of CSP by specifying
variables, domains and constraints
2. Describe the topology of the constraint graph.
3. Using Forward Checking with Backpropagation, propose a
solution to help the invigilator. Variables and values should be
selected according to alphabetical or ascending order.
4. Using Backpropagation with MCV heuristic, propose a solution to
help the invigilator. Variables and values are ordered according to
alphabetical or ascending order.
CSP
Exercise 4
Forward Checking
• Do it yourself …
• Solve 6-queens …
Q1
1
2
3
4
5
6
Q2
Q3
Q4
Q5
Q6