Comp Sci What is uniform crossover in genetic algorithm crossover operation?

  • Thread starter Thread starter shivajikobardan
  • Start date Start date
  • Tags Tags
    Algorithm Uniform
AI Thread Summary
Uniform crossover in genetic algorithms involves randomly selecting genes from two parent genomes to create offspring, with each gene having an equal probability of being inherited from either parent. The process uses a pseudorandom number generator to determine which parent's gene is selected for each position in the offspring's genome. This method contrasts with single-point and double-point crossover techniques, which select contiguous segments of genes. The pseudocode provided illustrates that for each gene index, a random value is generated to decide the source of the gene for the offspring. Uniform crossover ensures genetic diversity by allowing a more varied combination of parental traits in the offspring.
shivajikobardan
Messages
637
Reaction score
54
Homework Statement
genetic algorithm
Relevant Equations
none
1644313134345.png

https://slidetodoc.com/genetic-algorithms-an-example-genetic-algorithm-procedure-ga/
slide is taken from here. is this done total randomly or is it done pseudorandomly. I mean is there some forumula for randomness used in this case?

i learned about single point and double point crossover but confused in this stuff.
 
Physics news on Phys.org
I don't think there is anything unclear here, but just to confirm the procedure is:

[code title=pseudocode]
for geneIndex in (0, genomeLength - 1):
if (random() < 0.5):
offspring1genome[geneIndex] = parent1genome[geneIndex]
offspring2genome[geneIndex] = parent2genome[geneIndex]
else:
offspring1genome[geneIndex] = parent2genome[geneIndex]
offspring2genome[geneIndex] = parent1genome[geneIndex]
[/code]

where random() is a (p)rng in [0, 1).
 
Back
Top