Breadth First Search Algorithm Python Code