Abstract
Two case studies are presented that demonstrate the systematic derivation of efficient algorithms from simple combinatorial definitions. These case studies contribute to an exploration of evolutionary approaches to the explanation, proof, adaptation, and possibly the design of complex algorithms.
The algorithms derived are the linear-time depth-first-search algorithms developed by Tarjan and Hopcroft for strong connectivity and biconnectivity. These algorithms are generally considered by students to be complex and difficult to understand. The problems they solve, however, have simple combinatorial definitions that can themselves be considered inefficient algorithms.
The derivations employ systematic program manipulation techniques combined with appropriate domain-specific knowledge. The derivation approach offers evolutionary explanations of the algorithms that make explicit the respective roles of programming knowledge (embodied as program manipulation techniques) and domain-specific knowledge (embodied as graph-theoretic lemmas). Because the steps are rigorous and can potentially be formalized, the explanations are also proofs of correctness. We consider the merits of this approach to proof as compared with the usual a posteriori proofs. These case studies also illustrate how significant algorithmic derivations can be accomplished with a relatively small set of core program manipulation techniques.
A summary version of the biconnectivity derivation appeared in the first LICS conference, 1983 (Springer LNCS 164).
This research was supported in part by National Science Foundation Grant NSF-MCS79-21024, ONR N00014-80-C-0647, and DARPA/AFSOR F30602-01-2-0561, NSF ITR EIA-0086015, NSF EIA-0218376, and NSF EIA-0218359.
Author for correspondence. This research was supported in part by the Defense Advanced Research Projects Agency, ARPA Order No. 3597, monitored by the Air Force Avionics Laboratory under Contract F33615-81-K-1539, and U.S. Army Communications R&D Command under Contract DAAK80-81-K-0074, and the High Dependability Computing Program from NASA Ames cooperative agreement NCC-2-1298. The views and conclusions contained in this document are those of the authors and should not be interpreted as representing the official policies, either expressed or implied, of NASA, DARPA, or the U.S. Government.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
A. Aho, J. Hopcroft, and J. Ullman. The Design and Analysis of Computer Algorithms. Addison-Wesley, 1974.
A. Aho, J. Hopcroft, and J. Ullman. Data Structures and Algorithms. Addison-Wesley, 1983.
D. Barstow. The roles of knowledge and deduction in algorithm design. Research Report 178, Yale University, April 1980.
F. Bauer et al. Programming in a wide spectrum language: a collection of examples. Science of Computer Programming, 1:73–114, 1981.
R. Bird. Tabulation techniques for recursive programs. Computing Surveys, 12(4):403–417, 1980.
R. Burtall and J. Darlington. A transformation system for developing recursive programs. Journal of the ACM, 24(1):44–67, 1977.
K. Clark. Negation as failure. In H. Gallaire and J. Minker, editors, Logic and Databases. Plenum, 1978.
K. Clark and J. Darlington. Algorithm classification through synthesis. Computer Journal, 23(1), 1980.
S. Dietzen and W. Scherlis. Analogy and program development. In J. Boudreaux, editor, The Role of Language in Problem Solving II. North Holland, 1987.
C. Green and D. Barstow. On program synthesis knowledge. Artificial Intelligence, 10:241, 1978.
Z. Manna and R. Waldinger. Synthesis: dreams → programs. IEEE Transactions on Software Engineering, SE-5(4), July 1979.
Z. Manna and R. Waldinger. Deductive synthesis of the unification algorithm. Science of Computer Programming, 1:5–48, 1981.
R. Paige and S. Koenig. Finite differencing of computable expressions. ACM Transactions on Programming Languages and Systems, 4(3):402–454, 1982.
J. H. Reif. Synthesis of Parallel Algorithms. Morgan Kaufmann, 1993.
R. Reiter. On closed world data bases. In Gallaire and Minker [7].
R. W. Robert Paige, John Reif. Parallel Algorithm Derivation and Program Transformation. Kluwer Academic Publishers, 1993.
D. Sands. Higher-order expression procedures. In Proceedings of the ACM SIG-PLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation (PEPM), pages 178-189. ACM Press, 1995.
W. Scherlis. Expression procedures and program derivation. PhD thesis, Stanford University, 1980.
W. Scherlis. Program improvement by internal specialization. In Eighth Symposium on Principles of Programming Languages, pages 41-49, 1981.
R. Tarjan. Depth first search and linear graph algorithms. SIAM Journal of Computing, 1(2):146–160, 1972.
R. Tarjan. Testing flow graph reducibility. Fifth ACM Symposium on the Theory of Computing, pages 96-107, 1973.
M. Tullsen and P. Hudak. Shifting expression procedures into reverse. In Partial Evaluation and Semantic-Based Program Manipulation, pages 95-104, 1999.
M. Wand. Continuation-based program transformation strategies. Journal of the ACM, 27(1):164–180, 1980.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2003 Springer-Verlag Berlin Heidelberg
About this chapter
Cite this chapter
Reif, J.H., Scherlis, W.L. (2003). Deriving Efficient Graph Algorithms. In: Dershowitz, N. (eds) Verification: Theory and Practice. Lecture Notes in Computer Science, vol 2772. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-39910-0_28
Download citation
DOI: https://doi.org/10.1007/978-3-540-39910-0_28
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-21002-3
Online ISBN: 978-3-540-39910-0
eBook Packages: Springer Book Archive