News for hackers. Stuff that matters.
Re:Show HN: Pathfinding Visualizer by emilfihlman on Saturday June 25, 2022 @02:31PM (#31877559)
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

Re:Show HN: Pathfinding Visualizer by emilfihlman on Saturday June 25, 2022 @02:36PM (#31877591)
Also seems to produce suboptimal solutions with Dijkstra's algorithm, which shouldn't be the case, right?

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

Re:Show HN: Pathfinding Visualizer by emilfihlman on Saturday June 25, 2022 @02:41PM (#31877634)
And depth first seems to behave, strangely.

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

Re:Show HN: Pathfinding Visualizer by honzaaap on Saturday June 25, 2022 @02:53PM (#31877712)
That's weird, I am unable to recreate these bugs but it could be something with screen size, since I generate tiles according to window size. I'll look into it. Thanks!
Re:Show HN: Pathfinding Visualizer by emilfihlman on Saturday June 25, 2022 @03:17PM (#31877900)
Here's one a friend generated on his machine with Dijkstra.

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

Seems like there's a bug or more.

Re:Show HN: Pathfinding Visualizer by jhomedall on Saturday June 25, 2022 @03:30PM (#31878012)
The top (selected) path is 23 hexes from start to finish, but the winding closer path is 24 hexes.
Re:Show HN: Pathfinding Visualizer by emilfihlman on Saturday June 25, 2022 @03:32PM (#31878027)
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.
Re:Show HN: Pathfinding Visualizer by jhomedall on Saturday June 25, 2022 @09:54PM (#31880365)
Oh you're right. My bad, sorry.