This project solves the Knight's Tour problem, where a knight moves on a chessboard, visiting each square exactly once. Two different approaches are implemented using Python:
Genetic Algorithm (GA) - An evolutionary approach to finding solutions.
Constraint Satisfaction Problem (CSP) - A logical constraint-based approach (found in the 3.knights_tour folder).
- Genetic Algorithm Approach:
- Uses mutation, crossover, and selection to evolve a valid knight’s tour.
- Implements fitness evaluation to optimize solutions over generations.
- CSP Approach:
- Models the problem as a constraint satisfaction problem.
- Uses constraint propagation and backtracking techniques.
1-Run the Genetic Algorithm Solver
python Population.py
2-Run the CSP Solver
python 3.knightsTour/main.py