Theory And Techniques For Synthesizing Efficient Breadth-First Search Algorithms