Heilbronn's triangle problem
Heilbronn's triangle problem in the unit square: configurations of 11 to 16 points, every one checked in exact arithmetic

n = 15 dg: 0.0199320451 (94.0%) verified, 1.1% short; hop + 1500-start batch running (issue 7)
Browse filesChecks
verify Program
Details
+5 −2 routes/mcmga-c2-n14-dg-n15/README.md View file
| @@ -14,8 +14,11 @@ Issue #7 is shared: @zcode-kepler's route `zcode-kepler/within-5-percent` runs a | ||
| 14 | 14 | |
| 15 | 15 | c2 is impossible at odd n (its fixed point is the centre, collinear with any half-turn pair). `dsearch.py` (pushed here) mirrors pairs across the diagonal dg, (x, y) → (y, x), plus one point (t, t) on x = y — a fixed point there forces no collinearity (only t = (x+y)/2 of a pair would, and zero area repels the search). K = 3 pinned pairs on x = 0 / x = 1. |
| 16 | 16 | |
| 17 | -Probe (`dsearch.py 15 dg 3 100 700000 2 30`, 4 min 46 s): best **0.0183774838** (seed 700080) = 86.6 % of 0.0212105410, **below** the 95 % bar 0.0201500140. Top-5 cluster tightly: 0.01838, 0.01767, 0.01760, 0.01758, 0.01755 — no outlier basin like n = 14's. Negative result so far; batch 2 (600 starts, seed 800000) and K = 2 / K = 4 probes (seeds 900000 / 910000) are running — if none clears the bar, the honest best stands here with the commands to continue. | |
| 17 | +- Probe (`dsearch.py 15 dg 3 100 700000 2 30`, 4 min 46 s): best 0.0183774838 (seed 700080) = 86.6 %, top-5 clustered 0.0175–0.0184. | |
| 18 | +- Batch 2 (`dsearch.py 15 dg 3 600 800000 6 30`, ~9.5 min): best **0.0199320451** (seed 800531) = **94.0 %**, verified `n = 15: 0.0199320451` (contacts 3, 10, 14). Top-5: 0.01993, 0.01961, 0.01948, 0.01912, 0.01909 — better basins keep appearing with more starts; 1.1 % short of the bar. | |
| 19 | +- K sweep: K = 2 (100 starts, seed 900000) best 0.0181879; K = 4 (100 starts, seed 910000) best 0.0185250 — both clearly below K = 3. K = 3 is the right structure here, as for n = 16. | |
| 20 | +- Running: `hop.py n15.txt 400 300700 6` polish from the 0.01993 point, then batch 3 (`dsearch.py 15 dg 3 1500 1000000 6 30`, ~23 min). | |
| 18 | 21 | |
| 19 | 22 | ## Next |
| 20 | 23 | |
| 21 | -n = 14 is done and checked (99.67 %). For n = 15, judge the running batches (dg K = 3 × 600, K = 2 × 100, K = 4 × 100) against 0.0201500140; if still short, worth trying: hop.py from the best dg point, mixed pinning, or many more starts — every number above has its exact command and seed to resume from. | |
| 24 | +n = 14 is done and checked (99.67 %). n = 15 needs +1.1 % over 0.0199320451 to clear 0.0201500140; hop polish and batch 3 are running with exact commands and seeds above to resume from. Every pushed n15.txt / n14.txt is judged by the check on push. | |
+50 −0 routes/mcmga-c2-n14-dg-n15/hop.py added View file
| @@ -0,0 +1,50 @@ | ||
| 1 | +#!/usr/bin/env python3 | |
| 2 | +"""Basin hopping without symmetry from a given configuration. | |
| 3 | + | |
| 4 | +Usage: hop.py FILE ROUNDS SEED WORKERS > out.txt | |
| 5 | + | |
| 6 | +Each worker (seed SEED+k) runs ROUNDS hops from FILE: move 1-3 points by a normal step of random size | |
| 7 | +(0.01-0.1), run search.py's SLP on all 2N coordinates, keep the move if the smallest triangle grew. | |
| 8 | +Prints the best configuration with 17 significant digits. Needs numpy, scipy and search.py beside it. | |
| 9 | +""" | |
| 10 | +import sys | |
| 11 | +from multiprocessing import Pool | |
| 12 | + | |
| 13 | +import numpy as np | |
| 14 | + | |
| 15 | +from search import Problem | |
| 16 | + | |
| 17 | + | |
| 18 | +def read(path): | |
| 19 | + pts = [tuple(map(float, l.split())) for l in open(path) if l.strip() and not l.startswith("#")] | |
| 20 | + return np.array(pts) | |
| 21 | + | |
| 22 | + | |
| 23 | +def run(args): | |
| 24 | + path, rounds, seed = args | |
| 25 | + rng = np.random.default_rng(seed) | |
| 26 | + p = read(path) | |
| 27 | + P = Problem(len(p), "none") | |
| 28 | + z, v = P.slp(p.reshape(-1).copy(), iters=200, radius=1e-3) | |
| 29 | + for _ in range(rounds): | |
| 30 | + q = z.copy() | |
| 31 | + s = 10 ** rng.uniform(-2, -1) | |
| 32 | + for i in rng.choice(P.n, rng.integers(1, 4), replace=False): | |
| 33 | + q[2 * i:2 * i + 2] = np.clip(q[2 * i:2 * i + 2] + rng.normal(0, s, 2), 0, 1) | |
| 34 | + q, w = P.slp(q, iters=150) | |
| 35 | + if w > v: | |
| 36 | + z, v = q, w | |
| 37 | + return v, seed, P.full(z) | |
| 38 | + | |
| 39 | + | |
| 40 | +if __name__ == "__main__": | |
| 41 | + path, rounds, seed, workers = sys.argv[1], int(sys.argv[2]), int(sys.argv[3]), int(sys.argv[4]) | |
| 42 | + with Pool(workers) as pool: | |
| 43 | + runs = pool.map(run, [(path, rounds, seed + k) for k in range(workers)]) | |
| 44 | + runs.sort(key=lambda r: -r[0]) | |
| 45 | + for v, s, _ in runs: | |
| 46 | + print(f"# hop seed {s}: {v:.10f}", file=sys.stderr) | |
| 47 | + v, s, p = runs[0] | |
| 48 | + print(f"# n = {len(p)}: smallest triangle about {v:.10f}, by hop.py {path} {rounds} {seed} {workers}; best seed {s}") | |
| 49 | + for x, y in p: | |
| 50 | + print(f"{float(x)!r} {float(y)!r}") | |
+5 −0 routes/mcmga-c2-n14-dg-n15/n15-k2.stderr added View file
| @@ -0,0 +1,5 @@ | ||
| 1 | +# dg K=2 start seed 900048: 0.0187697808 | |
| 2 | +# dg K=2 start seed 900010: 0.0187526338 | |
| 3 | +# dg K=2 start seed 900037: 0.0181879054 | |
| 4 | +# dg K=2 start seed 900033: 0.0180727757 | |
| 5 | +# dg K=2 start seed 900075: 0.0178878381 | |
+16 −0 routes/mcmga-c2-n14-dg-n15/n15-k2.txt added View file
| @@ -0,0 +1,16 @@ | ||
| 1 | +# n = 15: smallest triangle about 0.0187697808, best of 100 starts under diagonal symmetry dg with 2 pinned pairs, found by dsearch.py 15 dg 2 100 900000 6 30; best seed 900048 | |
| 2 | +0.2858569737705459 0.5300942319673465 | |
| 3 | +0.5300942319673465 0.2858569737705459 | |
| 4 | +0.0 0.37008476093439713 | |
| 5 | +0.37008476093439713 0.0 | |
| 6 | +0.7564363492048891 0.924825614648096 | |
| 7 | +0.924825614648096 0.7564363492048891 | |
| 8 | +0.0 0.6495532157531462 | |
| 9 | +0.6495532157531462 0.0 | |
| 10 | +0.4705793754343426 0.7648161436151462 | |
| 11 | +0.7648161436151462 0.4705793754343426 | |
| 12 | +0.3629783558078436 1.0 | |
| 13 | +1.0 0.3629783558078436 | |
| 14 | +0.9186588821443212 0.13432486177183706 | |
| 15 | +0.13432486177183706 0.9186588821443212 | |
| 16 | +0.13432486177183708 0.13432486177183708 | |
+5 −0 routes/mcmga-c2-n14-dg-n15/n15-k4.stderr added View file
| @@ -0,0 +1,5 @@ | ||
| 1 | +# dg K=4 start seed 910031: 0.0188193202 | |
| 2 | +# dg K=4 start seed 910030: 0.0186119140 | |
| 3 | +# dg K=4 start seed 910004: 0.0185250487 | |
| 4 | +# dg K=4 start seed 910041: 0.0183530217 | |
| 5 | +# dg K=4 start seed 910069: 0.0180225910 | |
+16 −0 routes/mcmga-c2-n14-dg-n15/n15-k4.txt added View file
| @@ -0,0 +1,16 @@ | ||
| 1 | +# n = 15: smallest triangle about 0.0188193202, best of 100 starts under diagonal symmetry dg with 4 pinned pairs, found by dsearch.py 15 dg 4 100 910000 6 30; best seed 910031 | |
| 2 | +0.0 0.7073007923740169 | |
| 3 | +0.7073007923740169 0.0 | |
| 4 | +0.33052005759646647 0.5490311857681293 | |
| 5 | +0.5490311857681293 0.33052005759646647 | |
| 6 | +1.0 0.34232758285359083 | |
| 7 | +0.34232758285359083 1.0 | |
| 8 | +1.0 0.9049786359787887 | |
| 9 | +0.9049786359787887 1.0 | |
| 10 | +0.0 0.42952180796112793 | |
| 11 | +0.42952180796112793 0.0 | |
| 12 | +0.13549851675634067 0.9331048255131338 | |
| 13 | +0.9331048255131338 0.13549851675634067 | |
| 14 | +0.8694828436044475 0.6300322210384285 | |
| 15 | +0.6300322210384285 0.8694828436044475 | |
| 16 | +0.13549851675634064 0.13549851675634064 | |
+5 −0 routes/mcmga-c2-n14-dg-n15/n15-run2.stderr View file
| @@ -0,0 +1,5 @@ | ||
| 1 | +# dg K=3 start seed 800531: 0.0199320452 | |
| 2 | +# dg K=3 start seed 800508: 0.0196073959 | |
| 3 | +# dg K=3 start seed 800441: 0.0194830306 | |
| 4 | +# dg K=3 start seed 800402: 0.0191194882 | |
| 5 | +# dg K=3 start seed 800114: 0.0190921939 | |
+16 −0 routes/mcmga-c2-n14-dg-n15/n15-run2.txt View file
| @@ -0,0 +1,16 @@ | ||
| 1 | +# n = 15: smallest triangle about 0.0199320452, best of 600 starts under diagonal symmetry dg with 3 pinned pairs, found by dsearch.py 15 dg 3 600 800000 6 30; best seed 800531 | |
| 2 | +0.15148362192212433 0.38509690521127843 | |
| 3 | +0.38509690521127843 0.15148362192212433 | |
| 4 | +0.0679739933571319 0.9353236181250422 | |
| 5 | +0.9353236181250422 0.0679739933571319 | |
| 6 | +0.8669011402473825 0.6072273535247045 | |
| 7 | +0.6072273535247045 0.8669011402473825 | |
| 8 | +0.0 0.7239415987668522 | |
| 9 | +0.7239415987668522 0.0 | |
| 10 | +1.0 0.8937222427292131 | |
| 11 | +0.8937222427292131 1.0 | |
| 12 | +0.0 0.1374806833679007 | |
| 13 | +0.1374806833679007 0.0 | |
| 14 | +1.0 0.27735983636243333 | |
| 15 | +0.27735983636243333 1.0 | |
| 16 | +0.4004644628698116 0.4004644628698116 | |
+16 −16 routes/mcmga-c2-n14-dg-n15/n15.txt View file
| @@ -1,16 +1,16 @@ | ||
| 1 | -# n = 15: smallest triangle about 0.0183774838, best of 100 starts under diagonal symmetry dg with 3 pinned pairs, found by dsearch.py 15 dg 3 100 700000 2 30; best seed 700080 | |
| 2 | -0.046985637707966654 0.9079512812395143 | |
| 3 | -0.9079512812395143 0.046985637707966654 | |
| 4 | -1.0 0.16866753011647756 | |
| 5 | -0.16866753011647756 1.0 | |
| 6 | -0.8768853349325239 0.4052177226081481 | |
| 7 | -0.4052177226081481 0.8768853349325239 | |
| 8 | -0.0 0.5062505629107465 | |
| 9 | -0.5062505629107465 0.0 | |
| 10 | -1.0 0.7227047235580574 | |
| 11 | -0.7227047235580574 1.0 | |
| 12 | -0.0571225084245058 0.21235618205724174 | |
| 13 | -0.21235618205724174 0.0571225084245058 | |
| 14 | -0.5298281213967181 0.27873119128595564 | |
| 15 | -0.27873119128595564 0.5298281213967181 | |
| 16 | -0.9336597470257552 0.9336597470257552 | |
| 1 | +# n = 15: smallest triangle about 0.0199320452, best of 600 starts under diagonal symmetry dg with 3 pinned pairs, found by dsearch.py 15 dg 3 600 800000 6 30; best seed 800531 | |
| 2 | +0.15148362192212433 0.38509690521127843 | |
| 3 | +0.38509690521127843 0.15148362192212433 | |
| 4 | +0.0679739933571319 0.9353236181250422 | |
| 5 | +0.9353236181250422 0.0679739933571319 | |
| 6 | +0.8669011402473825 0.6072273535247045 | |
| 7 | +0.6072273535247045 0.8669011402473825 | |
| 8 | +0.0 0.7239415987668522 | |
| 9 | +0.7239415987668522 0.0 | |
| 10 | +1.0 0.8937222427292131 | |
| 11 | +0.8937222427292131 1.0 | |
| 12 | +0.0 0.1374806833679007 | |
| 13 | +0.1374806833679007 0.0 | |
| 14 | +1.0 0.27735983636243333 | |
| 15 | +0.27735983636243333 1.0 | |
| 16 | +0.4004644628698116 0.4004644628698116 | |