필터 지우기
필터 지우기

Error "array exceeds maximum array size preference"

조회 수: 4 (최근 30일)
S AsZ
S AsZ 2019년 11월 2일
댓글: S AsZ 2019년 11월 3일
Hi I have a mixed integer linear programming model and I attemp to solve it by ga function but it show me this error:
Error using ==
Requested 3381035460x1 (25.2GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information.
How can I resolve this error?
  댓글 수: 2
the cyclist
the cyclist 2019년 11월 2일
Can you upload your code, using the paper clip icon?
S AsZ
S AsZ 2019년 11월 3일
편집: S AsZ 2019년 11월 3일
My code working properly with intlinprog solver but I have this problem with ga solver!

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

채택된 답변

Walter Roberson
Walter Roberson 2019년 11월 3일
The code in eqnsolv() converts LB and UB constraints into linear constraints by adding entries to the A, b matrices. It does needs one row per variable, for LB essentially constructs
N = 141660;
zeros(1,0) -1 zeros(1,N-1)
zeros(1,1) -1 zeros(1,N-2)
zeros(1,2) -1 zeros(1,N-3)
and so on, except that it uses -eye(N) to build it. This can be a huge matrix. Only once it is constructed does it filter out non-finite bounds.
And if it were to succeed at that, it would construct the same kind of matrix except with +1 instead of -1 for representing upper bound.
You might possibly be able to get further by using the problem based optimization system to construct a system with no upper bounds or lower bounds, and break that into pieces and call ga() on the pieces imposing appropriate LB and UB constraints. Maybe. But you are working with a lot of variables!
With that many variables, I would not expect any meaningful progress in a reasonable amount of time.
  댓글 수: 3
Walter Roberson
Walter Roberson 2019년 11월 3일
but why do I get the answer in about a minute when I solve this model with the same variables with problem-based optimization system and intlinprog solver while the ga function show me this error?
The answer is "Because that is the way that Mathworks programmed handling of bounds."
32768 variables is the point at which MATLAB would need 8 gigabytes to store the converted lower bounds; the converted upper bounds would take the same.
temp = which('-all', 'eqnsolv');
edit(temp{1})
Now look at roughly line 36 at the section "% Handle bounds as linear constraint"
You can open a technical support case with Mathworks pointing out that this code is a problem for large number of variables.
S AsZ
S AsZ 2019년 11월 3일
Thanks

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Linear Programming and Mixed-Integer Linear Programming에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by