Sheet 5
Sheet 5
1- You are a map-coloring robot assigned to color this Southwest USA map. Adjacent regions
must be colored in a different color (R=Red, G=Green, B=Blue). The constraint graph is
shown.
NV
CO
UT
CA
AZ NM
a. Cross out all values that would be eliminated by forward checking, after variable AZ
has just been assigned value R as shown:
CA NV AZ UT CO NM
RGB RGB R RGB RGB RGB
2- This problem asks about the Map Coloring Problem. Each region must be colored one of
Red (R), Green (G), or Blue (B).
Neighboring regions must be a different color. The map (left) and constraint graph (right) are
below.
Consider the partial assignment below. Variable B has been assigned value R as shown.
Cross out all values that would be eliminated by Forward Checking after the assignment to
variable B.
A B C D E F
RGB R RGB RGB RGB RGB
3- You are in charge of scheduling for computer science classes that meet Mondays,
Wednesdays and Fridays. There are 5 classes that meet on these days and 3 professors who
will be teaching these classes. You are constrained by the fact that each professor can only
teach one class at a time.
a- Formulate this problem as a CSP problem in which there is one variable per class, stating
the domains, and constraints. Constraints should be specified formally and precisely but
may be implicit rather than explicit.
C1 C2 C3 C4 C5
ABC ABC ABC ABC ABC
d- Apply forward checking after applying the unary constraints, assuming the first assigning
would be for C4 and has value to be B.
4- After years of struggling through mazes, Pacman has finally made peace with the ghosts,
Blinky, Pinky, Inky, and Clyde, and invited them to live with him and Ms. Pacman. The move
has forced Pacman to change the rooming assignments in his house, which has 6 rooms.
He has decided to figure out the new assignments with a CSP in which the variables are
Pacman (P), Ms. Pacman (M), Blinky (B), Pinky (K), Inky (I), and Clyde (C), the values are
which room they will stay in, from 1-6, and the constraints are:
a- Unary constraints on the grid below cross out the by enforcing unary constraints.
P 1 2 3 4 5 6
B 1 2 3 4 5 6
C 1 2 3 4 5 6
K 1 2 3 4 5 6
I 1 2 3 4 5 6
M 1 2 3 4 5 6
b- Forward Checking For the purpose of decoupling this problem from your solution to the
previous problem, assume we choose to assign P first, and assign it the value 6. What
are the resulting domains after enforcing unary constraints (from part i) and running
forward checking for this assignment?
P 6
B 1 2 3 4 5 6
C 1 2 3 4 5 6
K 1 2 3 4 5 6
I 1 2 3 4 5 6
M 1 2 3 4 5 6