Simple Example of AStar Search & Dijkstra Algorithm Implementation
An application that finds the shortest path given a maze, a start point and a goal.
It uses two different algorithmic flavours Dijkstra and AStar Search.You can use one of the mazes provided in test_data folder. Or try making one yourself.
Note: If invalid filename is given the application exits.
Acceptable maze format:
n_rows = your number of rowsn_cols = your number of cols0, O1, X2, X3, O...On the left column is the zero-based numbering of cells and should start from the bottom left corner of your maze and continue upwards.
Whereas on the right the blocked flag. Use
Ofor openXfor closed.See example below to understand how cell numbering is supposed to be.
6 7 8 3 4 5 0 1 2
Dijkstra:
AStar:
This is a Maven project and can be run as is. Just clean and build and give it a go.