Find all nodes with a max path length

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!

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

Great! BFS is working fine! Thanks so much!

1 Like