Minimum token swapping calculator with an adjacent swap sequence

Your numbers

Use an integer within the calculator’s stated finite bounds.
One zero-based unordered pair per row; use none for no edges. Loops and repeated pairs are rejected.
Entry i gives the token at vertex i; include each label 0…n−1 exactly once.
Use the same vertex-indexed convention and complete token-label range as the starting placement.

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

QuickCalculators · Full calculator and methodology ↗