This document tracks the ongoing work to speed-up girth and then integrate those gains into loop_modulus while keeping both GitHub repositories clean and easy to collaborate on.
- [~] Standardise tooling (pytest, coverage, black/ruff, pre-commit).
- [~] Add GitHub Actions workflow to run lint & tests.
- Protect
masterwith branch protection rules on GitHub (manual step). - Freeze current public API of
girth; record baseline test cases.
Target version: girth v0.2.0 – same API, faster implementation
- [~] Run existing
profile_algorithm.py/benchmark.pyon several graph sizes (baseline profiling in progress). - Store cProfile + flamegraphs in
profiling_results/. - Commit a markdown table of wall-clock results (
docs/benchmark_baseline.md).
- Remove repeated NetworkX look-ups in inner loops.
- Replace per-edge
dictaccess with cached locals / arrays where indices are dense.
- PR #1 – Refactor hot loops (micro-optimisations, early exits).
- PR #2 – Better heap (switch to
heapdictor optional Fibonacci heap). - PR #3 – Optional compiled speed-ups (Cython/C++ extension) ‑ stretch goal.
- Add
pyproject.toml/setup.cfgsopip install git+…works. - Adopt semantic versioning and tag
v0.2.0after performance PRs merge.
- Pin
girthdependency inloop_modulus/requirements.txttogirth@v0.2.0. - Add small unit test that computes a modulus instance and asserts numeric output.
- Profile full pipeline again; decide next optimisation targets (batching, pruning…).
- Merge feature branch via PR, update CHANGELOG, bump version.
git tag -a vX.Y.Z -m "…"and push tag.- Update downstream repo (
loop_modulus) when a newgirthversion is published.
- Pending / not started
- Completed
- [~] In progress
Maintain this file after each significant change so everyone stays in sync.
| ID | Task | Status | Notes |
|---|---|---|---|
| 1 | Adaptive Seed Count | ☐ Pending | Dynamic seeds = max(1, ⌊k·γ⌋); stop when BMSSP finds no new shorter cycle. |
| 2 | ρ-Weighted Graph Pruning | ☐ Pending | Build subgraph with ρ > ε (ε ≈ 1e-6) before each BMSSP call to shrink search space. |
| 3 | Active-Set QP / Constraint Dropping | ✅ Completed | Implemented: constraints with dual ≤ τ are removed after each OSQP solve; warm-starts adjusted. |
- Large-graph benchmark: run
girth/benchmark.py --run benchmarks(Agg backend) and log times indocs/benchmark_large_graphs.md. - Correctness check: compute loop modulus on the Cholera graph; expected value 98–101. Assert within this range in CI.
Update status and notes for each task as soon as code is merged or results measured.