Navigation

Order \(\{0, 1, ..., n-1\}\) so that base points come first and in order.

Parameters :

``base`` - the base :

``degree`` - the degree of the associated permutation group :

Returns :

A list ``base_ordering`` such that ``base_ordering[point]`` is the :

number of ``point`` in the ordering. :

Examples :

======== :

>>> from sympy.combinatorics.named_groups import SymmetricGroup :

>>> from sympy.combinatorics.util import _base_ordering :

>>> S = SymmetricGroup(4) :

>>> S.schreier_sims() :

>>> _base_ordering(S.base, S.degree) :

[0, 1, 2, 3] :

Notes

This is used in backtrack searches, when we define a relation \(<<\) on
the underlying set for a permutation group of degree \(n\),
\(\{0, 1, ..., n-1\}\), so that if \((b_1, b_2, ..., b_k)\) is a base we
have \(b_i << b_j\) whenever \(i<j\) and \(b_i << a\) for all
\(i\in\{1,2, ..., k\}\) and \(a\) is not in the base. The idea is developed
and applied to backtracking algorithms in [1], pp.108-132. The points
that are not in the base are taken in increasing order.

The base and strong generating set must be provided; if any of the
transversals, basic orbits or distributed strong generators are not
provided, they will be calculated from the base and strong generating set.

The algorithm is described in [1],pp.89-90. The reason for returning
both the current state of the element being decomposed and the level
at which the sifting ends is that they provide important information for
the randomized version of the Schreier-Sims algorithm.