Implementation of the A Star algorithm following some pre-defined restrictions