Skip to content

Tournaments ​

A name from the enumeratio catalogue with no kernel of its own yet; this page carries its crosswalk only.

Orientations of the complete graph on [n].

Tournaments(...)Orientations of the complete graph on [n].
Typed signatures
TypePackageApplies
(integer<0..>) -> indexed_collection<tournament>combinatoricsalways

Domain: Combinatorics

Definition

Epsil, as the implementation runs it.

count(_n)

2 ^ (Binomial(_n, 2) if 0 <= 2 && 2 <= _n else 0)

unrank(_n, _r)

Map(
     Function(Apply((tu_k: integer) => Apply(
                                              (tu_u: integer) => Apply(
                                                                        (tu_v: integer) => [tu_v, tu_u] if (_r -
                                                                                                            _r %
                                                                                                            2 ^
                                                                                                            ((Binomial(_n, 2) if 0 <= 2 &&
                                                                                                                                 2 <= _n else 0) -
                                                                                                             tk)) /
                                                                                                           2 ^
                                                                                                           ((Binomial(_n, 2) if 0 <= 2 &&
                                                                                                                                2 <= _n else 0) -
                                                                                                            tk) %
                                                                                                           2 ==
                                                                                                           1 else [tu_u, tu_v],
                                                                        tu_k -
                                                                        ((Binomial(_n, 2) if 0 <= 2 &&
                                                                                             2 <= _n else 0) -
                                                                         (Binomial(_n - tu_u +
                                                                                   1, 2) if 0 <= 2 &&
                                                                                           2 <=
                                                                                           _n - tu_u +
                                                                                           1 else 0)) + tu_u,
                                                                      ),
                                              _tables[tu_k],
                                            ), tk), tk),
     Range(1, Binomial(_n, 2) if 0 <= 2 && 2 <= _n else 0, 1),
   )

rank(_n, _x)

Fold(Function(
               ra + (2 ^ ((Binomial(_n, 2) if 0 <= 2 && 2 <= _n else 0) -
                          ((Binomial(_n, 2) if 0 <= 2 && 2 <= _n else 0) -
                           (Binomial(_n - Min(_x[rj][1], _x[rj][2]) + 1, 2) if 0 <=
                                                                               2 &&
                                                                               2 <=
                                                                               _n -
                                                                               Min(_x[rj][1], _x[rj][2]) +
                                                                               1 else 0) + (Max(_x[rj][1], _x[rj][2]) - Min(
                                                                _x[rj][1],
                                                                _x[rj][2],
                                                              )))) if _x[rj][2] < _x[rj][1] else 0),
               ra,
               rj,
             ), 0, Range(1, Length(_x), 1))

valid(_n, _x)

Fold(Function(ok_wb && 1 <= _x[wb][1] && _x[wb][1] <= _n && 1 <= _x[wb][2] &&
                       _x[wb][2] <= _n && _x[wb][1] != _x[wb][2], ok_wb, wb), True, Range(1, Length(_x), 1)) && Fold(
                                                                             Function(ok_wj &&
                                                                                      Fold(
                                                                                            Function(ok_wi &&
                                                                                                     (Binomial(_n, 2) if 0 <= 2 &&
                                                                                                                         2 <= _n else 0) -
                                                                                                     (Binomial(_n -
                                                                                                               Min(_x[wi][1], _x[wi][2]) +
                                                                                                               1, 2) if 0 <= 2 &&
                                                                                                                       2 <=
                                                                                                                       _n -
                                                                                                                       Min(_x[wi][1], _x[wi][2]) +
                                                                                                                       1 else 0) +
                                                                                                     (Max(_x[wi][1], _x[wi][2]) -
                                                                                                      Min(_x[wi][1], _x[wi][2])) !=
                                                                                                     (Binomial(_n, 2) if 0 <= 2 &&
                                                                                                                         2 <= _n else 0) -
                                                                                                     (Binomial(_n -
                                                                                                               Min(_x[wj][1], _x[wj][2]) +
                                                                                                               1, 2) if 0 <= 2 &&
                                                                                                                       2 <=
                                                                                                                       _n -
                                                                                                                       Min(_x[wj][1], _x[wj][2]) +
                                                                                                                       1 else 0) +
                                                                                                     (Max(_x[wj][1], _x[wj][2]) -
                                                                                                      Min(_x[wj][1], _x[wj][2])), ok_wi, wi),
                                                                                            True,
                                                                                            Range(1, wj - 1, 1),
                                                                                          ), ok_wj, wj),
                                                                             True,
                                                                             Range(1, Length(_x), 1),
                                                                           ) if Length(_x) ==
                                                                               (Binomial(_n, 2) if 0 <= 2 &&
                                                                                                   2 <= _n else 0) &&
                                                                               Fold(
                                                                                     Function(ok_wp &&
                                                                                              Length(_x[wp]) == 2, ok_wp, wp),
                                                                                     True,
                                                                                     Range(1, Length(_x), 1),
                                                                                   ) else False

tables(_n)

Fold(
      Function(Join(et, Map(Function(eu, ez), Range(1, _n - eu, 1))), et, eu),
      [],
      Range(1, _n - 1, 1),
    )

Enumeration

Examples

Basic #

2(n2)=642^{\binom{n}{2}} = 64 tournaments on 44 vertices

live ↗
InCount(Tournaments(4))\mathrm{Count}(\mathrm{Tournaments}(4))Out6464

The first tournament on 33 vertices in enumeration order

live ↗
InTournaments(3)[1]\mathrm{Tournaments}(3)[1]OutTournament⁡((3,[[1,2],[1,3],[2,3]]))\operatorname{Tournament}((3,\bigl\lbrack\bigl\lbrack1, 2\bigr\rbrack, \bigl\lbrack1, 3\bigr\rbrack, \bigl\lbrack2, 3\bigr\rbrack\bigr\rbrack))
About
Examples2