Sorting by Nonadjacent Swaps with a Fixed Half-Length Budget
Given a word of 2N positive integers, with repetitions allowed, deciding whether it can be sorted in at most N swaps of nonadjacent positions is NP-complete. A reduction from colored token swapping on a clique first separates all original positions and then adds four-position blocks whose exact cost is three swaps. The number of blocks makes the allowed budget exactly half the output length. A cycle argument proves that neither repeated separator colors nor moves mixing different blocks can reduce the required cost. The output has length at most six times the original word length. The accompanying Lean development proves answer preservation and the explicit length bound; the NP-completeness interpretation uses an external source-hardness theorem and ordinary polynomial-time analysis. Formal scope. The archived Lean source covers the answer-preserving half-budget reduction, certificate legality, padding arguments and explicit output-length bound. The clique token-swapping hardness theorem is external. NP-completeness in a machine model follows from the written polynomial-time and certificate arguments, not a Lean complexity endpoint. No new Lean kernel build is claimed for this release. Rights. CC BY 4.0 applies to the original manuscript and author-owned exposition. Accompanying source and third-party material retain their own terms, as recorded in RIGHTS_AND_NOTICES.md in the source archive.
Authors
- Venkateshwar Reddy Jambula (ORCID: https://orcid.org/0009-0007-6740-2150)
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-12-01
- DOI
- https://doi.org/10.5281/zenodo.24729954
- Primary Topic
- Complexity and Algorithms in Graphs
- Type
- preprint