Breadth First Search Algorithm for the Flight System