Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/obadakhalili/the-knights-tour
đ´ A visualization of Warnsdorffâs Algorithm for the Knights Tour problem
https://github.com/obadakhalili/the-knights-tour
algo algorithm javascript knights-tour visualization warnsdorff-algorithm
Last synced: 27 days ago
JSON representation
đ´ A visualization of Warnsdorffâs Algorithm for the Knights Tour problem
- Host: GitHub
- URL: https://github.com/obadakhalili/the-knights-tour
- Owner: obadakhalili
- Created: 2020-08-22T06:22:06.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-11-12T14:42:51.000Z (about 4 years ago)
- Last Synced: 2024-11-11T22:44:02.369Z (3 months ago)
- Topics: algo, algorithm, javascript, knights-tour, visualization, warnsdorff-algorithm
- Language: Vue
- Homepage: https://knightstour-visualizer.netlify.app/
- Size: 225 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Winner of an honorable mention of the [Algoexprt SWE Contest](https://www.algoexpert.io/swe-project-contests/2020-summer).
# The Knight's Tour Problem
According to Wikipedia
>A **knight's tour** is a sequence of moves of a knight on a chessboard such that the knight visits every square exactly once. If the knight ends on a square that is one knight's move from the beginning square (so that it could tour the board again immediately, following the same path), the tour is closed; otherwise, it is openAccording to me
> It's one of those problems that bring you hair-pulling disorder if you tried to solve it on your own instead of assigning computers to solve it# Warnsdorffâs Rule
Is a simple heuristic technique for solving the Knights Tour problem. And its the used technique in this visualization.It consists of two steps:
1. Find the list of unvisited legal knight moves from the surrounding squares.
2. Choose the one with the lowest accessibility.Accessibility
: The accessibility of square is the number of squares accessible from x.# The Fun Facts
* On an 8 x 8 board, it has been proven that there are 26,534,728,821,064 closed-path tours!
* The number of open path tours is unknown until this day of age!
* And above all, despite all these absurd numbers of tours, non can produce a [magic square]([https://en.wikipedia.org/wiki/Magic_square](https://en.wikipedia.org/wiki/Magic_square)), only [semi-magic squares]([https://en.wikipedia.org/wiki/Magic_square#Additive-multiplicative_magic_and_semimagic_squares](https://en.wikipedia.org/wiki/Magic_square#Additive-multiplicative_magic_and_semimagic_squares))!