Question: Part 1 : ( 4 0 pts ) Write a code that will scan the input file from a given path and solve it using
Part : pts
Write a code that will scan the input file from a given path and solve it using one of the five
algorithms you need to code all five algorithms
Input: Two command line arguments:
File path and
Algorithm to be used BFSIDShhh
Output:
Total nodes generated for A this includes nodes in closed list and fringe
Total time taken.
A valid sequence of actions that will take the given state to the goal state.
a Please note that the meaning of action is important action is associated with the
movement of a tile, not with the movement of the blank space For example, in
Fig above, the action sequence is DRUL.
Also note that not all puzzles are solvable See Appendix A Your code should check
whether the puzzle is solvable or not before attempting to solve it
A note on efficiency:
Some of the algorithms may take a prohibitive amount of time. In such cases terminate
your code after a maximum of minutes.
A algorithm should not run into memory or time issues if implemented properly.
Below are sample outputs for A for two heuristics hManhattan distance and hmisplaced
tiles Your code should work in a similar fashion for other algorithms. Please note:
The exact format of the output is not important; it should capture all the information
though.
Your solution can take different paths and can generate a different number of nodes.
Also, different heuristics could give different optimal paths. However, the optimal path
length should be the same.
In the following, the state in txt is:
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
