visitNeighbors

fun visitNeighbors(vertex: T, onVisit: (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

onVisit

callback invoked with the updated graph after visiting the neighbors