getPath

fun getPath(target: T): List<T>

Retrieves the path from the starting node to the specified target node based on the most recent search results.

Return

A list of nodes representing the path from the start to the target node.

Parameters

target

The target node for which the path is to be retrieved.

Throws

IllegalStateException

If no search algorithm (DFS, BFS, Dijkstra) has been executed yet.