Skip to content
Open
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
6 changes: 5 additions & 1 deletion linear_programming/simplex.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,11 @@ def run_simplex(self) -> dict[Any, Any]:
self.tableau = self.change_stage()
else:
self.tableau = self.pivot(row_idx, col_idx)
return {}
message = (
f"Simplex did not converge within {Tableau.maxiter} iterations. "
"The problem may be cycling or unbounded."
)
raise ValueError(message)

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