This project runs simulated annealing experiments for Erdős Problem #170 (sparse rulers / restricted difference bases). It builds candidate mark sets A ⊆ {0..N}, tracks distance multiplicities W(d), and searches for complete rulers with near-optimal energy.
python -m venv .venv
source .venv/bin/activate
pip install -e .sparse-ruler run 29 9 --runs 50 --steps 200000 --processes 4 --out-dir outputsOutputs:
outputs/results_N29_m9.csvwith one CSV row of metrics.outputs/solutions/solution_N29_m9_*.jsonwith the best 5 solutions.
Small scan (N=1..120 with m0, m0+1, m0+2):
sparse-ruler small-scan --runs 200 --steps 200000 --processes 8 --out-dir outputsLarge scan (N in {1000,2000,5000,10000,20000,50000}):
sparse-ruler large-scan --runs 200 --steps 200000 --processes 8 --out-dir outputssparse-ruler metrics 13 0,1,6,9,11,13If you are running on Modal, the CLI works the same way. Mount the repo, then run:
python -m sparse_ruler.cli small-scan --runs 200 --steps 200000 --processes 8 --out-dir /mnt/outputs- The code keeps
W(d)updated incrementally when marks move. - The annealer uses
H = alpha*M + beta*E + gamma*peakwithalpha=1_000_000,beta=1,gamma=1000. - If
C(m,2) < N, the run is declared impossible and a CSV row is still written.
pytestGenerate the latest paper bundle locally:
cd /Users/hema/Desktop/erdos170
export PYTHONPATH=src
python3 scripts/generate_research_report_to_date.py
python3 scripts/build_paper_artifacts.py --repo-root .This writes:
paper/main.texpaper/generated/tables.texpaper/generated/status_snapshot.json- copies of generated markdown/json reports into
paper/generated/
CI workflow: .github/workflows/paper-automation.yml
- Auto-runs on
mainpushes, nightly, and manual dispatch. - Rebuilds paper artifacts and uploads
erdos170-paper-bundleartifact. - Optional Overleaf sync if repository secrets are set:
OVERLEAF_GIT_URL(required for sync; use Overleaf project Git URL, no token in URL)OVERLEAF_GIT_TOKEN(required for sync; generated in Overleaf account Git settings)OVERLEAF_GIT_BRANCH(optional, defaultmaster)
cd /Users/hema/Desktop/erdos170
source .venv/bin/activate
export PYTHONPATH=src
python3 scripts/run_e_hunt_breakthrough_cycle3.py \
--config configs/e_hunt_breakthrough_cycle3_tailfocus.jsonOutputs land under:
results/e_hunt_breakthrough_cycle3_tailfocus/
Build DIMACS + attempt direct solve (requires python-sat):
cd /Users/hema/Desktop/erdos170
source .venv/bin/activate
pip install "python-sat[pblib,aiger]"
export PYTHONPATH=src
python3 scripts/run_sat_sparse_ruler_feasibility.py \
--N 500 --m 39 \
--mode solve \
--dimacs-out results/sat_feasibility/sparse_ruler_N500_m39.cnf \
--json-out results/sat_feasibility/sparse_ruler_N500_m39_result.jsonDIMACS-only mode (external solver):
python3 scripts/run_sat_sparse_ruler_feasibility.py \
--N 500 --m 39 --mode dimacs