remo
remo

Reputation: 898

Sensivity analysis in MATLAB

I have a large scale linear programming problem. I can solve it within matlab using "linprog". However, it is within a loop, and I need to bypass it from second iteration to end of my loop. It is a simple LP in the form of below:

Minimize sum a_i b_i st. ...

Where a_is are my variables and b_is are coefficients. In each loop iteration only b_is change slightly. I want the new values of my variables after this change. (please note that matlab does not use simplex method for large-scale problems).

Is there any way I can save my time in the loop and do not solve LP multiple times?

Thanks

Upvotes: 1

Views: 1947

Answers (1)

Ram Narasimhan
Ram Narasimhan

Reputation: 22506

Note that Sensitivity Analysis for LPs/IPs is not one of MATLAB's strengths.

Option 1: If at all you can use CPLEX or SAS, they both have "warm-start" methods that will have your previous basis and come up with something fast. (This is true Sensitivity Analysis.)

Here's one IBM/CPLEX's link to setting an initial solution.

Similarly, SAS/OR also has warmstart options.

Option 2: If you only have access to MATLAB

From Matlab's documentation, here's how to "force" it to use Simplex.

To use the simplex method, set 'LargeScale' to 'off' and 'Simplex' to 'on' in options.

options = optimset('LargeScale','off','Simplex','on')

Note: If the default Interior-point method is much better suited for your particular LP, first solve it as you are doing in iteration 1. Then set the Upper and Lower bounds of your basic variables to be the solution values, and now set linprog options to invoke Simplex. It will trivially solve it.

Try switching the Solution engine to use simplex, and see if that helps in your second and subsequent iterations of the LP with slight changes to the coefficients.

Upvotes: 2

Related Questions