Skip to content
Snippets Groups Projects
Verified Commit 2b6d7709 authored by iliya.saroukha's avatar iliya.saroukha :first_quarter_moon:
Browse files

fix: bug with initial condition of cycle

parent b575202c
No related branches found
No related tags found
No related merge requests found
...@@ -264,6 +264,7 @@ class Simplexe: ...@@ -264,6 +264,7 @@ class Simplexe:
################################################################### ###################################################################
# returns cheks if the current solution is feasible or not (return True if feasible) # returns cheks if the current solution is feasible or not (return True if feasible)
def __isSolutionFeasible(self): def __isSolutionFeasible(self):
# we MUST have that all BASIC variables are >= 0 to have a FEASIBLE solution # we MUST have that all BASIC variables are >= 0 to have a FEASIBLE solution
# to iterate over basic variables do: # to iterate over basic variables do:
...@@ -284,7 +285,8 @@ class Simplexe: ...@@ -284,7 +285,8 @@ class Simplexe:
# print(self.__tableau[rowId, baseColId]) # print(self.__tableau[rowId, baseColId])
# #
if np.array_equal(self.__basicVariables, self.__initBasicVariable): if self.__PivotCount != 0 and np.array_equal(self.__basicVariables,
self.__initBasicVariable):
self.hasCycle = True self.hasCycle = True
if self.hasCycle: if self.hasCycle:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment