Experimental Evaluation of a Branch and Bound Algorithm for Computing Pathwidth David Coudert, Dorian Mazauric, Nicolas Nisse
Total Page:16
File Type:pdf, Size:1020Kb
Experimental Evaluation of a Branch and Bound Algorithm for computing Pathwidth David Coudert, Dorian Mazauric, Nicolas Nisse To cite this version: David Coudert, Dorian Mazauric, Nicolas Nisse. Experimental Evaluation of a Branch and Bound Algorithm for computing Pathwidth. 13th International Symposium on Experimental Algorithms, 2014, Copenhagen, Denmark. pp.46-58. hal-00966851 HAL Id: hal-00966851 https://hal.inria.fr/hal-00966851 Submitted on 27 Mar 2014 HAL is a multi-disciplinary open access L’archive ouverte pluridisciplinaire HAL, est archive for the deposit and dissemination of sci- destinée au dépôt et à la diffusion de documents entific research documents, whether they are pub- scientifiques de niveau recherche, publiés ou non, lished or not. The documents may come from émanant des établissements d’enseignement et de teaching and research institutions in France or recherche français ou étrangers, des laboratoires abroad, or from public or private research centers. publics ou privés. Experimental Evaluation of a Branch and Bound Algorithm for computing Pathwidth David Coudert, Dorian Mazauric, Nicolas Nisse RESEARCH REPORT N° 8470 February 2014 Project-Teams COATI ISSN 0249-6399 ISRN INRIA/RR--8470--FR+ENG Experimental Evaluation of a Branch and Bound Algorithm for computing Pathwidth∗ David Coudert†‡, Dorian Mazauric§, Nicolas Nisse‡† Project-Teams COATI Research Report n° 8470 — February 2014 — 301 pages Abstract: It is well known that many NP-hard problems are tractable in the class of bounded pathwidth graphs. In particular, path-decompositions of graphs are an important ingredient of dynamic programming algorithms for solving such problems. Therefore, computing the pathwidth and associated path-decomposition of graphs has both a theoretical and practical interest. In this paper, we design a Branch and Bound algorithm that computes the exact pathwidth of graphs and a corresponding path-decomposition. Our main contribution consists of several non-trivial techniques to reduce the size of the input graph (pre-processing) and to cut the exploration space during the search phase of the algorithm. We evaluate experimentally our algorithm by comparing it to existing algorithms of the literature. It appears from the simulations that our algorithm offers a significative gain with respect to previous work. In particular, it is able to compute the exact pathwidth of any graph with less than 60 nodes in a reasonable running-time (≤ 10 min.). Moreover, our algorithm also achieves good performance when used as a heuristic (i.e., when returning best result found within bounded time-limit). Our algorithm is not restricted to undirected graphs since it actually computes the vertex-separation of digraphs (which coincides with the pathwidth in case of undirected graphs). Key-words: Pathwidth, Branch and Bound, Sage ∗ This work has been partially supported by European Project FP7 EULER, ANR project Stint (ANR-13- BS02-0007), the Inria associated-team AlDyNet, and the project ECOS-Sud Chile. † Inria, France ‡ Univ. Nice Sophia Antipolis, CNRS, I3S, UMR 7271, 06900 Sophia Antipolis, France § Aix-Marseille Université, CNRS, LIF UMR 7279, Marseille, France RESEARCH CENTRE SOPHIA ANTIPOLIS – MÉDITERRANÉE 2004 route des Lucioles - BP 93 06902 Sophia Antipolis Cedex Etude d’un algorithme de Branch and Bound pour le calcul de la Pathwidth Résumé : Les décompositions en chemin de graphes sont très importants pour la conception d’algorithmes de programmation dynamique pour résoudre de nombreux problèmes NP-difficiles. Calculer la pathwidth et la décomposition en chemin correspondante sont donc d’un grand intérêt tant d’un point de vue théorique que pratique. Dans ce papier, nous proposons un algorithme de Branch and Bound qui calcule la pathwidth et une décomposition. Notre contribution principale réside dans les techniques que nous prouvons pour réduire la taille du graphe donné en entrée (pré- traitement) et réduire la taille de l’espace d’exploration de la phase de recherche de l’algorithme. Nous évaluons expérimentalement notre algorithme en le comparant aux algorithmes proposés dans la littérature. Les simulations montrent que notre algorithme apporte un gain significatif par rapport aux algorithmes existants. Il est capable de calculer la valeur exacte de la pathwidth de tout graphe composé d’au plus 60 sommets en un temps raisonnable (moins de 10 minutes). De plus, notre algorithme montre de bonnes performances lorsqu’il est utilisé en heuristique (c’est-à-dire lorsqu’il retourne le meilleur résultat trouvé en un temps donné). Notre algorithme n’est pas spécifique au graphes non orientés car il permet de calculer la vertex-separation des digraphes (qui coïncide avec la pathwidth dans le cas des graphes non orientés). Mots-clés : Pathwidth, Branch and Bound, Sage Experimental Evaluation of a Branch and Bound Algorithm for computing Pathwidth 3 Contents 1 Introduction 5 1.1 Practical computation of pathwidth . 5 1.2 Contributions and organization of the paper . 6 2 Preliminaries 6 2.1 Definitions and Notations . 6 2.2 Technical lemmas for preprocessing . 7 2.3 Technical lemmas for the Cut part . 8 3 The algorithm 8 3.1 Pre-processing phase . 9 3.2 Branch & Bound phase . 9 4 Simulations and interpretation of results 11 4.1 Implementation . 11 4.2 Comparison of our algorithms with BAB, MILP, and DYNPROG in random digraphs . 13 4.3 Comparison of BAB-GPP with SAT on the Rome graphs dataset . 13 4.4 Impact of prefix length . 15 4.5 Using BAB-GPP as an heuristic . 16 5 Conclusion 17 A Proofs 20 A.1 Proofs of technical lemmas for pre-processing . 20 A.2 Proofs of technical lemmas for the Cut part . 24 B Computational results on benchmark instances 26 B.1 Comparison of our algorithms with BAB, MILP, and DYNPROG in random graphs 26 B.2 TreewidthLIB . 28 B.3 VSPLIB . 33 B.4 Sage . 36 B.5 Rome graphs dataset . 50 RR n° 8470 Experimental Evaluation of a Branch and Bound Algorithm for computing Pathwidth 4 List of Figures 1 Average running time of the algorithms on random digraphs. 14 2 Computation time for Rome graphs instance . 15 3 Average running time of the algorithms on random graphs . 27 4 Computation time for instances of the TreewidthLIB with less than 110 nodes . 28 5 Computation time for instances from the VSPLIB . 37 6 Computation time for named graphs in Sage .................... 37 7 Computation time for families of graphs in Sage . 39 List of Tables 1 Versions of the B&B algorithms. 12 2 Repartition of (un)solved instances . 15 3 Pathwidth of some Mycielski graphs. 16 4 Running time of BAB-GPP for the Mycielski graph M6. 16 5 Computational results for twl. instance. 28 6 Upper bounds for twl. instance (10 min. per graph). 31 7 Computational results for twl-tsp instance. 31 8 Upper bounds for twl-tsp instance (10 min. per graph). 32 9 Computational results for vsplib_hb instance. 33 10 Upper bounds for vsplib_hb instance (10 min. per graph). 34 11 Computational results for vsplib_tree instance. 35 12 Upper bounds for vsplib_tree instance (10 min. per graph). 36 13 Computational results for sage_named instance. 38 14 Upper bounds for sage_named instance (10 min. per graph). 39 15 Computational results for sage_families instance. 40 16 Upper bounds for sage_families instance (10 min. per graph). 49 17 Computational results for rome instance. 50 18 Upper bounds for rome instance (10 min. per graph). 290 RR n° 8470 Experimental Evaluation of a Branch and Bound Algorithm for computing Pathwidth 5 1 Introduction Because of their well known algorithmic interest [15], a lot of work has been devoted to the computation of treewidth and tree-decompositions of graphs [3,33]. On the theoretical side, exact exponential algorithms [6, 20], Fixed Parameter Tractable (FPT) algorithms [8] and Approxi- mation algorithms [5, 19, 31, 36] have been designed. Unfortunately, most of these algorithms can hardly be used in practice. For instance, the algorithm in [6] is both exponential in time and space and therefore cannot be used for graphs with more than 32 nodes. Another example is the FPT algorithms whose time-complexity is at least exponential in the treewidth: there exists no efficient implementation of the Bodlaender and Kloks algorithm [8] even for graphs with treewidth at most 4. On the positive side, efficient algorithms exist for computing the treewidth of particular graph classes, e.g., graphs with treewidth at most 4 [22]. Many heuristics for computing lower or upper bounds on the treewidth have also been designed [1,9–11]. Surprisingly, much less work has been devoted to the computation of pathwidth and path- decompositions of graphs [3,32]. Indeed, the pathwidth of any n-node graph is at most O(log n) times its treewidth [3]. Hence, providing an efficient algorithm to compute pathwidth immedi- ately leads to an efficient approximation algorithm for computing the treewidth. In this paper, we design an algorithm that computes the pathwidth and a corresponding path-decomposition of graphs. We then provide an experimental analysis of our algorithm that presents a significative improvement with respect to existing algorithms. 1.1 Practical computation of pathwidth Any path-decomposition of a n-node graph G =(V,E) corresponds to a layout (i.e., an ordering) 1 (v1, ··· ,vn) of its vertices. The width of a path-decomposition is the maximum size of the border of the subgraphs induced by {v1, ··· ,vi}, i ≤ n. The pathwidth of a graph is equal to the mini- mum width of its path-decompositions. A motivation for computing path-decompositions comes from algorithmic applications. Indeed, given a path-decomposition of a graph, dynamic program- ming algorithms (whose time-complexity depends on the width of the path-decomposition) can be designed for many combinatorial optimization problems [15]. Other motivations arise from the close relationship between pathwidth and other graph invariants (related to node layouts), e.g., the node search number [12,16,30], the process number [14] and the edge search number [25].