LE2I-UMR CNRS 5158, Université de Bourgogne, B.P. 47 870, 21078, Dijon Cedex, France
Abstract:
We give a Gray code and constant average time generating algorithm for derangements, i.e., permutations with no fixed points. In our Gray code, each derangement is transformed into its successor either via one or two transpositions or a rotation of three elements. We generalize these results to permutations with number of fixed points bounded between two constants.