What is Genetic algorithm?
In Turkish: Genetik algoritma · Topic: Math foundations
The best-known kind of evolutionary algorithm, which encodes solutions as strings of numbers called chromosomes and improves them over generations through crossover and mutation.
How does it work?
Each candidate solution is represented as a string, for example the order of stops on a delivery route. The algorithm starts with a population of random strings and scores each one with a fitness function. High scorers are paired, and pieces of two strings are combined to produce offspring, which is called crossover. Some genes are changed at random with a small probability, called mutation, which keeps the population diverse. After a few hundred generations, the population usually approaches a good solution.
Why does it matter?
It is a practical tool for combinatorial optimization problems, where the number of possible solutions is enormous. It is simple to set up and needs little knowledge of the problem's mathematical structure. On the downside, it can get stuck in a local optimum and can be slow because it needs many fitness evaluations.
Example
A cargo company could use a genetic algorithm to solve a variant of the traveling salesman problem and find the shortest route through dozens of delivery points.
FAQ
Does a genetic algorithm guarantee the best solution?
No. Because it involves randomness, each run can give a different result, and it can get stuck in a local optimum. It is usually used to find a good-enough solution in reasonable time rather than the exact best one.
Why is it called genetic?
The method borrows the ideas of genes, chromosomes, crossover and mutation from biology. It does not imitate real biology closely; it adapts the logic of evolution into a search technique.