mex.simplex.problem_definition.minz¶
-
mex.simplex.problem_definition.
minz
(matrix)[source]¶ Creates minimization function. Determines if 1 extra pivot is required, locates the pivot element, pivots about it and continues the process until all negative elements have been removed from the last column and row.
- Parameters
matrix (numpy array) – problem matrix with constraints and objective function added.
- Returns
(dict) A dictionary with Min and variables.
>>> problem_matrix = create_matrix(2,4) # 2 variables and 4 constraints >>> constrain(problem_matrix,'1,1,L,6') # x_1 + x_2 <= 6 >>> constrain(problem_matrix,'-1,2,L,8') # -x_1 + 2x_2 <= 8 >>> constrain(problem_matrix,'1,G,0') # x_1 >= 0 >>> constrain(problem_matrix,'0,1,G,0') # x_2 >= 0 >>> obj(problem_matrix,'-1,-3,0') # -x_1 - 3x_2 >>> minz(problem_matrix) {'x1': 1.3333333333333333, 'x2': 4.666666666666667}