A* Pathfinding Project

Find all nodes with a max path length


#1

Is there any out-of-the-box procedure to find all nodes of a GridGraph which have a certain shortest path length (or less) to a start node?
Such as:
List<GridNode> GetAllReachableNodes(GridNode startNode, int maxShortestPathLength) {…}

Thanks a lot for any support!


#2

Hi

Yes, you can use either the ConstantPath (see https://arongranberg.com/astar/docs/constantpath.html) or the PathUtilties.BFS method (see https://arongranberg.com/astar/docs/pathutilities.html#BFS).
You might also be interested in this section: https://arongranberg.com/astar/docs/wander.html#method3


#3

Great! BFS is working fine! Thanks so much!