fix: update Sidon tests for Mian-Chowla API (68/68 pass)

This commit is contained in:
Brandon Schneider 2026-05-28 17:06:40 -05:00
parent bcc40a8318
commit 6bf0445031

View file

@ -328,13 +328,18 @@ def test_sidon():
# Edge cases
report("assign_sidon_slots(0) = []", bs.assign_sidon_slots(0) == [])
report("assign_sidon_slots(1) = [seed]", bs.assign_sidon_slots(1) == [42])
report("assign_sidon_slots(1) = [1]", bs.assign_sidon_slots(1) == [1])
# Reproducibility
s1 = bs.assign_sidon_slots(15, seed=100)
s2 = bs.assign_sidon_slots(15, seed=100)
# Reproducibility (deterministic — no seed needed for Mian-Chowla)
s1 = bs.assign_sidon_slots(15)
s2 = bs.assign_sidon_slots(15)
report("sidon is deterministic", s1 == s2)
# Method comparison
p2 = bs.assign_sidon_slots(8, 'powers_of_2')
mc = bs.assign_sidon_slots(8, 'greedy_optimal')
report("Mian-Chowla denser than powers_of_2", max(mc) < max(p2))
# ── 8. Soliton Search ────────────────────────────────────────────────────────