Development of several reachability algorithms for directed graphs

  • Rudolf Berghammer
  • Herbert Ehler
  • Hans Zierer
Program Design
Part of the Lecture Notes in Computer Science book series (LNCS, volume 314)


In the development above only the control structure of the algorithms was subject to transformations. The final versions (6) and (7) which are due to the different generalizations in Section 3.1 are both operational provided implementations of the underlying data structures for vertices, graphs, and sets are given.

If these implementations are too inefficient or are not available at all, transformations of the data structures would have to follow. For example, an implementation of graphs by successor lists and of sets by boolean vectors allows to achieve a complexity O(NM) for algorithm (6), where M denotes the number of arcs of the graph. However, using two different set implementations (namely boolean vectors for the argument t and stacks or queues for s) and successor lists for graphs again, we could even obtain an O(M) version of (7). This shows that different strategies and techniques may lead to algorithms of different complexity. But on the other hand, the example also demonstrates that different sequences of design decisions can yield the same result.

Since the derivation of algorithms is a complex and creative task, there is no a priori recipe to determine which strategy or technique is best at a specific stage. Hence, the transformational approach is user-controlled. It offers the programmer various routes to follow and due to the correctness of each individual rule the final program is correct with respect to the initial specification by construction.


Simple Path Reachability Problem Creative Task Boolean Vector Sort Sequ 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. [Bauer 79]
    Bauer F. L.: Program development by stepwise transformation — the project CIP. In: Bauer F. L., Broy M. (eds.): Program construction. Lecture Notes in Computer Science 69. Springer: Berlin-Heidelberg-New York (1979)Google Scholar
  2. [Bauer et al. 85]
    Bauer F. L. et al.: The Munich project CIP. Volume I: The wide spectrum language CIP-L. Lecture Notes in Computer Science 183. Springer: Berlin-Heidelberg-New York (1985)Google Scholar
  3. [Bauer Wössner 81]
    Bauer F. L., Wössner H.: Algorithmische Sprache und Programmentwicklung. Springer: Berlin-Heidelberg-New York (1981); engl. translation: Algorithmic Language and Program Development. Springer: Berlin-Heidelberg-New York (1982)Google Scholar
  4. [Berghammer 84]
    Berghammer R.: Zur formalen Entwicklung von graphentheoretischen Algorithmen durch Transformation. Dissertation, Institut für Informatik, TU München, TUM-18403 (1984)Google Scholar
  5. [Bird 84]
    Bird R.: The promotion and accumulation strategies in transformational programming. ACM TOPLAS 6, 487–504 (1984)CrossRefGoogle Scholar
  6. [Broy Gnatz Wirsing 79]
    Broy M., Gnatz R., Wirsing M.: Problemspezifikation — eine Grundlage für Programmentwicklung. Proc. of a Workshop on Reliable Software, Hanser: München, 235–246 (1979)Google Scholar
  7. [Burstall Darlington 77]
    Burstall R. M., Darlington J.: A transformation system for developing recursive programs. JACM 24, 44–67 (1977)CrossRefGoogle Scholar
  8. [Cooper 66]
    Cooper D. C.: The equivalence of certain computations. Computer J. 9, 45–52 (1966)Google Scholar
  9. [Hussmann 86]
    Hussmann H.: Rapid prototyping for algebraic specifications — RAP System user's manual. Fakultät für Mathematik und Informatik, Universität Passau (1986)Google Scholar
  10. [Paige Koenig 82]
    Paige R., Koenig S.: Finite differencing of computable expressions. ACM TOPLAS 4, 3, 402–454 (1982)CrossRefGoogle Scholar
  11. [Tarjan 78]
    Tarjan R. E.: Complexity of combinatorial algorithms. SIAM Review 20, 3, 457–491 (1978)CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1988

Authors and Affiliations

  • Rudolf Berghammer
    • 1
  • Herbert Ehler
    • 1
  • Hans Zierer
    • 1
  1. 1.Institut für InformatikTechnische Universität MünchenMünchen 2

Personalised recommendations