Live data from Hacker News

Pathfinding Visualizer

pathfinding-visualizer-nu.vercel.app

41–50 of 55 posts

Re: Pathfinding Visualizer

#41
post #37

Nice stuff! However, when I try to drag the start/end points around the map it has an 'eraser' effect, deleting walls as it goes. Also you can try using black or darker gray for walls.

Thanks for highlighting that the start and end nodes aren't meant to be moved but I fixed it so that they can't be overridden by a wall. I also made the walls darker for the light theme so hopefully its a bit better !

Re: Pathfinding Visualizer

#43
post #32

Earlier quoted context omitted.

It still doesn't feel like a DFS though. It's not picking the next node in a consistent order. I wouldn't expect gaps between the search. This nerd-sniped me so I dug into the code, it's because it uses the non-recursive approach but it has an extra step of not adding neighbors to the stack if they've already been added previously. So you get this staggered line search because it avoids searching any tiles adjacent t…

"Still technically a DFS" - No! The traditional textbook DFS visiting order has certain important properties. It's not just a "BFS" which uses stack and doesn't produce shortest path. There are more complex graph processing for finding strongly connected components, searching cutpoints and others which rely on proper DFS. Replacing DFS with this thing will result in completely wrong result. It is possible to implemen…

What important property of DFS is missing if you just replace a stack with a queue?

Re: Pathfinding Visualizer

#45
post #32

Earlier quoted context omitted.

"Still technically a DFS" - No! The traditional textbook DFS visiting order has certain important properties. It's not just a "BFS" which uses stack and doesn't produce shortest path. There are more complex graph processing for finding strongly connected components, searching cutpoints and others which rely on proper DFS. Replacing DFS with this thing will result in completely wrong result. It is possible to implemen…

What important property of DFS is missing if you just replace a stack with a queue?

If you form a spanning tree by noting which edges where used during DFS traversal of undirected graph, then all of the edges not used will connect a node with it's ancestor and there will be no cross edges. It doesn't matter if all you care is traversing the graph in any order and maybe checking which parts are connected, but it is important for some of the more complex graph algorithms built on top of DFS.

Re: Pathfinding Visualizer

#46

Nice! Some feature requests: The contrast between the walls and the blue (explored) areas is too low. When I press the round button to retry, the maze disappears. I'd like to see the same maze solved with different algorithm, or even see the same algorithm a few times. So my recommendation is to not errase the map, until the user press the button to make another map.

Ye great idea ! Will definitely look into updating the logic to implement this

Re: Pathfinding Visualizer

#47
post #4

Very nice! My only suggestion would be to include Jump Point Search (JPS) [1], which can be an order of magnitude faster than A* search in grid map settings. JPS has also been extended to 3D grids for quadrotor path planning [2]. [1]: https://ojs.aaai.org/index.php/AAAI/article/view/7994 [2]: https://ieeexplore.ieee.org/abstract/document/7839930

Thanks for the resources !

Re: Pathfinding Visualizer

#48
post #17

Looks nice, but too bad you can't run different pathfinders on the same maze. Running on an empty grid is default but it's less interesting to me.

+1 for this. Would love to compare all the algos on the same maze, so you can visualize the differences in their pathfinding approach.

Yep great idea will try and update the logic to implement this !
Post reply on HN