Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hoshiyamaseizen/astar-java
A* Algorithm Visualization with Java
https://github.com/hoshiyamaseizen/astar-java
algorithm algorithms-and-data-structures astar-algorithm fxml gui java javafx maven
Last synced: 5 days ago
JSON representation
A* Algorithm Visualization with Java
- Host: GitHub
- URL: https://github.com/hoshiyamaseizen/astar-java
- Owner: HoshiyamaSeizen
- Created: 2022-06-26T12:40:55.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-07-12T08:05:07.000Z (over 2 years ago)
- Last Synced: 2024-05-11T18:35:26.471Z (6 months ago)
- Topics: algorithm, algorithms-and-data-structures, astar-algorithm, fxml, gui, java, javafx, maven
- Language: Java
- Homepage:
- Size: 5.53 MB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
A* Algorithm in Java with GUI
What does the app do?
The user enters a *weighted directed graph*. The application runs the A* algorithm, visually displays the process of the algorithm *step by step*, finds *the shortest path* from vertex A to vertex B and outputs *its length*.
Installation and launch
Make sure you have JDK (version 17+) and Maven (version 3.3+) installed and configured. Then go to the project folder and type the following to create a modular runtime image:
mvn clean javafx:jlink
It will create a folder with the application which you can launch:
Windows:
.\target\AStar\bin\AStar.bat
(cmd)
./target/AStar/bin/AStar.bat
(PowerShell)Linux:
./target/AStar/bin/AStar
If instead you just want to build and run the project:
mvn clean javafx:run
Running tests
After building the project enter the command:
mvn clean tests
Input data
Output data
App's features
User's Guide
Do you need to find the shortest path in a graph from vertex A to vertex B?
Then, **define the graph** in one of two ways:
a) By *clicking on the window*, choosing the necessary actions: create a vertex, connect vertices, delete a vertex.
b) *Import the graph from a text file* that should contain the following information about the graph:
~ number of vertices in the graph
~ coordinates of the vertices
~ adjacency matrix of graph with weights
Next, **choose the heuristic** to be used in the A* algorithm:
a) *Chebyshev distance*
b) *Manhattan Metric*
c) *Euclidean distance*
**Press the "Run"** button to run the algorithm.
**Select the start and end vertex** of the path.
The algorithm is running.
You can pause the process of the algorithm and proceed to the next step of the algorithm.
As a result, you will get the shortest path from A to B and the length of this path.
You can also output the resulting graph along with the results to a text file.
Possible problems
If you have problems with building the project, the issue may be as follows:
- Wrong JDK version (should be at least JDK 17)
- Wrong Maven version (should be at least Maven 3.3)
- Maven not properly configured (`\maven\bin\` path should be added to `PATH` environment variable, and `JAVA_HOME` variable should be set to the `\jdk` path of the suitable JDK version)