From the course: Python Data Structures and Algorithms

Unlock the full course today

Join today to access over 24,400 courses taught by industry experts.

Visualize the A* algorithm

Visualize the A* algorithm

- [Instructor] We're now going to trace the behavior of the A* search algorithm in a similar way to what we did with depth-first search and breadth-first search. So, the setup is basically the same. We're going to use blue cells for items that have been put onto the queue. And we're going to start here at K and we're going to try and get to S. I've changed the letters that we used in the grid in order to avoid confusion using F, G, and H values. If F, G, and H were also grid names, they would get very confusing. Now, in this left-hand text area, we have the algorithm that we're going to use, and we also have the state of the priority queue. And at the minute, I've just given an example entry. So in the priority queue, you can see that it contains two pools, and each two pool contains a cell and an F value for that cell. So that's generic at the moment. It's not set specifically to that K cell, so let's set it to the K cell. So that's going to contain K now, and K's F value is…

Contents