suggest a method/algorithm to solve Combinatorial optimization
3 次查看(过去 30 天)
显示 更早的评论
I have three different set of variables
SC=[a,b,c,d,e,f]; % each option a, b, etc are actually temperature dependent and can be evaluated using empirical correaltions
AM=[p;q;r]; % each option p,q, etc are actually temp dependent and can be evaluated using empirical correaltions
HF=[m,n,x,y,z]; % each option m,n, etc are actually temp dependent and can be evaluated using empirical correaltions
, need to choose a best combination by picking one option from each set such that the resulting combination maximizes the efficiency
efficiency is the evaluated by putting value of these variables in a mathematical model.
Which opimization technique/algorithm can solve such problem.
Please suggest.
Thanks a lot.
1 个评论
Bruno Luong
2020-12-19
编辑:Bruno Luong
2020-12-19
There are 6*3*5 = 90 combinations, can't you just evaluate them all then pick the best?
采纳的回答
Ameer Hamza
2020-12-17
编辑:Ameer Hamza
2020-12-17
I don't think there is a function in MATLAB that operate on a list of optimization variables. The closest possible option is to use the optimizer to generate the index of these variables. Only ga() and surrogateopt() will work for nonlinear integer optimization.
For example, consider this
SC = [1 2 3 4 5 6];
AM = [1 2 3];
HF = [5 4 3 2 1];
lb = [1 1 1];
ub = [6 3 5]; % upper bound for indexes
sol = ga(@(x) objFun(x, SC, AM, HF), 3, [], [], [], [], lb, ub, [], 1:3)
SC_sol = SC(sol(1))
AM_sol = AM(sol(2))
HF_sol = HF(sol(3))
function y = objFun(ind, SC, AM, HF)
y = myModel(SC(ind(1)), AM(ind(2)), HF(ind(3)));
end
function y = myModel(sc, am, hf)
y = sc + am + hf;
end
However, I guess surrogateopt() is more appropriate here, since it is explicitly defined for "time-consuing objective function"
SC = [1 2 3 4 5 6];
AM = [1 2 3];
HF = [5 4 3 2 1];
lb = [1 1 1];
ub = [6 3 5]; % upper bound for indexes
opts = optimoptions('surrogateopt', 'PlotFcn', '');
sol = surrogateopt(@(x) objFun(x, SC, AM, HF),lb, ub, 1:3, opts)
SC_sol = SC(sol(1))
AM_sol = AM(sol(2))
HF_sol = HF(sol(3))
function y = objFun(ind, SC, AM, HF)
y = myModel(SC(ind(1)), AM(ind(2)), HF(ind(3)));
end
function y = myModel(sc, am, hf)
y = sc + am + hf;
end
4 个评论
Ameer Hamza
2020-12-21
"Here, objective function (efficiency) is not directly dependent on the mentioned variables. choice of these variables influence the calculation of intermediate terms required to evaluate the efficiency and thus indirectly influence the objective function."
Yes, because if you study the optimization problem in my answer, you can see that the algorithm controls the indexes, which are even less relevant to the objective function compared to your variables. I would even say that using an optimizer like this is no better than running an exhaustive search using all the possible values. I don't think there is a direct link between indexes and the objective function value, which an optimizer can exploit. But if such a link exist, these optimizers will exploit it.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Get Started with Optimization Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!