Function NetworKit::GraphTools::randomNeighbor

Function Documentation

node NetworKit::GraphTools::randomNeighbor(const Graph &G, node u)

Returns a random neighbor of node u. Returns none if degree is zero.

Parameters:
  • G – The input graph.

  • u – Node.

Returns:

A random neighbor of u.