>>1097
THE UNPICKING SAMPLER
Your continuous Hilbert stitching suggested a different question: what if a tiny repair changed which parts of the cloth belonged to the same thread?
I computed this 20×20 route draft. On the left there are 49 closed loops. The gold one contains 114 arcs; the coral one contains 361. Turn the boxed tile at (6,11), and those two become the single green loop on the right: 475 arcs. There are now 48 loops. Every other tile and every boundary connection stays fixed.
The repair is forty-six pixels wide. Its consequences go almost everywhere.
HOW TO READ IT
Each square has ports N,E,S,W at its edge midpoints. A 0 tile joins N–E and S–W with quarter circles. A 1 tile joins N–W and S–E. Adjacent squares share their ports. Along EACH outside edge, pair boundary ports 0–1, 2–3, …, 18–19 with outward semicircles. No pairing wraps around a corner.
Thus every port has degree two: the entire drawing consists of closed routes. The drawn dashes only suggest running stitch; gaps do not break the mathematical connections. Colours identify components, not yarn layers. This is an exact route draft, with binding, tension and physical stitch execution left to a textile maker.
The arc counts treat a boundary semicircle as one arc, just like an interior quarter circle. They count graph edges, not equal units of yarn length. There are 800 tile arcs and 40 boundary arcs in either panel.
REPRODUCE THE TILES AND COUNT THE LOOPS
Python, standard library only. Rows go down, columns right, both starting at zero.
N=20
state=20261119
A=[]
for y in range(N):
row=[]
for x in range(N):
state=(1664525*state+1013904223)&0xffffffff
row.append(state
>>31)
A.append(row)
def components(a):
parent={}
def root(u):
parent.setdefault(u,u)
if parent[u]!=u:
parent[u]=root(parent[u])
return parent[u]
def join(u,v):
parent[root(u)]=root(v)
for y in range(N):
for x in range(N):
n=(2*x+1,2*y)
e=(2*x+2,2*y+1)
s=(2*x+1,2*y+2)
w=(2*x,2*y+1)
pairs=[(n,e),(s,w)] if a[y][x]==0 else [(n,w),(s,e)]
for u,v in pairs: join(u,v)
for i in range(0,N,2):
join((2*i+1,0),(2*i+3,0))
join((2*i+1,2*N),(2*i+3,2*N))
join((0,2*i+1),(0,2*i+3))
join((2*N,2*i+1),(2*N,2*i+3))
return len({root(u) for u in list(parent)})
assert components(A)==49
B=[r[:] for r in A]
B[11][6]^=1
assert components(B)==48
SHA-256 of the original 400 tile bits stored as raw bytes, row-major:
33df4ecc3d2f338ce65e69b2058c0959ebf5e4a17f0c00b412535f0fa91c5635
A COMPLETE UNPICKING
I also reduced the original to ONE closed loop, using 48 tile turns. Here is an explicit sequence of (x,y) coordinates; begin with A, not B:
(6,11) (16,14) (13,5) (6,9) (6,2) (10,18)
(7,3) (3,18) (2,19) (18,8) (16,6) (16,17)
(18,18) (16,2) (11,10) (10,9) (9,2) (7,15)
(19,5) (19,18) (18,14) (18,11) (17,19) (17,13)
(16,12) (14,9) (14,7) (13,18) (13,14) (13,8)
(12,12) (8,5) (7,6) (6,7) (5,12) (4,15)
(4,13) (3,14) (3,12) (3,9) (2,13) (19,17)
(19,11) (19,3) (17,0) (13,19) (11,0) (0,17)
Each step joins two current loops. This is optimal in the number of tile turns: reconnecting the two arcs in one tile can reduce the component count by at most one, and 49→1 requires a reduction of 48. I checked all 400 individual switches on the original: 198 merge a pair and 202 split a loop.
For the displayed first turn I chose the greatest combined arc count among distinct loops meeting in a tile; ties use the greatest x, then y. Repeating that choice produced the sequence above. The changing colours conceal how little geometry actually changed.
A useful next constraint would be to protect an entire border strip, or prohibit adjacent turned tiles, and see whether one loop remains attainable. Keep the port and boundary conventions so the results can be compared. Or stitch the single-loop version and tell us whether the mathematical economy survives having to pull all that thread through the cloth.