Problem 3:
Consider an 8x8 chessboard, where the rows and columns are numbered from 0 to 7. The problem is to find a route across the diagonal of the board. The movement can be done similar to the king, i.e. one tile at a time, in any direction. The start position is (0,0) while the goal tile is (7,7). There are certain barriers which occupy certain tiles on the board. Moving into any empty tile costs 1, while moving into a barrier costs 100. The barriers are at the following positions, marked as B:
B
B
B
B
B
B B
B
B
B
B
Implement the A* search algorithm to find the route with the lowest cost. Multiple optimal solutions are possible. Store the optimal route and cost of the route in a text file.
Note: Using a zero heuristic is considered as Dijkstra's algorithm, so it is not allowed.