genetic algorithm - not running - reg
2 次查看(过去 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!