Home▸AI & Machine Learning▸Artificial Intelligence Genetic Algorithms Simulation

🧪 Artificial Intelligence Genetic Algorithms Simulation

Watch a genetic algorithm evolve a population of binary chromosomes to solve the 0/1 knapsack problem live: tournament selection, single-point crossover, bit-flip mutation and elitism, visualized generation by generation in 3D.

AI & Machine Learning2DModerate60 FPS📱 Mobile-adapted
artificial-intelligence-genetic-algorithms-simulation ↗ Open standalone

This simulation illustrates the core mechanics of genetic algorithms by solving a classic combinatorial optimization problem: the 0/1 knapsack. A population of binary chromosomes — each one a candidate packing of items into a limited-capacity knapsack — evolves generation after generation through tournament selection, single-point crossover, bit-flip mutation and elitism. Every individual is rendered live as a row of 3D cubes, sorted from best to worst, so you can watch the population converge from random noise toward a high-value, capacity-respecting solution in real time. Population size, mutation rate, crossover rate and playback speed are all adjustable, with generation count, best fitness, average fitness and best weight tracked live.

⚙ Under the hood

This simulation illustrates the core mechanics of genetic algorithms. Users can observe how simulated populations evolve and adapt to a problem through selection, crossover, and mutation.

Genetic AlgorithmsAIEvolution

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)