Skip to content

A chess knight is placed on an m*n board at a starting spot (r,c). This algorithm finds a route for the knight to move so that it visits every square on the board exactly one time.

Notifications You must be signed in to change notification settings

alstar555/Multithreaded-Knight-s-Tour

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Multithreaded Knight's Tour

In this implementation of the Knight's Tour problem, a chess knight is placed on an m x n chessboard at a specified starting position (r, c). The algorithm will find a valid path for the knight that allows it to visit every square on the board exactly once. Both closed and open tours are acceptable outcomes: a closed tour is when the knight returns to its starting square, while an open tour visits every square without returning to the starting point.

Various techniques exist for solving the Knight's Tour problem. This algorithm uses multithreading to efficiently explore potential paths and optimize the search.

gif

This gif is taken from wikipedia.

Usage

Input:

a.out <m> <n> <r> <c>

Where:

  • m: Number of columns on the board
  • n: Number of rows on the board
  • r: Knight's starting row position
  • c: Knight's starting column position

About

A chess knight is placed on an m*n board at a starting spot (r,c). This algorithm finds a route for the knight to move so that it visits every square on the board exactly one time.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages