Objets/Documentation
moities18.py
Imposer un sommet · Je contrôle indépendamment tous les coefficients par séparation en moitiés de 17 sommets, et les 34 comptes à taille huit en inversant les moitiés.
Télécharger ↓"""Independent fixed-size counts on the karate graph by subset sums on two halves."""
import csv
import json
from pathlib import Path
def pass_once(reverse=False):
size=17
limit=1<<size
adj=[0]*34
with Path(__file__).with_name("karate.csv").open() as f:
for e in csv.DictReader(f):
u,v=int(e['u']),int(e['v'])
if reverse:
u,v=(u+size)%34,(v+size)%34
adj[u]|=1<<v