%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % MIDACO solves Multi-Objective Mixed-Integer Non-Linear Problems: % % % Minimize F_1(X),... F_O(X) where X(1,...N-NI) is CONTINUOUS % and X(N-NI+1,...N) is DISCRETE % % subject to G_j(X) = 0 (j=1,...ME) equality constraints % G_j(X) >= 0 (j=ME+1,...M) inequality constraints % % and bounds XL <= X <= XU % % % The problem statement of this example is given below. You can use % this example as template to run your own problem. To do so: Replace % the objective functions 'F' (and in case the constraints 'G') given % here with your own problem and follow the below instruction steps. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function autocorr_bern55 key = '************************************************************'; problem.func = @problem_function; problem.o = 1; % Number of objectives problem.n = 55; % Number of variables (in total) problem.ni = 55; % Number of integer variables (0 <= ni <= n) problem.m = 0; % Number of constraints (in total) problem.me = 0; % Number of equality constraints (0 <= me <= m) problem.xl = [0 0 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0]; problem.xu = [1 1 1 1 1 1 1 1 1 1 1 1 ... 1 1 1 1 1 1 1 1 1 1 1 1 ... 1 1 1 1 1 1 1 1 1 1 1 1 ... 1 1 1 1 1 1 1 1 1 1 1 1 ... 1 1 1 1 1 1 1]; problem.x = problem.xl; % Starting point: lower bounds option.maxeval = 2000000; option.maxtime = 60*60*24; option.printeval = 1000; option.save2file = 1; option.resumable = 0; option.param( 1) = 0; % ACCURACY option.param( 2) = 0; % SEED option.param( 3) = -242144 + 0.5; % FSTOP option.param( 4) = 0; % ALGOSTOP option.param( 5) = 0; % EVALSTOP option.param( 6) = 0; % FOCUS option.param( 7) = 0; % ANTS option.param( 8) = 0; % KERNEL option.param( 9) = 0; % ORACLE option.param(10) = 0; % PARETOMAX option.param(11) = 0; % EPSILON option.param(12) = 0; % BALANCE option.param(13) = 0; % CHARACTER option.param(14) = 0; % SURROGATE option.param(15) = 0; % PMISQP option.parallel = 0; % Serial: 0 or 1, Parallel: 2,3,4,5,6,7,8... option.paradigm = 0; % Parallel mode: 0 = parfor, 1 = vectorized [F,G] = func(X) [ solution ] = midaco( problem, option, key ); end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function [ f, g ] = problem_function( x ) % Spins s(i) = 1 - 2*x(i) are +1 or -1. The energy of Liers et al. sums % the four-spin products s(a)*s(a+L1)*s(a+L2)*s(a+L1+L2) with the % weights of the published MINLPLib polynomial (threshold T = 20 for % n = 55); the -1 / -NS terms remove its constant part. n = 55; T = 20; s = 1 - 2*x(:)'; f(1) = 0; for L1 = 1:n-1 sp = s(1:n-L1) .* s(1+L1:n); % pair products s(a)*s(a+L1) for L2 = L1:n-1 S = L1 + L2; if S >= n, break; end NS = n - S; q = sp(1:NS) .* sp(1+L2:NS+L2); % four-spin products if L1 == L2 f(1) = f(1) + 2*(sum(q) - NS); elseif S <= T f(1) = f(1) + 4*(sum(q) - NS); else a = 1:NS; f(1) = f(1) + sum(4*min(a, NS+1-a) .* (q - 1)); end end end g = []; end