Gene
A gene is a discrete unit of encoded information representing a hereditary biological trait or a variable within an evolutionary candidate solution.
Advanced Algorithms and Data Structures
A gene is an individual position in a genetic-algorithm chromosome that represents one optimization variable and its assigned value.
- How it is used
- Encodes one optimization variable within a candidate solution’s chromosome.
- How deep it goes
- Develops binary and permutation encodings with mutation and crossover operations; sketches maximum-flow genes without implementing that algorithm.
- Examples
- Uses knapsack item bits, traveling-salesperson vertex permutations, and maximum-flow edge values.
- What you can do after
- Build it from scratch: choose gene domains and adapt mutation and crossover to preserve encoding constraints.
Read how Advanced Algorithms and Data Structures explains gene →
Evolutionary Deep Learning: Genetic algorithms and neural networks
A gene is a heritable unit of biological information that influences an organism's traits and occupies a position on a chromosome.
- How it is used
- Connects inherited biological traits to the gene-and-chromosome representation used by genetic algorithms.
- How deep it goes
- Defines genes biologically and computationally, then demonstrates representations, but stops short of detailed molecular genetics.
- Examples
- Uses binary NumPy chromosomes and EvoLisa polygon genes containing coordinates, color, and transparency.
- What you can do after
- Apply genes by encoding traits as binary values, numeric arrays, or structured value groups for evolutionary optimization.
Read how Evolutionary Deep Learning: Genetic algorithms and neural networks explains gene →
Classic Computer Science Problems in Swift: Essential techniques for practicing programmers
Gene is a book-specific array-based representation of a nucleotide sequence as an ordered collection of codons.
- How it is used
- Represents nucleotide sequences for codon search and related algorithm exercises.
- How deep it goes
- Defines nucleotides, codons, array conversion, ordering, and searches without developing broader biological semantics.
- Examples
- Uses a nucleotide string, stringToGene(), an ACG codon, and linear or binary containment searches.
- What you can do after
- Build it from scratch as Swift enums, tuples, arrays, and a parser for codon sequences.
Grokking AI Algorithms, Second Edition
A gene is an individual value or position within an evolutionary algorithm chromosome that contributes to the encoded candidate solution.
- How it is used
- Represents one decision or value inside an evolutionary algorithm's encoded candidate solution.
- How deep it goes
- Explains gene structure, encoding, mutation, population creation, and fitness effects, while deferring nonbinary mechanisms to later treatment.
- Examples
- Uses binary Knapsack Problem chromosomes, a nine-gene word-selection exercise, mutation figures, and Python fitness and population code.
- What you can do after
- Build it from scratch by encoding decisions as genes, generating chromosomes, mutating values, and calculating fitness.
Read how Grokking AI Algorithms, Second Edition explains gene →
Optimization Algorithms: AI techniques for design, planning, and control problems
A gene is a segment of genetic material that encodes a specific biological property or functional product.
- How it is used
- Uses genes as building blocks for biological traits and as encoded parameters in genetic-algorithm candidate solutions.
- How deep it goes
- Explains genes through alleles, loci, genotypes, phenotypes, and encoding, stopping short of molecular mechanisms.
- Examples
- Illustrates genes with appetite, movement, feet, and skin traits, then applies them to binary ticket-price chromosomes.
- What you can do after
- Evaluate/understand how biological genes map to genetic-algorithm parameters and chromosomes with suitable encodings.
Related concepts
- chromosomepart of · A chromosome is an encoded representation of a candidate solution in an evolutionary algorithm, composed of genes or other solution components.
- individualpart of · An individual is a single candidate solution represented as a member of an evolutionary algorithm's population and evaluated by its fitness.
- genetic algorithmused by · A genetic algorithm is an evolutionary optimization method that improves a population of candidate solutions through fitness-based selection and variation, often including recombination and mutation.
- codonhas part · A codon is a sequence of three nucleotides that specifies an amino acid.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.




