bfs
Performs a Breadth-First Search, which finds the shortest path from the starting node to all other nodes, assuming the graph is unweighted (all edges have a weight of 1.0) It stores results that can be retrieved with the following functions:
depth()currentVisitedNodes()visitedNodes()finalPath()foundTarget()distanceTo(node: T)maxDistance()furthestNode()
Parameters
A list of starting nodes for the BFS traversal.
An optional target node. If specified, the search will stop once the target is found, flag the target as found so that foundTarget() returns true, and store the path to the target node for use in visualization.
A boolean indicating whether to reset the previous search results. If set to false, previously visited nodes will not be visited again.
Throws
If any of the starting nodes or the target node is not found in the graph.
Overload of fun bfs(startNodes: List