|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
; \5 M0 u" H/ m2 B合作协同进化已经引入协同进化算法,目的是通过分而治之的范式解决日益复杂的优化问题。理论上,协同改 变子成分的想法是十分适合解决大规模优化问题的。然而在实践中,没有关于问题的先验知识, 问题应如何分解是尚不清楚的。在本文中,我们提出一个自动分解策略,称为差分分组,可以揭示决策变量的底层交互结构和形成子成分,以使它们之间的相互依存关系保持到最低限度。我们在数学上展示这样一个分解策略如何从部分可分性的定义中产生。实证研究表明,这样的近最优的分解可以大大提高大规模的全局优化问题的解决方案的质量。最后,我们展示了这样一个自动分解是如何产生对多样的子成分的分布的更好的近似,导致一个对多样的子成分的计算预算的更高效的分配。
" v/ D. ]9 f/ u: Z z; M2 g0 E* q, }6 j3 h) ^. @9 q1 X" y3 t( X
索引词:合作协同进化,大规模优化,问题分解,不可分性,数值优化 % Z7 p. r: `) Z6 e# H, h- o
8 ?) ^% h- u7 z$ y2 _3 s
: P, N6 ]- w: U' I
run.m
# |* ?8 G( H, ] g* M7 T0 |# G/ O9 c0 u f% C
% Author: Mohammad Nabi Omidvar
7 ~5 p6 [5 ]4 W+ q7 Y1 S/ c3 F% email address: mn.omidvar AT gmail.com6 j: |1 J `+ D- X# P
%" O0 i( u% m- H% Z' i% n
% ------------
: _" r; m# l, u3 d4 C7 b+ g( n% Description:
8 s' p1 b' A$ ]' F* w1 [ s% ------------' U) r+ n7 S P$ E
% This files is the entry point for running the differential gropuing algorithm.. ?& D6 D! v* p+ Y- ] |
8 J' ?0 v* {2 H5 V; s# h
clear all;, W& C6 @- J( ]2 k# D9 i- f
2 x) q. Q1 A# [: b# i3 v% Specify the functions that you want the differential grouping algorithm to
- @) n- U7 r" a; M- S/ B$ l3 V% identify its underlying grouping structure.
) l b0 C1 Y) L+ r8 }& n$ {func = [20:-1:1];
) c5 t4 K1 G5 v3 \: K5 sfor i=func1 }8 r B }. ]) Q! A
func_num = i2 o* N& k A" Q0 a2 d$ I
+ {% [$ C F8 u4 J% l/ R: a: M! Z. m
t1 = [1 4 7 8 9 12 13 14 17 18 19 20];4 u6 \$ ?9 V# n( X" o+ G! D( N' s
t2 = [2 5 10 15];
- H/ U7 g' b6 ^: H' y t3 = [3 6 11 16];8 z) |6 i! D3 ]" n y) q1 R0 j! y4 |
# V: x: H& }4 @
if (ismember(func_num, t1))
; _. { _7 f: \5 o. l9 h lb = -100;2 Z8 J! C% j4 l# z6 [- h4 y3 M5 m" m. H
ub = 100;; W f3 I* R, _2 y4 u5 v
elseif (ismember(func_num, t2)): r7 Z: h2 X7 O7 w
lb = -5;
% @3 H$ V& J5 G2 _1 {9 @ ub = 5;0 _8 X& p' d0 e- R
elseif (ismember(func_num, t3))
3 t1 y8 G. `+ c$ v2 ^% X lb = -32;/ w% ~% v k d4 C/ q2 g: ], H
ub = 32;
; i7 U4 O# S+ Q end5 X; ?" d4 A: l! p! l- X
* N! E6 K$ i- F8 N( i" ~+ u/ m! g opts.lbound = lb;
1 m k& N5 D0 o3 U! | opts.ubound = ub;3 K* f4 U/ ~3 I, `, V9 ~ O
opts.dim = 1000;& _2 u! a6 J0 t8 ]/ M
opts.epsilon = 1e-3;
$ i: v4 T6 Y9 G/ U& J8 O+ |/ F' q9 Q0 K1 U# b" Q2 r
addpath('cec2010');
: L9 [9 m" L" {& ? addpath('cec2010/datafiles');2 m0 j2 x) E% Z1 {% V( \* F- i
global initial_flag;
r0 a/ V1 A5 T0 ? initial_flag = 0;' M3 G+ V3 A0 ]+ Z! o
3 a- Y$ P' A5 b; H% l8 q' L
[seps, nonseps, FEs] = dg('benchmark_func', func_num, opts);
4 j' }& j; S# H+ q* c4 k. h! w/ d
4 E4 t8 o; A& W! Z" M % filename = sprintf('./results/F%02d.mat', func_num);
: ~! y! f0 I$ U3 ]/ E) K, H % save (filename, 'seps', 'nonseps', 'FEs', '-v7');
1 [$ }: o, h( r( F) A j9 s! U2 \end- _3 M$ z; b8 h5 h8 d- o. O, S2 r
6 |! Y& J! _4 K6 I6 }
# d. v5 @) z. L( j, ~' }5 s0 S+ @dg.m . [8 i1 r! O& E @9 v* G) t
8 B* o9 M/ H5 [3 j0 h% C% Author: Mohammad Nabi Omidvar
! b3 q2 ^2 v, u4 C& B( N3 W5 P% u% email : mn.omidvar AT gmail.com
& |# J( w5 h+ t%: f5 H% y. r k% X `+ e2 [, y7 ?
% ------------
% J j% x8 Z3 b+ Y4 H q% Description:# ?" f+ W6 Y0 v
% ------------
* v3 {; W8 c+ |0 M% dg - This function runs the differential grouping
d* a0 C9 }5 X5 f; ~5 `( x% procedure to identify the non-separable groups9 x! R$ d, j# t& V; S- h
% in cec'2010 benchmark problems.o
2 W e: s8 @2 {& v0 |) N2 D) Q%
( a( P) \" t' s8 o1 M& m% -------8 ~4 a& e7 S. W) d
% Inputs:/ F6 D- k' w$ S3 k$ O ]0 g
% -------
0 ` G! N: o5 ^% fun : the function suite for which the interaction structure % ^+ N' {4 d1 `$ _
% is going to be identified in this case benchmark_func
! ?7 R- K" ^# c1 i3 A m% of cec'2010.
4 v4 ~5 K* M2 c# f& \# l" w# @%
4 L8 {8 }" S+ P. |% i4 V% fun_number : the function number., Y5 ]' B# g4 h" ?
%/ H- M9 O1 Y4 J. [
% options : this variable contains the options such as problem6 h5 c5 f9 n3 g) f) X* ?2 u$ I: Z; C
% dimensionality, upper and lower bounds and the parameter
1 g% N7 Z+ @' l' P% epsilon used by differential grouping.
7 V% @" g6 ^/ K4 _0 G. A" K, V% input3 - Description/ r+ L* E( W' m% e4 ^: T) H% J" M. L
%# i; C7 m: s% @6 K% I$ C8 |2 X
% --------1 |4 j+ B; v3 M* c& l' R; N, [
% Outputs:
! W0 p+ y( T" }6 x- K' v% --------
) L7 ?/ i j% V' p% sep : a vector of all separable variables.) h# K9 r& }3 f" A* q# o* Z
% allgroups: a cell array containing all non-separable groups.2 k \6 r% J$ ?
% FEs : the total number of fitness evaluations used.: p9 R4 `3 y- o# ~0 e
%5 Y8 j+ ^9 ~0 h' a( H2 e% `4 \% { H
% --------
; M, i; p* i# f7 _% License:
/ Y: q3 l! A6 T" e% --------/ R* P+ W( T9 D5 ~2 V. L- P
% This program is to be used under the terms of the GNU General Public License + J8 x% [4 |1 r n; d* c2 U
% (http://www.gnu.org/copyleft/gpl.html). t f0 H8 u1 M& K! `# N( v! }5 l& X4 Z, d
% Author: Mohammad Nabi Omidvar
$ c$ d' x0 ]- h" W' y) y; p4 O+ N% e-mail: mn.omidvar AT gmail.com
3 w! i* V4 U5 q- K: Q% Copyright notice: (c) 2013 Mohammad Nabi Omidvar
- ^% e, [1 } Z* ^+ Q; H8 @ ?! R! q$ l8 e) `2 o' d
# c |5 x: H" ~0 S% G" o1 H# J4 yfunction [seps, allgroups, FEs] = dg(fun, fun_number, options);/ _4 C/ J- L4 O: p/ o
ub = options.ubound;0 o2 P5 s+ i% c [1 {
lb = options.lbound;
9 [# x% P, o$ m& X; f dim = options.dim;/ s% h) m: v' P& x
epsilon = options.epsilon;
5 x4 f; m1 i+ ?) k6 W8 l& H$ l r = ub - lb;
* y5 l+ q2 T/ ~1 P dims = [1:1:dim];& Y: v: ?# |* y% b. H
seps = [];$ }; y' w' B# m- Y- W* Y
allgroups = {};4 v: c0 z( ~' _
FEs = 0;
0 E7 U; @+ E* ~" G! O
$ ~9 U- [" j- W while (length(dims) >= 1)2 i# f: P5 B: V$ Q$ G
allgroups;2 c7 ?0 @ G f* o) \1 n% n: r
n = length(dims)
- E: E' u$ O( `/ E group = [dims(1)];
/ M& Z3 E/ P8 Y: R1 s# t; o6 |1 X group_ind = [1];& B: L8 z: ~9 `0 i$ g6 c* h+ k
" P8 h( J( D# J" [, u
p1 = lb * ones(1,dim);
; i. d' B3 P/ l8 w2 m. L$ S p2 = p1;
0 f& n( _& m' b4 K p2(dims(1)) = ub;
$ h: Z+ V8 @) C' d: x) p2 o6 b. r$ N$ A+ f4 n
delta1 = feval(fun, p1, fun_number) - feval(fun, p2, fun_number);
9 ~/ m. t0 q7 E/ Q% b8 c) c/ r( p1 `9 n
FEs = FEs + 2;' @: s6 L1 M+ W1 F, |6 {6 M* d
E [+ M x I8 a, P! b for i=2:n
- I3 B9 b6 _8 a4 I# k: {6 ?0 U4 b p3 = p1;
+ T1 }; r/ g8 ]2 Y p4 = p2;. P! v9 O; b0 H+ @' [
# u+ a- B- N6 q9 j" f7 i* n
temp = 0;) @9 y$ ~' j. k" ^
p3(dims(i)) = temp;+ [; W' L; q* l
p4(dims(i)) = temp;9 X3 a" K4 |/ l' b6 C4 u( M' @
9 I; {) r+ C! F X6 { s0 J4 ?
delta2 = feval(fun, p3, fun_number) - feval(fun, p4, fun_number);
, s/ ~, H5 A: M& j' b! `( c
5 K& d2 o/ {: q FEs = FEs + 2;
9 ]9 V9 z: ]3 D5 I& u: y7 q3 N
- U& ~( p% F3 R6 F5 S. r6 ~. W+ V& d) h if(abs(delta1-delta2) > epsilon)
: j; J! q4 y( _0 o' K. f+ ` group = [group ; dims(i)];
, ?3 w. D7 I9 J& E% n group_ind = [group_ind ; i];% A6 C, M. ?7 b+ [, f
end) h5 I8 P" T, j. U: b
end6 ~ p+ ]' g5 w* `
9 \3 l9 j; W$ N! L if(length(group) == 1)7 M ^/ Q) A. C2 A& Q
seps = [seps ; group];
8 p; |: e: O6 O0 M( X9 E! J, W else
7 P& U! s$ G. D' h6 v$ Y! e allgroups = {allgroups{1:end}, group};7 x D! N/ h O1 ?* C4 d3 Z# f" f1 u
end
' f$ z0 Z/ S0 K9 {. {- z
8 z2 J3 j# H: O! \ j$ h1 k { if(length(dims) > 0), I* X/ v& c+ P
dims(group_ind) = [];3 o; r5 a! V1 ^" a* Y
end6 y4 L. o9 P D5 @% R' ?! J0 W+ T
end
6 H2 @4 j5 v6 d. H9 I6 e+ [end
- W9 o8 x3 U; r! Q; p( E- o
; h- } A6 D' E; B+ Z7 [
5 Z' o3 s: l: Lanalyze.m4 |. ~: v! K3 C; U5 ^: V/ I, I
6 V, C; X0 I5 {* Y
% Author: Mohammad Nabi Omidvar+ w% E& w2 |1 G4 \ e
% email address: mn.omidvar AT gmail.com/ k& N- a: U1 Z
%3 ~( h' M5 g+ x# `
% ------------; R' a: b& J. y# ^3 D$ D1 ]
% Description:# f3 W( V. |# v' r5 v0 Y6 h
% ------------
7 A# s z' l$ O; v8 b G% This file is used to analyze the peRFormance of the differential a" |' z9 y$ @- N% A4 q0 R. D# A$ k
% grouping algorithm on CEC'2010 benchmark problems.
/ y1 |$ u- d6 l1 c# X3 ~% This program reads the data files generated by differential
3 Y8 i3 s, Y$ w2 d: _% grouping and shows how many variables from each formed group
' G9 s$ U; h, O: @: b$ n% are correctly identified and to which permutation group they
4 f! C# a% x/ I3 {1 w! q9 f8 d% belong.. v# V( U I2 ^. y4 s1 E* O
%9 B4 `6 R* g; V) C7 B( Y1 g' [
%--------
, M' T1 A+ S1 U9 Z% Inputs:! M- Q" l, z0 q+ T
%--------
: s% M3 _* U8 H4 W; k% funs: a vector containing the functions ids the functions that you r- ?7 ^$ X, ?
% want to analyze.5 u) A) i& v1 K! t Y$ k" d
%
( B! {3 y' _7 I9 [1 h, D6 l* Q% ----------- I2 m2 c" B, R
% References:/ w+ `0 Y9 i: R: N: h5 } ~" @
% -----------! f" c' X0 ~+ w: x8 @
% Omidvar, M.N.; Li, X.; Mei, Y.; Yao, X., "Cooperative Co-evolution with
?! {) P) {7 E9 O, @5 D9 a% Differential Grouping for Large Scale Optimization," Evolutionary Computation,
; E8 p( C) E' l4 }; u% IEEE Transactions on, vol.PP, no.99, pp.1,1, 0. y7 \+ ]3 K4 a- O* [
% http://dx.doi.org/10.1109/TEVC.2013.2281543
I; k+ V d/ @+ V+ Y%
' _1 X8 N! r" `* G k* C7 X% --------. i) O& j# F" s- ?5 m8 G
% License:
$ z: V; Q: r8 N% --------- l( m/ I4 [$ x$ H J0 E9 }, |$ |
% This program is to be used under the terms of the GNU General Public License $ \6 u3 _1 A% r: I+ k
% (http://www.gnu.org/copyleft/gpl.html)., V5 W2 R, e: D+ p1 E
% Author: Mohammad Nabi Omidvar
1 Q5 P5 \' E) T5 o3 h5 H% e-mail: mn.omidvar AT gmail.com) d1 b" w; n- e
% Copyright notice: (c) 2013 Mohammad Nabi Omidvar m! E& P% Q5 \, s$ `
8 V* h8 H7 @( q; Z) E1 |4 k
( Y; E, f% i! g9 nfunction analyze(funcs): s$ I7 u) R! S% ^7 k
more off;" B( M$ e3 J3 L [( s9 ^, i
4 d: u0 V: i" a- D( @+ c9 y! d
% Number of non-separable groups for each function in CEC'210 benchmark suite.
4 j6 Q) `, d& h, F& N: _ numNonSep = [0 0 0 1 1 1 1 1 10 10 10 10 10 20 20 20 20 20 20 20];* g a1 W* {% e
4 [# E- ]9 G0 b- V! I- |! `
for f=funcs
2 b; V j( z7 O: t; J" C filename = sprintf('./results/F%02d.mat', f);( q* Y' H( u+ a2 J' I4 ?
p = 1:1:1000;
9 r) ~9 h8 ]: F9 h$ @ load(filename);% t) d9 e2 k, x( |! h
, X' j" u0 C+ u( w5 B2 T
mat = zeros(length(nonseps), 20);
. q+ `( H! B% u, Q+ c/ m drawline('=');
4 C3 ]0 w/ ?/ C: k' ` fprintf('Function F: %02d\n', f);
! X. U5 d$ N3 O8 v fprintf('FEs used: %d\n', FEs);
& M$ e+ U( Z: ]. Q fprintf('Number of separables variables: %d\n', length (seps));* I( R9 `+ I7 S; P! V, x. L' N
fprintf('Number of non-separables groups: %d\n', length (nonseps));
! b7 `# s; D8 c+ `& U( z- \, P" z
5 u- ]8 c4 W% T o5 N filename1 = sprintf('./cec2010/datafiles/f%02d_op.mat', f);: @: i7 z4 C! { f! [- l- D/ ^
filename2 = sprintf('./cec2010/datafiles/f%02d_opm.mat', f);+ ^7 H7 s- ~, _8 u
flag = false;
4 y( A8 e: d6 ~ if(exist(filename1))
: O. I W& G- E. B1 {3 P5 H. F2 V load(filename1);6 P I7 n4 n U7 r" N; J# a# J
flag = true;3 x2 \& j# s% P
elseif(exist(filename2))
. ?* S' N4 t- L6 ^2 ~8 Y1 ^ load(filename2);
% I! `7 |3 P( j: [+ ?. g+ p% E flag = true;
I) _, U2 o4 D% o end
/ Y' H! W. ^7 c2 @' Y; D% y
& ~; B+ [/ R+ @3 C0 D printheader();& f/ z* z& a2 ^! I3 v1 O- b. c' X8 d
+ a& Z# d( m: }- c* ^2 L for i=[1:1:length(nonseps)]
8 D$ [0 D8 a" l6 L/ ] fprintf('Size of G%02d: %3d | ', i, length (nonseps{i}));
# F0 e7 e) U- ? m = 50;
8 W9 x5 t; O2 o7 K' q9 } if(flag)
# J' \% l' Y2 T5 \9 T3 J ? for g=[1:1:20]
3 ?3 x- n. Z% @4 X; l2 L captured = length(intersect(p((g-1)*m+1:g*m), nonseps{i}));
! c, U. ?4 H* a+ f+ i fprintf(' %4d', captured);, T+ E4 ]8 ^, [5 x! w
mat(i, g) = captured;! a" [4 N# Z5 a4 }, y' [. |
end
/ S }/ C# P! J: a, _/ R% M end
" q8 n' c; |* K. w4 v. u: v fprintf('\n');
/ X& z, I( U! d- i end6 M1 d3 y# z4 z9 }$ |- f8 ^, e
6 Q# ]0 X2 K9 D1 d$ x5 p mat2 = mat; f, M" j# o% x% T& Q6 U# n+ [- J
[temp I] = max(mat, [], 1);
? Z1 |5 r% V1 j [sorted II] = sort(temp, 'descend');
! P' O+ h u! ]" ~ masks = zeros(size(mat));5 k8 c& a+ S2 q |! Z
for k = 1:min(size(mat))+ T$ _; o9 I O" U: ?
mask = zeros(1, length(sorted));
% T) q" P9 f( E3 E mask(II(k)) = 1;- q Z# V- ~, T+ J# W) I: P
masks(I(II(k)), :) = mask;
7 o* _* i$ ~. H+ g+ Y %point = [I(k) II(k)];8 Q$ E' X7 z4 D( R; N, g
mat(I(II(k)), :) = mat(I(II(k)), :) .* mask;
% C. E( s: {! s [temp I] = max(mat, [], 1);1 O& ?* p7 E8 l3 F7 S
[sorted II] = sort(temp, 'descend');% J+ }- s, ^( H% G; g9 H
end& r B- h% A, Z
mat = mat2 .* masks;* c* p! \" O! D; |9 `
[temp I] = max(mat, [], 1);
% ]$ w" @5 W2 v7 p- x, g if(ismember(f, [19 20]))
& |! D4 y7 \6 f* `# q. | | gsizes = cellfun('length', nonseps);+ {$ _; o5 r, H9 v5 l
fprintf('Number of non-separable variables correctly grouped: %d\n', max(gsizes));/ y8 R9 ~% J6 C# r/ T7 x
else5 \2 K/ b1 a; c& I
fprintf('Number of non-separable variables correctly grouped: %d\n', sum(temp(1:numNonSep(f))));
! x. Y5 b( M6 g end
; j' [: _+ G: T+ l1 _4 r% p: w drawline('=');
, @9 V. ?: l& p, w+ w pause;
2 P' P% X$ k$ J3 [8 T0 p/ Rend
0 R* H& Y1 ]* ~
) s/ l" a1 Q0 C- u/ ~0 Fend
/ W7 ~. t8 D. ~/ Z) d8 Z% Helper Functions ----------------------------------------------------------
, b' Q+ M. s* o" y5 h+ F2 c/ Nfunction drawline(c)% B; E) d! W+ ~
for i=1:121
7 [# Y8 C, f& d2 H3 L fprintf(1,c);
6 ]) ?! M$ g+ @5 r$ J5 z" n# M' V3 ` end
) p% P2 N) s4 \9 N9 I4 Q fprintf('\n')
3 u' F; j' B. h3 n4 c8 Gend
% W# S7 i E; W/ v4 _: s8 ^/ Q0 w- c$ B2 ~: H7 [
function printheader()' S7 y1 C: J3 O5 M. l8 r, d
fprintf('Permutation Groups| ');0 O) Y0 {0 r+ \. U
for i=1:20
' r) q. w2 ?, N3 Z: |" y. L {3 V fprintf(' %4s', sprintf('P%d', i));
! e' R$ H7 L& F4 [9 _8 C% p5 R$ n end
( A' B0 R0 V! h' ^ fprintf('\n'): o+ g0 ]! N$ \4 }" U% [! e
drawline('-');. M! `3 p C$ g
end+ `+ J( z$ M- G% k* ?+ [
% End Helper Functions ------------------------------------------------------- i' n7 j; Y$ j9 E$ ~
! j% w6 p% N$ T( I9 b' O! `2 p4 B" Q T4 V+ v9 S
|
|