README.md
3.1 kB · markdown
carpet-geodesics
- Shortest paths in
bang dim 2, code 7at odd sideNand levelL: the side-Ntile voids a cell iff both digits are odd, the render is itsL-th Kronecker power in the unit square, and a path runs in the union of the closed filled cells. codeprints the side-Ntile as a base-Ncode, bitN*i + j, forN = 3..11, and asserts495atN = 3.cornerprintsD,N (D - sqrt(2))and2 - D. It computes the corner distanceD(N, L) = d((0,0), (1,1))exactly: Dijkstra with the straight-line heuristic on the visibility graph of void corners, a segment blocked iff it meets the interior of a void (Liang-Barsky on integer coordinates), voids and corners pruned by the ellipse|p| + |p - (1,1)| <= bound, the bound widened until a path is found under it, which makes the pruning exact. It assertssqrt(2) <= D <= 2 - (2 - sqrt(2)) (1 - 1/N)^L,Dnondecreasing inL, andD(3, L) = 2 sqrt(5)/3to1e-12.level1runscorneratL = 1for every oddNfrom 3 to 41 againstsqrt(2) + (2 sqrt(5) - 3 sqrt(2))/N.mapiterates the homogenisation map one-sidedly. The street grid has period 2 and void(1, 2)^2; the edges are the visible segments between translates of the four void corners within a window of 3 periods (244 edges) and of 6 periods (484 edges). For each of 720 directionsp, bisection on the 24 simple node cycles of the four corners finds the cycle of largest ratiop.vover cost, and its displacement over its cost is a point of the true unit ball. The convex hull of those points is inside the true ball, so its gauge is an upper bound onnu_L; that gauge prices the edges of the next level. It prints the upper bounds at four angles and the lower bound they give on the gap to the regular octagon, atL = 1..4, 5, 10, 15, 20for both windows, and the explicit path of displacement(4, 2). A wider window only lowers the bounds, and both windows read the same atL = 1.bridgecompares the exact level-1 distance from(0,0)to(1, (N-1)/(2N))withnu_1of the same vector atN = 11, 21, 31, 41. Herenu_1comes from the support function on 1440 directions, by max-plus Floyd-Warshall on the 3-period window.hullcounts the vertices, edges and faces of the convex hull of the 18 unit vectors along the axes and the face diagonals of the cube, and asserts18, 48, 32.
RUN
uv run python mrlyprod/research/lab/py/carpet-geodesics/geodesics.pyruns every verb in about 7 s:code0 s,corner5 s,level10.3 s,map1.7 s,bridge0.2 s,hull0.1 s.- One verb by name:
uv run python mrlyprod/research/lab/py/carpet-geodesics/geodesics.py corner 5,3 11,2runs the two long cases, 52 s and 31 s. - Needs numpy and scipy; prints only, writes nothing.
WITNESSES
- walks.md, section "Shortest paths: two limits that do not commute": the codes
495and33226431; everyD(N, L)andN (D(N, L) - sqrt(2))printed there; the level-1 formula atN = 3..41to4.4e-16; the upper bounds onnu_Lat22.5degrees, the lower bounds on the gap to the octagon and the explicit path; the bridge readings; the counts18, 48, 32, a check of the proof on the page.