

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Logic programming and Artificial Intelligence
Typology: Study notes
1 / 2
This page cannot be seen from the preview
Don't miss anything!


Logic Programming and Artificial Intelligence 17 May 2011 Problem Sheet 8 Due: 17:15, 24 May 2011
B B B W W W E
There are three black tiles (B), three white tiles (W), and an empty cell (E). The puzzle has the following moves:
The goal of the puzzle is to have all of the white tiles to the left of all of the black tiles (without regard for the position of the blank cell). We shall use the obvious representation for this problem: the states and operators of the represen- tation correspond directly to the configurations and moves of the puzzle.
(a) [4 marks] Specify a heuristic function, h, for this problem. (b) [8 marks] Show the search tree that is grown by A∗^ search using your heuristic function. Assume that the algorithm halts when the first goal is found. Label each node in tree by its f , g, and h values, and number the nodes to indicate the order in which they are removed from the list of nodes. Do not include any cycles in your search tree. If your search tree does not fit on a single sheet of paper, then your heuristic function is not good enough; find a better one. (c) [2 marks] Argue convincingly either that your heuristic function is admissible or that it is not admissible.
(a) [3 marks] Show how each of the following search methods finds a solution in search space by writing down, in order, the names of the nodes removed from the list of states. Assume that the search halts when a goal state is removed from the list. (i) Uniform-cost search (ii) Greedy best-first search (iii) A∗^ search (b) [1 mark] Name every node in the search space for which h produces an overestimate.
(a) [1 mark] Let C be a constraint on three variables, each of which is associated with a finite domain. Define precisely what it means for C to be (generalized) arc-consistent? (b) [2 marks] The constraint alldifferent applied to a list of variables is satisfied if and only if every variable in the list is assigned a different value. Consider three variables: X with do- main {a, b, c}, Y with domain {b, c} and Z with domain {b, c}. What, if any, values must be pruned from the domains of X, Y and Z in order to make the constraint alldifferent([X, Y, Z]) (generalized) arc-consistent?
(a) [1 mark] Define precisely what it means for a set of constraints to be (generalized) arc- consistent? (b) [2 marks] Consider a finite domain constraint satisfaction problem in which there are four variables—X,Y , W and Z—each of which has the domain { 1 , 2 , 3 }, and the following con- straints: a) X + Y + Z ≤ 6 b) X + W = 3 c) X 6 = Y d) W 6 = Z e) odd(W ) Show the domains of the variables after making this problem node consistent. (c) [3 marks] Now take this node-consistent problem, make it arc-consistent, and show the resulting domains of the variables.
S E N D
M O N E Y
It is assumed that the leftmost digits (S and M) are not 0, otherwise they would not be written.
(a) [4 marks] Formulate this puzzle as a constraint satisfaction. problem. (Hint: give the variables, their domains, and the constraints.) (b) [1 marks] Now change the domains of the variables to make the problem formulation node consistent. (c) [4 marks] Using the node-consistent formulation, change the domains of the variables to make the problem formulation arc consistent. (d) Now consider using forward checking to solve this node and arc consistent problem. i. [2 marks] Choose the variable ordering method that you will use and briefly justify your choice. ii. [2 marks] Choose the value ordering method that you will use and briefly justify your choice. iii. [8 marks] Show the part of the search space that forward checking generates before finding a solution. At each node show the domains of all uninstantiated variables. (You can stop if the search space grows too large to fit on a page.)