Explore modules

Minimal Cyclic String Rotation

Eliminate cyclic starts until only the least rotation remains.

Free theory article

Eliminate cyclic starts until only the least rotation remains.

Concept & interpretation

The minimal cyclic string rotation problem asks to find the lexicographically least rotation of a given word. For example, the word "baca" has rotations "baca", "acab", "caba", and "abac", with "abac" being the lexicographically smallest.

Experiment

In the interactive module (available at https://riano.app/module/minimal-cyclic-string-rotation), you can experiment with the algorithm:

  1. Select different preset words from the "Word preset" dropdown control.
  2. Observe the visualizer as it displays the doubled string and highlights the starting index (denoted as k).
  3. Test words with varying periodicity to see how the algorithm successfully eliminates inferior candidates.
Read the full free theory article