17 comments

[ 3.2 ms ] story [ 49.7 ms ] thread
Interesting to watch but some explanations on the website might be useful.

Choosing "Prim's Algorithm" uses up 20GB in a few seconds before it gets killed.

Makes me wonder why anyone would use anything but A* or greedy algorithm. Fun to play with and watch!
very cool!

tiny nit: solid grey blocks are paths and gradient tiles are walls, but my expectation is reversed

I wish the gradient walls were replaced by solid color tiles instead. Currently the top part of the grid seems lacking in contrast between paths and walls.
This is great! Very juicy visualization. One bit of feedback though: some of the algorithms take a while to complete, and it doesn't seem like I can "stop" or "reset" while it's running?
I think there's a "bug" (a bad heuristic?) in the A* code, since it produces easy suboptimal "solutions".

https://emil.fi/m/astarsuboptimal.png

Also seems to produce suboptimal solutions with Dijkstra's algorithm, which shouldn't be the case, right?

https://emil.fi/m/dijkstrasuboptimal.png

The top (selected) path is 23 hexes from start to finish, but the winding closer path is 24 hexes.
Not the issue here, look at the end of the selected path, where the cursor is. If you go down where the cursor is instead of right the path is 1 step shorter.
Looks cool! Thanks for sharing :)