This is a Python programming assignment. You can either do this assignment individually or you can do it in a pair with one other student from the class. If you choose to do it in a pair, please upload one (1) copy of (each part of) the program with both of your names/ids clearly indicated in a comment in the file (but only one ID in the upload page).
This assignment involves starting with existing Python code and extending it. When you are done, please upload your files. You should not change any of the files given here. You should just create new files, one for the Missionary problem and one for the Eight Puzzle problem. Your files should import the appropriate files to allow you to write your code.
Save the file pq.py to your own directory. This contains the definition of a PriorityQueue class. Read through the implementation and see if you understand how it works. You can test it by modifying the test code at the bottom of the file, but you don't really need to completely understand this file.
Save the file informedSearch.py
Create a file that implements the states, operators, and heuristics needed for the eight puzzle problem. Your EightPuzzle class should inherit from the InformedProblemState class. Remember to make sure that your operators make a copy of the current state before moving the tiles.
Test your solution on the following starting states A-H using the same goal each time. State A should take 2 steps, state B should take 6 steps, and state C should take 8 steps. You'll need to determine the length of the other solutions.
1 2 3 1 3 1 3 4 1 3 7 1 2 8 1 2 2 6 3 7 3 4 7 4 5 8 4 8 2 4 8 6 2 4 2 5 8 3 7 4 4 5 6 1 5 6 3 7 6 5 7 6 5 7 5 8 7 6 6 5 4 6 5 3 1 8 7 8 2 8 1 2 goal A B C D E F G H
In order to demonstrate that A* is superior to standard BFS and that the Manhattan distance heuristic is more informed than the tiles out of place heuristic, you will compare the number of nodes that each search expands on the problems given above (A-H). The only change you'll need to make to do a BFS search rather than an A* search is to replace the priority queue with the standard queue that we used in the previous question. One easy way to do this is to always have a heuristic, but in BFS have the heuristic always return 0. Convince yourself that this is equivalent to BFS. Inside a comment in your eight puzzle file, create and fill in the following table:
Node Expansions Problem BFS A*(tiles) A*(dist) A B C D E F G H