Why GA fails to get optimal solution for linear programming problem?

1 vue (au cours des 30 derniers jours)
When I compare the solutions between "fmincon" and GA solver, I get 2 different results. It is also clear that "fmincon" gives better solution:
n = 22;
AssetMean = [...
0
0.0044
0
0.0510
0
0.0397
0.0295
0
0
0
0.0397
0.0295
0.0397
0.0510
0
0
0
0
0
0
0.0200
0];
LowerBound = zeros(n,1);
UpperBound = [...
0.7500
0.7500
0
0.1500
0
0.1500
0.1500
0
0
0
0.1500
0.1500
0.1500
0.1500
0
0
0
0.7500
0
0
0
0];
%%fmincon
of = @(x) -(AssetMean'*x);
[x, y] = fmincon(of, (1/n)*ones(n,1), [], [], ones(n,1)', 1, LowerBound, UpperBound)
%%GA
of = @(x) -(x*m.AssetMean);
[x1, y1] = ga(of, n, [], [], ones(n,1)', 1, LowerBound, UpperBound);
x1 = x1'
y1

Réponse acceptée

MathWorks Support Team
MathWorks Support Team le 19 Avr 2019

"fmincon" uses second derivative information to find a solution.

On the other hand, for GA, the algorithm is converging but slowly because it is not using any derivative information.

For a linear programming problem, it is recommended to use the "linprog" function.

Plus de réponses (0)

Produits


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by