diff --git a/src/simplexe.py b/src/simplexe.py index 8fc59598907dc768f76cebe4eefbf0975200394a..2247d3267123f922ab8233444f22b07d04c92239 100644 --- a/src/simplexe.py +++ b/src/simplexe.py @@ -253,9 +253,14 @@ class Simplexe: def __isSolutionFeasible(self): # we MUST have that all BASIC variables are >= 0 to have a FEASIBLE solution # to iterate over basic variables do: - # for rowId, baseColId in enumerate(self.__basicVariables): - raise Exception( - 'Not implemented', 'Simplexe.__isSolutionFeasible: missing code to be implemented.') + + for rowId, baseColId in enumerate(self.__basicVariables): + if self.RHS[rowId] / self.__tableau[rowId][baseColId] < 0: + return False + + # raise Exception( + # 'Not implemented', 'Simplexe.__isSolutionFeasible: missing code to be implemented.') + return True # returns index of entering col Id # return None or -1 if there is pivot