diff --git a/linear_programming/simplex.py b/linear_programming/simplex.py index a8affe1b72d2..835b42d4ce5e 100644 --- a/linear_programming/simplex.py +++ b/linear_programming/simplex.py @@ -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