/knights-tour

Java Swing application that demonstrates a heuristic approach to solving the knight's tour problem using Squirrel's algorithm.

Primary LanguageJavaMIT LicenseMIT

Knights Tour

A GUI application built with Java Swing that demonstrates a heuristic approach to solving the knight's tour problem on an 8x8 chessboard. The application offers three modes: auto, guided, and manual, catering to different ways of solving or exploring the problem.

The knight's tour problem involves finding a sequence of moves for a knight on a chessboard such that the knight visits every square exactly once. Squirrel's algorithm provides a heuristic to solve this problem efficiently.

Modes

  • Auto Mode: Automatically solves the knight's tour problem without user intervention.
  • Guided Mode: Guides the user by suggesting which cell to move next to solve the knight's tour.
  • Manual Mode: Allows the user to solve the knight's tour themselves, turning it into a game-like experience.

Features

  • GUI interface built with Java Swing for interactive visualization.
  • Implements Squirrel's algorithm heuristic for solving the knight's tour problem.
  • Board size: 8x8 chessboard.

Technologies Used

  • Java Swing

Setup Instructions

  1. Clone the repository
  2. Open the project in your Java IDE.
  3. Compile and run the application.

Usage

  1. Choose a mode (auto, guided, manual) to solve the knight's tour problem.
  2. Follow the instructions or prompts based on the selected mode.
  3. Visualize the knight's moves on the 8x8 chessboard.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

Contact