shortest Paths From
Performs Dijkstra's algorithm to find the shortest path from the starting node to all other nodes. It stores results that can be retrieved with the following functions:
currentVisitedNodes()visitedNodes()finalPath()foundTarget()distanceTo(node: T)maxDistance()furthestNode()
Parameters
start Node
The starting node to find the shortest paths from.
target
An optional target node. If specified, the algorithm will store the shortest path to the target node for use in visualization and flag the target as found so that foundTarget() returns true. NOTE: Edge weights must be non-negative.
Throws
If the starting node is not found in the graph, or if the graph is sparse, and the target node is not defined beforehand.