Theory and Techniques for Synthesizing Efficient Breadth-First Search Algorithms

  • Srinivas Nedunuri
  • Douglas R. Smith
  • William R. Cook
Part of the Lecture Notes in Computer Science book series (LNCS, volume 7436)


Although Breadth-First Search (BFS) has several advantages over Depth-First Search (DFS) its prohibitive space requirements have meant that algorithm designers often pass it over in favor of DFS. To address this shortcoming, we introduce a theory of efficient BFS (EBFS), along with a simple recursive program schema for carrying out the search. The theory is based on dominance relations, a long standing technique from the field of search algorithms. We also show that greedy and greedy-like algorithms form a very useful and important sub-category of EBFS. Finally, we show how the EBFS class can be used for semi-automated program synthesis by introducing some techniques for demonstrating that a given problem is solvable by EBFS. We illustrate our approach on several examples.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. [BM93]
    Bird, R.S., De Moor, O.: From Dynamic Programming to Greedy Algorithms. In: Möller, B., Schuman, S., Partsch, H. (eds.) Formal Program Development. LNCS, vol. 755, pp. 43–61. Springer, Heidelberg (1993)CrossRefGoogle Scholar
  2. [BZ92]
    Björner, A., Ziegler, G.M.: Introduction to greedoids. In: White, N. (ed.) Matroid Applications. Cambridge University Press (1992)Google Scholar
  3. [CLRS01]
    Cormen, T., Leiserson, C., Rivest, R., Stein, C.: Introduction to Algorithms, 2nd edn. MIT Press (2001)Google Scholar
  4. [Cur03]
    Curtis, S.A.: The classification of greedy algorithms. Sci. Comput. Program. 49(1-3), 125–157 (2003)MathSciNetMATHCrossRefGoogle Scholar
  5. [Dec03]
    Dechter, R.: Constraint Processing. Morgan Kauffman (2003)Google Scholar
  6. [GHJV95]
    Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design patterns: elements of reusable object-oriented software. Addison-Wesley Professional (1995)Google Scholar
  7. [GJTV11]
    Gulwani, S., Jha, S., Tiwari, A., Venkatesan, R.: Synthesis of loop-free programs. In: PLDI, pp. 62–73 (2011)Google Scholar
  8. [Iba77]
    Ibaraki, T.: The power of dominance relations in branch-and-bound algorithms. J. ACM 24(2), 264–279 (1977)MathSciNetMATHCrossRefGoogle Scholar
  9. [IGIS10]
    Itzhaky, S., Gulwani, S., Immerman, N., Sagiv, M.: A simple inductive synthesis methodology and its applications. In: OOPSLA, pp. 36–46 (2010)Google Scholar
  10. [Kre98]
    Kreitz, C.: Program synthesis. In: Bibel, W., Schmitt, P. (eds.) Automated Deduction – A Basis for Applications, vol. III, ch. III.2.5, pp. 105–134. Kluwer (1998)Google Scholar
  11. [Lei10]
    Leino, K.R.M.: Dafny: An Automatic Program Verifier for Functional Correctness. In: Clarke, E.M., Voronkov, A. (eds.) LPAR-16 2010. LNCS, vol. 6355, pp. 348–370. Springer, Heidelberg (2010)CrossRefGoogle Scholar
  12. [NC09]
    Nedunuri, S., Cook, W.R.: Synthesis of fast programs for maximum segment sum problems. In: Intl. Conf. on Generative Prog. and Component Engineering (GPCE) (October 2009)Google Scholar
  13. [Ned12]
    Nedunuri, S.: Theory and Techniques for Synthesizing Efficient Breadth-First Search Algorithms. PhD thesis, Univ. of Texas at Austin (2012)Google Scholar
  14. [NSC10]
    Nedunuri, S., Smith, D.R., Cook, W.R.: A Class of Greedy Algorithms and Its Relation to Greedoids. In: Cavalcanti, A., Deharbe, D., Gaudel, M.-C., Woodcock, J. (eds.) ICTAC 2010. LNCS, vol. 6255, pp. 352–366. Springer, Heidelberg (2010)CrossRefGoogle Scholar
  15. [NSC12]
    Nedunuri, S., Smith, D.R., Cook, W.R.: Theory and techniques for synthesizing graph algorithms using breadth-first search. In: 1st Workshop on Synthesis (SYNT) in Computer Aided Verification, CAV (to appear, 2012)Google Scholar
  16. [PBS11]
    Pu, Y., Bodík, R., Srivastava, S.: Synthesis of first-order dynamic programming algorithms. In: OOPSLA, pp. 83–98 (2011)Google Scholar
  17. [PPS10]
    Pavlovic, D., Pepper, P., Smith, D.R.: Formal Derivation of Concurrent Garbage Collectors. In: Bolduc, C., Desharnais, J., Ktari, B. (eds.) MPC 2010. LNCS, vol. 6120, pp. 353–376. Springer, Heidelberg (2010)CrossRefGoogle Scholar
  18. [S]
  19. [SGF10]
    Srivastava, S., Gulwani, S., Foster, J.S.: From program verification to program synthesis. In: POPL, pp. 313–326 (2010)Google Scholar
  20. [SHT00]
    Sasano, I., Hu, Z., Takeichi, M.: Make it practical: A generic linear-time algorithm for solving maximum-weightsum problems. In: Intl. Conf. Functional Prog. (ICFP) (2000)Google Scholar
  21. [SHT01]
    Sasano, I., Hu, Z.: Generation of Efficient Programs for Solving Maximum Multi-marking Problems. In: Taha, W. (ed.) SAIG 2001. LNCS, vol. 2196, pp. 72–91. Springer, Heidelberg (2001)CrossRefGoogle Scholar
  22. [SLTB+06]
    Solar-Lezama, A., Tancau, L., Bodik, R., Seshia, S., Saraswat, V.: Combinatorial sketching for finite programs. In: Proc. of the 12th Intl. Conf. on Architectural Support for Prog. Lang. and Operating Systems (ASPLOS), pp. 404–415 (2006)Google Scholar
  23. [Smi88]
    Smith, D.R.: Structure and design of global search algorithms. Tech. Rep. Kes. U.87.12, Kestrel Institute (1988)Google Scholar
  24. [Smi90]
    Smith, D.R.: Kids: A semi-automatic program development system. IEEE Trans. on Soft. Eng., Spec. Issue on Formal Methods 16(9), 1024–1043 (1990)Google Scholar
  25. [Smi10]
    Smith, D.R.: Global search theory revisited. Unpublished (December 2010)Google Scholar
  26. [SOH05]
    Sasano, I., Ogawa, M., Hu, Z.: Maximum Marking Problems with Accumulative Weight Functions. In: Van Hung, D., Wirsing, M. (eds.) ICTAC 2005. LNCS, vol. 3722, pp. 562–578. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  27. [SPW95]
    Smith, D.R., Parra, E.A., Westfold, S.J.: Synthesis of high-performance transportation schedulers. Technical report, Kestrel Institute (1995)Google Scholar
  28. [SW08]
    Smith, D.R., Westfold, S.: Synthesis of propositional satisfiability solvers. Final proj. report, Kestrel Institute (2008)Google Scholar
  29. [VY08]
    Vechev, M., Yahav, E.: Deriving linearizable fine-grained concurrent objects. In: PLDI 2008, pp. 125–135 (2008)Google Scholar
  30. [VYY10]
    Vechev, M., Yahav, E., Yorsh, G.: Abstraction-guided synthesis of synchronization. In: POPL 2010, pp. 327–338 (2010)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2012

Authors and Affiliations

  • Srinivas Nedunuri
    • 1
  • Douglas R. Smith
    • 2
  • William R. Cook
    • 1
  1. 1.University of Texas at AustinUSA
  2. 2.Kestrel InstituteUSA

Personalised recommendations