Skip to content

Fix all LAP algorithms and add correctness CI (P0)#6

Merged
MinLee0210 merged 1 commit into
mainfrom
fix/p0-lap-correctness
Jul 3, 2026
Merged

Fix all LAP algorithms and add correctness CI (P0)#6
MinLee0210 merged 1 commit into
mainfrom
fix/p0-lap-correctness

Conversation

@MinLee0210

Copy link
Copy Markdown
Collaborator

Replace the broken algorithm implementations with a shared, correct O(n^3) shortest-augmenting-path solver and verify all six algorithms against scipy/lap reference solvers.

Algorithms:

  • Add sap_solve + pad_to_square/trim_solution helpers in utils.rs
  • Rewrite lapjv, hungarian, lapmod, dantzig on top of sap_solve
  • Fix auction: correct the inverted (maximizing) sign so it minimizes cost
  • Fix subgradient: add SAP primal recovery after the dual phase

Testing & CI:

  • Expand test_correctness.py to 42 tests covering all six algorithms, cross-algorithm agreement, and permutation validity
  • Add .github/workflows/ci.yml: fmt/clippy + pytest on Python 3.9-3.13, running on every push and pull request
  • Fix CI.yml version check to read Cargo.toml (pyproject uses dynamic version)

Packaging:

  • Move maturin/twine/lap out of runtime deps into the dev group

Replace the broken algorithm implementations with a shared, correct
O(n^3) shortest-augmenting-path solver and verify all six algorithms
against scipy/lap reference solvers.

Algorithms:
- Add sap_solve + pad_to_square/trim_solution helpers in utils.rs
- Rewrite lapjv, hungarian, lapmod, dantzig on top of sap_solve
- Fix auction: correct the inverted (maximizing) sign so it minimizes cost
- Fix subgradient: add SAP primal recovery after the dual phase

Testing & CI:
- Expand test_correctness.py to 42 tests covering all six algorithms,
  cross-algorithm agreement, and permutation validity
- Add .github/workflows/ci.yml: fmt/clippy + pytest on Python 3.9-3.13,
  running on every push and pull request
- Fix CI.yml version check to read Cargo.toml (pyproject uses dynamic version)

Packaging:
- Move maturin/twine/lap out of runtime deps into the dev group

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@MinLee0210 MinLee0210 merged commit 81fd7cc into main Jul 3, 2026
1 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant