Question: (6 points) Write a Python code to implement the dual simplex algorithm for non-degenerate LPs. Your code should: - take as an input an LP

(6 points) Write a Python code to implement the dual simplex algorithm for non-degenerate LPs. Your code should: - take as an input an LP (characterized by a matrix A and vectors c and b in appropriate dimensions) in standard form with b0 and assume that the LP has m slack variables which provides with an initial BFS. - output the optimal solution and the optimal objective function value. Write the code such that the user can input c,A and b in Python list format (i.e., do not prompt the user to provide the input). For example, c can be input as a list of the form [c1,c2,,cn],b can be input as a list of the form [b1,b2,,bm] and A can be entered as a list of lists, with each list representing a row (e.g., A=[[a11,a12,,a1n],..,[am1,..,amn]]). Print the output in the following format: "The optimal solution is: [x1,x2,x3,,x5] ". Using your code, solve the LP given in problem (4) first, but then with the additional constraint x13 (not x12 ). Solve this problem with your primal simplex implementation and compare the number of iterations taken by both methods
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
