suggest a method/algorithm to solve Combinatorial optimization
조회 수: 2 (최근 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!