Research Article

A Rough Penalty Genetic Algorithm for Multicast Routing in Mobile Ad Hoc Networks

Pseudocode 1

Pseudocode of the crossover operation for routing problem.
user is Number of OD pair;
Node is all nodes in the network;
Parents is the chromosomes which be selected;
nKids is the numbers of chromosomes create by crossover;
r1, r2 is the chromosomes which are crossover;
coeC is the number of gene will be crossover;
thisScore is the multi path score;
thisGeneScore is the path score in the multi path;
xoverPoint is genes in the chromosome which be select to crossover;
lengthXP is length of xoverPoint;
Begin
for i =  1:nKids
 Pick chromosomes r1 and r2 from parents;
 coeC is decrease by generations from 1 to 0.2;
 Randomly select xoverPoint which probability small than coeC;
 if thisScore(r1) thisScore(r2)
  xoverKids(i) = thisPopulation(r1);
  for j = 1 to lengthXP
   if thisGeneScore(r2(j))  <  thisGeneScore(r1(j))
    Record path r1(j) as a;
    Record path r2(j) as b;
    if the route paths in a and b have the same intermediate node  (m)
     Interchange the sub-routes (s,  m) or (m,  d) in a and b;
    else
     xoverKids(i,  j) =  r2(j);
    end if
   end if
  end for
 else
  xoverKids(i) = thisPopulation(r2);
  for j = 1 to lengthXP
   if thisGeneScore(r1(j))  <  thisGeneScore(r2(j))
    Record path r1(j) as b;
    Record path r2(j) as a;
    if the route paths in a and b have the same intermediate node (m)
     Interchange the sub-routes (s,  m) or (m,  d) in a and b;
    else
     xoverKids(i,  j) = r1(j);
    end if
   end if
  end for
 end if
end for
End