Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The following example can be used to test your code (assuming an initial basic f

ID: 3824403 • Letter: T

Question

The following example can be used to test your code (assuming an initial basic feasible solution is available): min - 4x_1 + x_2 + 30x_3 - 11x_4 - 2x_5 + 3x_6 s.t - 2x_1 + 6x_3 + 2x_4 - 3x_6 + x_7 = 20 -4x_1 + x_2 + 7x_3 + x_4 - x_6 = 10 -5x_3 + 3x_4 + x_5 - x_6 = 60 x_1, ..., x_7 greaterthanorequalto 0 In other words, your matrices/vectors defining the LP are A = [-2 -4 0 0 1 0 6 7 -5 2 1 3 0 0 1 -3 -1 -1 1 0 0], b = [20 10 60], c = [-4 1 30 -11 -2 3 0]. Your initial basis can be chosen as {x_7, x_2, x_5}. In your first iteration, you should see x_4 can enter the Then x_2 should leave the basis. Now your basis is {x_7, x_4, x_5}. Next there will be two nonbasic variables x_1 and x_6, have negative reduced costs. If you choose x_1 to enter the basis, your leaving will be x_7. Then your new basis is {x_1, x_4, x_5}. Now either x_2 or x_6 can enter. If you choose x_6, your new basis will be {x_1, x_4, x_6}. At this point you should get the optimal solution x^* = [5/4, 0, 0, 45/2, 0, 15/2, 0]'. Some further suggestions: Eventually you should provide use a function, say in a file "MySimplexSolver.m", define

Explanation / Answer

Octave pgm:

c=[16];
A=[1;1,1;1,01];
b=[80;80;40;09;40]

lb=[0;0]
ub=[Inf;Inf];
ctype = ["U";"U";"U";"L";"L"]; % indicates upper bound or lower bound
vtype = ["C";"C"]; % continuous variables

sense=-1; % maximises
[xopt,zmx]=glpk(c,A,b,lb,ub,ctype,vtype,sense)

xopt =

20
60

zmx = 180

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote