min and max optimization as a single minimization function

8 次查看(过去 30 天)
Hello all..
I have two questions.
1) I have a minimization and maximization objective function. Am using pso to solve the problem. However, i have a confusion that how to merge the both the function together to solve it.
for example,
f1=maximization
f2=minimization
if i am adding these function together like as follows
min(f)=(1/f1)+f2;
will it be correct? can i get the proper result?
2) I have 15 variables that are ranges from 1 to 25. I am using PSO to solve the problem. I need a 15 unique numbers for a set to solve my problem. how can i ensure the unique values of the variables for each iterations?
if length(x)==length(unique(x))
%proceed with the function
else
f1=0;
end
I am using this logic for solving the problem. Will it be correct?
Please help me in this.
Thanks in advance.
Muthukannan

回答(1 个)

Matt J
Matt J 2021-10-15
编辑:Matt J 2021-10-15
if i am adding these function together like as follows min(f)=(1/f1)+f2 will it be correct? can i get the proper result?
The solver can return only a single solution x. If you know that f1(x) is maximimized at the same solution x=xmin where f2(x) is minimized, then yes it will work. Otherwise, no, it will not work. Also, if you were fortunate enough for that to be true, you would not need to co-optimize the functions. You could simply minimize f2 and, if you needed the maximum value of f1, simply evaluate f1(xmin).
What you could do is have two sets of variables x and y and minimize
1/f1(x) +f2(y)
as a function of [x,y], but I doubt it will be better than just optimizing each function separately.
I need a 15 unique numbers for a set to solve my problem. how can i ensure the unique values of the variables for each iterations?
Such a constraint only makes sense if your variables are also integer constrained, and pso() does not allow you to impose integer constraints. If you use ga(), you could apply integer constraints and then possibly also the nonlinear constraint,
function [c,ceq]=nonlcon(x)
ceq=0;
c=1-diff(sort(x));
end

类别

Help CenterFile Exchange 中查找有关 Particle Swarm 的更多信息

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by