Uploaded by Charbel Allawi

Chapter2-exercices-TM366

advertisement
Question 1
Given the following search graph, how many states will be visited until reaching the
goal state using breadth-first search?. Trace the states inside the search agenda until
reaching the goal state.
The goals state is 18
1,
2,3,4,
3,4,5,6,7,
4,5,6,7,8,
5,6,7,8,9,10,11,12,
6,7,8,9,10,11,12,13,14,
7,8,9,10,11,12,13,14,15,16,17,18,
8,9,10,11,12,13,14,15,16,17,18,19,
9,10,11,12,13,14,15,16,17,18,19,
10,11,12,13,14,15,16,17,18,19,20,
11,12,13,14,15,16,17,18,19,20,21,22,23,
12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,
13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,
14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,
15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,
16,17,18,19,20,21,22,23,24,25,26,27,28,29,
17,18,19,20,21,22,23,24,25,26,27,28,29,
18,19,20,21,22,23,24,25,26,27,28,29,
The number of visited states is 18
Question 2
Given the following search graph, how many states will be visited until reaching the
goal state using depth-first search?. Trace the states inside the search agenda until
reaching the goal state.
The Goal state is 9
1,
2,3,4,5,
6,3,4,5,
12,3,4,5,
3,4,5,
4,5,
7,8,9,5,
8,9,5,
13,9,5,
9,5,
The number of visited states is 10
Question 3
Given the following search graph, write the sequence of node numbers in the search
agenda across the search life-time and using depth-first search.
1,
2,3,
4,5,6,3,
10,5,6,3,
5,6,3,
11,12,13,14,6,3,
12,13,14,6,3,
13,14,6,3,
14,6,3,
6,3,
15,16,17,3,
16,17,3,
17,3,
3,
7,8,9,
18,19,20,21,8,9,
19,20,21,8,9,
20,21,8,9,
21,8,9,
8,9,
22,23,24,25,9,
23,24,25,9,
24,25,9,
25,9,
9,
26,27,
27,
The number of visited states is 28
Question 4
Given the following search graph, write the sequence of node numbers in the search
agenda across the search life-time using breadth-first search.
1,
2,3,
3,4,5,
4,5,6,7,8,
5,6,7,8,9,10,
6,7,8,9,10,11,
7,8,9,10,11,12,13,14,
8,9,10,11,12,13,14,15,
9,10,11,12,13,14,15,16,17,
10,11,12,13,14,15,16,17,
11,12,13,14,15,16,17,
12,13,14,15,16,17,
13,14,15,16,17,
14,15,16,17,
15,16,17,
16,17,
17,
The number of visited states is 18
Question 5
Given the following search graph, how many states will be visited until reaching the
goal state using best-first search?. Trace the states inside the search agenda until
reaching the goal state.
Assumume the following heuristic values:
The Goal state is 20
Node ID Node Heuristic value
1
7
2
6
3
6
4
6
5
16
6
20
7
6
8
2
9
15
10
17
11
6
12
20
13
1
14
13
15
11
16
17
17
9
18
3
19
2
20
19
21
2
22
17
1,
2,3,4,
7,3,4,5,6,
18,3,4,17,5,6,
3,4,17,5,6,
8,4,17,9,5,10,6,
19,4,17,9,5,10,6,
4,17,9,5,10,6,
17,9,5,10,6,
9,5,10,6,
21,5,10,20,6,
5,10,20,6,
13,11,10,20,12,6,
11,10,20,12,6,
10,20,12,6,
22,20,12,6,
20,12,6,
The number of visited states is 17
Question 6
Given the following search graph, write the sequence of node numbers in the search
agenda across the search life-time and using Best-first search.
Node ID Node Heuristic value
1
13
2
2
3
20
4
3
5
0
6
14
7
20
8
4
9
4
10
15
11
3
12
20
13
18
14
15
15
2
16
7
17
9
18
5
19
7
20
9
21
14
22
16
23
4
24
12
25
19
26
1
27
7
28
12
29
18
30
18
31
4
32
12
1,
5,2,4,3,
2,4,13,3,
4,8,6,13,7,3,
11,8,6,10,13,12,7,3,
31,8,6,10,29,30,13,12,7,3,
8,6,10,29,30,13,12,7,3,
20,21,6,10,22,29,30,13,12,7,3,
21,6,10,22,29,30,13,12,7,3,
6,10,22,29,30,13,12,7,3,
15,14,10,22,29,30,13,12,7,3,
14,10,22,29,30,13,12,7,3,
10,22,29,30,13,12,7,3,
26,27,28,22,29,30,13,12,7,3,
27,28,22,29,30,13,12,7,3,
28,22,29,30,13,12,7,3,
22,29,30,13,12,7,3,
29,30,13,12,7,3,
30,13,12,7,3,
13,12,7,3,
12,7,3,
32,7,3,
7,3,
18,16,19,17,3,
16,19,17,3,
19,17,3,
17,3,
3,
9,
23,24,25,
24,25,
25,
The number of visited states is 33
Question 7
Given the following search graph, how many states will be visited until reaching the
goal state using best-first search? Trace the states inside the search agenda until
reaching the goal state.
Assume the following heuristic values:
The Goal state is 43
Node ID Node Heuristic value
1
6
2
16
3
8
4
2
5
10
6
9
7
9
8
15
9
15
10
9
11
1
12
18
13
14
14
17
15
16
16
10
17
13
18
1
19
4
20
17
21
6
22
18
23
3
24
1
25
15
26
6
27
6
28
13
29
10
30
8
31
6
32
20
33
17
34
15
35
11
36
12
37
6
38
7
39
4
40
6
41
13
42
7
43
1
44
11
45
10
46
1
47
20
48
0
49
19
50
6
51
10
1,
4,3,5,2,
3,16,5,13,15,2,14,
11,10,16,5,13,9,15,2,14,12,
10,16,5,13,34,9,15,2,14,12,
16,5,13,34,9,15,2,33,14,12,
45,5,44,13,34,9,15,2,33,14,12,
5,44,13,34,9,15,2,33,14,12,
18,19,44,17,13,34,9,15,2,20,33,14,12,
48,46,19,44,17,13,34,9,15,2,20,33,14,12,49,47,
46,19,44,17,13,34,9,15,2,20,33,14,12,49,47,
19,44,17,13,34,9,15,2,20,33,14,12,49,47,
50,51,44,17,13,34,9,15,2,20,33,14,12,49,47,
51,44,17,13,34,9,15,2,20,33,14,12,49,47,
44,17,13,34,9,15,2,20,33,14,12,49,47,
17,13,34,9,15,2,20,33,14,12,49,47,
13,34,9,15,2,20,33,14,12,49,47,
39,40,41,34,9,15,2,20,33,14,12,49,47,
40,41,34,9,15,2,20,33,14,12,49,47,
41,34,9,15,2,20,33,14,12,49,47,
34,9,15,2,20,33,14,12,49,47,
9,15,2,20,33,14,12,49,47,
31,15,2,20,33,14,12,49,32,47,
15,2,20,33,14,12,49,32,47,
43,42,2,20,33,14,12,49,32,47,
The number of visited states is 25
Question 8
Given the following search graph, how many states will be visited until reaching the
goal state using depth-first search? Trace the states inside the search agenda until
reaching the goal state.
The Goal state is 17
1,
2,3,4,5,
6,7,8,3,4,5,
13,14,7,8,3,4,5,
14,7,8,3,4,5,
7,8,3,4,5,
15,8,3,4,5,
8,3,4,5,
16,17,18,19,3,4,5,
17,18,19,3,4,5,
The number of visited states is 10
Question 9
Given the following search graph, how many states will be visited until reaching the
goal state using breadth-first search?. Trace the states inside the search agenda until
reaching the goal state.
The goals state is 10
1,
2,3,4,
3,4,5,
4,5,6,7,
5,6,7,8,9,10,
6,7,8,9,10,11,12,
7,8,9,10,11,12,13,14,
8,9,10,11,12,13,14,15,
9,10,11,12,13,14,15,
10,11,12,13,14,15,16,17,
The number of visited states is 10
Question 10
Given the following search graph, how many states will be visited until reaching the
goal state using breadth-first search?. Trace the states inside the search agenda until
reaching the goal state.
The goals state is 21
1,
2,3,
3,4,5,6,
4,5,6,7,8,9,
5,6,7,8,9,10,
6,7,8,9,10,11,12,13,
7,8,9,10,11,12,13,14,15,16,17,
8,9,10,11,12,13,14,15,16,17,18,19,
9,10,11,12,13,14,15,16,17,18,19,20,21,
10,11,12,13,14,15,16,17,18,19,20,21,22,
11,12,13,14,15,16,17,18,19,20,21,22,
12,13,14,15,16,17,18,19,20,21,22,
13,14,15,16,17,18,19,20,21,22,
14,15,16,17,18,19,20,21,22,
15,16,17,18,19,20,21,22,
16,17,18,19,20,21,22,
17,18,19,20,21,22,
18,19,20,21,22,
19,20,21,22,
20,21,22,
21,22,
The number of visited states is 21
Related documents
Download