Loading tutorials
deque, dictionaries and sets, and that you know a grid can be treated as a graph whose neighbours come from a function like neighbors. Here you use that graph to find the fewest moves between two vertices.2 min readneighbors function from the previous chapters.3 min readneighbors function from the earlier chapter and that you know how a stack works. Here you will use the same grid graph to answer a different question: how many separate areas does it contain?2 min readneighbors function from earlier chapters. A* is Dijkstra with one change: it uses a guess about the remaining distance to decide which cell to expand next.2 min readneighbors function, breadth-first search (BFS) with a parent dictionary, and Dijkstra's algorithm. Most bugs in graph search come from the model, not the algorithm. The search runs correctly on a wrong graph and returns2 min read