Skip to content

fatmazohrasaidi/KnightsTourProblem

Repository files navigation

Knight's Tour Solver

📌 Project Overview

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).

🛠 Features

  • 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.

🚀 How to Run

1-Run the Genetic Algorithm Solver
python Population.py
2-Run the CSP Solver
python 3.knightsTour/main.py

About

TP2 RP: Solving the Knight’s Tour problem using a genetic algorithm

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages