Benjamin Lindqvist
Benjamin Lindqvist

Reputation: 4610

Large linear programs in Matlab

I have a linear program with order N^4 variables and order N^4 constraints. If I want to solve this in AMPL, I define the constraints one by one without having to bother about the exact coefficient matrices. No memory issues arises. When using the standard LP-solver in Matlab however, I need to define the matrices explicitly.

When I have variables with four subscripts, this will lead to a massively sparse matrix of dimension order N^4 x N^4. This matrix won't even fit in memory for non trivial problem sizes.

Is there a way to get around this problem using Matlab, apart from various column generation/cutting plane techniques? Since AMPL manages to solve it, I suppose they're either automating some kind of decomposition, or they somehow solve the LP without explicitly working with this sparse monster matrix.

Upvotes: 1

Views: 203

Answers (2)

vitaut
vitaut

Reputation: 55524

Apart from sparse mentioned by m.s. you can also use AMPL API for MATLAB. It is especially useful if you already have an AMPL model and want to work with it from MATLAB.

Upvotes: 2

m.s.
m.s.

Reputation: 16324

Converting my comment into an answer:

MATLAB supports sparse matrices using the sparse command which allows you to build your constraint matrix without exceeding memory limits.

Upvotes: 1

Related Questions