Skip to content

fix(simplex): handle phase-one variables and constant constraints - #17

Closed
rasheedja wants to merge 2 commits into
masterfrom
fix/objective-variable-allocation
Closed

rasheedja wants to merge 2 commits into
masterfrom
fix/objective-variable-allocation

Conversation

@rasheedja

Copy link
Copy Markdown
Owner

Summary

  • Reserve variables from every transformed objective before allocating slack, artificial, and objective variables. Previously, maximizing x1 + x2 with nonnegative variables and only x1 <= 1 could alias x2 with a slack variable and incorrectly report a finite optimum instead of Unbounded.
  • Evaluate constant constraints before constructing phase one: discard tautologies and return infeasible for contradictions. This covers empty coefficient maps and maps containing only zero coefficients, avoiding the previous maximum [] exception.
  • Keep the public API unchanged and add regression coverage for later objectives, transformed variables, and all three constraint relations.

These two review findings share phase-one input handling, so they are bundled to keep the PRs independently mergeable. This PR targets master and has no dependency on the other fixes.

Validation

  • New regression tests reproduced failures before the fix.
  • stack test --no-terminal: 285 examples, 0 failures.
  • cabal check: no errors or warnings.
  • Fourmolu 0.15.0.0 check of all tracked Haskell files passed.
  • stack haddock --no-haddock-deps and git diff --check passed.

@rasheedja rasheedja closed this in #24 Oct 4, 2026
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