|
|
|
|
|
by drewtato
1316 days ago
|
|
My feedback: Building the maze takes too long. Maybe turn the play button into a fast-forward button when the maze is being built and solved. The dark mode colors are pretty bad. When you click and hold, it should turn every square the same color until you let go again. Right now it toggles every square you pass over, which is confusing. When you move the start and end, it removes walls from the board. Isn't Dijkstra the same as BFS? Fast is not fast. I think an inverted binary tree maze would be nice. |
|
That's because demonstrating Dijkstra on a grid is as useful as demonstrating air resistance in vacuum. In a grid with only horizontal and vertical Dijkstra will produce same order as BFS (but more slowly). You could see some difference if you treated diagonal moves as having sqrt(2) length, but such distance metric is rarely useful. Either you simplify things by having grid and not allowing diagonal movement or treating them like like them length 1, or you allow free 2D movement at arbitrary angles with proper euclidean geometry and distances. Treating diagonal distances as sqrt(2) is worst of both approaches. You loose most of the simplification provided by grid and can't evaluate it in head or on a paper, but it still doesn't produce geometrically accurate results.
One case where Dijkstra on a grid would make sense if you treated entering and exiting certain cells as slower=longer distance. Might be useful if you modeled a game where certain cells contain difficult to traverse terrain like mountains or swamp.