visitNeighbors

fun visitNeighbors(vertex: T, update: (VisitableOnceGraph<T>) -> Unit): Set<T>

Visits the unvisited neighbors of the specified vertex, marking each vertex as visited.

Return

the yet unvisited neighboring vertices that were now visited

Parameters

vertex

the vertex whose neighbors are to be visited

update

an action to perform after visiting the neighbors, which is supposed to update the graph state with the visited vertices