Академический Документы
Профессиональный Документы
Культура Документы
Algorithm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Initial
State
Max.
Queue
length
Path
length
No. of state
expansions
Sequence
of moves
Actual
Running
Time
(sec.)
042158367
042158367
042158367
042158367
876543210
876543210
876543210
876543210
481302675
481302675
481302675
481302675
168342750
168342750
168342750
168342750
123804765
123804765
123804765
123804765
((# 1 2)
(3 4 5)
(6 7 8))
((# 4 2)
(1 5 8)
(3 6 7))
START2:
((8 7 6)
(5 4 3)
N.H.Reyes
((4 8 1)
(3 # 2)
(6 7 5))
START4:
((1 6 8)
(3 4 2)
(7 5 #))
START5:
((1 2 3)
(8 # 4)
(7 6 5))
Marking:
Make sure your program compiles using gcc before handing it in.
Effective comments make it easier to award marks or partial points if the program is not 100%
working properly.
You can work as a group for this assignment. Copied work will be awarded zero marks.
Hints:
Some random combinations of pieces for your initial state are unsolvable.
Refer to the lecture slides for concepts.
You can step through the search by including a getch() function inside your main loop to pause the
program until the user presses any key.
Example Sequence:
N.H.Reyes