Add IPM-based maximum flow solver (Chen et al. 2022)#18
Open
Add IPM-based maximum flow solver (Chen et al. 2022)#18
Conversation
Implement an interior point method approach to maximum flow, reducing the problem to min-cost circulation and solving with a primal-dual IPM using weighted Laplacian Newton steps. Includes 23 unit tests covering each component (Laplacian solver, dead-end pruning, flow initialization, IPM step, step size computation) plus GRL_6_A integration tests. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Replace vec-of-vec with flat array in solve_laplacian to avoid per-call heap allocations (nn separate vectors → single flat buffer) - Use adaptive barrier reduction based on step quality (alpha > 0.8 → aggressive, alpha < 0.3 → conservative) instead of fixed shrink - Reduce target_mu from 1e-9 to 1e-7 (sufficient for integer rounding) - GRL_6_A test time: 6.1s → 0.46s (13x speedup) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Algorithm components
solve_laplacian— Gaussian elimination for weighted Laplacian systemsprune_dead_ends— Iterative removal of edges to/from dead-end nodescompute_excess— Flow conservation violation at each nodecompute_step_size— Line search keeping flow strictly interiorinitialize_flow— Weighted projection of cap/2 onto conservation constraintsipm_step— Newton step via KKT conditions of barrier-penalized circulationmax_flow— Integration: reduction → pruning → initialization → IPM loop → roundingTest plan
🤖 Generated with Claude Code