Implementing weighted b-matching algorithms: towards a flexible software design

We present a case study on the design of an implementation of a fundamental combinatorial optimization problem: weighted <i>b</i>-matching. Although this problem is well-understood in theory and efficient algorithms are known, only little experience with implementations is available. This study was motivated by the practical need for an efficient <i>b</i>-matching solver as a subroutine in our approach to a mesh refinement problem in computer-aided design (CAD).The intent of this paper is to demonstrate the importance of flexibility and adaptability in the design of complex algorithms, but also to discuss how such goals can be achieved for matching algorithms by the use of design patterns. Starting from the basis of the famous blossom algorithm we explain how to exploit in different ways the flexibility of our software design which allows an incremental improvement of efficiency by exchanging subalgorithms and data structures.In a comparison with a code by Miller and Pekny we also demonstrate that our implementation is even without fine-tuning very competitive. Our code is significantly faster, with improvement factors ranging between 15 and 466 on TSPLIB instances.

[1]  W. Pulleyblank Matchings and extensions , 1996 .

[2]  Gerhard Reinelt,et al.  TSPLIB - A Traveling Salesman Problem Library , 1991, INFORMS J. Comput..

[3]  James B. Orlin A Faster Strongly Polynomial Minimum Cost Flow Algorithm , 1993, Oper. Res..

[4]  N. Amenta,et al.  Deformed products and maximal shadows of polytopes , 1996 .

[5]  Ravindra K. Ahuja,et al.  Use of Representative Operation Counts in Computational Testing of Algorithms , 1996, INFORMS J. Comput..

[6]  Jack Edmonds,et al.  Maximum matching and a polyhedron with 0,1-vertices , 1965 .

[7]  J. Edmonds Paths, Trees, and Flowers , 1965, Canadian Journal of Mathematics.

[8]  Jack Edmonds,et al.  Matching: A Well-Solved Class of Integer Linear Programs , 2001, Combinatorial Optimization.

[9]  M. Grötschel,et al.  Solving matching problems with linear programming , 1985, Math. Program..

[10]  Richard P. Anstee A Polynomial Algorithm for b-Matchings: An Alternative Approach , 1987, Inf. Process. Lett..

[11]  Andreas S. Schulz,et al.  Base polytopes of series—parallel posets: Linear description and optimization , 1998, Math. Program..

[12]  Jens Gustedt,et al.  Linear-time register allocation for a fixed number of registers , 1998, SODA '98.

[13]  Alessandro Panconesi,et al.  On the Hardness of Allocating Frequencies for Hybrid Networks , 1996, WG.

[14]  Rolf H. Möhring,et al.  Mesh refinement via bidirected flows: modeling, complexity, and computational results , 1997, JACM.

[15]  Karell Bertet,et al.  Weak-Order Extensions of an Order , 1997, WG.

[16]  George L. Nemhauser,et al.  Handbooks in operations research and management science , 1989 .

[17]  J. Edmonds,et al.  Facets of I-matching polyhedra , 1974 .

[18]  Rolf H. Möhring,et al.  Complexity and Modeling Aspects of Mesh Refinement into Quadrilaterals , 1997, Algorithmica.

[19]  Uta Wille,et al.  The role of synthetic geometry in representational measurement theory , 1997 .

[20]  Stefan Felsner,et al.  Interval Reductions and Extensions of Orders: Bijections to Chains in Lattices , 1998 .

[21]  Harold N. Gabow,et al.  An efficient reduction technique for degree-constrained subgraph and bidirected network flow problems , 1983, STOC.

[22]  William J. Cook,et al.  Computing Minimum-Weight Perfect Matchings , 1999, INFORMS J. Comput..

[23]  Rolf H M Ohring,et al.  Fachbereich 3 Mathematik Cardinality Matching: Heuristic Search for Augmenting Paths Cardinality Matching: Heuristic Search for Augmenting Paths , 1995 .

[24]  Donald L. Miller A Matching Based Exact Algorithm for Capacitated Vehicle Routing Problems , 1995, INFORMS J. Comput..

[25]  Martin Skutella,et al.  Scheduling-LPs Bear Probabilities: Randomized Approximations for Min-Sum Criteria , 1997, ESA.

[26]  William J. Cook,et al.  Solving Large-Scale Matching Problems , 1991, Network Flows And Matching.

[27]  L. Lovász Matching Theory (North-Holland mathematics studies) , 1986 .

[28]  Matthias Müller-Hannemann,et al.  High Quality Quadrilateral Surface Meshing Without Template Restrictions: A New Approach Based on Network Flow Techniques , 2000, Int. J. Comput. Geom. Appl..

[29]  Ulrich Derigs,et al.  An analysis of alternative strategies for implementing matching algorithms , 1983, Networks.

[30]  Karsten Weihe,et al.  Iterators and Handles for Nodes and Edges in Graphs , 1996 .

[31]  M. R. Rao,et al.  Odd Minimum Cut-Sets and b-Matchings , 1982, Math. Oper. Res..

[32]  M. Goemans Network Ows , 2007 .

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

[34]  R. Graham,et al.  Handbook of Combinatorics , 1995 .

[35]  Alexander Schwartz,et al.  Implementing weighted b-matching algorithms: insights from a computational study , 1999, JEAL.

[36]  Bjarne Stroustrup,et al.  C++ Programming Language , 1986, IEEE Softw..

[37]  Joseph F. Pekny,et al.  A Staged Primal-Dual Algorithm for Perfect b-Matching with Edge Capacities , 1995, INFORMS J. Comput..

[38]  Alfred Burton Marsh Matching algorithms. , 1979 .