A* and Breadth First implementation (python)