resetSearchResults

Clears the search results stored in the graph.

The search results are replaced with empty results, as if a search had visited no nodes. Until a new search (DFS, BFS, or shortestPathsFrom) is run, the following functions return:

  • depth(): throws IllegalStateException

  • currentVisitedNodes(): an empty list

  • visitedNodes(): an empty list

  • foundTarget(): false

  • distanceTo(node: T): Double.POSITIVE_INFINITY

  • maxDistance(): Double.POSITIVE_INFINITY

  • furthestNode(): the first node of the graph (all distances are infinite)

NOTE: finalPath() is not cleared by this function. It is cleared when the next search is run.