linprog: Interior point algorithm gives wrong results
Show older comments
I test the "linprog" linear programming function on a NetLib .mat file. I found that only the dual-simplex alg gives me the correct answer. The other two algo options yield incorrect results. Here is my code:
load adlittle.mat % downloaded from NetLib
disp('>> dual-simplex');
options = optimoptions('linprog','Algorithm','dual-simplex');
[x fval, exitflag, output, lambda] = linprog(c,[],[], A,b, lo, hi,options);
disp(sprintf('Algorithm: dual-simplex ; fval = %e\n', fval));
disp('>> interior-point-legacy');
options = optimoptions('linprog','Algorithm','interior-point-legacy');
[x fval, exitflag, output, lambda] = linprog(c,[],[], A,b, lo, hi,options);
disp(sprintf('Algorithm: interior-point-legacy ; fval = %e\n', fval));
disp('>> interior-point');
options = optimoptions('linprog','Algorithm','interior-point');
[x fval, exitflag, output, lambda] = linprog(c,[],[], A,b, lo, hi,options);
disp(sprintf('Algorithm: interior-point ; fval = %e\n', fval));
Only the dual-simplex option givesfval = 2.254950e+05 which is correct. the other two interior-point algos either give wrong answer or no answer.
May I know how to correctly set up linprog for the interior point algo?
H.C. Lui
Answers (0)
Categories
Find more on Introduction to Installation and Licensing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!