Closed saulshanabrook closed 8 years ago
the To
method will return math.Inf(1)
as the weight if it is unreachable
It's worth looking at what path.Shortest and path.AllShortest actually hold. They are not holding just the single shortest path (trivially obvious in the latter case), but all paths from the source (or all nodes) to all destinations. Since we are keeping this, it's a necessary consequence that we report when a part is not possible.
How do I know if a path search (like
AStar
) failed? It returns apath.Shortest
struct, but I don't know how to tell if that is a valid path or just a dummy one it returned.