Finding all local/global minima of an Optimization Problem

조회 수: 1 (최근 30일)
Daniela Würmseer
Daniela Würmseer 2022년 1월 20일
편집: John D'Errico 2022년 1월 20일
Is there a way of finding all local/global minima of an Optimization Problem with Matlab?
For example:
f= [-1,-1]
x0 = [0,0];
ub = [5,5];
lb = [0,0];
A = [1 1];
b = 9;
Aeq = [];
beq = [];
[x,fval] = linprog(f,A,b,Aeq,beq,lb,ub)
Here i get the solution x = (4,5) but i would like to get the solution (5,4) too.
(I want to iterate over all local/global solutions after)
Thank you

채택된 답변

John D'Errico
John D'Errico 2022년 1월 20일
편집: John D'Errico 2022년 1월 20일
Do you understand there are infinitely many such equivalent solutions to that problem, not just TWO? And, while I'd like to write code that will generate infinitely many solutions, it tends to take a long time to run. You seems to be choosing the two soutions at the extremes (not surprising for LP solutions) but if you want to generate more than just one solution, then you need to accept that the rest of them are equally valid. So if [5,4] and [4,5] are solutions you wish to see, then why not [4.5,4.5], and [4.3,4.7]?
Anyway, iterating over ALL such local solutions is clearly impossible. Even if your computer is REALLY fast, infinity is a long way out.
Edit: YEs. I admit that someone will feel it necessary to point out there are actually only finitely many solutions along the line segment. There will be on the order of
1/4*1/eps
ans = 1.1259e+15
solutions. So if your computer can generate a billion solutions per second (mighty fast that is), that would still take you
ans/1e9/60/60/24
ans = 13.0312
So roughly 13 days of computer time, with your CPU melting down from the heat generated. And do you have sufficient RAM to store them all? I seriously doubt it.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기

제품


릴리스

R2012b

Community Treasure Hunt

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

Start Hunting!

Translated by