Network.get_any_nodes

Network.get_any_nodes(n, exclude_leaves=False)[source]

Get a list of identifiers of a random set of n nodes.

Parameters
  • n (int) – The number of random nodes.

  • exclude_leaves (bool (False)) – Exclude the leaves (nodes with only one connected edge) from the set. Default is to include the leaves.

Returns

list – The identifiers of the nodes.