aimacode / aima-javascript

Javascript visualization of algorithms from Russell And Norvig's "Artificial Intelligence - A Modern Approach"
http://aimacode.github.io/aima-javascript/
MIT License
541 stars 219 forks source link

Ch 3 - Show concepts for A* search #121

Open redblobgames opened 6 years ago

redblobgames commented 6 years ago

The current diagram shows the mechanics of A* search (g value, h value, f value, etc.) but not some of the concepts in the book:

These might each be a separate diagram.

Dragneel7 commented 6 years ago

@redblobgames I think the example of 8 puzzle game as shown in the book to depict the above can be useful in the visualization. The first 2 points have been properly elaborated using that example but I am not sure about the 3rd one.

redblobgames commented 6 years ago

For choice of heuristics, I think we would want to show a graph of all the states, the larger the better. For example the bidirectional search visualization here is large enough that you'll be able to see the difference a heuristic makes. Here's an example with A* search over a maze — light blue is using one heuristic and dark blue is using a better heuristic:

two heuristics for A* search over a maze

This kind of visualization can also show contours, by plotting the f value at each position and then drawing contour lines on that.

I think 8 puzzle can work but I don't know how large the graph is.

Dragneel7 commented 6 years ago

The 8 puzzle problem graph isn't very large and the difference in heuristics is displayed by showing the no. of states visited and the branching ratio. It was used in the book for the same but I don't know if it will meet our requirements here.