Skip to content
← All projects

8-Queens

December 2023

8-Queens

Problem

Place eight queens on a chessboard so that no two queens attack each other. Instead of brute-force search, this project solves it with evolutionary computation.

Approach

A genetic algorithm evolves a population of candidate boards:

  • Fitness counts the number of non-attacking queen pairs.
  • Crossover combines two parent boards into offspring.
  • Mutation randomly moves a queen to keep the population diverse.
  • Selection keeps the fittest boards for the next generation, until a conflict-free arrangement emerges.

Tech Stack

  • Python