An Implementation of Dijkstra's Shortest Path Algorithm Using Btree
This is a maze solver program which is implemented using the Dijkstra's shortest path algorithm and Btree data structure for improving the efficiency. The Btree was implemented with a little help from HERE.
-
Number of rows and columns of your maze
-
Your maze such that:
โ: 0 means a dead end.
โ๏ธ: Positive numbers indicate the difficulty of that path.
The solved maze such that the shortest path from the start to the finish is marked with -1s.
You can directly copy and paste the following test cases to try out the program.
-
First test case:
4 4 0 1 0 0 0 1 1 1 1 2 3 2 0 0 1 0
-
Second test case:
8 10 0 0 0 1 0 0 0 0 0 0 0 3 1 1 0 1 51 0 1 0 0 2 0 1 0 0 1 41 1 0 0 10 0 1 1 111 1 0 0 0 0 34 1 1 0 0 1 23 1 0 0 1 0 5 0 1 1 0 0 0 0 1 0 166 1 0 54 1 1 0 0 0 0 0 0 0 0 7 0 0
-
Third test case:
7 11 0 0 0 0 0 0 0 1 0 0 0 0 0 3 2 5 3 2 5 6 4 2 0 1 1 7 6 1 1 7 9 0 3 1 1 4 0 1 9 4 8 6 0 2 1 1 4 1 9 9 1 8 3 4 2 0 3 1 1 2 1 1 2 1 0 0 0 0 0 0 1 0 0 0 0 0 0
Parisa Rabbany - [email protected]