Home > Mateda2.0 > ordering > Pareto_ordering.m

# Pareto_ordering

## PURPOSE

[Index]=Pareto_ordering(Pop,FunVal)

## SYNOPSIS

function[Index]=Pareto_ordering(Pop,FunVal)

## DESCRIPTION

     [Index]=Pareto_ordering(Pop,FunVal)
     Pareto_ordering:            Individuals are ordered according according to the front they belong to. Individuals in
                                 the first front (non-dominated solutions) come first. Then individuals that are only
                                 dominated by those in the first front and so on. There is no ordering criteria for
                                 individuals in the same front (see ParetoRank_ordering for more refined order.
     INPUTS
     Pop:                 Population
     FunVal:              A matrix of function evaluations, one vector of m objectives for each individual
     OUTPUTS
     Index: Ordered index of the individuals in the population

     Last version 8/26/2008. Roberto Santana (roberto.santana@ehu.es)

## CROSS-REFERENCE INFORMATION

This function calls:

This function is called by:

## SOURCE CODE

    0001 function[Index]=Pareto_ordering(Pop,FunVal)
    0002 % [Index]=Pareto_ordering(Pop,FunVal)
    0003 % Pareto_ordering:            Individuals are ordered according according to the front they belong to. Individuals in
    0004 %                             the first front (non-dominated solutions) come first. Then individuals that are only
    0005 %                             dominated by those in the first front and so on. There is no ordering criteria for
    0006 %                             individuals in the same front (see ParetoRank_ordering for more refined order.
    0007 % INPUTS
    0008 % Pop:                 Population
    0009 % FunVal:              A matrix of function evaluations, one vector of m objectives for each individual
    0010 % OUTPUTS
    0011 % Index: Ordered index of the individuals in the population
    0012 %
    0013 % Last version 8/26/2008. Roberto Santana (roberto.santana@ehu.es)
    0014
    0015 PopSize = size(Pop,1);
    0016    number_objectives = size(FunVal,2);
    0017    Ind = [1:PopSize];
    0018    nfronts = 0;
    0019
    0020
    0021    while ~isempty(Ind)
    0022    last = size(Ind,2)
    0023    DomPop = zeros(1,last);
    0024    for i=1:last-1
    0025     for j=i+1:last
    0026       if(sum(FunVal(Ind(i),:)>=FunVal(Ind(j),:))==number_objectives)
    0027         DomPop(j) = DomPop(j) + 1;
    0028       elseif(sum(FunVal(Ind(j),:)>=FunVal(Ind(i),:))==number_objectives)
    0029         DomPop(i) = DomPop(i) + 1;
    0030       end,
    0031     end
    0032    end
    0033    NonDom = Ind(find(DomPop==0));
    0034    nfronts = nfronts + 1;
    0035    Front{nfronts} = NonDom;
    0036    Ind = setdiff(Ind,NonDom);
    0037   end,
    0038
    0039
    0040
    0041   Index = [];
    0042   for i=1:nfronts
    0043    Index = [Index,Front{i}];
    0044   end
    0045
    0046  return
    0047
    0048
    0049
    0050