Artificial Intelligence 2007 Spring Homework 3
Due date: April 19, 2007 April 13, 2007
1. Constrain Satisfaction Problem
We have only four variables: A, B, C and D and each of them have only two legal values, which we will write as: A1, A2 (for variable A), B1, B2 (for variable B), C1, C2 (for variable C) and D1, D2 (for variable D). The only legal assignments for each pair of variables are:
A-B: A1-B1, A2-B1 A-C: A1-C1, A2-C2 B-D: B1-D1
C-D: C2-D1 B-C: No constraint.
A-D: No constraint.
No other combination of variable values is legal. Let’s say that that ”an assignment is generated” every time a variable in the problem gets a new (tentative) assignment. We assume that the variables are examined in alphabetical order and the values in numerical order . Below, we ask you to solve this problem using pure backtracking and also by using backtracking with forward checking. Stop when a valid solution is found.
The search tree for this problem is given below. Each node (except the root) is labeled with the value involved in the assignment, the variable involved is obvious given the value. Your answers will be a space-separated sequence of these values involved in the assignments as they are generated during the appropriate search. For example, A1 B1 etc.
(a) Pure backtracking: How many total assignments are made before finding an answer?
(b) Pure backtracking: Show the assignments in order.
(c) Backtracking with forward checking: How many assignments are made before finding an answer?
(d) Backtracking with forward checking: Show the assignments in order.
1