Вы находитесь на странице: 1из 3

TRNG I HC BCH KHOA TP.

HCM Khoa Khoa hc & K thut My tnh

ARTIFICIAL INTELLIGENCE
Tutorial 2 Questions STATE SPACE SEARCH AND STRATEGIES
Question 1.

Figure 1 A road map of Romania Figure 1 gives a simplified road map of Romania. Find a path from Bucharest to Timisoara using Depth-First-Search and Breadth-First-Search. Assume that when performing the traversal, the cities will be considered in counter-alphabetical order when in the same level. Question 2. For each of the following problems, specify (i) a representation for a state; (ii) the start and goal states and (iii) the operators, each of which is followed by an example. Example problem: The water-jug problem in the lecture notes. State representation: a pair (x,y) where x and y are respectively the amounts of water in 4-litre and 3-litre jugs. 1

TRNG I HC BCH KHOA TP.HCM Khoa Khoa hc & K thut My tnh Start state: (0,0) Goal state: (2,n) 0<=n<=3 Operators: - Fill up the first jug: (2,2) (4,2) - Fill up the second jug: (2,2) (2,3) - Empty the first jug: (2,2) (0,2) - Empty the second jug: (2,2) (2,0) - Fill up the first jug by the water in the second one: (2,3) - Fill up the second jug by the water in the first one: (2,1) - Empty the first jug to the second one: (1,1) (0,2) - Empty the second jug to the first one: (2,1) (3,0)

(4,1) (0,3)

a. The 8-puzzle problem: The 8-puzzle is a small board game for a single player; it consists of 8 square tiles numbered 1 through 8 and one blank space on a 3 x 3 board, as depicted in left board in Figure 2. Moves of the puzzle are made by sliding an adjacent tile into the position occupied by the blank space, which has the effect of exchanging the positions of the tile and blank space. Only tiles that are horizontally or vertically adjacent (not diagonally adjacent) may be moved into the blank space. The object is to reach the configuration in the right board of Figure 2.

Figure 2 An instance of the 8-puzzle problem Give all states that can be generated from the left board in Figure 2. b. The 8-queens problem: The eight-queens puzzle is the problem of putting eight chess queens on an 88 chessboard such that none of them is able to capture any other using the standard chess queen's moves. Figure 3 depicts one solution.

TRNG I HC BCH KHOA TP.HCM Khoa Khoa hc & K thut My tnh

Figure 3 An example solution for the 8-queens problem c. The missionaries and cannibals problem: Three cannibals and three missionaries must cross a river from the bank to the right one. Their boat can only hold two people. If the cannibals outnumber the missionaries, on either side of the river, the missionaries are in trouble. How can all six get across the river? Illustrate the state space (up to 3 levels) in which the duplicated states are eliminated. Question 3. Analyze each of three problems in Question 2 with respect to the seven problem characteristics discussed in Chapter 2. -- End --

Вам также может понравиться