Skip to content

About

Ring-Cascade-Permutation-Algorithm: A transformative O((n−1)!) framework for high-speed permutation generation and superpermutation construction.

Topics

Resources

Stars

6 stars

Watchers

0 watching

Forks

Repository files navigation

Ring-Cascade Permutation Algorithm

License: MIT Complexity: O((n-1)!) Language: C++ DOI Permutation Generation ORCID GitHub stars

An optimized iterative algorithm for Full Permutation generation that challenges the $O(N!)$ amortized complexity barrier.

Ring-Cascade-Permutation-Algorithm is a transformative generation framework for permutations that shatters the operational bottlenecks of classical combinatorial algorithms. By introducing a triple-segment memory mirroring topology, this framework demonstrates that active logic overhead can be structurally decoupled from the $n!$ sequence scale.

This repository is the official C++ implementation of the paper:
Work in Progress

Why This Matters

As discussed in the computer science community, $O(N!)$ and $O((N-1)!)$ represent fundamentally different complexity classes:

  • Non-Constant Factor: Since they differ by a factor of $N$, which grows toward infinity, they are not in the same order of magnitude.
  • Scalability: This project focuses on optimizing the transition between permutation sets (e.g., scaling from $N=15$ to $N=16$), significantly enhancing the algorithm's capability to handle larger datasets.
  • Practical Impact: By narrowing the computational gap, we make generating permutations for larger $N$ more viable in real-world applications.

🎮 Live Demo

You can try the interactive Ring-Cascade permutation visualization directly in your browser:

👉 View Ring-Cascade and Triple Process


🚀 Key Highlights

  • Complexity Breakthrough: Reduces the frequency of state-transition decisions to an amortized $O((n-1)!)$ level, while the majority of permutations are generated via deterministic topological shifts.
  • Extreme Performance: Unlike traditional algorithms, the Ring-Cascade Algorithm's throughput scales positively with order N. It reaches 4.856 Giga/s at N=14, demonstrating the power of its O((n−1)!) amortized logic. This performance translates to a CPP of 0.41, setting a new benchmark for combinatorial generation.
  • Optimal Superpermutation: Provides a universal constructive proof for the Superpermutation problem, yielding sequences match the classical length formula $L = \sum_{i=1}^{n} i!$.
  • Stateless Sharding: Features a mathematically consistent indexing theorem (Theorem 1) that enables efficient Rank and Unrank operations for massive parallelization.

📊 Benchmarks

🚀 Performance: Ring Cascade Permutation Algorithm (RCPA)

Heap's Algorithm vs RCPA Benchmark

🔹 AMD Architecture Benchmark (Comparison)

Last Run: 2026-07-03 05:34:09 UTC / 2026-07-03 13:34:09 (UTC+8) Processor: AMD EPYC 7763 64-Core Processor

N Heap's Algorithm (s) RCPA (s) Speedup (vs Heap)
10 0.011264 s 0.000887 s 12.69x
11 0.119455 s 0.008244 s 14.48x
12 1.448630 s 0.080818 s 17.92x
13 18.308625 s 0.894950 s 20.45x

🔹 Intel Architecture Benchmark (Comparison)

Position Pure Algorithm vs RCPA Benchmark

🔹 AMD Architecture Benchmark (Comparison)

PP vs RCPA Performance Comparison

Last Run: 2026-05-11 10:48:39 UTC / 2026-05-11 18:48:39 (UTC+8) Processor: AMD EPYC 9V74 80-Core Processor

N PP Algorithm (s) RCPA (s) Speedup (RCPA vs PP)
10 0.007551 s 0.000984 s 7.67x
11 0.077807 s 0.008898 s 8.74x
12 0.892017 s 0.087764 s 10.16x
13 11.158704 s 0.980750 s 11.37x

🔹 Intel Architecture Benchmark (Comparison)

PP vs RCPA Performance Comparison

Last Run: 2026-02-26 13:29:31 UTC / 2026-02-26 21:29:31 (UTC+8) Processor: Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz

N PP Algorithm (s) RCPA (s) Speedup (RCPA vs PP)
10 0.005372 s 0.000890 s 6.03x
11 0.057325 s 0.008918 s 6.42x
12 0.645912 s 0.083839 s 7.70x
13 8.716429 s 0.939324 s 9.27x

🚀 Superpermutation Verification

Order (N) Theoretical Lower Bound ($\sum i!$) Ring-Cascade Algorithm Length Status
10 4,037,913 4,037,913 ✅ MATCH
12 523,001,313 523,001,313 ✅ MATCH
15 1,401,602,636,313 1,401,602,636,313 ✅ MATCH

Citation

If you use this algorithm in your research or project, please cite it as:

Yusheng-Hu. (2026). Ring-Cascade-Permutation-Algorithm: High-performance Full Permutation Generation [Data set]. Zenodo. https://doi.org/10.5281/zenodo.18194997

DOI

Hu, Yusheng, Ring-Cascade: A Sub-constant Amortized Time Algorithm for High-Speed Permutation Generation (April 09, 2026). Available at SSRN: https://ssrn.com/abstract=6553539

About

Ring-Cascade-Permutation-Algorithm: A transformative O((n−1)!) framework for high-speed permutation generation and superpermutation construction.

Topics

Resources

Stars

6 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages