A simple path finding visualization, demostrating A* and Dijkstra's shortest path algorithms. I wrote this project in my first year of university using javafx 11 and had a lot of fun during the process.
When the application starts, a random maze (which you can configure in Constants.java
) is generated. By selecting a starting point and a finishing point you can choose one of the following algorithims to visualize:
- A* with Euclidean distance
- Dijkstra with Priority queues
- clone this repository.
git clone https://github.com/itzloop/AStar.git
- First install Java 11
- Then with
gradlew
script run the following to initialize the project, get the dependencies and run it.
# Initialize the project
$ ./gradlew init
# Build the project
$ ./gradlew build
# Run the project
$ ./gradlew run
- Enjoy
For windows the steps are the same. Only run the gradlew.bat
script instead of gradlew
You can configure following asspects of the project by changing the corresponding value in the Constants.java
file.
- How many obstacles are generated by changing
Constants.ObstacleRatio
. - The size of the maze by changing
Constants.NodeDistance and Constants.Radius
. - Some color options.
- How fast the visualization progresses by changing
Constants.SleepDelay
.