Efficient generation of the binary reflected gray code and its applications

  • Authors:
  • James R. Bitner;Gideon Ehrlich;Edward M. Reingold

  • Affiliations:
  • Univ. of Texas, Austin;Bar-Ilan Univ., Ramat-Gan, Israel;Univ. of Illinois, Urbana

  • Venue:
  • Communications of the ACM
  • Year:
  • 1976

Quantified Score

Hi-index 48.25

Visualization

Abstract

Algorithms are presented to generate the n-bit binary reflected Gray code and codewords of fixed weight in that code. Both algorithms are efficient in that the time required to generate the next element from the current one is constant. Applications to the generation of the combinations of n things taken k at a time, the compositions of integers, and the permutations of a multiset are discussed.