forEachNeighbour

fun forEachNeighbour(t: T, action: (T) -> Unit)

Executes a given function on all the neighbours of a given node.

More performant then retrieving a copied list of nodes and calling forEach on them

Parameters

t

The node whose neighbours we want to process

action

The function to be called on each neighbour

Throws

IllegalStateException

If the specified node is not found in the graph.