Question

I have a problem in finding the strength of the non dominated solutions using MATLAB for two

objective functions.

Actually, I know its concept and its if condition statement but I could not extract the required

data.

Without going to details and confusion,

I think the following figure explains my problem clearly:

pareto

where the vertical and horizontal black lines are drawn just to know the red points

which are covered by the blue point.

what is done for blue point 1 is also done to other blue points 2 and 3

and that's it

the final output vector should be:

[ 4  4  2 ]

What I have tried is:

clear all
clc
% the non dominated solutions are:
N = [ 1.5   3
  2.5    1.5
  4    0.5 ] ;
% And the dominated solutions are:
D  = [2     4
  2.5    3
  3      1.5
  3      4
  4      1
  4      3 ] ;

n=size(N);
d=size(D);

for i=1:n(1)
for j=1:d(1)
    if N(i,1)<=D(j,1) && N(i,2)<=D(j,2)
 %%%%%%%%%%%%%%%%%%%%%%%%%
 % I have a problem here %
 %%%%%%%%%%%%%%%%%%%%%%%%%        
end
end
end

any help is highly appreciated

Was it helpful?

Solution

clear all
N = [1.5 3; 2.5 1.5; 4 0.5];
D = [2 4; 2.5 3; 3 1.5; 3 4; 4 1; 4 3];
inds = false(size(D,1),size(N,1));
for ii = 1:size(N,1);
    inds(:,ii) = D(:,1) >= N(ii,1) & D(:,2) >= N(ii,2);
end
results = sum(inds);
[d n] = find(inds);
for ii = 1:size(N,1)
    disp(N(ii,:))
    disp([d(n == ii) D(inds(:,ii),:)])
end

results contains what you asked in the very first post

d contains indices of points selected from D matrix, point D(d(i),:) is selected for point N(n(i),:), is it clear enough? :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top