Design Patterns for the Implementation of Graph Algorithms

While the theoretical aspects of many graph algorithms are well understood, the practical application of these algorithms imposes some problems: Typically, the implementation is bound to a specific data structure, the results and their representation are predefined etc. On the other hand, since many graph algorithms use other algorithms to solve subproblems, it is necessary to be able to freely choose the input and the output and/or to modify the behavior of the subalgorithms. Since the necessary freedom is normally missing from the implementation of graph algorithms, a programmer of a complex algorithm is forced to implement algorithms in an appropriated way to use them as subalgorithms. Thus, implementing complex algorithms becomes even harder resulting in relatively erroneous implementations if complex algorithms are implemented at all. It would desirable to have implementation of algorithms available which can be used as subalgorithms in a flexible way and which can be applied to arbitrary graph representations. This work introduces and discusses concepts to implement graph algorithms in a reusable fashion. With reusable it is meant that an algorithm can be used with different graph data structures and/or with modified behavior. To achieve this, components for an abstraction from the data structure are introduced which allow using many different data structures as graphs. In addition it is shown how to implement algorithms in a way which allows easy and flexible modification of their behavior.

[1]  D. R. Fulkerson,et al.  Maximal Flow Through a Network , 1956 .

[2]  Robert E. Tarjan,et al.  Depth-First Search and Linear Graph Algorithms , 1972, SIAM J. Comput..

[3]  Richard M. Karp,et al.  Theoretical Improvements in Algorithmic Efficiency for Network Flow Problems , 1972, Combinatorial Optimization.

[4]  A. V. Karzanov,et al.  Determining the maximal flow in a network by the method of preflows , 1974 .

[5]  Robert E. Tarjan,et al.  Computing an st -Numbering , 1976, Theor. Comput. Sci..

[6]  Donald E. Knuth,et al.  The art of computer programming: V.1.: Fundamental algorithms , 1997 .

[7]  Kenneth Steiglitz,et al.  Combinatorial Optimization: Algorithms and Complexity , 1981 .

[8]  Leonidas J. Guibas,et al.  Primitives for the manipulation of general subdivisions and the computation of Voronoi diagrams , 1983, STOC.

[9]  Thomas Lengauer,et al.  Combinatorial algorithms for integrated circuit layout , 1990, Applicable theory in computer science.

[10]  William E. Lorensen,et al.  Object-Oriented Modeling and Design , 1991, TOOLS.

[11]  Maria Grazia Scutellà,et al.  Toward a Programming Environment for Combinatorial Optimization: A Case Study Oriented to Max-Flow Computations , 1993, INFORMS J. Comput..

[12]  Gerald W. Both,et al.  Object-oriented analysis and design with applications , 1994 .

[13]  Ralph Johnson,et al.  design patterns elements of reusable object oriented software , 2019 .

[14]  Siam J. CoMPtrr,et al.  FINDING A MAXIMUM CUT OF A PLANAR GRAPH IN POLYNOMIAL TIME * , 2022 .