An open API service indexing awesome lists of open source software.

https://github.com/hattima-tim/knight-travails

A visual representation of the knight's optimal movement.
https://github.com/hattima-tim/knight-travails

algorithms-and-data-structures breadth-first-search chess graph

Last synced: 9 months ago
JSON representation

A visual representation of the knight's optimal movement.

Awesome Lists containing this project

README

          

# knight-travails

This project is a visual representation of a [problem](https://www.theodinproject.com/lessons/javascript-knights-travails) I had to solve as part of [The Odin Project](https://github.com/TheOdinProject). The problem was to write a program that will find the shortest path a knight can take, to move between two positions on a chessboard.

https://user-images.githubusercontent.com/29122213/204795217-092199b9-e27a-41a0-bb32-ba96451cfed9.mp4

See the project live [here](https://hattima-tim.github.io/knight-travails/).

## A bit about the path finding program

The program uses graph data structure and breadth-first-search algorithm for finding the shortest path.

## Challenges

- The first challenge I faced when solving the path finding problem, is the graph data structure. I did not know what it is and how it works. So, I had to learn about this.

- After that, I had to choose between depth-first-search and breadth-first-search for graph traversal. This was the hardest part. After trying to implement both and spending a lot of time, I decided to focus on just breadth-first-search and was able to solve the problem with it.