|
|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
& ]/ ^7 h, s" R5 J合作协同进化已经引入协同进化算法,目的是通过分而治之的范式解决日益复杂的优化问题。理论上,协同改 变子成分的想法是十分适合解决大规模优化问题的。然而在实践中,没有关于问题的先验知识, 问题应如何分解是尚不清楚的。在本文中,我们提出一个自动分解策略,称为差分分组,可以揭示决策变量的底层交互结构和形成子成分,以使它们之间的相互依存关系保持到最低限度。我们在数学上展示这样一个分解策略如何从部分可分性的定义中产生。实证研究表明,这样的近最优的分解可以大大提高大规模的全局优化问题的解决方案的质量。最后,我们展示了这样一个自动分解是如何产生对多样的子成分的分布的更好的近似,导致一个对多样的子成分的计算预算的更高效的分配。
' @& ~! @, C3 O$ h% F0 c7 Q1 R4 x+ P, Y9 c1 s( l
索引词:合作协同进化,大规模优化,问题分解,不可分性,数值优化 ) N; R+ @& r+ z% F7 I& d
" A# J% Z3 V( C8 w- K3 b/ m
* h+ H* H& }4 {$ u! a0 E- ^" v" R* wrun.m9 {( `& R- T0 c- Y6 C# i9 S
5 Q( y. J( g8 K, }- T$ O: Y: q% Author: Mohammad Nabi Omidvar
i" F- |8 W# e% email address: mn.omidvar AT gmail.com
. J( r. o/ ^: e4 Q9 p1 ]3 h%
! E5 @9 E- O3 i% ------------$ J R* D* q; x6 M+ D
% Description:
+ y6 X, v2 i4 n1 d5 n4 W! N% ------------
2 X2 J! S9 ^5 _% This files is the entry point for running the differential gropuing algorithm.
% u1 I2 ?1 B4 @0 v& d& r f7 P' Z. L) @- w
clear all;0 @4 x' n4 ?/ z- k+ e: q- ~
( I; ?) A& ^3 p' a
% Specify the functions that you want the differential grouping algorithm to : `+ Z% Y/ o3 `* G" g( U9 h
% identify its underlying grouping structure.' v H. u5 |+ ~. m* M
func = [20:-1:1];7 d* i2 [: z( n3 S; V/ u
for i=func
+ W1 c ?7 \% M! }3 D3 z7 Y func_num = i
3 G' d; e; S/ H$ |6 K; O( Z1 ^2 E+ ]4 x
/ o z+ B- H, S, | f t1 = [1 4 7 8 9 12 13 14 17 18 19 20];
' `* Q1 O- t' L9 ?& q* @: P. R6 {' E t2 = [2 5 10 15];
! a+ I# Z$ V2 s t3 = [3 6 11 16];5 L7 r6 ~+ E4 l* F1 b; A( I( C
& K g) \6 e' H1 g
if (ismember(func_num, t1)); p* C" t' }# w1 F' B9 N( b
lb = -100;
& `' f! r; t5 @% b8 S8 i ub = 100;
0 D% H5 `3 k5 J' Z elseif (ismember(func_num, t2))
: P9 A* L$ f. P) z, S2 k6 m lb = -5;
, T5 X; Z% n: D6 K3 p ub = 5;
; u9 d/ V1 W' p. M# C& h" V# q3 Y elseif (ismember(func_num, t3))
5 Z) ?2 d" q$ P1 N lb = -32;
: y' P% S; r( L5 s+ Z, g ub = 32; c. m& C+ X; c( V" b7 n9 Z
end
! I& U/ T' {3 N( g
5 o8 g% v8 q. \. b" @9 p opts.lbound = lb;2 s- |" h, s5 z, P/ H
opts.ubound = ub;
" S6 q U8 b+ i; b, n/ y* Q+ c opts.dim = 1000;# T, s* \% C0 Q. g$ O
opts.epsilon = 1e-3;
4 v w$ G! ~- y% g! _# ~" Z4 g$ ]( b
addpath('cec2010');+ `7 G' x: e7 h$ e
addpath('cec2010/datafiles');, w( e8 _3 u7 \* J" P) m
global initial_flag;
4 }+ z3 p9 S' i' q: ? initial_flag = 0;
" t5 c4 [% K. H/ p2 P% |1 }6 P0 Q. E! h
[seps, nonseps, FEs] = dg('benchmark_func', func_num, opts);: T3 @6 H+ Q# I2 B# \
- e D, u! ]/ O3 r. b# O % filename = sprintf('./results/F%02d.mat', func_num);
' `0 q& s4 S0 i" l/ D7 E" l0 c9 P3 P$ l % save (filename, 'seps', 'nonseps', 'FEs', '-v7'); |' D$ U3 n i
end
" I% z/ R- }( I, X2 p& v* l% x- ]2 c1 s' V$ h( p
. n' {1 e5 U8 G5 Y
dg.m 5 P: }9 h* t8 L9 e9 y- K6 n
/ O6 v' `. O8 x& U; s5 F) L$ i+ D
% Author: Mohammad Nabi Omidvar6 E1 S, N6 L( C1 U3 z$ Y
% email : mn.omidvar AT gmail.com
* }, e9 q# o) F+ V1 ~%
3 i- r" X. W! O% u7 T$ o7 s, g% ------------
/ k, S- k N3 l( k5 ~8 D% Description:
- W$ l7 e; g: G. Q% ------------
. M$ M) y. I5 }% dg - This function runs the differential grouping
9 z% o# f, e* {; C8 _8 U s$ g% procedure to identify the non-separable groups: f/ @' M* |: w; f0 [) F
% in cec'2010 benchmark problems.o
, h" s) { L" f/ D: h) q( _%
% _+ I6 J6 U x% -------
0 g; \' n: K2 b E0 N5 i3 Z1 P- m4 w% Inputs:, h ~- J: A" S1 q" A
% -------
6 h6 q/ ], K# B) {; K% \; S% fun : the function suite for which the interaction structure
! r) C0 l- V6 F& B3 S, K. t% is going to be identified in this case benchmark_func
7 \* v' p t. y8 s- Y9 t& v% of cec'2010.: M, S9 o/ L! ^. A) ^0 Z
%
2 w8 C9 z/ n1 {0 x% fun_number : the function number.% X/ W- `# j2 T9 j3 n
%1 i, w) o, @' k0 U* I6 N" K
% options : this variable contains the options such as problem( x" h8 W. B6 E6 @
% dimensionality, upper and lower bounds and the parameter
1 c/ E/ Y2 f( H0 {% epsilon used by differential grouping.
2 p! i6 j- ]$ D- ]0 j% input3 - Description8 S6 N5 B# T5 G9 \5 i
%8 n) S H/ [! `
% --------3 N& s6 Y: f( q( d& N$ M0 p# k
% Outputs:, h: Y( [( r% l5 d9 m2 s# @ P! K
% --------% a$ ]& ]; @, N" v: }
% sep : a vector of all separable variables.
; W ]3 h8 u$ R5 _3 e% allgroups: a cell array containing all non-separable groups.
/ o4 u3 s j* D% FEs : the total number of fitness evaluations used.3 J* P- m R N8 f, z
%
' V, j$ P1 g c6 Y5 O- V- G/ C% --------! _8 A* u ~6 @
% License:8 h% [* q Y4 ~/ P _( N7 i% Q
% --------' C+ l3 v7 ]0 i8 l% r' a' Y
% This program is to be used under the terms of the GNU General Public License + N3 s' ~: N/ O
% (http://www.gnu.org/copyleft/gpl.html)." e+ \3 y: S4 P. a5 H: G
% Author: Mohammad Nabi Omidvar
8 B% A! x3 K* u: t. p7 C+ j2 `% e-mail: mn.omidvar AT gmail.com
/ v! I& G( h$ j7 f$ q& B% Copyright notice: (c) 2013 Mohammad Nabi Omidvar: N9 z. V; V1 }9 I! {+ H1 n
! C# R7 C. N% s& ]5 U
) |- K; s& [% z( y1 M* v1 T V0 ~function [seps, allgroups, FEs] = dg(fun, fun_number, options);
Q' }) D# ~5 m. f) b ub = options.ubound;& R1 C, i3 O. p$ \' I) y+ b4 d
lb = options.lbound;
N; {3 ^. K. v1 n dim = options.dim;
) v# B5 @ t9 G$ {% z/ f( S epsilon = options.epsilon;
# g$ F& n ^3 ^( _6 X. `6 Q& t r = ub - lb; Q4 r& R! V& O0 z6 p% D
dims = [1:1:dim];
; r7 c g1 [- f3 a seps = [];
( A. Y" }* Y2 j% C allgroups = {};
6 u8 ~( L5 {: r% p FEs = 0;7 u+ N( W" M% S4 M" M! h a4 L* D
8 X! g$ m; Q4 |1 A6 W
while (length(dims) >= 1)5 b- G3 h" z% _3 W3 b- X
allgroups;! n, S- K& q; Z
n = length(dims)6 A2 W; P2 O B" V! X
group = [dims(1)]; Z* S# G4 x3 o7 ^
group_ind = [1];
5 j. d; v% K" q0 U1 r# E* B& A! }9 V4 y
p1 = lb * ones(1,dim);
# Y, `. o5 ^' Q p2 = p1;# L8 D( o) ?$ W" Q
p2(dims(1)) = ub;
' e7 O: T8 D( C' g2 e- M' @6 L6 K2 q& F4 Z3 n
delta1 = feval(fun, p1, fun_number) - feval(fun, p2, fun_number);
3 k2 [/ }* F/ D2 p0 V* a: @3 o0 {8 d3 t$ E1 [& _
FEs = FEs + 2;
. l- f* T9 T1 l1 c1 J$ y$ D
3 l) C& `* e6 W for i=2:n c A2 m3 I, t$ |' h5 i- A
p3 = p1;
' q, Q* o7 ~8 U6 a0 U1 g p4 = p2;6 o' k- W: Q, N, d" J! Y2 Y: ?
' \4 D8 V* w9 C f0 a
temp = 0;$ m1 S; s" j/ k) }0 p* E) {
p3(dims(i)) = temp;
$ h; O, i, t' H. e1 p; g: l7 |4 p p4(dims(i)) = temp;
0 n" R& I9 [% U- I+ O: D
# g" S$ v# O* C9 B% I0 } delta2 = feval(fun, p3, fun_number) - feval(fun, p4, fun_number);" }9 H& E+ b# v& j* P" r
( U4 v1 i" h* M5 I, q0 q0 } FEs = FEs + 2;
* j! ~% _! v) G
: @% C( G' c5 ^& L5 W5 ] if(abs(delta1-delta2) > epsilon)- I" V# V8 H. c# b: h4 L3 L
group = [group ; dims(i)];
+ K6 r0 w2 e, ?$ x' N! U' ?2 f group_ind = [group_ind ; i];2 f+ A6 g) r# s/ C0 o
end! f' r4 s8 G+ P
end
: p B0 F0 C. g" @
, {) }7 U! }' J/ l a if(length(group) == 1)( Z s5 c/ B. c, U
seps = [seps ; group];, G' J8 Y. |0 j9 v3 C
else
' w; M% N: @1 N J3 J/ D+ B allgroups = {allgroups{1:end}, group};
8 `( l9 k) O* E0 K+ X0 b end& {( n1 x3 i/ F1 d4 C+ f' |+ t8 n6 X
- t! }! A6 w7 I" Y if(length(dims) > 0). A( v/ ]% X& W# g; }7 a& r
dims(group_ind) = [];, A" x- Q7 w G" S( X
end
0 g' D9 ]9 K# l5 V- V5 ?. Q) w! n: ~- b end' J5 a3 l& {( n5 i
end
& E9 }1 i3 X1 y4 }) g1 }3 X
' \" t5 R7 Y( m- a6 C
3 O- o& ^- x! o& }) N/ t* J+ Sanalyze.m
W. @& a4 Q( |7 D/ P' b: ]& p' x! l: C* ?9 S3 j
% Author: Mohammad Nabi Omidvar
+ R; { ?+ B& s# p& x E% email address: mn.omidvar AT gmail.com
6 _ n0 [6 y7 X/ F%$ z9 s) s( I& }: V7 c( p A, F$ |
% ------------
5 n d5 ^/ K7 Z; k; s% Description:, r( |6 [7 S7 K+ r5 ?
% ------------
! D+ h( v. B# E% This file is used to analyze the peRFormance of the differential
9 j/ g, l7 Q' y7 ] Y$ x% grouping algorithm on CEC'2010 benchmark problems.
; \& w' T- G4 E5 ~8 e, x% k$ g% This program reads the data files generated by differential
( A* V: l0 v6 a, |3 C1 R% grouping and shows how many variables from each formed group
; \7 H% r$ i. H: M3 l( w: l; M% are correctly identified and to which permutation group they
]" o2 s6 g* O+ J7 e( @: R5 i% belong.
; J- @+ ^" l* [/ |" M%
+ r1 ~6 E; S, B# u8 d+ R$ Y4 Z! `%--------' P8 C, Q- u: z. \; M" Z1 A' Y
% Inputs:$ |) m, k8 v# d4 E( M/ [; w: ^
%--------' c& N8 W5 t- J O
% funs: a vector containing the functions ids the functions that you 2 h' Z3 e# S8 I6 H, O& x
% want to analyze.% h3 g% ^/ {9 t" W$ I
%( l# Y+ d- |( | [3 R
% -----------" n& o' B- H- P: T' x5 N
% References:
3 N2 q3 p/ c& J% U0 ?0 N% -----------
8 G$ t, y. K8 A8 u' o# V% Omidvar, M.N.; Li, X.; Mei, Y.; Yao, X., "Cooperative Co-evolution with
& r/ W4 j: m( K3 d1 O& ^' v% Differential Grouping for Large Scale Optimization," Evolutionary Computation,4 l* O6 T; h, H; u& l, X
% IEEE Transactions on, vol.PP, no.99, pp.1,1, 0
2 d' d' Q) b" F2 s9 S' Z2 ^% http://dx.doi.org/10.1109/TEVC.2013.2281543
* Z, L7 M: m! W%( o$ W& } q8 H' |! m2 B& e0 R# V
% --------
7 n! [! \* S1 |) F+ A2 j3 T0 E( M; |% License:6 M: ]7 Y: Q. l- ^
% --------. f* t- p# q& U0 M
% This program is to be used under the terms of the GNU General Public License
$ \9 J& G, w: X, M% (http://www.gnu.org/copyleft/gpl.html).
f: ? w0 V9 s& Q7 X$ Z% Author: Mohammad Nabi Omidvar
3 r4 X) m+ r; c3 Q/ }% e-mail: mn.omidvar AT gmail.com* D1 Q; g+ Y: r$ m
% Copyright notice: (c) 2013 Mohammad Nabi Omidvar
( t* D- [* |% T" S9 \! S3 a! ?) L) Z9 ` k. M9 f j% @- ^
* M/ x! H) {9 C$ i- jfunction analyze(funcs)( o# p+ y& `1 }7 N2 k' i
more off;9 {! G3 v9 W& k. R% _
1 r/ ?: @. V" N
% Number of non-separable groups for each function in CEC'210 benchmark suite. \ h: c; K; d
numNonSep = [0 0 0 1 1 1 1 1 10 10 10 10 10 20 20 20 20 20 20 20];. x/ T& ?9 o0 N5 e
$ ^% y' c6 b* B for f=funcs
/ E1 x/ j' \# V! ? filename = sprintf('./results/F%02d.mat', f);
# C, M' h4 g- H+ ^! i' \ p = 1:1:1000;
; }- N( L+ ]7 M3 A7 |4 H. Q( O load(filename);! @" \$ O7 ~1 g9 Q; N. ~- o- j
1 i6 e; r# G' i4 O- @
mat = zeros(length(nonseps), 20);% ?- B% M s+ D& B1 I& w
drawline('=');! l: @4 _; X, _; b% B
fprintf('Function F: %02d\n', f);1 R8 w$ t# G% `1 C8 j# R3 M
fprintf('FEs used: %d\n', FEs);
) ]. H% C( h- j5 z8 Z. @ fprintf('Number of separables variables: %d\n', length (seps));& f, B6 z/ [ Y% i. E2 {
fprintf('Number of non-separables groups: %d\n', length (nonseps));0 B: h6 \- I& D
S; g; }$ X% z' \8 |* w filename1 = sprintf('./cec2010/datafiles/f%02d_op.mat', f);9 ?1 y. f2 K, w- v4 S
filename2 = sprintf('./cec2010/datafiles/f%02d_opm.mat', f);3 H& F3 Z* Z- P" X! k5 `* r
flag = false;' @! W* Q' C I* [( d
if(exist(filename1))
# f2 T% C( m; J3 I& G- _ load(filename1);2 J$ N: g5 {( x
flag = true;
3 g q O2 X2 p elseif(exist(filename2))0 T; e( t8 Y, j6 D' T
load(filename2);: M, P+ T: v* v. `; H
flag = true;" r4 o3 o" }/ f ]( b: l
end
% j. r- c0 ^/ R; d/ ]/ S* U
5 V; I" w a. t( ?, j/ \ ` printheader();
- _7 c( }6 S3 g# J k# h0 \- h0 G' ?. J" E8 {
for i=[1:1:length(nonseps)]
% X: m: Y# G P$ ?* M fprintf('Size of G%02d: %3d | ', i, length (nonseps{i}));
) V4 x: U; @( a3 R m = 50;
, I% U" H" W% |. N4 i if(flag): s& d* _8 ]; d1 A$ K9 X; E( n6 k
for g=[1:1:20] ~6 G s( i& m- N& W5 {9 t" b
captured = length(intersect(p((g-1)*m+1:g*m), nonseps{i}));
9 C% \9 a, L) s6 J fprintf(' %4d', captured);5 _9 ~& z/ E3 X1 @) f$ q; m
mat(i, g) = captured;8 u) }- H' [4 N, c
end
( w' U8 T1 J( e/ p3 t3 }& s end8 c% {1 u# } G7 w: H1 M# v6 x6 h
fprintf('\n');; |8 B* _+ D; P( G) l! R R
end4 a6 O) C8 E+ q9 H
6 r( M2 e$ }% G2 W% y I7 U" K3 r mat2 = mat;3 C+ H0 I/ ?) t6 y' d8 ? r
[temp I] = max(mat, [], 1);
6 L6 G' s6 R" M4 V1 H [sorted II] = sort(temp, 'descend');
! U: j7 O/ u9 t! a4 g% d& {) } masks = zeros(size(mat));! u/ s$ v2 v$ k
for k = 1:min(size(mat))
4 j2 C: R8 {3 D6 f! r mask = zeros(1, length(sorted));
8 s" [: C, B" w2 s mask(II(k)) = 1;
- s& m/ d) k# C+ r4 @8 S masks(I(II(k)), :) = mask;
: Z8 U' N# Y/ T1 R: k+ i' t %point = [I(k) II(k)];
5 y2 A8 r8 D0 u- Q. g+ O mat(I(II(k)), :) = mat(I(II(k)), :) .* mask;
- T7 H; k8 m7 f, {. { [temp I] = max(mat, [], 1);+ d9 ^7 a" m. ~& S1 L, E! i% q
[sorted II] = sort(temp, 'descend');
4 z/ `1 Z: D4 Z; s1 x6 x( U* M end
5 a7 G0 `" J9 _ mat = mat2 .* masks;' t9 V, u# j1 G: w8 a
[temp I] = max(mat, [], 1);1 ^7 c- I5 W# o
if(ismember(f, [19 20]))
# \7 m5 ^. }. w7 @3 Y gsizes = cellfun('length', nonseps);0 f+ N/ _5 y5 _1 j2 o
fprintf('Number of non-separable variables correctly grouped: %d\n', max(gsizes));
8 Q- E$ m9 G7 E; F3 U g7 O else0 x+ w* \% ?* s8 g, a
fprintf('Number of non-separable variables correctly grouped: %d\n', sum(temp(1:numNonSep(f))));/ Y4 g/ F% `1 H3 w$ ^( b5 q+ @
end
7 k2 ^/ h1 e ~2 @, t L drawline('='); w5 C- S% n: d1 N6 q! d. q6 ?+ e
pause;
, I# r* N% D# [( F6 s0 j5 W7 cend! r9 Y% \7 N" L Y1 r
5 U( E5 Z4 d& T/ x5 n4 T
end2 s4 V H; u; r' P* N! p
% Helper Functions ----------------------------------------------------------
% ]) @0 w9 \4 e' P' T3 qfunction drawline(c)
& i$ f) ~: ]! N for i=1:121
" E7 |' F/ l3 b fprintf(1,c);( j) L8 |! T' y: e- t/ O
end
0 r5 A0 X' p- b/ N fprintf('\n'), ^+ G: F J' f# D
end
# e* \+ R) W- }- }/ L0 k3 t9 b
1 G- C+ m0 ^8 z$ Ofunction printheader()2 M- ~5 K D2 A
fprintf('Permutation Groups| ');
9 c! I# @' v& x1 Q) k for i=1:20
& {/ j, I/ d, n6 E fprintf(' %4s', sprintf('P%d', i)); I1 g3 m) Z- z7 B) E% I) I
end
Q8 F$ Q( Y1 ~ v fprintf('\n')5 |- Q6 K" f- u# h, ?! |0 w# \
drawline('-');/ J- q5 z+ Y/ S4 O; T0 q
end
- h0 f, J/ l% N' M0 i! w( i% End Helper Functions ------------------------------------------------------# t. g6 s) m- p* ~+ H. x, T8 d
% ~- s* c6 i! v1 }+ D3 g6 T
& o/ @+ U) r; d
|
|