Genetic algorithm
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.
Evolutionary Deep Learning: Genetic algorithms and neural networks
A genetic algorithm is an evolutionary optimization method that encodes candidate traits as genes and applies selection and recombination to search for solutions.
- How it is used
- Applies evolutionary search to optimization problems, including deep-learning hyperparameters, architectures, weights, and GAN training balance.
- How deep it goes
- Walks through encoding, fitness, selection, crossover, mutation, stopping criteria, Python simulation, DEAP implementations, and structured neural-network genomes.
- Examples
- Uses binary One Max populations, traveling salesperson routes, polygon image rendering, MLP weight search, autoencoders, and DCGANs.
- What you can do after
- Apply it via DEAP to encode candidates, configure operators, evaluate fitness, and evolve solutions for search and deep-learning optimization tasks.
Advanced Algorithms and Data Structures
A genetic algorithm is an evolutionary optimization technique that improves a population of candidate solutions through selection and variation operators inspired by biological reproduction.
- How it is used
- Uses population-based optimization to seek good solutions to knapsack, TSP, and vertex cover problems.
- How deep it goes
- Develops chromosome encoding, initialization, fitness, generation operators, and parameter tuning through pseudocode and problem-specific implementations.
- Examples
- Works through a Mars knapsack, TSP tours, vertex cover fitness, and measured routing results.
- What you can do after
- Build it from scratch for encoded optimization problems, then tune operators and validate solutions against their constraints.
Read how Advanced Algorithms and Data Structures explains genetic algorithm →
Optimization Algorithms: AI techniques for design, planning, and control problems
A genetic algorithm is a stochastic evolutionary optimization algorithm that generates candidate solutions through selection and variation of a population.
- How it is used
- Uses evolving populations to search for high-quality solutions to optimization problems such as ticket pricing and route planning.
- How deep it goes
- Works through representations, fitness, selection, variation, survival, termination, and Python implementations; does not establish a guarantee of optimality.
- Examples
- Uses a binary ticket-pricing implementation and a permutation-based, 20-city traveling-salesman solver.
- What you can do after
- Build it from scratch for binary ticket pricing, or apply it via pymoo to pricing and route optimization.
Classic Computer Science Problems in Swift: Essential techniques for practicing programmers
An evolutionary optimization technique that searches for solutions by iteratively selecting, combining, and mutating candidate representations according to their fitness.
- How it is used
- Searches complex problems when traditional approaches are too slow and a good-enough solution may suffice.
- How deep it goes
- Develops a configurable Swift chromosome interface and generation loop, then tests two fitness functions; emphasizes fundamentals over application-specific tuning.
- Examples
- Works through equation maximization and SEND+MORE=MONEY, then proposes tournament-selection, constraint-satisfaction, and bit-string exercises.
- What you can do after
- Build it from scratch using a reusable Swift genetic algorithm, then define chromosome representations and fitness functions for new problems.
Grokking AI Algorithms, Second Edition
A genetic algorithm is an evolutionary optimization technique that improves candidate solutions through selection, recombination, and mutation.
- How it is used
- Searches large sets of possible solutions for a good answer when checking every combination is costly.
- How deep it goes
- Walks through population creation, fitness scoring, and the overall life cycle; defers alternative encoding, crossover, mutation, and selection techniques.
- Examples
- Uses knapsack item combinations, Python population and fitness snippets, delivery routes, truck packing, and feature selection.
- What you can do after
- Build it from scratch using random candidate generation and fitness scoring, then configure the search for solution quality and computational cost.
Read how Grokking AI Algorithms, Second Edition explains genetic algorithm →
Inside AI
A genetic algorithm is an optimization technique that evolves a population of candidate solutions through evaluation, selection, recombination, and random variation.
- How it is used
- Uses genetic algorithms to search large spaces of possible delivery plans and to optimize parameters in a proposed fraud-prevention system.
- How deep it goes
- Walks through evaluation, selection, crossover, mutation, and stopping conditions without code or formal equations.
- Examples
- Illustrates candidate solutions with delivery routes and resource allocations, then tabulates the number of possible school-bus routes.
- What you can do after
- Evaluate/understand it as a way to search delivery plans or optimize model parameters, with progress judged against chosen measures.
Machine Learning Algorithms in Depth
A genetic algorithm is an evolutionary optimization technique that iteratively evaluates a population of candidate solutions and generates new candidates through selection, crossover, and mutation.
- How it is used
- Uses evolutionary search to optimize a population of candidates against a target.
- How deep it goes
- Works through initialization, fitness, selection, crossover, mutation, and stopping in a from-scratch string implementation.
- Examples
- Evolves random letter sequences toward “Genome” and asks readers to brainstorm further applications.
- What you can do after
- Build it from scratch to evolve strings toward a target using fitness-ranked selection, crossover, and mutation.
Read how Machine Learning Algorithms in Depth explains genetic algorithm →
Related concepts
- crossoveruses · Crossover is an evolutionary recombination technique that combines material from parent candidate solutions to produce one or more offspring.
- Traveling Salesman problemaddresses · The Traveling Salesman problem is a combinatorial optimization problem that seeks a minimum-cost tour visiting each specified location exactly once and returning to the starting location.
- evolutionary computationkind of · Evolutionary computation is a family of search and optimization methods that iteratively improve candidate solutions through variation and selection inspired by biological evolution.
- mutationuses · Mutation is an alteration to an existing value, state, data structure, or representation.
- natural selectionuses · Natural selection is the evolutionary process by which heritable traits affecting survival or reproduction influence which variants become more common in a population.
- optimizationkind of · Optimization is the systematic selection or adjustment of values, actions, or system designs to improve a specified objective, often subject to constraints.
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.






