Speed up simplex via pricing rules and leaner phase-1#2
Merged
Conversation
Two algorithmic improvements to the exact fraction-free simplex, both preserving the exact optimal answers on every test instance. Pricing (solver/tableau.ml, bin/simplex.ml): - Add --rule dantzig (most-positive reduced cost) and --rule steepest (steepest-edge approximation, maximising c^2 / ||col||^2 via exact integer cross-multiplication). Both use a Bland index tie-break for anti-cycling. Bland stays the default. On the 100x100 instance: bland 3034 pivots/4.7s -> dantzig 478/1.3s -> steepest 237/0.37s. Phase-1 restructure (solver/tableau.ml): - Build negative-RHS constraints already in artificial-basic form (negate the row so the artificial has coefficient +1 and RHS >= 0) and repair the phase-1 objective in a single construction pass. This removes the forced setup pivots that previously brought each artificial into the basis one by one (~21% of all pivots; large steepest 237 -> 186). Final answers verified identical across all 61 test problems. The pricing/phase-1 changes alter pivot sequences (and counts) on problems with artificial variables, so the affected golden .out files are regenerated; only pivot counts change, the solutions and objective values are unchanged. Investigated but deliberately not pursued (measured, documented in commit history): GCD content removal is a no-op (Edmonds/Bareiss already leaves no removable common content, 1-3 bits out of ~430), and sparse CSC storage loses at the ~45-50% mid-solve density of these instances.
This was referenced Jul 2, 2026
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.
Two algorithmic improvements to the exact fraction-free simplex, both preserving the exact optimal answers on every test instance.
Pricing (solver/tableau.ml, bin/simplex.ml):
Bland stays the default. On the 100x100 instance: bland 3034 pivots/4.7s ->
dantzig 478/1.3s -> steepest 237/0.37s.
Phase-1 restructure (solver/tableau.ml):
The pricing/phase-1 changes alter pivot sequences (and counts) on problems with artificial variables, so the affected golden .out files are regenerated; only pivot counts change, the solutions and objective values are unchanged.
Investigated but deliberately not pursued (measured, documented in commit history): GCD content removal is a no-op (Edmonds/Bareiss already leaves no removable common content, 1-3 bits out of ~430), and sparse CSC storage loses at the ~45-50% mid-solve density of these instances.