how to use simplex method for LP in matlab

조회 수: 14 (최근 30일)
Pavlos
Pavlos 2019년 6월 26일
댓글: Matt J 2019년 6월 28일
Hello,
i want to use the simplex-algorithm in matlab to solve my optimization problem. After reading the threads i underestand that the simplex-algorithm is not used for
linprog, instead the dual-simplex is the default solution which essentially performs a simplex algorithm on the dual problem. How can i use the simplex-algorithm to solve my linear problem? The most relevant thread that i found is: https://uk.mathworks.com/matlabcentral/fileexchange/61086-simplex-solver
any suggestions?
Thanks!
  댓글 수: 1
Matt J
Matt J 2019년 6월 26일
The most relevant thread that i found is:
Doesn't that solve the issue? What is wrong with the solver that you found there?

댓글을 달려면 로그인하십시오.

답변 (1개)

Matt J
Matt J 2019년 6월 26일
편집: Matt J 2019년 6월 26일
I do find it a bit strange that the primal simplex algorithm is not an option in linprog...
However, the dual of the dual is the primal, so a simple work around might be to input the dual problem to linprog instead. That way, when linprog applies the "dual simplex algorithm", it will really be applying the simplex algorithm to the primal. The Lagrange multipliers (lambda) that it returns
[x,fval,exitflag,output,lambda] = linprog(___)
should then give you the primal solution, as found by the primal simplex algorithm.
  댓글 수: 6
Pavlos
Pavlos 2019년 6월 28일
The unbounded solution is for the dual. The primal actually is infeasible in this case.
So i sovle the dual e.g.,
[dualVars, dualVal, dualFlag, dualOutput, dualLamba] = linprog(g, -A_dual, -b_dual, [], [], lb_dual, ub_dual);
thanks for your time!
Matt J
Matt J 2019년 6월 28일
If the primal is infeasible (and so has no solution) why was your original goal to run the primal simplex algorithm?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Get Started with Optimization Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by