C++20 project for finding optimal Golomb rulers using multiple approaches: heuristics, MCTS, and exact methods.
A Golomb ruler is a set of marks at integer positions such that all pairwise distances are distinct. This project implements three optimization layers:
./scripts/build.sh
./scripts/run_tests.sh
# Or manually
mkdir build
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j
ctest --test-dir build
Download pre-compiled binaries from the latest successful CI run:
golomb_cli-Linux artifactExtract the executable and run directly.
./build/golomb_cli --order 8 --ub 120 --mode mcts --iters 5000
# Options:
# --order <n> Number of marks (default: 8)
# --ub <value> Upper bound for positions (default: 120)
# --mode <mode> heur|mcts|exact (default: heur)
# --iters <n> Iterations for heur/mcts (default: 1000)
# --c-puct <value> PUCT exploration constant (default: 1.4)
# --timeout <ms> Exact solver timeout (default: 10000)
core/ - Distance bitset, validation, state management
utils/ - RNG utilities
heuristics/ - Evolutionary algorithm, local search
mcts/ - PUCT-based MCTS with hooks for policy/value networks
exact/ - OR-Tools CP-SAT solver for exact optimization
cli/ - Command-line interface
See docs/ARCHITECTURE.md for detailed design documentation.
Full API documentation is automatically generated with Doxygen and deployed to GitHub Pages:
Documentation is automatically updated on every push to the master branch.
# Run all tests
./scripts/run_tests.sh
# Run benchmarks
./build/golomb_benchmarks
./scripts/format.sh
This project uses Google Benchmark for performance testing. Benchmarks run automatically on every push to master, comparing performance with previous commits to detect regressions.
View benchmark results:
gh-pages branchRun benchmarks locally:
./build/golomb_benchmarks
Benchmark categories:
Performance regressions >10% will trigger warnings in pull requests.
This project is configured with Model Context Protocol (MCP) servers for enhanced development with Claude Code in VS Code.
Configured MCP servers:
Setup instructions: See docs/MCP_GUIDE.md
Prerequisites: Node.js 18+
We welcome contributions! This project uses Conventional Commits for automated versioning and changelog generation.
Quick start:
git checkout -b feat/your-featureCommit message format:
# Feature (minor version bump)
git commit -m "feat(core): add parallel distance calculation"
# Bug fix (patch version bump)
git commit -m "fix(mcts): correct PUCT formula"
# Breaking change (major version bump)
git commit -m "feat!: redesign API
BREAKING CHANGE: RuleState constructor signature changed"
For detailed guidelines: See CONTRIBUTING.md
MIT License - See LICENSE