genetic algorithm - not running - reg
1 回表示 (過去 30 日間)
古いコメントを表示
I converted a GAMS model (mip) file into cplexmps format using PAVER web server. I read this file into MATLAB R2015b using mpsread command.
Then i got the following output.
problem = mpsread('cplex(1).mps')
problem =
f: [1925x1 double]
Aineq: [216x1925 double]
bineq: [216x1 double]
Aeq: [773x1925 double]
beq: [773x1 double]
lb: [1925x1 double]
ub: [1925x1 double]
intcon: [0x1 double]
solver: 'linprog'
options: [1x1 optim.options.Linprog]
Then i made slight modifications as follows to use the problem with genetic algorithm solver.
c =(problem.f)';
A=problem.Aineq;
b=problem.bineq;
Aeq=problem.Aeq;
beq=problem.beq;
lb=problem.lb;
ub=problem.ub;
A = full(A);
Aeq=full(Aeq);
fun = @(x) sum(c.*x);
A=[A;Aeq;-Aeq];
b=[b;beq;-beq];
options = gaoptimset('PlotFcn',@gaplotbestf)
when i wanted to run ga with the following commands, it is showing 'busy' symbol for an abnormal time. how can i get the output.
[x,fval]=ga(fun,1925,A,b,[],[],lb,ub,[],options)
2 件のコメント
KSSV
2017 年 11 月 16 日
May be the data is huge......for your computer spec. YOu first try with a down sampled/ less data.
回答 (1 件)
Walter Roberson
2017 年 11 月 16 日
ga() uses random searching that wanders around local minima hoping to find a good location, with no certainty at all that it will ever find the best conformation. The number of combinations to try rises exponentially.
linprog() uses linear programming techniques that know how to split the problem domain according to constraints and then run a minimizer on each subdomain that is certain to find the minima over that subdomain; it goes through all of the subdomains and picks the one that does the best. It can take a while to create all of the subdomains implied by the constraints, but because each sub-problem is linear, it is certain to be able to optimize it -- the optimum is always at one of the corners of each linear sub-domain.
参考
カテゴリ
Help Center および File Exchange で Genetic Algorithm についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!