Breadth First Search In Python Code