neighbours

fun neighbours(t: T): List<T>

Retrieves a list the neighboring nodes of the specified node.

WARNING: should be replaced by the forEachNeighbour function if performance is critical, to avoid copying overhead.

Return

A list of neighboring nodes connected to the specified node.

Parameters

t

The node whose neighbors are to be retrieved.

Throws

IllegalStateException

If the specified node is not found in the graph.