In this project I had implemented a 'c' code to solve 15 slide puzzle using A* algorithm.
Here the heuristic H(n)=Sum of “number of moves each tile is away from its goal position”.Compile and run the 'AI_optimalH2.c' file and give the 4x4 input matrix and the output will be:
1)matrix is solvable matrix or not.
2)all the matrices in the path of reaching the goal matrix
3)number of nodes generated(time)
4)number of nodes present in the memory(space)
Here are some of the test cases
TESTCASE-1
1 2 4 7
5 6 3 0
9 10 11 8
13 14 15 12
TESTCASE-2
2 4 3 7
1 6 10 8
5 9 0 11
13 14 15 12
TESTCASE-3
3 7 0 4
2 1 8 11
5 6 10 15
9 13 14 12
TESTCASE-4
2 6 3 4
1 10 7 8
5 11 0 12
9 13 14 15
TESTCASE-5
2 3 8 4
1 5 14 12
11 6 7 15
9 13 10 0
TESTCASE-6
1 2 4 8
7 3 11 10
0 9 14 12
5 6 13 15
VIRUS-ATTACK/Solving-15-SLIDE-PUZZLE-using-A-star-algorithm-
In this project I had implemented a 'c' code to solve 15 slide puzzle using A* algorithm
C