

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Logic Programming and Artificial Intelligence 25 May 2010 Solutions to Problem Sheet 8
BBBWWWE 0123456 white sum = 3+4+5 = 12
h(start) = 27
This heuristic function, h is not an admissible heuristic since it sometimes overestimates the true cost to a goal. For example, in the search space below h(goal) = 8, while the true cost is defined to be zero. Since h is not a lower bound on the true cost to a goal, this search does not guarantee an optimal solution (though a solution of cost 14 may be the best we can do). Nodes are represented in the form: (g(position), position, h(position)). The numbers to the right of the nodes indicate the order in which they are removed from the list and expanded. The Search Space: (0 BBBWWWE 27)
| | | (1 BBBWEWW 29) (2 BBBEWWW 30) (1 BBBWWEW 28)
(2 BBBWEWW 29) (2 BBBEWWW 30) (3 BBEWWBW 25)
| | | | (4 BBWWEBW 23) (4 BBWEWBW 24) (4 BEBWWBW 24) (4 EBBWWBW 23)
| | (5 BEBWWBW 24) (6 WBBEWBW 20)
| | | | | (8 WBBWWBE 17)6 (7 WBEBWBW 19) (7 WEBBWBW 18) (7 WBBBWEW 22) (7 WBBWEBW 19)
| | (9 WBBWEBW 19) (9 WBBWWEB 16)
| | | (10 WBBWEWB 17) (11 WBEWWBB 13)8 (10 WBBEWWB 18)
| | | | (12 WEBWWBB 12) (12 EBWWWBB 15) (12 WBWWEBB 11)9 (12 WBWEWBB 12)
| | | | (13 WBWEWBB 12) (13 WBWWBEB 12) | (13 WBWWBBE 13) | [14 WEWWBBB 8] Goal!
Note that some of the ties in the search tree shown above could have been broken differently, resulting in a different solution. This heuristic function does lead us much more quickly to the solution than many admissible heuristics might (as some of you found out the hard way).
(b) X : { 1 , 2 , 3 } Y : { 1 , 2 , 3 } Z : { 1 , 2 , 3 } W : { 1 , 3 }
(c) X : { 2 } Y : { 1 } Z : { 2 , 3 } W : { 1 }
c 3 c 2 c 1 c 0 M O + 10c 3 N + 10c 2 E + 10c 1 Y + 10c 0
Thus, in our problem formulation we have the following variables and domains: i. D, E, M, N, O, R, S, Y ā { 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 } ii. c 0 , c 1 , c 2 , c 3 ā { 0 , 1 } and the constraints: (a) {S, E, N, D, M, O, R, Y } are all different. (b) D + E = 10c 0 + Y (c) N + R + c 0 = 10c 1 + E (d) E + O + c 1 = 10c 2 + N (e) S + M + c 2 = 10c 3 + 0 (f) c 3 = M (g) M 6 = 0 (h) S 6 = 0 (i) R = 8