manishkumarkeshri / 8puzzle Goto Github PK
View Code? Open in Web Editor NEWThere exists a puzzle state which comprises of 8 numbers and an empty slot E randomly arranged. The goal state is to reach the puzzle state that will have the numbers arranged in order with the 0 coming after all other numbers have been arranged. For example, consider the initial puzzle state as (E 1 3 4 2 5 7 8 6), then the final or the goal state will be (1 2 3 4 5 6 7 8 E). We should be using A* algorithm to solve the 8-puzzle problem with the heuristic being the total number of misplaced tiles in the given puzzle state. The empty slot can move only once to generate the new puzzle state.