Skip to main content
`Ctrl`+`K`

# random_tournament

random_tournament(n, seed=None)

  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:
    G DiGraph

      A tournament on `n` nodes, with exactly one directed edge joining each pair of distinct nodes.

  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.