Python implementation of the A Star algorithm