Loop-free Gray code algorithms for the set of compositions (Q655198)

From MaRDI portal

!

This is the item page for this Wikibase entity, intended for internal use and editing purposes. Please use the normal view instead:

scientific article; zbMATH DE number 5994036
Language Label Description Also known as
default for all languages
No label defined
    English
    Loop-free Gray code algorithms for the set of compositions
    scientific article; zbMATH DE number 5994036

      Statements

      Loop-free Gray code algorithms for the set of compositions (English)
      0 references
      0 references
      0 references
      2 January 2012
      0 references
      The topic of Gray codes for the set of compositions with non-negative integer parts has been studied by several authors. Klingsberg gave a non-recursive description of a Gray code for this set after the recursive version of Knuth. Recently, Walsh modified Klingsberg's algorithm to find a Gray code which generates the set of all bounded compositions with non-negative integer parts. In this paper, the authors present two loopless Gray code algorithms for the set of compositions with positive integer parts. Each composition is obtained from its predecessor by either incrementing one part by 1 and decrementing another part by 1, or substracting \(i\) from a part and inserting \(i\) to the right of the composition. In an appendix the authors present their algorithms in C++.
      0 references
      composition
      0 references
      Gray code
      0 references
      loopless algorithm
      0 references

      Identifiers