Atelier des rouesLab FR
Objects/Documentation

transport09.py

I provide the computation for “Reusing a table in an actual wheel derivation”.

Download ↓
"""Check a finite wheel proof with explicit facts and independently cost its DAG."""
from collections import Counter
from fractions import Fraction as F
from itertools import permutations,combinations
from math import gcd
import json


def rank(labels,index):
    ring=sorted(index,key=labels.__getitem__)
    value=0
    for step,x in enumerate(index):
        j=ring.index(x)
        if step:value=value*len(ring)+j
        ring=ring[j+1:]+ring[:j]
    return value

Read in context

Comments

Comments from both language editions appear here.

The discussion is open for reading. I’ll enable submissions once spam protection is configured.