A fast algorithm to generate necklaces with fixed content

  • Authors:
  • Joe Sawada

  • Affiliations:
  • Department of Computer Science, University of Toronto, 10 King's College Road, Toronto, Ont. Canada M5S 1A4

  • Venue:
  • Theoretical Computer Science
  • Year:
  • 2003

Quantified Score

Hi-index 5.23

Visualization

Abstract

We develop a fast algorithm for listing all necklaces with fixed content. By fixed content, we mean the number of occurrences of each alphabet symbol is fixed. Initially, we construct a simple but inefficient algorithm by making some basic modifications to a recursive necklace generation algorithm. We then improve it by using two classic combinatorial optimization techniques. An analysis using straight forward bounding techniques is used to prove that the algorithm runs in constant amortized time.