Answered step by step
Verified Expert Solution
Question
1 Approved Answer
find the solution (Step by step) In this task, you will implement a greedy best-first search to solve the Sliding Tiles puzzle. It is played
find the solution (Step by step)
In this task, you will implement a greedy best-first search to solve the Sliding Tiles puzzle. It is played on an n-by-n grid ( n is usually 3 or 4 ), with numbers occupying all but 1 of the n2 cells, and an empty space occupying the last. Starting from a state with the numbers arranged at random, the goal is to rearrange all the tiles in ascending order to reach the goal state. The algorithm you will implement in this assignment is the greedy best-first search. This algorithm is described in Section 3.5 (informed search) of your reference book. Recall from class that search can be conceptualized as expanding a tree. Note, however, that no search algorithm builds this search tree in its totality. On the contrary, these algorithms simply move through the search space, by taking actions that lead them from one state to another. Moreover, while it is convenient to think about searching a tree, a search space is not necessarily a tree. In general, it is a graph, because it is possible to revisit states. In the Sliding Tiles puzzle, for example, you can move a tile into the empty space and back again indefinitely. Hence, to the extent that memory permits, your implementation should keep track of previously visited states, and should not visit them again. To complete your implementation of the informed search algorithms, you should use your knowledge of the Sliding Tile Game to develop your admissible heuristic. Your task: - Implement the greedy best-first search algorithm. The search function takes in a problem and outputs a path through the search tree. This path should be represented as a list of states, where the first element is the start state and the last element is a goal state. - Your search function takes an initial state and the goal state. One example could be: Figure 3.25 A typical instance of the 8-puzzle. The shortest solution is 26 actions longStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started