I am trying to obtain the pareto optimal front for the two fitness functions. I sorted the undominated solutions by using a dummy matrix that allocated "ones" in the matrix for any undominated solution. When I plot the pareto front it keeps including points that I know are not part of the pareto optimal. However, I cannot seem to find the cause of this problem. Any help would be really appreciated.
for i = 1:1000
f1(i) = x(i,1)^2;
f2(i) = (x(i,1)-2)^2;
end
store = zeros(1000,1);
for i = 1:1000
st = zeros(1000,1);
for j = 1:1000
if i == j
st(j) = 1;
continue; %Skip to next iteration.
end
if f1(i) > f1(j) && f2(i) > f2(j); %Check for "x-dominated"
continue;
else st(j) = 1; %Dummy 1000x1 matrix
end
end
if st == ones(1000,1) %Testing the dummy matrix for dominance
store(i) = x(i);
end
end
pareto = store(store ~= 0);
N = length(pareto);
for k = 1:N
f3(k) = x(k,1)^2;
f4(k) = (x(k,1)-2)^2;
end