diff --git a/resources/simplex/run_simplex.py b/resources/simplex/run_simplex.py index 948d3a15fce8b5ec32c9cf17ab6fc7ce7af4b955..0dc5028ff62b4c30d74efdd3f0bc272b3122653f 100644 --- a/resources/simplex/run_simplex.py +++ b/resources/simplex/run_simplex.py @@ -54,10 +54,16 @@ class RunSimplex(): :return: Solution found for problem | False if problem is infeasible. """ # Run "Initialize-Simplex" function before we do any work. - self._parent.initialize() - - # Our initialize calls part of this logic. So put it in a separate method to avoid unintentional recursion. - return self._run_simplex() + feasible = self._parent.initialize() + + # Check if problem was found to be feasible. + if feasible: + # Is feasible. Solve problem. + # Our initialize calls part of this logic. So put it in a separate method to avoid unintentional recursion. + return self._run_simplex() + else: + # Not feasible. Return false. + return False def _run_simplex(self): """