As currently GitHub is challenging users on their Meet the Noops challenge, we decided to develop an algorithm in order to solve every maze generated by one of their Noops called MAZEBOT via its API call GET https://api.noopschallenge.com/mazebot/random
that can be found at their API Documentation.
Solving a maze is based on finding the path from the point A (starting position) to the point B (ending position) and the best solution is the one that completes the path between A and B on the fewer movements possible. So on, a pathfinding algorithm is the best approach to achieve that, in this case, A Star Algorithm has been developed in order to fit the needs of the problem.
One of the most relevant factors of A Star Algorithm are the heuristics, that help the algorithm in order to get the better solution based on leaf node's path decission making process, prioritizing always the leaf node with the lower heuristic and tree degree value, so to reach the point B in the fewer movements possible.
The choosen heuristic has been the Euclidean Distance so to determine the closest matrix cell to the ending point (B) from the current cell, which combined with the tree degree of the selected node, the resulting value will determine which node of the "visitable" nodes will be the choosen one on the next iteration.
This Algorithm grants that the best solution will be achived in terms of the lower distance between the starting point A, to the ending point B.