Objects/Documentation
sauts18.py
Skip suffix reversals · Reproducible Python implementation.
Download ↓"""Random access and the exact sequential work bypassed in the suffix-flip order."""
import json
from math import factorial
from pathlib import Path
import sys
if not (Path(__file__).parent / "roues.py").exists():
sys.path.insert(0,str(Path(__file__).resolve().parents[2]/"diffusion/I/src"))
from roues import unrank_fast, unrank, flip_length
def run(start, distance, n=9):
if n<2 or not 0<=start<factorial(n) or distance<0:
raise ValueError("invalid rank or distance")
end=start+distance
counts={}