Skip to content

Raise an error when simplex reaches max iterations - #15243

Open
Rokesh2008 wants to merge 1 commit into
TheAlgorithms:masterfrom
Rokesh2008:fix/simplex-maxiter-error
Open

Raise an error when simplex reaches max iterations#15243
Rokesh2008 wants to merge 1 commit into
TheAlgorithms:masterfrom
Rokesh2008:fix/simplex-maxiter-error

Conversation

@Rokesh2008

Copy link
Copy Markdown

Fixes #14584.

Tableau.run_simplex() now raises:

ValueError: Simplex did not converge within N iterations. The problem may be cycling or unbounded.

when the configured iteration limit is exhausted, instead of silently returning an empty dictionary. A regression test forces maxiter=0 and verifies the exact diagnostic.

Tests:

  • python -m pytest tests/test_simplex.py -q (1 passed)
  • python -m doctest linear_programming/simplex.py
  • git diff --check

@algorithms-keeper algorithms-keeper Bot added the tests are failing Do not merge until tests pass label Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests are failing Do not merge until tests pass

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: run_simplex() returns empty dict {} on max iteration instead of raising an informative error

1 participant