My MATLAB codes call CPLEX12.1 to solve a cplex instance from MATLAB2009b.
I specifically want to have CPLEX21.1 solve the cplex instance using “3=network simplex” of lpmethod setting. I assume there is a corresponding concert technology callable library that we can use from C, C++, or JAVA. Is there any function that I can use in MATLAB2009b to tell CPLEX12.1 to use “3=network simplex” to solve my given cplex instance?
Thank you,
Chaehwa
Topic

Re: How to "set lpmethod" in MATLAB?
20100728T07:23:34ZThis is the accepted answer. This is the accepted answer.OK,
2 ways:
1. Use Cplex class.
>> cplex=Cplex(); >> cplex.addCols(1); >> cplex.Param.lpmethod.Cur = 3; >> cplex.solve();
2. Use toolbox function
f = [1 2 3]'; Aineq = [1 1 1; 1 3 1]; bineq = [20 30]'; lb = [0 0 0]'; ub = [40 inf inf]'; options = cplexoptimset('cplex'); options.lpmethod = 3; [x, fval, exitflag, output] = cplexlp ... (f, Aineq, bineq, [], [], lb, ub, [], options);
John CuiUpdated on 20140325T00:32:27Z at 20140325T00:32:27Z by ironman 
Re: How to "set lpmethod" in MATLAB?
20130130T20:23:52ZThis is the accepted answer. This is the accepted answer. John Cui
 20100728T07:23:34Z
OK,
2 ways:
1. Use Cplex class.
<pre class="java dw" dataeditorlang="java" datapbcklang="java" dir="ltr">>> cplex=Cplex(); >> cplex.addCols(1); >> cplex.Param.lpmethod.Cur = 3; >> cplex.solve(); </pre>
2. Use toolbox function
<pre class="java dw" dataeditorlang="java" datapbcklang="java" dir="ltr">f = [1 2 3]'; Aineq = [1 1 1; 1 3 1]; bineq = [20 30]'; lb = [0 0 0]'; ub = [40 inf inf]'; options = cplexoptimset('cplex'); options.lpmethod = 3; [x, fval, exitflag, output] = cplexlp ... (f, Aineq, bineq, [], [], lb, ub, [], options); </pre>
John Cui
Additionally, I tried this on a much larger problem with thousands of variables and constraints. The output.time was less than 1 second but the actual time, which I computed using tic/toc around the cplexlp function, was almost 20 seconds. Any reason for such overhead or why the big difference?
Thank you for your help. 
Re: How to "set lpmethod" in MATLAB?
20130205T06:49:30ZThis is the accepted answer. This is the accepted answer. SystemAdmin
 20130130T20:23:52Z
I tried the second way. When I check the output variable returned, output.algorithm=2. When I try lpmethod=2, the algorithm is also 2, but if I change the lpmethod=1, it uses algorithm 1. How can I verify that it is using the network simplex method?
Additionally, I tried this on a much larger problem with thousands of variables and constraints. The output.time was less than 1 second but the actual time, which I computed using tic/toc around the cplexlp function, was almost 20 seconds. Any reason for such overhead or why the big difference?
Thank you for your help.
> I tried the second way. When I check the output variable returned, output.algorithm=2. When I try lpmethod=2, the algorithm is also 2, but if I change the lpmethod=1, it uses algorithm 1. How can I verify that it is using the network simplex method?
>
I don't understand. Isn't it expected that algorithm 1 is used if you set lpmethod to 1? What is the problem here? The network simplex method is algorithm 3.
> Additionally, I tried this on a much larger problem with thousands of variables and constraints. The output.time was less than 1 second but the actual time, which I computed using tic/toc around the cplexlp function, was almost 20 seconds. Any reason for such overhead or why the big difference?
>
What time did you measure with tic/toc? The time reported by CPLEX does not include the time to setup the internal CPLEX problem from the data provided in matlab. If this transformation takes very long then time spent in the solve() call may be significantly larger than the time required for the actual solve itself.
>
> Thank you for your help.