Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion linear_programming/simplex.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,10 @@
self.tableau = self.change_stage()
else:
self.tableau = self.pivot(row_idx, col_idx)
return {}
raise ValueError(
f"Simplex did not converge within {Tableau.maxiter} iterations. "
"The problem may be cycling or unbounded."

Check failure on line 307 in linear_programming/simplex.py

View workflow job for this annotation

GitHub Actions / ruff

ruff (EM102)

linear_programming/simplex.py:306:13: EM102 Exception must not use an f-string literal, assign to variable first help: Assign to variable; remove f-string literal

Check failure on line 307 in linear_programming/simplex.py

View workflow job for this annotation

GitHub Actions / ruff

ruff (EM102)

linear_programming/simplex.py:306:13: EM102 Exception must not use an f-string literal, assign to variable first help: Assign to variable; remove f-string literal
)

def interpret_tableau(self) -> dict[str, float]:
"""Given the final tableau, add the corresponding values of the basic
Expand Down
Loading