From 0988abe23c4be3e5104ccb418f3bc174b93aeb26 Mon Sep 17 00:00:00 2001 From: weijianle <1516577123@qq.com> Date: Tue, 24 Jun 2025 01:44:44 +0800 Subject: [PATCH 1/2] Upload CoDEA --- .../CoDEA/CoDEA.m | 45 ++++++++++++ .../CoDEA/EnvironmentalSelection.m | 72 +++++++++++++++++++ .../CoDEA/Normalization.m | 37 ++++++++++ 3 files changed, 154 insertions(+) create mode 100644 PlatEMO/Algorithms/Multi-objective optimization/CoDEA/CoDEA.m create mode 100644 PlatEMO/Algorithms/Multi-objective optimization/CoDEA/EnvironmentalSelection.m create mode 100644 PlatEMO/Algorithms/Multi-objective optimization/CoDEA/Normalization.m diff --git a/PlatEMO/Algorithms/Multi-objective optimization/CoDEA/CoDEA.m b/PlatEMO/Algorithms/Multi-objective optimization/CoDEA/CoDEA.m new file mode 100644 index 000000000..cc74677ff --- /dev/null +++ b/PlatEMO/Algorithms/Multi-objective optimization/CoDEA/CoDEA.m @@ -0,0 +1,45 @@ +classdef CoDEA < ALGORITHM +% <2022> +% collaborative decomposition-based evolutionary algorithm + +%------------------------------- Reference -------------------------------- +% Yu Wu, Jianle Wei, Weiqin Ying, Yanqi Lan, Zhen Cui, Zhenyu Wang, +% A collaborative decomposition-based evolutionary algorithm integrating +% normal and penalty-based boundary intersection methods for many-objective +% optimization, Information Sciences,Volume 616,2022,Pages 505-525 +%------------------------------- Copyright -------------------------------- +% Copyright (c) 2025 BIMK Group. You are free to use the PlatEMO for +% research purposes. All publications which use this platform or any code +% in the platform should acknowledge the use of "PlatEMO" and reference "Ye +% Tian, Ran Cheng, Xingyi Zhang, and Yaochu Jin, PlatEMO: A MATLAB platform +% for evolutionary multi-objective optimization [educational forum], IEEE +% Computational Intelligence Magazine, 2017, 12(4): 73-87". +%-------------------------------------------------------------------------- + + methods + function main(Algorithm,Problem) + %% Generate the reference points and random population + [W,Problem.N] = UniformPoint(Problem.N,Problem.M); + Population = Problem.Initialization(); + [z,znad] = deal(min(Population.objs),max(Population.objs)); + H1 = 1; + while nchoosek(H1+Problem.M,Problem.M-1) <= Problem.N + H1 = H1 + 1; + end + ILid = nchoosek(H1+Problem.M-1,Problem.M-1); + r = []; + for i = 1 : ILid + deta = min(W(i,:)); + beta = (1 - max(W(i,:))); + r(i) = ((2*(1-deta*Problem.M)+(beta/(0.5)))/2);%旋转系数 + end + + %% Optimization + while Algorithm.NotTerminated(Population) + MatingPool = randi(Problem.N,1,Problem.N); + Offspring = OperatorGA(Problem,Population(MatingPool)); + [Population,z,znad] = EnvironmentalSelection([Population,Offspring],W,Problem.N,z,znad,ILid,r ); + end + end + end +end \ No newline at end of file diff --git a/PlatEMO/Algorithms/Multi-objective optimization/CoDEA/EnvironmentalSelection.m b/PlatEMO/Algorithms/Multi-objective optimization/CoDEA/EnvironmentalSelection.m new file mode 100644 index 000000000..69f15bdad --- /dev/null +++ b/PlatEMO/Algorithms/Multi-objective optimization/CoDEA/EnvironmentalSelection.m @@ -0,0 +1,72 @@ +function [Population,z,znad] = EnvironmentalSelection(Population,W,N,z,znad,ILid,r) +% The environmental selection of CoDEA + +%------------------------------- Copyright -------------------------------- +% Copyright (c) 2025 BIMK Group. You are free to use the PlatEMO for +% research purposes. All publications which use this platform or any code +% in the platform should acknowledge the use of "PlatEMO" and reference "Ye +% Tian, Ran Cheng, Xingyi Zhang, and Yaochu Jin, PlatEMO: A MATLAB platform +% for evolutionary multi-objective optimization [educational forum], IEEE +% Computational Intelligence Magazine, 2017, 12(4): 73-87". +%-------------------------------------------------------------------------- + + %% Non-dominated sorting + [FrontNo,MaxFNo] = NDSort(Population.objs,N); + St = find(FrontNo<=MaxFNo); + + %% Normalization + [PopObj,z,znad] = Normalization(Population(St).objs,z,znad); + + %% CoD-non-dominated sorting + tFrontNo = CoDSort(PopObj,W,ILid,r); + + %% Selection + MaxFNo = find(cumsum(hist(tFrontNo,1:max(tFrontNo)))>=N,1); + LastFront = find(tFrontNo==MaxFNo); + LastFront = LastFront(randperm(length(LastFront))); + tFrontNo(LastFront(1:sum(tFrontNo<=MaxFNo)-N)) = inf; + + Next = St(tFrontNo<=MaxFNo); + % Population for next generation + Population = Population(Next); + + +end + +function tFrontNo = CoDSort(PopObj,W,ILid,r) + % Do CoD-non-dominated sorting + + N = size(PopObj,1); + [NW,M] = size(W); + + %% Calculate the d1 and d2 values for each solution to each weight + normP = sqrt(sum(PopObj.^2,2)); + Cosine = 1 - pdist2(PopObj,W,'cosine'); + d2 = repmat(normP,1,size(W,1)).*sqrt(1-Cosine.^2); + + %% Clustering + [~,class] = min(d2,[],2); + + %% Sort + tFrontNo = zeros(1,N); + + for i = 1 : NW + C = find(class==i); + if(size(C,1) == 0) + continue; + end + + if i <= ILid + d = max(PopObj(C,:)-W(i,:),[],2); + g = ((d+(M)/(1+exp(-1*(M-5.5)*M))*r(i)*((d2(C,i)-min(d2(C,i)))./(max(d2(C,i))-min(d2(C,i)))))); + [~,rank] = sort(g); + else + d = 1 - pdist2(PopObj(C,:),ones(1,M)*(1/M),'cosine'); + [~,rank] = sort(d); + end + tFrontNo(C(rank)) = 1 : length(C); + end + + + + \ No newline at end of file diff --git a/PlatEMO/Algorithms/Multi-objective optimization/CoDEA/Normalization.m b/PlatEMO/Algorithms/Multi-objective optimization/CoDEA/Normalization.m new file mode 100644 index 000000000..667fad93f --- /dev/null +++ b/PlatEMO/Algorithms/Multi-objective optimization/CoDEA/Normalization.m @@ -0,0 +1,37 @@ +function [PopObj,z,znad] = Normalization(PopObj,z,znad) +% Normalize the population and update the ideal point and the nadir point + +%------------------------------- Copyright -------------------------------- +% Copyright (c) 2025 BIMK Group. You are free to use the PlatEMO for +% research purposes. All publications which use this platform or any code +% in the platform should acknowledge the use of "PlatEMO" and reference "Ye +% Tian, Ran Cheng, Xingyi Zhang, and Yaochu Jin, PlatEMO: A MATLAB platform +% for evolutionary multi-objective optimization [educational forum], IEEE +% Computational Intelligence Magazine, 2017, 12(4): 73-87". +%-------------------------------------------------------------------------- + + [N,M] = size(PopObj); + + %% Update the ideal point + z = min(z,min(PopObj,[],1)); + + %% Update the nadir point + % Identify the extreme points + W = zeros(M) + 1e-6; + W(logical(eye(M))) = 1; + ASF = zeros(N,M); + for i = 1 : M + ASF(:,i) = max(abs((PopObj-repmat(z,N,1))./(repmat(znad-z,N,1)))./repmat(W(i,:),N,1),[],2); + end + [~,extreme] = min(ASF,[],1); + % Calculate the intercepts + Hyperplane = (PopObj(extreme,:)-repmat(z,M,1))\ones(M,1); + a = (1./Hyperplane)' + z; + if any(isnan(a)) || any(a<=z) + a = max(PopObj,[],1); + end + znad = a; + + %% Normalize the population + PopObj = (PopObj-repmat(z,N,1))./(repmat(znad-z,N,1)); +end \ No newline at end of file From 140dbc703edb453f220109b9e89ccefa8477d085 Mon Sep 17 00:00:00 2001 From: weijianle <56677006+weijianle@users.noreply.github.com> Date: Tue, 24 Jun 2025 02:09:06 +0800 Subject: [PATCH 2/2] Update CoDEA.m --- PlatEMO/Algorithms/Multi-objective optimization/CoDEA/CoDEA.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PlatEMO/Algorithms/Multi-objective optimization/CoDEA/CoDEA.m b/PlatEMO/Algorithms/Multi-objective optimization/CoDEA/CoDEA.m index cc74677ff..8a72bc858 100644 --- a/PlatEMO/Algorithms/Multi-objective optimization/CoDEA/CoDEA.m +++ b/PlatEMO/Algorithms/Multi-objective optimization/CoDEA/CoDEA.m @@ -31,7 +31,7 @@ function main(Algorithm,Problem) for i = 1 : ILid deta = min(W(i,:)); beta = (1 - max(W(i,:))); - r(i) = ((2*(1-deta*Problem.M)+(beta/(0.5)))/2);%旋转系数 + r(i) = ((2*(1-deta*Problem.M)+(beta/(0.5)))/2); end %% Optimization @@ -42,4 +42,4 @@ function main(Algorithm,Problem) end end end -end \ No newline at end of file +end