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

idk what happened ngl

parent 0500da53
No related branches found
No related tags found
No related merge requests found
......@@ -264,7 +264,6 @@ class Simplexe:
###################################################################
# returns cheks if the current solution is feasible or not (return True if feasible)
def __isSolutionFeasible(self):
# we MUST have that all BASIC variables are >= 0 to have a FEASIBLE solution
# to iterate over basic variables do:
......@@ -341,7 +340,7 @@ class Simplexe:
minRatio = ratio
leavingRow = index
# print("leaving row :", leavingRow) # vérification ok
print("leaving row :", leavingRow) # vérification ok
return leavingRow
......@@ -393,6 +392,8 @@ class Simplexe:
# | c | 0 | 0 | | c | 0 | 0 | 0 |
# |-----------| |---------------|
# | d |-1 | 0 | S |
print(
f"Shape = {simplexe.__tableau.shape}\t= {simplexe.__tableau}")
# d = - sum(coeff in column) and S is the -sum vector b (NOTE: we already made sure all elements in b are non-negative!)
# store the fact we are actually using a Phase I - to make sure we don't select a pivot in the "original" objective row!
self.IsPhaseI = True
......@@ -405,11 +406,17 @@ class Simplexe:
tmpCopy = simplexe.__tableau.copy()
self.__tableau = tmpCopy[0:-1, 0:-1]
# add the auxiliary variables and their objective row
print(
f"Shape = {self.__tableau.shape}\tBefore appending = {self.__tableau}")
self.__tableau = np.append(
self.__tableau, np.identity(simplexe.NumRows), axis=1)
# add the RHS column
self.__tableau = np.append(
self.__tableau, np.array([tmpCopy[0:-1, -1]]).T, axis=1)
print(
f"Shape = {self.__tableau.shape}\tAfter appending = {self.__tableau}")
# create the tableau for the PhaseI from above initialized arrays!!!
raise Exception('Not implemented',
'Simplexe.initPhaseI: missing code to be implemented.')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment