I like most of the pathfinding intro I wrote, but there are some things I want to change. I'm using this card to collect ideas.
Resolve confusing points
- [x] The breadth first search arrows are a little unintuitive. The natural arrow direction is in the expansion not the parent. Maybe start with the expansion arrows, and then explain that we reverse these once we find the end. (This is also how lightning bolts work!)
- [ ] Forest example for costs is a little confusing because it shows tile costs whereas the code uses edge costs. It might be better to go into costs first, maybe with water (water to grass takes time to put on shoes, grass to water takes time to put on swimwear) or uphill/downhill costs. Tile costs can be converted to edge costs but edge costs cannot be converted to tile costs.
- [ ] Might be useful to show numbers in the grid, especially to give people the idea that distances could be useful for other things.
- [ ] In the diagrams showing greedy best-first and A*'s visual heuristic, one commenter mentioned it looks like euclidean, even though it's meant to be manhattan or any other heuristic. A curved line might work better here.
- [ ] The whole explanation is written for locations but A* works on states. The first example could be extending the example to handle facing-direction (e.g. UPS wants to turn right three times instead of left).
- [ ] Explain what happens when no path is found. reconstruct_path might even fail.
- [ ] An alternative to the forest would be to switch to a non-grid map, with the intuition being that distance between nodes varies. That would also reinforce that A* is not limited to grids.
Other changes
- [ ] Add motivation for breadth first search, ideally with a graph that has few nodes, not the big grid. Let's take a step in each direction and see if we found the goal. I'm missing this step, and jump right into the expanding frontier, but the expanding frontier is the consequence of the step-in-each-direction.
- [x] Implementation page should include path reconstruction.
- [ ] Dijkstra, A*, Greedy Best First form a continuum. Add a slider to show the continuous nature.
- [ ] Chart of (step number, number of squares visited) for the three algorithms should show that A* and Greedy Best First are low, and Dijkstra is high.
- [ ] Chart of path length for the three algorithms should show that A* and Dijkstra are low, and Greedy Best First is high. The combination of this and the number of steps should show that A* is a good combination of the two. A scatter plot might work best here.
- [ ] Make Path Reconstruction into its own section. Mention that it doesn't tell you how to move along edges — grid movement, straight lines, curved lines, flocking, etc.
- [ ] Side topic: reuse A* data for finding several paths. Compare to flow fields.
- [ ] For the non-grid map at the top, allow the start and goal to be at any position, not only polygon centers. Insert the synthetic start/goal nodes into the graph. This probably needs to be explained on a separate page (maybe implementation page).
- [ ] Use a much bigger map example, maybe something from http://www.movingai.com/benchmarks/bg512/
- [ ] Mention flow fields somewhere in the dijkstra's section. Maybe a diagram with arrows or distances.