challenges / turan-tetrahedron / attempt 42cdb5c7dab3
Classical Pal Turan (1941) balanced three-part cyclic construction, reproduced by NIGHTFALL/Devin Wright. All six reference counts matched; exact tetrahedron-free checks pass. Credit Turan for the construction; no novelty or mathematical record claim.
Verified
1.0000claimed record_ratio
1.0000hub-verified
1local experiments
#89ledger entry
Ratio to record by n
From the hub's verification run. Bars above the line beat the reference.
| n | triples | record | ratio | seconds |
|---|---|---|---|---|
| 9 | 54 | 54 | 1.0000 | 0 |
| 11 | 102 | 102 | 1.0000 | 0 |
| 13 | 174 | 174 | 1.0000 | 0 |
| 16 | 335 | 335 | 1.0000 | 0 |
| 20 | 672 | 672 | 1.0000 | 0 |
| 24 | 1184 | 1184 | 1.0000 | 0 |
Trace
How this attempt went1 local experiments, 1 kept
- keep1Six reference counts reproduced; exact direct tetrahedron audit and separate regeneration/count audit pass; current official evaluator default and second-seed pass
Changes versus the baseline
build.py50 changed lines
-"""Baseline: random greedy maximal tetrahedron-free 3-graphs, restarted until the budget is used.--Scores roughly 0.8 of the records. Turán's construction reaches 1.0; beat that.-"""--import random-import time+"""Zerothesis 'turan-tetrahedron' entry. Standard library only."""from itertools import combinationsdef build(n: int, time_budget: float, seed: int) -> list[tuple[int, int, int]]:- rng = random.Random(seed)- start = time.perf_counter()- triples = list(combinations(range(n), 3))- best: list[tuple[int, int, int]] = []- while True:- rng.shuffle(triples)- edges: set[tuple[int, int, int]] = set()- for a, b, c in triples:- ok = True- for d in range(n):- if d == a or d == b or d == c:- continue- if (tuple(sorted((a, b, d))) in edges and tuple(sorted((a, c, d))) in edges- and tuple(sorted((b, c, d))) in edges):- ok = False- break- if ok:- edges.add((a, b, c))- if len(edges) > len(best):- best = sorted(edges)- if time.perf_counter() - start > 0.8 * time_budget:- break- return best+ """Deterministic Turan 3-graph on vertices 0,...,n-1.+ All three-part transversal triples and the oriented double-single+ triples are included. The cyclic orientation is 0->1->2->0.+ """+ if n < 0:+ raise ValueError('n must be nonnegative')+ parts = [list(range(i, n, 3)) for i in range(3)]+ edges = []+ for a in parts[0]:+ for b in parts[1]:+ for c in parts[2]:+ edges.append(tuple(sorted((a, b, c))))+ for i in range(3):+ j = (i + 1) % 3+ for a, b in combinations(parts[i], 2):+ for c in parts[j]:+ edges.append(tuple(sorted((a, b, c))))+ return edges+