Objects/Documentation
rotations30.py
When rotating a schedule changes its count · rotations30.py
Download ↓"""Rotate a six-residue footprint. Compare order alone with the two-slot dwell rule."""
from itertools import combinations,product
from functools import lru_cache
from strate29 import accepts
from longueurs28 import transfer
import json
@lru_cache(None)
def local(n,d,visits,k):
shifts={(d+j+5)%6:j for j in (-1,0,1)}
prescribed=sorted((t,shifts[t%6]) for t in visits)
changes=sum(a[1]!=b[1] for a,b in zip(prescribed,prescribed[1:]))
return changes<=k,accepts(prescribed,6*n,k)
def study():
base=(2,0,2)*2;cache={};out=[]