# Duplicate dominating parents when using Deterministic Crowding in Genetic Algorithm

This is the pseudocode for using deterministic crowding:

for _ in (0, ..., n/2):
p1, p2 = random_individual(), random_individual()
c1 = mutate(crossover(p1, p2))
c2 = mutate(crossover(p2, p1))

if d(p1, c1) + d(p2, c2) < d(p1, c2) + d(p2, c1):

where d is a function that determines the difference between two individuals.
• Is d using the fitness function, i.e., is d(p,q) the same as fitness(p) - fitness(q)? – Pål GD Feb 13 '20 at 10:45
• @PålGD No. d is Hamming Distance. The number of different genes in two individuals. If two individuals have nothing in common, d will be at its maximum. If two individuals have same genes, d will be 0. – Md Narimani Feb 13 '20 at 13:51