Question: Write a program to implement the A * algorithm in python that will solve the 8 - puzzle problem. The program will implement all three
Write a program to implement the A algorithm in python that will solve the puzzle problem. The program will implement all three heuristics h h & h from task The program will also implement an additional heuristic, h maxh h h and utilize it at each node. Your program will have two input options for the initial configuration. Either it can be taken as input from the user, or it can be randomly generated. The program will calculate three metrics to measure the performance of the program: time required, peak memory usage, and the number of nodes generated. Before starting to generate the nodes, the program will print the input configuration and its initial heuristic values. Output metrics will be printed for all heuristics.
Try your program with the four configurations you described in task Create a table that shows the metrics for all four configurations using the heuristics. Which heuristics gives the best performance for all four configurations. Why? Discuss using the concepts of dominance and time complexity.
Try your program with some randomly generated configurations. Does it take a very long time as if it never ends for any of these configurations? Write the configuration. Why do you think solving this one takes a long time? You learnt the theoretical time complexity of the A algorithm in the class. Which component of this complexity do you think is causing the program to take such a long time? Why?
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
