Warning

This documents an unmaintained version of NetworkX. Please upgrade to a maintained version and see the current NetworkX documentation.

networkx.algorithms.tournament.random_tournament

random_tournament(n, seed=None)[source]

Returns a random tournament graph on n nodes.

Parameters
  • n (int) – The number of nodes in the returned graph.

  • seed (integer, random_state, or None (default)) – Indicator of random number generation state. See Randomness.

Returns

Whether the given graph is a tournament graph.

Return type

bool

Notes

This algorithm adds, for each pair of distinct nodes, an edge with uniformly random orientation. In other words, binom{n}{2} flips of an unbiased coin decide the orientations of the edges in the graph.