Development of several reachability algorithms for directed graphs
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.
KeywordsSimple Path Reachability Problem Creative Task Boolean Vector Sort Sequ
Unable to display preview. Download preview PDF.
- [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
- [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
- [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
- [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
- [Bird 84]
- [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
- [Burstall Darlington 77]
- [Cooper 66]Cooper D. C.: The equivalence of certain computations. Computer J. 9, 45–52 (1966)Google Scholar
- [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
- [Paige Koenig 82]
- [Tarjan 78]