Lecture Notes in Computer Science Commenced Publication in 1973 Founding and Former Series Editors: Gerhard Goos, Juris Hartmanis, and Jan van Leeuwen
Editorial Board David Hutchison Lancaster University, UK Takeo Kanade Carnegie Mellon University, Pittsburgh, PA, USA Josef Kittler University of Surrey, Guildford, UK Jon M. Kleinberg Cornell University, Ithaca, NY, USA Alfred Kobsa University of California, Irvine, CA, USA Friedemann Mattern ETH Zurich, Switzerland John C. Mitchell Stanford University, CA, USA Moni Naor Weizmann Institute of Science, Rehovot, Israel Oscar Nierstrasz University of Bern, Switzerland C. Pandu Rangan Indian Institute of Technology, Madras, India Bernhard Steffen University of Dortmund, Germany Madhu Sudan Massachusetts Institute of Technology, MA, USA Demetri Terzopoulos University of California, Los Angeles, CA, USA Doug Tygar University of California, Berkeley, CA, USA Gerhard Weikum Max-Planck Institute of Computer Science, Saarbruecken, Germany
5344
Hajo Broersma Thomas Erlebach Tom Friedetzky Daniel Paulusma (Eds.)
Graph-Theoretic Concepts in Computer Science 34th International Workshop, WG 2008 Durham, UK, June 30 – July 2, 2008 Revised Papers
13
Volume Editors Hajo Broersma Tom Friedetzky Daniel Paulusma Durham University, Department of Computer Science South Road, Durham DH1 3LE, UK E-mail: {hajo.broersma, tom.friedetzky, daniel.paulusma}@durham.ac.uk Thomas Erlebach University of Leicester, Department of Computer Science University Road, Leicester, LE1 7RH, UK E-mail:
[email protected]
Library of Congress Control Number: Applied for CR Subject Classification (1998): F.2, G.2, G.1.6, G.1.2, E.1, I.3.5 LNCS Sublibrary: SL 1 – Theoretical Computer Science and General Issues ISSN ISBN-10 ISBN-13
0302-9743 3-540-92247-4 Springer Berlin Heidelberg New York 978-3-540-92247-6 Springer Berlin Heidelberg New York
This work is subject to copyright. All rights are reserved, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, re-use of illustrations, recitation, broadcasting, reproduction on microfilms or in any other way, and storage in data banks. Duplication of this publication or parts thereof is permitted only under the provisions of the German Copyright Law of September 9, 1965, in its current version, and permission for use must always be obtained from Springer. Violations are liable to prosecution under the German Copyright Law. springer.com © Springer-Verlag Berlin Heidelberg 2008 Printed in Germany Typesetting: Camera-ready by author, data conversion by Scientific Publishing Services, Chennai, India Printed on acid-free paper SPIN: 12585687 06/3180 543210
Preface
The 34th International Workshop on Graph-Theoretic Concepts in Computer Science (WG 2008) took place in Van Mildert College at Durham University, UK, 30 June – 2 July 2008. The approximately 80 participants came from various countries all over the world, among them Australia, Brazil, Canada, Chile, Czech Republic, France, Greece, Hungary, Israel, Italy, Japan, The Netherlands, Norway, Poland, Spain, Switzerland, UK and the USA. WG 2008 continued the series of 33 previous WG conferences. Since 1975, the WG conference has taken place 21 times in Germany, four times in The Netherlands, twice in Austria as well as once in Italy, Slovakia, Switzerland, the Czech Republic, France, Norway and now in the UK. The WG conference traditionally aims at uniting theory and practice by demonstrating how graph-theoretic concepts can be applied to various areas in computer science, or by extracting new problems from applications. The goal is to present recent research results and to identify and explore directions of future research. The continuing interest in the WG conferences was reflected in the number and quality of submissions; 76 papers were submitted and in an evaluation process with four reports per submission, 30 papers were accepted by the Program Committee for the conference. Due to the high number of submissions and the limited schedule of 3 days, various good papers could not be accepted. There were excellent invited talks by Giuseppe Di Battista (Università Roma Tre, Italy) on algorithmic aspects of (un)-stable routing in the Internet, by Leszek Gąsieniec (University of Liverpool, UK) on memory-efficient graph exploration, and by Martin Grohe (Humboldt-Universität zu Berlin, Germany) on algorithmic meta theorems. The WG 2008 Best Student Paper Award was awarded to the paper “Faster Exact Bandwidth” by Marek Cygan and Marcin Pilipczuk. We are grateful to all those who contributed to WG 2008, especially the authors for submitting so many good papers, the numerous referees, the speakers and the Program Committee. We would also like to thank the London Mathematical Society (LMS) and the Engineering and Physical Sciences Research Council (EPSRC) for financial support and INFO.RO for sponsoring the Best Student Paper Award.
October 2008
Hajo Broersma Thomas Erlebach Tom Friedetzky Daniel Paulusma
Organization
The Tradition of WG 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008
U. Pape – Berlin, Germany H. Noltemeier – Göttingen, Germany J. Mühlbacher – Linz, Austria M. Nagl, H.J. Schneider – Castle Feuerstein, Germany U. Pape – Berlin, Germany H. Noltemeier – Bad Honnef, Germany J. Mühlbacher – Linz, Austria H.J. Schneider, H. Göttler – Neuenkirchen, Germany M. Nagl, J. Perl – Haus Ohrbeck near Osnabrück, Germany U. Pape – Berlin, Germany H. Noltemeier – Castle Schwanberg near Würzburg, Germany G. Tinhofer, G. Schmidt – Bernried near Munich, Germany H. Göttler, H.J. Schneider – Kloster Banz near Bamberg, Germany J. van Leeuwen – Amsterdam, The Netherlands M. Nagl – Castle Rolduc, The Netherlands R.H. Möhring – Berlin, Germany G. Schmidt, R. Berghammer – Fischbachau near Munich, Germany E.W. Mayr – Wiesbaden-Naurod, Germany J. van Leeuwen – Utrecht, The Netherlands G. Tinhofer, E.W. Mayr, G. Schmidt – Herrsching near Munich, Germany M. Nagl – Aachen, Germany G. Ausiello, A. Marchetti-Spaccamela – Como, Italy R.H. Möhring – Berlin, Germany J. Hromkovič, O. Sýkora – Smolenice Castle, Slovak Republic P. Widmayer – Ascona, Switzerland D. Wagner – Konstanz, Germany A. Brandstädt – Boltenhagen near Rostock, Germany L. Kučera – Český Krumlov, Czech Republic H.L. Bodlaender – Elspeet, The Netherlands J. Hromkovič, M. Nagl – Bad Honnef, Germany D. Kratsch – Metz, France F.V. Fomin – Bergen, Norway A. Brandstädt, D. Kratsch, H. Müller – Dornburg near Jena, Germany H. Broersma, T. Erlebach – Durham, UK
VIII
Organization
Program Committee Hajo Broersma Artur Czumaj Thomas Erlebach Mike Fellows Fedor V. Fomin Juraj Hromkovic Jan Kratochvíl Luděk Kučera Jan van Leeuwen Alberto Marchetti-Spaccamela Hartmut Noltemeier Christophe Paul Andrzej Pelc Ingo Schiermeyer Jan Arne Telle Takeaki Uno Dorothea Wagner Peter Widmayer Shmuel Zaks
Durham University, UK (Co-chair) University of Warwick, UK University of Leicester, UK (Co-chair) The University of Newcastle, Australia University of Bergen, Norway ETH Zürich, Switzerland Charles University, Prague, Czech Republic Charles University, Prague, Czech Republic Universiteit Utrecht, The Netherlands Sapienza University of Rome, Italy Universität Würzburg, Germany CNRS, LIRMM, Montpellier, France Université du Québec, Canada TU Bergakademie Freiberg, Germany University of Bergen, Norway National Institute of Informatics (NII), Japan Universität Karlsruhe (TH), Germany ETH Zürich, Switzerland Technion, Haifa, Israel
Local Organization Hajo Broersma Tom Friedetzky Daniel Paulusma
Additional Reviewers Gill Barequet Reinhard Bauer Michael Baur Hans Bodlaender Hans-Joachim Böckenhauer Anthony Bonato Magnus Bordewich Andreas Brandstädt Stephan Brandt Binh-Minh Bui-Xuan Jurek Czyzowicz Daniel Delling Camil Demetrescu Stephan Dempe Giuseppe Di Battista
Zdeněk Dvořák Louis Esperet Jiří Fiala Michele Flammini Paolo Giulio Franciosa Karin Freiermuth Dalibor Fronček Marco Gaertler Philippe Gambette Tomáš Gavenčiak Robert Görke Petr Golovach Martin Golumbic Fabrizio Grandoni Gregory Gutin
Organization
Michel Habib Pinar Heggernes Jan van den Heuvel Petr Hliněný David Ilcinkas Bill Jackson Stanislav Jendroľ Matthew Johnson Mamadou Moustapha Kanté Bastian Katz Michael Kaufmann Arnfried Kemnitz Shuji Kijima Lefteris Kirousis Masashi Kiyomi Ekkehard Köhler Petr Kolman Daniel Kráľ Rastislav Královič Richard Královič Dieter Kratsch Marcus Krug Isabella Lari Van Bang Le Vincent Limouzy Giuseppe Liotta Martin Mareš Euripides Markou Steffen Mecke Klaus Meer Sascha Meinert Daniel Meister Tobias Mömke Gianpiero Monaco
Luca Moscardelli Haiko Müller Nicolas Nisse Martin Nöllenburg Hartmut Noltemeier Yoshio Okamoto Sang-il Oum Daniel Paulusma David Peleg Martin Pergel Bert Randerath Dieter Rautenbach Udi Rotics Ignaz Rutter Toshiki Saitoh Saket Saurabh Sebastian Seibert Brigitte Servatius Mordechai Shalom Joachim Spoerhase Björn Steffen Lorna Stewart Iain Stewart Jayme Szwarcfiter Tami Tamir Ioan Todinca Regina Tyshkevich Walter Unger Ugo Vaccaro Yngve Villanger Margit Voigt Hans-Christoph Wirth David Wood Xiao Zhou
IX
Table of Contents
Invited Contributions (Un)-Stable Routing in the Internet: A Survey from the Algorithmic Perspective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Luca Cittadini, Giuseppe Di Battista, and Massimo Rimondini
1
Memory Efficient Anonymous Graph Exploration . . . . . . . . . . . . . . . . . . . . Leszek Gasieniec and Tomasz Radzik
14
Algorithmic Meta Theorems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Martin Grohe
30
Regular Papers A Most General Edge Elimination Polynomial . . . . . . . . . . . . . . . . . . . . . . . Ilia Averbouch, Benny Godlin, and Johann A. Makowsky
31
Approximating the Metric TSP in Linear Time . . . . . . . . . . . . . . . . . . . . . . Davide Bil` o, Luca Forlizzi, and Guido Proietti
43
The Valve Location Problem in Simple Network Topologies . . . . . . . . . . . . Hans L. Bodlaender, Alexander Grigoriev, Nadejda V. Grigorieva, and Albert Hendriks
55
A 3/2-Approximation Algorithm for Finding Spanning Trees with Many Leaves in Cubic Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Paul Bonsma and Florian Zickfeld On the Pseudo-achromatic Number Problem . . . . . . . . . . . . . . . . . . . . . . . . Jianer Chen, Iyad A. Kanj, Jie Meng, Ge Xia, and Fenghui Zhang Making Role Assignment Feasible: A Polynomial-Time Algorithm for Computing Ecological Colorings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Pilu Crescenzi, Miriam Di Ianni, Federico Greco, Gianluca Rossi, and Paola Vocca
66
78
90
Faster Exact Bandwidth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Marek Cygan and Marcin Pilipczuk
101
Additive Spanners for Circle Graphs and Polygonal Graphs . . . . . . . . . . . Feodor F. Dragan, Derek G. Corneil, Ekkehard K¨ ohler, and Yang Xiang
110
XII
Table of Contents
Upward Straight-Line Embeddings of Directed Graphs into Point Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Alejandro Estrella-Balderrama, Fabrizio Frati, and Stephen G. Kobourov Complexity of the Packing Coloring Problem for Trees . . . . . . . . . . . . . . . . Jiˇr´ı Fiala and Petr A. Golovach Characterizations of Restricted Pairs of Planar Graphs Allowing Simultaneous Embedding with Fixed Edges . . . . . . . . . . . . . . . . . . . . . . . . . J. Joseph Fowler, Michael J¨ unger, Stephen Kobourov, and Michael Schulz
122
134
146
A Lower Bound on the Area Requirements of Series-Parallel Graphs . . . . Fabrizio Frati
159
On Independent Sets and Bicliques in Graphs . . . . . . . . . . . . . . . . . . . . . . . Serge Gaspers, Dieter Kratsch, and Mathieu Liedloff
171
Evaluations of Graph Polynomials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Benny Godlin, Tomer Kotek, and Johann A. Makowsky
183
Parameterized Complexity for Domination Problems on Degenerate Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Petr A. Golovach and Yngve Villanger An Algorithm for Finding Input-Output Constrained Convex Sets in an Acyclic Digraph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Gregory Gutin, Adrian Johnstone, Joseph Reddington, Elizabeth Scott, and Anders Yeo Cutwidth of Split Graphs, Threshold Graphs, and Proper Interval Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Pinar Heggernes, Daniel Lokshtanov, Rodica Mihai, and Charis Papadopoulos
195
206
218
The Rank-Width of the Square Grid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V´ıt Jel´ınek
230
Improved Upper Bounds for Partial Vertex Cover . . . . . . . . . . . . . . . . . . . . Joachim Kneis, Alexander Langer, and Peter Rossmanith
240
On the Expressive Power of CNF Formulas of Bounded Tree- and Clique-Width . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Pascal Koiran and Klaus Meer
252
Planar Feedback Vertex Set and Face Cover: Combinatorial Bounds and Subexponential Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Athanassios Koutsonas and Dimitrios M. Thilikos
264
Table of Contents
XIII
What Is between Chordal and Weakly Chordal Graphs? . . . . . . . . . . . . . . Elad Cohen, Martin Charles Golumbic, Marina Lipshteyn, and Michal Stern
275
Parameterized Graph Cleaning Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . D´ aniel Marx and Ildik´ o Schlotter
287
Traffic Grooming in Unidirectional WDM Rings with Bounded Degree Request Graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Xavier Mu˜ noz and Ignasi Sau
300
Fast Robber in Planar Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Nicolas Nisse and Karol Suchan
312
From a Circular-Arc Model to a Proper Circular-Arc Model . . . . . . . . . . . Yahav Nussbaum
324
Digraph Decompositions and Monotonicity in Digraph Searching . . . . . . . Stephan Kreutzer and Sebastian Ordyniak
336
Searching for a Visible, Lazy Fugitive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . David Richerby and Dimitrios M. Thilikos
348
A Faster Shortest-Paths Algorithm for Minor-Closed Graph Classes . . . . Siamak Tazari and Matthias M¨ uller-Hannemann
360
Local Construction and Coloring of Spanners of Location Aware Unit Disk Graphs (Extended Abstract) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Andreas Wiese and Evangelos Kranakis
372
Author Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
385
(Un)-Stable Routing in the Internet: A Survey from the Algorithmic Perspective Luca Cittadini, Giuseppe Di Battista, and Massimo Rimondini Roma Tre University {ratm,gdb,rimondin}@dia.uniroma3.it
Abstract. The Internet is a huge and complex network in which Internet Service Providers (ISPs) compete for revenue. In order to support the establishment of commercial agreements, routing in the Internet must therefore allow each ISP to autonomously set up its own routing policies while ensuring global connectivity. The Border Gateway Protocol (BGP) allows to achieve both these goals, and is the currently adopted protocol for Internet routing. It can be shown that the interaction of not-so-unlikely BGP configurations adopted at different ISPs can cause permanent oscillations of routing. Several models and algorithms have been proposed in the literature to study routing oscillations. The goal of this paper is to provide a survey of state of the art contributions in this field with an emphasis on the algorithmic aspects.
1
Introduction
Internet interdomain routing relies on the Border Gateway Protocol (BGP). BGP [1] allows each Internet Service Provider (ISP) to autonomously set up its own routing policies while ensuring global connectivity. ISPs negotiate commercial and political agreements and subsequently connect and configure BGP routers to exchange reachability information to establish paths to a set of destinations. Each ISP owns an Autonomous System (AS ) that comprises all the equipments it administrates. Roughly speaking, BGP works as follows. An AS (say AS0) tells (announces) its neighboring ASes of its existence. Its neighbors, according to the commercial agreements of their ISPs, propagate this information to other ASes, that, in turn, do the same. In this way, after a while, the entire Internet knows about the existence of AS0. While the announcement about AS0 is propagated through the Internet, each traversed AS adds (prepends) its identifier to the announcement. In this way an announcement carries in itself the entire path to reach AS0. Each AS, according to its policies, can choose to discard some announcements and can select its favorite one. Unfortunately, it can be shown that the interaction of not-so-unlikely BGP configurations adopted at different ISPs can cause permanent oscillations of Internet routing (see, e.g., [2,3]). H. Broersma et al. (Eds.): WG 2008, LNCS 5344, pp. 1–13, 2008. c Springer-Verlag Berlin Heidelberg 2008
2
L. Cittadini, G.D. Battista, and M. Rimondini
In this paper we first introduce a well known formulation of the BGP routing stability problem, based on commonly adopted models to capture BGP routing dynamics. We then propose a classification of significant instances of the stability problem according to their convergence properties. Algorithms for computing stable states are then described, together with sufficient conditions that lead to guaranteed stability. We also discuss the relationships between the classical models for stability and other variants that accommodate link costs or account for the existence of commercial relationships in the routing system. Very recent results have been obtained by studying the stability problem with a game theoretic approach. These results are also presented. Section 2 discusses models for BGP. Section 3 considers configurations that may admit multiple stable states and conditions for guaranteed convergence. Section 4 presents algorithms for computing stable states. Section 5 shows the interplay between stability and real world constraints. Conclusions are drawn in Section 6. Most of the presented results come from the literature, while some are original contributions. A way to read this survey is to look at Fig. 3, which provides an at-a-glance view of the relationships between classes of instances with different convergence properties.
2
Models for BGP and the Stability Problem
Several approaches have been proposed to model BGP and to study its stability. A pioneering work on this subject is in [4], that proposed the return graph, while algebraic models have been shown in [5,6,7]. In this paper we adopt the Simple Path Vector Protocol (SPVP) model [8], that is the reference point of most of the scientific contributions on BGP stability. We now define an SPVP instance. Let G = (V, E) be an undirected graph, with vertex set V = {0, 1, . . . , n} and edge set E. The graph G is used to encode the AS-level topology of the network under consideration, in such a way that vertices correspond to ASes and edges correspond to adjacency relationships between ASes (also called peerings by operators). A path P in G is a sequence of k + 1 vertices P = (vk vk−1 . . . v1 v0 ), vi ∈ V , such that (vi , vi−1 ) ∈ E for 0 < i ≤ k. Vertex vk−1 is the next hop of vk in P . We denote the empty path by . The concatenation of two nonempty paths P = (vk vk−1 . . . vi ), k ≥ i, and Q = (vi vi−1 . . . v0 ), i ≥ 0, denoted as P Q, is the path (vk vk−1 . . . vi vi−1 . . . v0 ). We assume that P = P = . In the SPVP model each vertex in V − {0} attempts to establish a path to a single vertex 0. Note that, since BGP manages each destination separately, this is not a limitation. Each vertex u ∈ V is assigned a set of permitted paths P u . All the paths in P u are simple (i.e., no repeated vertices), start from u and end in 0, and represent the paths that u can use to reach 0. The empty path represents unreachability of 0 and is permitted at each vertex u = 0. Let P 0 = {(0)} and u P = u∈V P .
(Un)-Stable Routing in the Internet
3
For each vertex u ∈ V , a ranking function λu : P u → N determines the relative level of preference λu (P ) assigned by u to path P . If P1 , P2 ∈ P u and λu (P2 ) < λu (P1 ), then P2 is preferred over P1 . Let Λ = {λu |u ∈ V }. Ranking functions in Λ describe the BGP routing policies. According to the model in [2], the following conditions hold on the paths, for each vertex u ∈ V − {0}: i. ∀P ∈ P u , P = : λu (P ) < λu () (unreachability is the last resort); ii. ∀P1 , P2 ∈ P u , P1 = P2 : λu (P1 ) = λu (P2 ) ⇒ P1 = (u v)P1 , P2 = (u v)P2 , (strict ranking is assumed on all the paths but those with the same next hop). An instance S of SPVP is a triple (G, P, Λ). See an example in Figure 2(a). The graphical convention adopted throughout the paper is the same as in [2], namely each vertex u is equipped with a list of paths representing P u sorted by increasing values of λu . The empty path and P 0 are omitted for brevity. We assume that the size of S is the size of P. A path assignment π is a function that maps each vertex u ∈ V to a permitted path π(u) ∈ P u . This represents the fact that vertex u is using path π(u) to reach 0. We have that π(0) = (0) and, if π(u) = , then u cannot reach vertex 0. In SPVP vertices asynchronously exchange messages containing paths to 0. We assume that edges introduce a finite delay on message delivery. Each vertex u keeps in a routing information base ribt (u) the path it adopts at time t to reach vertex 0. If a vertex u receives from a neighbor w at time t an announcement containing a path P , first of all u checks whether (u)P is permitted, namely if (u)P ∈ P u . If this is the case, u puts (u)P into a data structure called rib-int (u ⇐ w), which is used to store the latest path received from w. If (u)P is not permitted, u puts in rib-int (u ⇐ w). Then, u checks whether the currently selected path, stored in ribt−1 (u), is the currently available best path. If this is not the case, u selects the best ranked path among those in all its rib-int data structures and stores it in ribt (u). We refer to such a path as bestt (u) = arg min λu (rib-int (u ⇐ v)). Afterwards, u announces bestt (u) to all v|(u,v)∈E
its neighbors v | (u, v) ∈ E. An activation sequence [8] σ = (A0 A1 . . . Ai . . . ) is a (possibly infinite) sequence where At is a set containing an ordered pair (u, v)|(u, v) ∈ E for each vertex v that processes a message from u at time t. We say that edge (u, v) is activated at time t. Since the delay introduced by edges is finite, messages are eventually delivered. An activation sequence is fair if any edge (u, v) ∈ E is eventually activated whenever u sends a message to its neighbors. In a real world scenario, all those messages that are not filtered by explicitly configured policies are never discarded. Therefore, in the following we will be mostly considering fair activation sequences. As SPVP operates within the network, the routing evolves through different path assignments πt , where πt (u) = ribt (u), until a stable path assignment is reached (we say that SPVP converges to that path assignment). A path
4
L. Cittadini, G.D. Battista, and M. Rimondini
assignment πt is stable if, for each u ∈ V , πt (u) = bestt (u). Once a stable path assignment is reached, no further messages are generated in the network. Obviously, the existence of a stable path assignment is a crucial requirement for a network running BGP. For this reason the Stable Paths Problem has been defined in [2] as follows: Problem 1 (Stable Paths Problem). Given an instance S of SPVP, does S admit a stable path assignment? Theorem 1. The Stable Paths Problem is NP-complete [2]. If a stable path assignment exists for S, it is a solution for the problem. We define Solvable (Unsolvable) as the set of SPVP instances that admit (do not admit) a solution. For example, instance Good-Gadget (Fig. 2(a)) belongs to Solvable since it admits a stable path assignment. In fact, it is easy to check that the path assignment π(1) = (1 3 0), π(2) = (2 0), π(3) = (3 0), π(4) = (4 2 0) is stable. On the other hand, instance Bad-Gadget (Fig. 2(b)) belongs to Unsolvable. In fact, in any stable path assignment π there must be at least one vertex that picks the direct path to 0. Assume that π(2) = (2 0). For π to be stable, we must have π(3) = (3 2 0), which in turn implies π(1) = (1 0). Note that now (2 0) is not the best available path at vertex 2, hence no path assignment can have π(2) = (2 0). The same argument applies symmetrically to the other vertices. Throughout this paper we shall discuss other notable classes of SPVP instances besides Solvable and Unsolvable. The relationships between those classes are illustrated in Fig. 3.
3
Multiple Stable States and Guaranteed Convergence
One might ask the question whether there are SPVP instances that admit more than one solution. Let Unique be the class of SPVP instances that have exactly one solution. We have that Good-Gadget belongs to Unique. Theorem 2. Unique ⊂ Solvable. Proof. Instance Disagree [9] (Fig. 2(c)) has two solutions. It is easy to see that both π(1) = (1 0), π(2) = (2 1 0) and π (1) = (1 2 0), π (2) = (2 0) are stable path assignments. Property 1. There are instances of SPVP with an exponential number of solutions. Proof. An instance that contains n distinct and independent Disagree structures has 2n solutions. Property 2. For each non-negative integer k there exists an instance of SPVP with k solutions.
(Un)-Stable Routing in the Internet
0
v 1,1 v 1,2 0 v 1,1 0
v 2,1 v 2,2 v 1,2 0 v 2,1 v 1,2 0
v k,1 v k,2 ...v2,2 v 1,2 0 v k,1 ...v2,2 v 1,2 0
v 1,1
v 2,1
v k,1
v 1,2
v 2,2
v 1,2 v 1,1 0 v 1,2 0
v 2,2 v 2,1v 1,2 0 v 2,2 v 1,2 0
5
v k,2 v k,2 v k,1 ...v2,2 v 1,2 0 v k,2 ...v2,2 v 1,2 0
Fig. 1. An instance of SPVP with k + 1 solutions
Proof. This is clearly true for k = 0 and k = 1. In fact, Bad-Gadget and Good-Gadget are examples of instances with no solutions and with only one solution, respectively. Fig. 1 shows the structure of a generic SPVP instance with k+1 solutions. The idea is to stack several Disagree gadgets, each of which adds a new stable path assignment to the SPVP instance. In particular, each triple of vertices (vi,1 , vi,2 , vi−1,2 ), with i > 0 and v0,2 = 0, forms a Disagree. Each vertex vi,j can reach 0 by using a direct path (vi−1,2 vi−2,2 . . . 0). However, vi,1 prefers the path via vi,2 , and vi,2 prefers the path via vi,1 . With this construction, if a Disagree (vi,1 , vi,2 , vi−1,2 ) stabilizes on πt (vi,1 ) = (vi,1 vi−1,2 vi−2,2 . . . 0) and πt (vi,2 ) = (vi,2 vi,1 )πt (vi,1 ) at time t, then there exists a time t > t after which the vertices of any other Disagree (vj,1 , vj,2 , vj−1,2 ), j > i permanently select the empty path . On the other hand, if a Disagree stabilizes on πt (vi,1 ) = (vi,1 vi,2 )πt (vi,2 ) and πt (vi,2 ) = (vi,2 vi−1,2 . . . 0), then the following Disagree (vi+1,1 , vi+1,2 , vi,2 ) (if any) has two stable path assignments, and a similar argument can be applied. In this way, every Disagree acts as a switch that can enable or disable the subsequent Disagree in the stack. The last Disagree (vk,1 , vk,2 , vk−1,2 ) can arbitrarily reach one of its two stable states without influencing further gadgets. It is easy to check that this SPVP instance has exactly k + 1 stable states. Even if an instance has a stable state, there may still be activation sequences that give rise to oscillations [10]. From the point of view of a network operator, it is interesting to know whether a given BGP configuration is guaranteed to converge to a stable state, regardless of any possible message orderings. Hence, we define the Safety problem [10,11]: Problem 2 (Safety). Given an SPVP instance S, does S admit only finite fair activation sequences? Theorem 3. Safe ⊂ Solvable. Proof. Disagree (Fig. 2(c)) is Solvable but not Safe. An infinite fair activation sequence σ = (A0 . . . Ai . . . ) can be constructed as follows. Vertices 1 and 2 first learn the direct path to zero A0 = {(0, 1), (0, 2)}. Then they periodically exchange information in a synchronous way, i.e. At = {(1, 2), (2, 1)}, ∀t ≥ 1. It
6
L. Cittadini, G.D. Battista, and M. Rimondini
is easy to see that vertex 1 keeps selecting alternately paths πt (1) = (1 0) and πt+1 (1) = (1 2 0) at time t = 2n. Symmetric considerations apply to vertex 2. Theorem 4. Safe ∪ Unique ⊂ Solvable. Proof. Disagree is neither Safe nor Unique. Theorem 5. Safe ∩ Unique = Unique. Proof. Instance Naughty-Gadget [10] (Fig. 2(d)) has a unique stable state but a persistent oscillation. The unique solution is the same as in Good-Gadget, while the persistent oscillation works in a similar way as in Bad-Gadget (see [12,2]). In [2,10] it has been shown that, when an SPVP instance has multiple solutions, then a cyclic dependence on the ranking of paths can be identified. Even though this does not imply the existence of an infinite activation sequence, we were not able to find an SPVP instance that is Safe but not Unique. We therefore state the following: Conjecture 1. Safe ∩ Unique = Safe. The safety of SPVP has also been studied from a game theoretic perspective [13] in the so called convergence game. All the vertices but 0 are players. When allowed to play, a vertex selects the best path among those offered by its neighbors (best-reply dynamics). The payoff of vertex u is λu (P ) if u selects path P . The game has infinite rounds. SPVP safety translates to the convergence of bestreply dynamics in the convergence game. In this framework the following result has been proved: Theorem 6. The safety problem is PSPACE-complete [13]. However, interpreting Theorem 6 from the SPVP point of view requires some care. First, [13] only considers activation sequences where vertices are activated one after the other. It is unclear whether an instance that is Safe in this model is also Safe in the more general model introduced above. Second, players of the convergence game can select a neighbor instead of a path.
4
Algorithms That Search for Stable States
In this section we restate and discuss a polynomial time Greedy algorithm that has been proposed in [2] to check if an SPVP instance has a solution. Greedy attempts to grow a solution by iteratively building a stable path assignment. If the algorithm terminates successfully, the path assignment defines a spanning tree that is a solution for the given instance. Otherwise, Greedy is only able to identify a stable path assignment for a subset of the vertices. The algorithm maintains a stable set of vertices for which there exists one permitted path that will be in every stable path assignment. The stable set at
(Un)-Stable Routing in the Internet
7
iteration i of the algorithm is denoted by Vi . Vertex 0 is always in the stable set, therefore let V0 = {0}. As the stable set grows, a path assignment π defined on the vertices in Vi is iteratively built. We say that a path P is compatible with a path assignment π if P = P1 (u v)P2 , where P1 does not contain vertices in Vi , (u, v) ∈ E, v ∈ Vi , and P2 = π(v). Algorithm Greedy is as follows. At iteration i, let Pv be the path with minimum λv (P ) among the paths at v compatible with π. If such a path does not exist, let Pv = . If there exists a vertex v ∈ / Vi−1 such that Pv has a next hop in Vi−1 , then construct Vi by adding v to Vi−1 and set π(v) = Pv . If such a vertex v does not exist, then stop. Intuitively, at each iteration vertex v is stabilized because its best compatible path directly reaches an already stabilized vertex. Observe that the algorithm terminates after at most |V | iterations. A solution to the SPVP instance exists if, after k iterations, we end with Vk = V . The solution is given by π. We define Greedy-Solvable as the set of SPVP instances that have a solution that is found by Greedy. It is easy to see that Good-Gadget ∈ Greedy-Solvable. In fact, at the first iteration vertex 3 enters the stable set V1 , and π(3) = (3 0). At the second iteration, the best path at vertex 1 is then directly connected to a stable node, hence 1 enters the stable set V2 , with π(1) = (1 3 0). Observe that this makes path (2 1 0) not compatible with π. Hence, the best compatible path at 2 is directly attached to a stable vertex (0), so 2 enters V3 , and π(2) = (2 0). Finally, vertex 4 has now a best path which is directly attached to 2, so it enters V4 with π(4) = (4 2 0). Since V4 = V , the algorithm successfully terminates. Theorem 7. Greedy-Solvable ⊂ Safe ∩ Unique. Proof. Part 1 (⊆): If an SPVP instance S is successfully solved by Greedy, then S has a unique solution [2] and it is safe [12]. Part 2 (⊂): A safe SPVP instance that has a unique solution and that Greedy is unable to solve is Di-Safe-gree (Fig. 2(e)). The instance is safe since any fair activation sequence of SPVP is finite. In fact, in any fair activation sequence vertices 1, 2, and 3 learn about the direct path to 0. After that, edge (3, 2) is eventually activated, and 2 learns about (2 3 0). Henceforth, vertex 2 will be permanently unable to select (2 0), in turn preventing vertex 1 from choosing (1 2 0). Finally, after edge (1, 2) is activated, 2 switches to its best path (2 1 0) and SPVP terminates, as no other message is further generated. Therefore any fair activation sequence is forcedly finite, and SPVP cannot oscillate on this instance. We now walk through the execution of Greedy on Di-Safe-gree. At the first iteration, vertex 3 enters the stable set V1 , and π(3) = (3 0). At the second iteration, the algorithm forcedly stops. In fact, path (2 1 0) is compatible with π because 2, 1 ∈ / V1 , 0 ∈ V1 , π(0) = (0), and (1, 0) ∈ E. However, even if (2 1 0) is the best compatible path at vertex 2, its next hop is not in V1 . A similar argument applies to path (1 2 0). Therefore, no new vertex can be added to the stable set and the algorithm stops without finding a solution, since V1 = V .
8
L. Cittadini, G.D. Battista, and M. Rimondini
A recent contribution [12] presents an improved Greedy algorithm that is able to solve a larger number of instances, including Di-Safe-gree. Most of the sufficient conditions [14,15,16,2,10,17] to ensure safety are based on the so called dispute wheels. A dispute wheel [10] Π k = (U , Q, R) of size k is a sequence of vertices U = u0 , u1 . . . uk−1 and sequences of nonempty paths Q = Q0 , Q1 . . . Qk−1 and R = R0 , R1 . . . Rk−1 such that: i. ii. iii. iv.
Ri is a path from ui to ui+1 Qi ∈ P ui Ri Qi+1 ∈ P ui λui (Qi ) ≥ λui (Ri Qi+1 )
We define No-Dispute-Wheel as the set of SPVP instances that do not have a dispute wheel. In [13] it is observed that testing the absence of dispute-wheels is coNP-complete. Theorem 8. No-Dispute-Wheel ⊂ Greedy-Solvable. Proof. Part 1 (⊆): If an instance S of SPVP has no dispute wheel, then Greedy successfully solves S [2]. Part 2 (⊂): As shown in [10], instance Bad-Backup (Fig. 2(f)) has a dispute wheel. However, it is easy to see that it is solved by Greedy. In fact, at iteration 1 path (4 0) is compatible with π because (4, 0) ∈ E, 0 ∈ V0 , and π(0) = (0). Since (4 0) is also highest ranked at vertex 4, we have that V1 = {0, 4} and π is updated setting π(4) = (4 0). At iteration 2 vertex 3 enters the stable set. In fact, (3 4 2 0) is not compatible with π since π(4) = (4 2 0), while (3 0) is compatible with π. Therefore, we set V2 = {0, 4, 3} and π(3) = (3 0). At iteration 3 vertex 1 enters the stable set, because (1 3 0) is the best ranked path compatible with π. We set V3 = {0, 4, 3, 1} and π(1) = (1 3 0). Last, at iteration 4 also vertex 2 can enter the stable set, since (2 1 0) is the not compatible with π, making (2 0) the best compatible path. Hence, we have that V4 = {0, 4, 3, 1, 2} = V and π(2) = (2 0).
5
Link Costs and Commercial Relationships
In this section we discuss the interplay between the stability of SPVP instances and several real-life constraints. 5.1
Cost-Consistent Instances
In computer networks quite often links have a cost. Hence, it is natural to rank the paths according to their cost. Consider an SPVP instance (G, P, Λ) and suppose that the edges of G have a cost. Let the cost function c be such that no cycle exists with a nonpositive cost and suppose that the paths are ranked by Λ according to their cost. We say that (G, P, Λ) is cost-consistent with c. We define Cost-Consistent as the set of SPVP instances that are cost-consistent with at least one cost function [10].
(Un)-Stable Routing in the Internet
9
Theorem 9. Cost-Consistent ⊂ No-Dispute-Wheel. Proof. Part 1 (⊆): The absence of dispute wheels in cost-consistent instances is proved in [10]. Part 2 (⊂): Incoherent (Fig. 2(g)), a simplification of an instance presented in [10], is an example of instance that has no dispute wheel and is not cost-consistent with any cost function. Assign variables to edges according to Fig. 2(g). Since path (3 2 1 0) is preferred over (3 2 0), the cost function must be such that a + b + d < a + c. Also, since (2 0) is preferred over (2 1 0) we have c < b + d, yielding a contradiction. 5.2
Modeling Commercial Relationships
From the economic perspective, relationships between ASes can be classified as customer-provider or peer-peer. In order to implement these agreements, routing policies must obey several constraints. In [11] it has been observed that an SPVP instance (G, P, Λ) modeling these constraints must be as follows. The neighbors of each vertex of G can be partitioned into three sets: customers, providers, and peers, such that: (i) Each path of P is valley-free: providercustomer and peer-peer edges can only be followed by provider-customer edges. (ii) Function Λ is such that, for each vertex of G, paths through customers are ranked better than paths through peers that, in turn, are ranked better than paths through providers (prefer-customer ranking). (iii) Relationships are acyclic. In [18] it is shown that the valley-free condition can be tested efficiently: Theorem 10. Given an SPVP instance it takes polynomial time to test whether the neighbors of each vertex of G can be partitioned into three sets: customers, providers, and peers, such that each permitted path is valley-free [18]. Good-Gadget (Fig. 2(a)) and Incoherent (Fig. 2(g)) are examples of instances that admit a valley-free assignment of commercial relationships such that the path rankings are prefer-customer. Two such assignments are shown in Figs. 2(h) and 2(i), where edges go from customers to providers. The layering emphasizes the customer-provider hierarchy. Theorem 11. Customer-Provider ∩ Cost-Consistent = Cost-Consistent. Proof. We have already shown in the proof of Theorem 9 that Incoherent (Fig. 2(g)) is not cost-consistent with any cost function. On the other hand, the policies in Incoherent are compatible with the customer-provider hierarchy depicted in Fig. 2(i). Theorem 12. Customer-Provider ∩ Cost-Consistent = Customer-Provider. Proof. It is easy to check that Costomer (Fig. 2(j)) is cost-consistent with the edge cost function which is presented in the figure. We now show that Costomer is not compatible with any customer-provider hierarchy. Consider edge (6, 7). We have three possibilities:
10
L. Cittadini, G.D. Battista, and M. Rimondini
130 10
1
210 20
2
130 10
1 120 10
0
1
210 20
2
0
3
30
210 20
420 430
4
(a) Good-Gadget. 130 10
1
320 30
3
0
(b) Bad-Gadget. 120 10
3420 30
3
2
(c) Disagree. 210 230 20 130
2
1
1
10
0 210 20
0
3
(d) Naughty-Gadget.
3210 320
210 20
1 10
3
30
20 210
1
130 10 30
20 210
3210 320
0
(g) Incoherent.
40 430 420
1 10 2
0
c
4
420 430
d
b
2
2
(f) Bad-Backup.
3 a
210 20
(e) Di-Safe-gree. 4
3420 30
0
430 420
4
2
3
2
0
3
(h) Layered Good-Gadget. (i) Layered Incoherent. 1 10
60 650
6
10
60 650
6
10
760
7 7850 7650
10 100
50
1 50 560
2
7650
10
0
20 210
760
7 7850
850
5
1
(j) Costomer.
8 8760 8560
3210 320
3
0
100
50
1 50 560
850
5
1
(k) Nocust-Nolowest-omer. Fig. 2. Interesting instances of SPVP
8 8760 8560
(Un)-Stable Routing in the Internet
11
i. 6 is a provider of 7. Since λ7 ((7 6 5 0)) < λ7 ((7 8 5 0)) < λ7 ((7 6 0)), 8 must be a provider of 7 as well. Then path (8 7 6 0) contains a valley. ii. 6 is a peer of 7. As above, 8 is also a peer of 7, and path (8 7 6 0) contains two consecutive peer-peer edges. iii. 6 is a customer of 7. Applying the same argument as above, we conclude that 7 is a provider of 8. By looking at the path ranking at 8 we have that λ8 ((8 7 6 0)) < λ8 ((8 5 6 0)) implies that 5 is also a provider of 8. Then path (7 8 5 0) forms a valley. Theorem 13. Customer-Provider ⊂ No-Dispute-Wheel. Proof. Part 1 (⊆): Customer-provider instances cannot have a dispute wheel [19]. Part 2 (⊂): Costomer (Fig. 2(j)) has no dispute wheel, since it is costconsistent with an edge cost function. On the other hand, from the proof of Theorem 12 we have that Costomer ∈ Customer-Provider. Theorem 14. Customer-Provider ∪ Cost-Consistent ⊂ No-Dispute-Wheel. Proof. It is possible to merge Costomer and Incoherent together, obtaining Nocust-Nolowest-omer (Fig. 2(k)). Since the building blocks are completely independent and do not form a dispute wheel, then Nocust-Nolowest-omer ∈ No-Dispute-Wheel. On the other hand, the proofs of Theorems 9 and 13 ensure that the instance is neither in Cost-Consistent nor in Customer-Provider.
6
Concluding Remarks
In this paper we have presented a survey on the state of the art knowledge about BGP stability, relating existing results by means of some new original contributions. Many other contributions have been proposed in the literature on the BGP stability problem, but they do not fit the scope of this paper. For example, several proposals have been presented to modify BGP in such a way to improve its convergence properties [20,21,22,23,24,25,26,27,28]. Also, there are modeling contributions on I-BGP, that is the part of the BGP protocol that is run by ISPs inside the ASes [29,30]. Interestingly, the SPVP model can be applied also in this context [14,17,31]. Further, [19] studies the robustness of BGP defined as the guaranteed convergence under any combination of link failures. Besides deep methodologies, the BGP stability field shows several open problems. For example, referring to the classes of Fig. 3, the following questions come naturally. Does it exist an SPVP instance that belongs to Safe but is not in Unique? Is it possible to explore the gap between the Greedy-Solvable and the Safe classes introducing further algorithms and/or conditions that better characterize safety? Is it possible to check if an SPVP instance belongs to the Customer-Provider class in polynomial time?
12
L. Cittadini, G.D. Battista, and M. Rimondini
Fig. 3. Relationships between the classes of SPVP instances. Black dots with letters represent instances from Fig. 2. The black dot with a question mark indicates that an instance of that subset has not been found yet.
References 1. Rekhter, Y., Li, T., Hares, S.: A Border Gateway Protocol 4 (BGP-4). RFC 4271 (Draft Standard) (January 2006) 2. Griffin, T.G., Shepherd, F.B., Wilfong, G.: The stable paths problem and interdomain routing. IEEE/ACM Trans. on Networking 10(2), 232–243 (2002) 3. Carlzon, M.: Bgp oscillations when peering with loopback addresses. In: Proc. AINA 2006 (2006) 4. Varadhan, K., Govindan, R., Estrin, D.: Persistent route oscillations in interdomain routing. Computer Networks 32(1), 1–16 (2000) 5. Kin Chau, C.: Policy-based routing with non-strict preferences. In: Proc. SIGCOMM 2006, pp. 387–398 (2006) 6. Griffin, T.G., Sobrinho, J.L.: Metarouting. In: Proc. SIGCOMM 2005, pp. 1–12 (2005) 7. Sobrinho, J.L.: An algebraic theory of dynamic network routing. IEEE/ACM Trans. on Networking 13(5), 1160–1173 (2005) 8. Griffin, T.G., Wilfong, G.T.: A safe path vector protocol. In: Proc. INFOCOM 2000, pp. 490–499 (2000) 9. Griffin, T.G., Wilfong, G.: An analysis of bgp convergence properties. Proc. SIGCOMM 1999 29(4), 277–288 (1999) 10. Griffin, T.G., Shepherd, F.B., Wilfong, G.: Policy disputes in path-vector protocols. In: Proc. ICNP 1999, pp. 21–30 (1999) 11. Gao, L., Rexford, J.: Stable internet routing without global coordination. In: Proc. SIGMETRICS 2000, pp. 307–317 (2000)
(Un)-Stable Routing in the Internet
13
12. Cittadini, L., Di Battista, G., Rimondini, M.: How Stable is Stable in Interdomain Routing: Efficiently Detectable Oscillation-Free Configurations. Technical Report RT-DIA-132-2008, Universit` a Roma Tre (July 2008) 13. Fabrikant, A., Papadimitriou, C.: The complexity of game dynamics: Bgp oscillations, sink equilibria, and beyond. In: Proc. SODA, pp. 844–853 (2008) 14. Jaggard, A.D., Ramachandran, V.: Robust path-vector routing despite inconsistent route preferences. In: Proc. ICNP 2006, pp. 270–279 (2006) 15. Feamster, N., Johari, R., Balakrishnan, H.: Implications of autonomy for the expressiveness of policy routing. IEEE/ACM Trans. on Networking 15(6), 1266–1279 (2007) 16. Jaggard, A.D., Ramachandran, V.: Robustness of class-based path-vector systems. In: Proc. ICNP 2004, pp. 84–93 (October 2004) 17. Rawat, A., Shayman, M.A.: Preventing persistent oscillations and loops in ibgp configuration with route reflection. Computer Networks 50(18), 3642–3665 (2006) 18. Di Battista, G., Erlebach, T., Hall, A., Patrignani, M., Pizzonia, M., Schank, T.: Computing the types of the relationships between autonomous systems. IEEE/ACM Trans. on Networking 15(2), 267–280 (2007) 19. Gao, L., Griffin, T., Rexford, J.: Inherently safe backup routing with BGP. In: Proc. INFOCOM 2001, pp. 547–556 (2001) 20. Ahronovitz, E., Konig, J.-C., Saad, C.: A distributed method for dynamic resolution of bgp oscillations. In: Proc. IPDPS 2006 (April 2006) 21. Bremler-Barr, A., Afek, Y., Schwarz, S.: Improved bgp convergence via ghost flushing. In: Proc. INFOCOM 2003, vol. 2, pp. 927–937 (2003) 22. Cobb, J.A., Gouda, M.G., Musunuri, R.: A stabilizing solution to the stable path problem. In: Proc. Self-Stabilizing Systems, pp. 169–183 (2003) 23. Ee, C.T., Ramachandran, V., Chun, B.G., Lakshminarayanan, K., Shenker, S.: Resolving inter-domain policy disputes. Technical Report UCB/EECS-2007-27, EECS Department, University of California, Berkeley (February 2007) 24. Klockar, T., Carr-Motyˇckov´ a, L.: Preventing oscillations in route reflector-based i-bgp. In: Proc. ICCCN 2004, pp. 53–58 (2004) 25. Luo, J., Xie, J., Hao, R., Li, X.: An approach to accelerate convergence for path vector protocol. In: Proc. GLOBECOM 2002, vol. 3, pp. 2390–2394 (2002) 26. Musunuri, R., Cobb, J.A.: A complete solution for ibgp stability. In: Proc. IEEE International Conference on Communications (ICC 2004), vol. 2, pp. 1177–1181 (June 2004) 27. Pei, D., Zhao, X., Wang, L., Massey, D., Mankin, A., Wu, S.F., Zhang, L.: Improving bgp convergence through consistency assertions. In: Proc. INFOCOM 2002, vol. 2, pp. 902–911 (2002) 28. Zhang, H., Arora, A., Liu, Z.: A stability-oriented approach to improving bgp convergence. In: Proc. IEEE Intl. Symposium on Reliable Distributed Systems 2004, pp. 90–99 (2004) 29. Basu, A., Ong, C.-H.L., Rasala, A., Shepherd, F.B., Wilfong, G.: Route oscillations in i-bgp with route reflection. In: Proc. SIGCOMM 2002 (2002) 30. Griffin, T.G., Wilfong, G.: On the correctness of ibgp configuration. Proc. SIGCOMM 2002 32(4), 17–29 (2002) 31. Griffin, T.G., Wilfong, G.T.: Analysis of the med oscillation problem in bgp. In: Proc. ICNP 2002, pp. 90–99 (2002)
Memory Efficient Anonymous Graph Exploration 1 Leszek Gasieniec ˛ and Tomasz Radzik2 1
2
Department of Computer Science, University of Liverpool, Liverpool L69 3BX, United Kingdom
[email protected] Department of Computer Science, King’s College London, Strand, London WC2R 2LS, United Kingdom
[email protected]
Abstract. Efficient exploration of unknown or unmapped environments has become one of the fundamental problem domains in algorithm design. Its applications range from robot navigation in hazardous environments to rigorous searching, indexing and analysing digital data available on the Internet. A large number of exploration algorithms has been proposed under various assumptions about the capability of mobile (exploring) entities and various characteristics of the environment which are to be explored. This paper considers the graph model, where the environment is represented by a graph of connections in which discrete moves are permitted only along its edges. Designing efficient exploration algorithms in this model has been extensively studied under a diverse set of assumptions, e.g., directed vs undirected graphs, anonymous nodes vs nodes with distinct identities, deterministic vs probabilistic solutions, single vs multiple agent exploration, as well as in the context of different complexity measures including the time complexity, the memory consumption, and the use of other computational resources such as tokens and messages. In this work the emphasis is on memory efficient exploration of anonymous graphs. We discuss in more detail three approaches: random walk, Propp machine and basic walk, reviewing major relevant results, presenting recent developments, and commenting on directions for further research.
1 Introduction A graph is a crucial combinatorial notion used for modeling complex systems in various application domains including communication, transportation and computer networks, manufacturing, scheduling, molecular biology and peer-to-peer networks. Models based on graphs often involve mobile entities which can move throughout the graph from node to node along the edges. We call such entities agents. An agent can be a robot servicing a hazardous environment, or a software process navigating the Internet in search for some information. Graph exploration refers to problems of designing algorithms (protocols) for an agent, or a group of agents, to traverse a graph in a systematic and efficient way. In recent years the research on efficient graph exploration gathered a new momentum, generated to large extent by the theory and the applications coming ever closer together. The demand for efficient practical solutions has increased as systems of software agents moving through a large network of computers have become reality. Another H. Broersma et al. (Eds.): WG 2008, LNCS 5344, pp. 14–29, 2008. c Springer-Verlag Berlin Heidelberg 2008
Memory Efficient Anonymous Graph Exploration
15
example is the relevance of efficient graph exploration algorithms for efficiency of the Internet search engines. The current applications indicate that the relative importance of various aspects of graph exploration has been changing, and those changes become reflected in the theoretical research. In the broad context of algorithmic agent design we distinguish two main models: the geometric model where the search environment is represented by two- or higherdimensional space (see, e.g., [11,28,59]) and the graph model, considered in this paper, where the environment is represented by a finite or infinite graph supported by discrete moves permitted only along its edges. The design of efficient exploration algorithms in the graph model has been extensively studied under many different assumptions, e.g., directed vs undirected graphs, anonymous nodes vs nodes with distinct identities, or deterministic vs probabilistic solutions, as well as with different performance objectives in mind including optimal time complexity, memory consumption, or use of other resources, see [1,6,9,29,30,31,34,41,56]. Different studies may also consider different aims of exploration. The aim of exploration can be to visit each node in the network, or each edge, and terminate. Alternatively, one may drop the termination requirement and ask only for perpetual exploration and a guarantee that each node is visited infinitely many times, or perhaps a stronger guarantee that the nodes are being visited with similar frequencies. If nodes have distinct identities (given as O(log n)-bit words), the graph stays unchanged (a static graph), and the size of the memory available to the agent (counted in words) is linear in the number of nodes of the graph, then the depth-first search (DFS) procedure gives linear time exploration. However, in many applications one or more of these assumptions might not hold. The nodes may not have unique identities; for example, if the nodes represent very simple devices (anonymous graphs). The graph may keep changing; for example, if it models a growing peer-to-peer network (dynamic graphs). Finally, the agents may have very limited memory, which may be sufficient for storing only few node identities. For example, software agents moving through a computer network from host to host might not be allowed to carry too much data with them. This survey is mainly concerned with exploration of anonymous graphs by agents equipped with bounded memory. In graph exploration algorithms, the memory utilisation refers actually not only to the memory of the agents (“carried” by them when they move from node to node), but also to any extra memory required in the graph environment. The latter may store some (pre-computed) additional information about the graph to guide the exploration, or may allow the agent to leave marks at nodes or to move tokens as it traverses. The demand for simple and cost effective agents as well as the desire to design exploration algorithms that are suitable for rigorous mathematical analysis imply the importance of limiting the local memory of agents and their ability to manipulate the explored environment. One of the most challenging problems in the theory of computation is to look at the far ends, border cases, of the considered models. In case of algorithmic agent design such a border case may refer to the size of the agent’s memory, where one can limit the memory of an agent to a constant number of bits. This case is very often modeled as graph exploration by a finite state automaton and it has been extensively studied already in the 1970’s [15,54,58,61]. Probably the strongest result in this setting
16
L. Gasieniec ˛ and T. Radzik
is due to Cook and Rackoff [19]. They proved that a fixed group of finite automata, that can permanently cooperate and that can use "teleportation" to move from their current location to the location of any other automaton, cannot explore all graphs. See [42] for some recent results about limits of graph exploration with finite automata. These results imply that we either have to allow the agents to use larger memory, or to divert to randomization, or to provide the agents with extra structural information that restricts the set of graphs they have to traverse. It has been known for some time that if we do not place strict restrictions on the local memory, then a single pebble is sufficient to explore an anonymous undirected graph. This result was extended to directed graphs by Bender et al. [8]. Note however that a good upper bound on the number of nodes must be known to avoid an exponential-time solution. Moreover, even if such a bound is known, the time complexity, while polynomial, remains impractically high. Another possibility is to drop determinism and to look for randomized solutions. It is known, e.g., that a random walk of length O(n3 log n) visits all nodes of an arbitrary n-node graph with high probability [3]. Attempts to regain determinism included research on derandomization of random walks and the main approach was universal traversal sequences [3] that provide guidance in deterministic traversal of all graphs in a given class. Several important results have been achieved [4,7,46,60] including Reingold’s [60] recent asymptotically optimal O(log n)-space deterministic algorithm for the undirected st-connectivity problem based on a novel O(log n)−bit navigation mechanism. However, note that the exploration time given by this algorithm is a polynomial of a rather high degree. Research closely related to the setting adopted in this paper assumes some structural information about the explored environment. Such additional information allows improvements in the time or memory complexity of graph traversal. The first results, concerning exploration of a labyrinth using a compass, are due to Blum and Kozen [12]. Later, Flocchini et al. [39] introduced a more general notion of sense of direction and proved that traversal can be performed using O(n) messages/agent moves in this model [38]. Fraigniaud et al. [40] have shown that interval routing scheme can be used to achieve the same goal. In fact, given a spanning tree, the graph can be traversed using O(n) moves. Pelc and Panaite [56] studied the impact of having a map of the graph on the efficiency of graph exploration. Finally Cohen et al. studied efficient navigation in graphs with nodes marked with a constant number of colors, see [18]. In this paper we focus on three graph traversal methods. We start with the probabilistic random walk method and then discuss its recently proposed deterministic counterpart known as the Propp machine, which requires some (small) memory at the nodes of the graph. We conclude this survey with presentation of an alternative traversal method based on the basic walk, in which a small amount of memory is provided to an agent and a certain type of graph preprocessing is permitted. These three methods have several interesting combinatorial properties and one might say that they have already set certain standards in agent based anonymous graph exploration.
2 The Graph Model In this survey we consider environments represented by undirected (symmetric) graphs. We denote by G = (V, E) the graph which is to be explored, and assume that it is
Memory Efficient Anonymous Graph Exploration
17
connected, unless stated otherwise. It will sometimes be convenient to view G as a di← → graph G obtained by replacing each undirected edge with two arcs pointing in opposite directions. We consider graphs (environments) that are anonymous, i.e., the nodes in the graphs are neither labeled nor marked in any other way. However, the ends of edges incident to each node v are ordered and often labeled by consecutive integers 1, . . . , dv called port numbers, where dv is the degree of v. If an agent is in the current step at a node v, then the standard assumptions are that it knows dv , the label of the port through which it has entered v and any information about the graph that it might have gathered in previous steps and has been able to (has been allowed to) store in its internal limited memory. The agent decides on the basis of this knowledge which port it should take to move in the next step to a neighbour of v. Agents do not have prior knowledge about the topology of the network. The exact details about the resources and abilities of the agents as well as about the objectives of exploration may vary from problem to problem. The number of nodes and the number of edges in G are denoted by n and m, respectively, but note that these parameters might not be known to the exploring agents.
3 The Random Walk A random walk on an (undirected, connected) graph G starting at a node v0 is an (infinite) random sequence (v0 , v1 , v2 , . . .) of nodes in G such that for each i ≥ 1, node vi is selected randomly and uniformly from all neighbours of node vi−1 . Using the graph exploration terminology, we say that an agent moves in step i from node vi−1 to its random neighbour vi . To implement such random exploration of an arbitrary n-node graph, the agent has to be able to select a random neighbour of the current node, so it needs O(log n)-bit memory and access to log n random bits per step. The (node) cover time of graph G from a node v is the expected number of steps Cv (G) the random walk starting from node v takes to visit all nodes of the graph. The cover time C(G) of graph G is defined as the maximum Cv (C) over all nodes v ∈ V . Thus the cover time is the worst-case (over all starting nodes) expected time of exploring the whole graph. For graphs of some special types, the cover time can be easily estimated, or even calculated exactly. For example, it is easy to show that the cover time of the graph Pn which is an n-node simple path is equal to C(Pn ) = (n−1)2 , by solving a simple recurrence relation for the number expected number of steps Hi required to reach the end of the path starting from its i-th node. Calculation of the cover time of the n-node clique Kn is the coupon collector problem: at step i select randomly and uniformly one of the n coupons/nodes and wait until all coupons have been seen, with a slight modification that the next coupon/node has to be different from the one just selected. If we have already seen exactly i distinct nodes, then the probability that in the next step we will see a new node is equal to (n − i)/(n − 1), so the expected number of steps before a new node is encountered is equal to (n − 1)/(n − i) and the cover time n−1 n−1 C(Kn ) is equal to i=1 (n − 1)/(n − i) = (n − 1) i=1 1/i = n(ln n + O(1)). Random walks became an important tool in algorithm design and complexity theory when Aleliunas et al. [3] showed in 1979 that the cover time of every graph is polynomial, or more specifically, at most 2m(n − 1). Since then general techniques for
18
L. Gasieniec ˛ and T. Radzik
bounding the cover times have been developed and bounds for the cover times for various families of graphs have been derived. An agent using a random walk on an n-node graph with the cover time bounded by T (n) = poly(n) should have an O(log n)-bit counter to count T (n) steps to terminate with the knowledge that the whole graph has been explored with constant probability, or to count T (n)p log n steps to terminate with the knowledge the whole graph has been explored with the high probability of at least 1 − 1/np . Thus a good bound T (n) on the cover time is required not to expand unnecessarily the exploration time, and we review below the main known bounds. Observe that an agent implementing a random walk needs memory for two purposes. It needs O(log Δ) bits to implement individual moves from the current node to a random neighbour, where Δ ≤ n is a bound on the degree of a node, and O(log n) bits to count the moves. If we do not require that the agent terminates, than the total of O(log Δ) bits suffices. In particular, constant-size memory is sufficient for the randomized perpetual exploration of any constant degree graph. Feige [36,35] showed the following tight bounds on the range of the cover times of n-node graphs: 4 (1 − o(1))n ln n ≤ C(G) ≤ (1 + o(1)) n3 . 27 Thus Kn is an example of a graph with the cover time achieving the lower bound, while it can be shown that the n-node lollipop graph given in Figure 1 has the cover time achieving the upper bound. A quadratic O(n2 ) upper bound on the cover time of regular graphs was first shown by Kahn, Linial, Nisan and Saks in 1989, and the best know bound of 2n2 is due to Feige [37]. This worst-case upper bound for regular graphs should be contrasted with Rubinfeld’s [62] O(n log n) bound on the cover time of regular expander graphs, and with Cooper and Frieze’s [20] recent result showing that the cover time of a random d-regular graph is (1 + o(1)) d−1 d−2 n ln n with high √ √ probability. The cover time of the 2-dimensional n × n grid is Θ(n log2 n), with the upper bound due to Chandra et al. [17] and the lower bound due to Zuckerman [65]. Aldous [2] showed that the cover time of the n-node k-dimensional grid is Θ(n log n), for k ≥ 3. Aleliunas’ et al. [3] polynomial upper bound on the cover time of an arbitrary graph was an important result for the computational complexity theory as it showed that the undirected s-t connectivity problem can be solved by a randomised log-space algorithm. This started a vast body of research with the goal to settle the conjecture that
Fig. 1. The n-node lollipop graph: (n/3)-node path connected to n-node clique
Memory Efficient Anonymous Graph Exploration
19
this problem can be solved by a deterministic log-space algorithm, and, ultimately, the more general conjecture that any problem solvable by a randomised log-space algorithm can be solved by a deterministic log-space algorithm. A natural approach to settle the first conjecture was to de-randomise random walks. In this framework the objective was to produce an explicit universal traversal sequence (UTS), i.e., a sequence p1 , . . . , pk of port labels, such that the path guided by this sequence visits all edges of any graph of a given size. It is known that, with high probability, a sequence of length O(n3 d2 log n), chosen uniformly at random, guides a walk in any d-regular (connected) n-node graph [3]. Unfortunately, explicit short UTS are known only for special families of graphs, including 2-regular graphs [7,13,16,50,53], 3-regular graphs [49], cliques [51], and expanders [46]. Some of these sequences can be constructed in logspace, providing exploration with O(log n)-bit memory. Kouck`y [52] introduced the notion of a universal exploration sequence (UXS), i.e., a sequence q1 , . . . , qk such that the agent leaves the current node x via port p + qi at the ith step, where p is the label of the port through which the agent entered node x. This notion allows to construct simpler and shorter sequences, for example, 1n is a UXS for n-node cycles, and (10)n is a UXS for n-node cliques. Reingold [60] has recently showed that a UXS for general graphs is log-space constructible, providing a deterministic log-space algorithm for undirected s-t connectivity and settling the first of the above two conjectures. Note that both UTS and UXS require a priori knowledge of the size of the network. If an agent uses an UTS or UXS for exploration, with stopping, of graphs (of some type) of size at most n, then it does not know at the termination whether the graph has at most n nodes, or whether it is larger and possibly not fully explored. A random walk on a graph is an example of a finite-state Markov chain and has often been studied within this general context, with its central issue of the stationary distribution and the rate of convergence to this distribution. If a random walk starts at a node s (v0 = s), then the i-th node vi on the walk is the random variable with distribution πsi , where πsi (v) = Prob(vi = v). The stationary distribution π is the probability distribution on the set of nodes defined by π(v) = limi→∞ πsi (v), if these limits exist and are independent of the starting node s. The stationary distribution exists for every connected non-bipartite graph, and is equal to π(v) = deg(v)/(2m). (For a bipartite graph, since there is no odd-length cycle, a random walk can visit a given node v either only in even steps, or only in odd steps, so limi→∞ πsi (v) is not defined. Not to exclude bipartite graphs, the inconvenience of not having an odd length cycle is usually dealt with by allowing the walk to stay at the current node with, say, probability 1/2, or, equivalently, by adding self-loops to the graph.) The rate of convergence to the stationary distribution is usually measured by the mixing time, defined as the first step t when the distribution πst of the random variable vt is guaranteed to be close to the stationary distribution π. More precisely, the mixing time is the minimum t such that maxs,v∈V {|πst (v) − π(v)|} ≤ 1/n3 , though other definitions of the distance between two distributions, and degrees of closeness other than 1/n3 have also been used. The random walk is rapidly mixing, if the mixing time is short, say O(n ) for a small constant . Among the constant degree graphs, expanders have the best possible O(log n) mixing time.
20
L. Gasieniec ˛ and T. Radzik
The advantage of a random walk as a strategy for exploring a graph is its simplicity and low memory requirements. Its main drawback is the time required to complete the exploration, which is given by the cover time and can be as high as Ω(n3 ). Thus a natural question is to reduce the cover time, if possible, for example by considering nonuniform transition probabilities, or by allowing the walking agent to gather, and use, some limited information about the graph. Ikeda et al. [47] considered the nonuniform probabilities p(v, u) of moving from a node v to its neighbour u such that p(v, u )/p(v, u ) = (deg(u )/ deg(u ))1/2 , for any two neighbours u and u of node v. They showed that these transition probabilities lead to an O(n2 log n) bound on the cover time of any graph. This quite remarkable reduction from the O(n3 ) bound of the uniform random walk, comes unfortunately with a cost. To implement this non-standard random walk, each node of the graph has to store information about the degrees of its neighbours, or the agent has to visit first all neighbours to gather this information. Ikeda et al. [47] showed also that the O(n2 log n) bound is close to the best what we can hope for, since for any transition probabilities defined on an n-node path, the cover time is Ω(n2 ). If we are looking for graph exploration with k ≥ 2 agents, then we would like to know good bounds on the cover time by k random walks: the expected number of steps until each node has been visited by at least one random walk (assuming all agents move simultaneously in synchronised steps). Observe that it may be, and indeed is, crucial what are the relative positions of the starting nodes of the walks. Broder et al. [14] considered k independent random walks starting from the stationary distribution (the starting node of walk i is a node v with probability π(v)) and showed an O((m2 log3 n)/k 2 ) bound on the cover time. Thus, for example, for constant degree graphs, the speed-up (the ratio of the cover times of a single random walk and k random walks) can be Ω(k 2 / log3 n). Recently Alon et al. [5] showed bounds on the speed-up of k independent random walks starting from the same node, including a Θ(log k) speed-up for n-node cycles, if log k = O(n), and an Ω(k) speed-up for n-node expanders, if k ≤ n. Cooper et al. [22] considered k independent random walks on random regular graphs, and analysed the cover time and the time required to achieve certain interaction between the agents. Random walks have been also applied in the context of exploring dynamic graphs. Cooper and Frieze [21] considered a random walk on a dynamic graph growing according to some random process, and analysed the expected proportion of visited vertices. Law and Siu [55] and Cooper et al. [23] used graph exploration with random walks to create new, random edges in a process of building and maintaining a well connected network.
4 The Propp Machine We consider now a type of graph exploration where the agents have no operational memory and the whole steering mechanism is provided within the environment. Thus the agents may actually be viewed as mere tokens which are being moved around the graph. We discuss the deterministic mechanism of the rotor-router model, which was introduced by Priezzhev in [57], further popularised by James Propp, and now known
Memory Efficient Anonymous Graph Exploration
21
also as the Propp machine. In this model each node of the graph G is equipped with a small marker indicating the exit port (the edge) to be taken by an agent on the conclusion of the next visit to this node. After the agent leaves the node, the marker is moved immediately to the next port in the cyclic order. The rotor-router model has been introduced as a deterministic alternative to the random walk method. Its advantages include the balanced usage of exit ports at each node, replacing the “coupon collector” nature of the usage of ports by the random walk method. The research on this model splits naturally into two directions associated with finite and infinite graphs. The main question for finite graphs is about properties of the periodic tour that has to be eventually adopted by the agent. For infinite graphs the Propp machine model was mainly investigated in the context of balancing schemes for even distribution of workload in networks. Finite Graphs. Note that if an agent follows the rotor-router mechanism in the Propp machine defined on a finite graph, the agent must eventually lock itself in a tour of limited size. This is a straightforward consequence of the fact that the number of configurations based on positions of markers on exit ports and location of the agent is bounded by n(dmax )n , where dmax is the maximum degree of a node. However, and rather surprisingly, following the rotor-router mechanism leads to a periodic tour that ← → corresponds to an Euler tour defined on G [10]. Moreover this periodic phenomenon starts occurring very early, namely within O(|E|·n) steps, independently of the original configuration of the port numbers and markers as well as the agent’s location. Yanovski et al. [64] improved this bound by showing that in fact 2|E| · D steps suffice to form an Euler tour, where D is the diameter of G. On the other hand a lower bound Ω(|E| · D) can be obtained on a lollipop graph (of a general structure as in Figure 1) in which exit ports and markers in the clique with Ω(|E|) edges are set to form an Euler tour, and markers on the external path of length D are placed on ports leading towards the clique. Yanovski et al. [64] studied also behaviour of a multi-agent system of explorers in the Propp machine where the agents cooperate via shared markers. When l agents want to exit from the same node in the same step, then they all leave this node in this step through the next l consecutive ports (according to an arbitrary assignment of the agents to these l ports, and sending multiple agents through the same ports, if l is greater than the degree of the node). They proved that for a team of k agents, the numbers of edge visits in the networks are balanced up to a factor of two within at most 2(1 + k1 )|E|D steps. Infinite Graphs. In the context of infinite graphs the rotor-router has been mostly studied as a deterministic analogue of the random walk approach to balancing the workload in a network, and the main question has been how similar these two processes are. The agents are now tokens, which are initially distributed among the nodes in some, possibly uneven, way (for example, they all may be initially piled up on one node). The random walk approach balances the load of tokens among nodes by sending them along independent random walks of the same length t. Let Et (v) denote the expected number of tokens which end up at a node v. The rotor-router process starting with the same initial distribution of tokens and executing t (deterministic) steps reaches a configuration with at (v) tokens at node v. The question of similarity of these two processes is the
22
L. Gasieniec ˛ and T. Radzik
question of analysing the node discrepancies |at (v) − Et (v)|. In particular, Cooper and Spencer [24] studied this question for d-dimensional grids and showed that all node discrepancies are bounded by a constant, which depends on d, but does not depend on the initial configuration, the total time t and the initial rotor settings. For example, they showed a bounding constant for d = 1 which is ≈ 2.3. This work was followed by a detail study of the 2-dimensional grid by Doerr and Friedrich [33]. They provided evidence that the exact (constant) value of the maximum node discrepancy depends on the choice of rotor sequences. The situation is different in the case of k-ary trees: for any number D, there exists an initial configuration of tokens, a number t and a node v such that after t steps of the rotor-router process node v has at least D tokens more than it is expected to get in the random walk process [25].
5 The Basic Walk The basic walk method is based on an observation that one can cover a graph G = ← → (V, E), or more precisely its symmetric digraph counterpart G , by a collection of directed cycles. The cycles are formed according to a simple rule. At any node v with the degree dv , the incoming arc incident via a port i becomes the predecessor of the outgoing arc incident via port (i mod dv ) + 1. Note that since each arc in the digraph has a unique predecessor as well as a unique successor a collection of arc-disjoint cycles containing all arcs in the digraph is formed. Figure 2 shows an example. 1
1
2
3
2
1
3
1
2
1 2
2
2
2 1
4
1
3
3
2
1
1 3
2
Fig. 2. The formation of cycles
Note also that a certain arrangement of the port numbers may lead to a cycle that visits all nodes in the graph (symmetric digraph), see Figure 3. We call such a cycle a witness cycle, see [32]. The presence of a witness cycle is very convenient in the context of graph exploration, since it can be used by a very simple mobile entity to periodically visit all nodes in the graph. We consider two types of graph traversal based on the basic walk method. In the oblivious model an agent has no operational memory. It is equipped with a simplest possible mechanism that allows it to follow a single cycle in the collection of cycles
Memory Efficient Anonymous Graph Exploration 1
1
2
3
1
4
3
2
2
1 2
2
2
23
2 1
1
2
3
3
1
1
1 3
2
Fig. 3. A witness cycle
covering the input graph. In this model the main task is to provide port labeling to the input graph such that a witness cycle is formed. Moreover one is interested in forming a shortest possible witness cycle. Note that in this model an agent traverses indefinitely along the chosen cycle since its has no memory to make any decisions and no state to stop. In the adaptive model an agent is provided with small (constant number of bits) memory that allows the agent to switch between different cycles in order to shorten the route covering all nodes in the graph. Such an agent is often modeled as Mealy automaton, where the output (outgoing port number) depends on the input (incoming port number) and the state of the automaton. More formally the automaton has a transition function f and a finite number of states governing the actions of the agent. When the agent enters a node v of degree dv through port i, it switches to state s and exits the node through port i , where (s , i ) = f (s, i, dv ), see [44] for more detail description. Oblivious Traversal. The oblivious traversal based on the basic walk method was first proposed by Dobrev et al. in [32]. The authors claimed that there exists a port labeling, such that the oblivious agent requires at most 10n steps to visit all n nodes of a graph in a periodic manner. While the stated problem and several combinatorial observations, in particular merging and exchanging contents of cycles, attracted attention in the community, the bound of 10n on their port labeling turned out to be incorrect. Very recently Czyzowicz et al. in [27] proposed a polished version of the previous argument supported by a new combinatorial structure of a three-layer partition of graphs. This led to the first provably correct port labeling inducing a linear tour of length 4 13 n. Moreover, the labeling based on the three-layer partition can be performed in the optimal O(|E|)−time. The authors proposed also a non-trivial class of graphs in which one can select a spanning tree such that each node is incident to some edge outside of the spanning tree. For this class of graphs one can construct a labeling that forms a witness cycle of length ≤ 2n − 2. An example of formation of the witness cycle in this class of graphs is presented in Figure 4. Unfortunately the problem of deciding whether the input graph has a spanning tree with the required property is NP-hard since this problem corresponds to selection of a
24
L. Gasieniec ˛ and T. Radzik
a)
b)
c)
d)
e)
f) 4
2 1
3 4 3 2 1
Fig. 4. Formation of a witness cycle: a) an input graph, b) a spanning tree with external edges at each node is formed, c) excessive external edges are dropped, d) the spanning tree edges are doubled, e) the parity of nodes is repaired starting from leaves in the tree, f) remaining double (non-bridging) edges are dropped and a witness cycle is formed
3
1
1
2 2
2
1 2
1
3
1
1
2
3
2 1
2
1
3 3
2
1
....
1
2
3
3
3
2 1
2
1
1 2
3 2
1
2 2
1
3
Fig. 5. A feasible solution in which each edge must be used in two directions
Hamiltonian path in 3-regular graphs, which is known to be hard. The authors in [27] give also an n-node graph, shown in Figure 5, in which the witness cycle must contain ← → all arcs in G and therefore cannot be shorter than 2.8n. It is worth mentioning that the explicit labeling of ports in G is not essential in the oblivious graph traversal. In fact, it is enough to provide a periodic ordering of ports at each node in G. The agent when arrives at some node v via some port must know only its successor in the periodic order to continue the walk along the chosen cycle. Adaptive Traversal. In [48] David Ilcinkas noted that the tour used by an agent to visit all nodes in the graph can be shortened to 4n − 2 if the agent is provided with a 2-bit operational memory. The extra memory translated to a larger number of states allows the agent to perform context sensitive decisions including switching between the cycles available in the basic walk method. More precisely, Ilcinkas noticed that using a certain type of port labeling cycles and the extra memory bits, one can force the agent to follow an Euler tour defined on a chosen spanning tree T in G. The spanning tree contains a unique root edge er = (vr , wr ) that bears port number 1 at its both ends. Apart from vr
Memory Efficient Anonymous Graph Exploration
25
and wr every node u in G has a parent which is reachable from u via port 1. In fact one can also interpret that vr is a parent of wr and vice versa. All children of any node v in G (including root nodes) are reachable from v via ports 2 through cv + 1, where cv is the number of children of v in the spanning tree T . When the agent traverses along the Euler tour down in the tree it follows consecutive arcs of some cycle provided by the basic walk method. This process is terminated when for two consecutive nodes on the cycle v1 and v2 , the node v2 is entered via port different from 1, meaning that v2 is not a child of v1 in T. In this case the agent returns first to v1 and then to the parent v of v1 , concluding that there are no more children of v1 to be visited in T . The traversal is then continued along some other cycle starting at the next child (if any) of v. The edge (v1 , v2 ) is called a penalty edge since it does not belong to T and it contributes an extra two agent moves in the tour that visits all nodes in the graph. The total length of the tour can be bounded by 2n − 2 moves along edges in the spanning tree (each edge has to be visited in two directions) and 2n moves along the penalty edges (each node including root nodes may have incident edges not forming a part of the spanning tree T ). Thus the total length of the tour is bounded by 4n − 2. Ilcinkas claimed also that 4n − 2 is the exact bound for all agents equipped with a small (constant size) memory. et al. in [44] where they showed that the This claim was later disproved by Gasieniec ˛ length of the tour could be shortened to 3.75n − 2. The improvement was possible due to the observation that visits to penalty edges could be avoided at the fraction 18 of the nodes. They proved that one can construct port labeling in which either a large fraction of nodes is saturated (all incident edges to these nodes are present in the spanning tree) or there are large clusters of sibling leaves and extended leaves (paths of length 2) located at the bottom of the spanning tree. Within each cluster the penalty edges are visited only at the first sibling, while visiting all other siblings in the same cluster is penalty free. This result was recently further improved in [27] to 3.5n − 2 with help of the three-layer partition and sham edges that pretend to be penalty edges while serving as proper edges in the spanning tree. Note here that while the explicit labeling of ports in G is not essential in the adaptive graph traversal at least one port at each node has to be distinguished in order to form the hierarchical structure of the spanning tree T. More precisely the marked ports play the same role as ports 1 in the explicit labeling setting.
6 Conclusion The standard random walks are memoryless in the sense that the selection of the next node does not depend on the past. This assumption is important from the point of view of the probabilistic methods used in the theoretical analysis. Simulations show that the performance of random walks may be improved for some types of graphs, if the agents are allowed to remember, and use, some very limited information about the past. It would be very interesting to develop some theoretical analysis of such processes. Further work on the random walk approach should include further efforts on derandomisation with limited random access memory, ideally considering also the secondary objective of minimizing the time complexity. An interesting aspects of random walks can be considered in the context of efficiency of pseudo-random number generators. A
26
L. Gasieniec ˛ and T. Radzik
pseudo-random number generator can be seen as a deterministic steering mechanism of an agent and the efficiency of such a generator may be expressed as the efficiency of exploration in arbitrary graphs. Research on the rotor-router mechanism started only very recently and further results on comparing this approach with random walks should be coming in near future. One possible interesting question is whether the results for infinite graphs can be used to obtain implications for their finite counterparts. Also better understanding of Euler tours formed by the rotor-router mechanism by single and multiple robots would be highly appreciated. Another direction for studies of this model is graph exploration by agents granted dynamic port labeling mechanism. This would refer to creation of various geometrical shapes and surfaces. Finally, in the context of the basic walk approach, further understanding of witness cycles as well as tours used by agents equipped with a small memory is required. There is also very little known so far about the case when the ports at each node form a random permutation.
Acknowledgements Many thanks go to Colin Cooper, Jurek Czyzowicz, Stefan Dobrev, David Ilcinkas, Jesper Jansson, Ralf Klasing, Adrian Kosowski, Ioannis Lignos, Russell Martin, and Alfredo Navarra for a number of valuable discussions on the main themes of this survey.
References 1. Albers, S., Henzinger, M.R.: Exploring unknown environments. SIAM Journal on Computing 29, 1164–1188 (2000) 2. Aldous, D.J.: On the time taken by random walks on finite groups to visit every state. Journal Probability Theory and Related Fields 62(3), 361–374 (1983) 3. Aleliunas, R., Karp, R.M., Lipton, R.J., Lovasz, L., Rackoff, C.: Random walks, universal traversal sequences, and the complexity of maze problems. In: FOCS 1979, pp. 218–223 (1979) 4. Alon, N., Azar, Y., Ravid, Y.: Universal sequences for complete graphs. Discrete Appl. Math. 27(1-2), 25–28 (1990) 5. Alon, N., Avin, C., Koucky, M., Kozma, G., Lotker, Z., Tuttle, M.R.: Many random walks are faster than one. In: SPAA 2008: Proceedings of the twentieth annual symposium on Parallelism in algorithms and architectures, pp. 119–128. ACM, New York (2008) 6. Awerbuch, B., Betke, M., Rivest, R.L., Singh, M.: Piecemeal graph exploration by a mobile robot. Information and Computation 152(2), 155–172 (1999) 7. Bar-Noy, A., Borodin, A., Karchmer, M., Linial, N., Werman, M.: Bounds on universal sequences. SIAM J. Comput. 18, 268–277 (1989) 8. Bender, M., Fernandez, A., Ron, D., Sahai, A., Vadhan, S.: The power of a pebble: Exploring and mapping directed graphs. Information and Computation 176(1), 1–21 (2002) 9. Bender, M., Slonim, D.K.: The power of team exploration: two robots can learn unlabeled directed graphs. In: Proc. of FOCS 1994, pp. 75–85 (1994) 10. Bhatt, S., Even, S., Greenberg, D., Tayar, R.: Traversing Directed Eulerian Mazes. Journal of Graph Algorithms and Applications 6(2), 157–173 (2002)
Memory Efficient Anonymous Graph Exploration
27
11. Blum, A., Raghavan, P., Schieber, B.: Navigating in unfamiliar geometric terrain. SIAM Journal on Computing 26, 110–137 (1997) 12. Blum, M., Kozen, D.: On the power of the compass (or, why mazes are easier to search than graphs). In: Proc. of FOCS 1978, pp. 132–142 (1978) 13. Bridgland, M.F.: Universal traversal sequences for paths and cycles. J. Algorithms 8(5), 395–404 (1987) 14. Broder, A.Z., Karlin, A.R., Raghavan, P., Upfal, E.: Trading space for time in undirected s-t connectivity. SIAM J. Comput. 23(2), 324–334 (1994) 15. Budach, L.: Automata and labyrinths. Math. Nachrichten, 195–282 (1978) 16. Buss, J.F., Tompa, M.: Lower bounds on universal traversal sequences based on chains of length five. Inf. Comput. 120(2), 326–329 (1995) 17. Chandra, A.K., Raghavan, P., Ruzzo, W.L., Smolensky, R.: The electrical resistance of a graph captures its commute and cover times. In: Proc. STOC 1989: Proceedings of the twenty-first annual ACM symposium on Theory of computing, pp. 574–586. ACM Press, New York (1989) 18. Cohen, R., Fraigniaud, P., Ilcinkas, D., Korman, A., Peleg, D.: Label-guided graph exploration by a finite automaton. In: Proc. of the 32nd International Colloquium on Automata, Languages and Programming (ICALP), pp. 335–346 (2005) 19. Cook, S.A., Rackoff, C.: Space lower bounds for maze threadability on restricted machines. SIAM Journal on Computing 9(3), 636–652 (1980) 20. Cooper, C., Frieze, A.: The cover time of random regular graphs. SIAM J. Discret. Math. 18(4), 728–740 (2005) 21. Cooper, C., Frieze, A.M.: Crawling on web graphs. In: Proc. STOC 2002, pp. 419–427 (2002) 22. Cooper, C., Frieze, A.M., Radzik, T.: Multiple random walks in random regular graphs (unpublished manuscript, 2008) 23. Cooper, C., Klasing, R., Radzik, T.: A randomized algorithm for the joining protocol in dynamic distributed networks. Technical Report RR-1432-07, LaBRI, Bordeaux, France (June 2007) 24. Cooper, J.N., Spencer, J.: Simulating a random walk with constant error. Combinatorics, Probability and Computing 15, 815–822 (2006) 25. Cooper, J., Doerr, B., Friedrich, T., Spencer, J.H.: Deterministic random walks on regular trees. In: Proc. of SODA 2008, pp. 766–772 (2008) 26. Cooper, J., Doerr, B., Spencer, J.H., Tardos, G.: Deterministic random walks on the integers. European Journal of Combinatorics 28(8), 2072–2090 (2007) 27. Czyzowicz, J., Dobrev, S., Gasieniec, ˛ L., Ilcinkas, D., Jansson, J., Klasing, R., Lignos, I., Martin, R., Sadakane, K., Sung, W.-K.: More efficient periodic traversal in anonymous undirected graphs (unpublished manuscript, 2008) 28. Deng, X., Kameda, T., Papadimitriou, C.H.: How to learn an unknown environment: The rectilinear case. Journal of the ACM 45, 215–245 (1998) 29. Deng, X., Papadimitriou, C.H.: Exploring an unknown graph. Journal of Graph Theory 32(3), 265–297 (1999) 30. Dessmark, A., Pelc, A.: Optimal graph exploration without good maps. Theoretical Computer Science 326(1-3), 343–362 (2004) 31. Diks, K., Fraigniaud, P., Kranakis, E., Pelc, A.: Tree exploration with little memory. Journal of Algorithms 51, 38–63 (2004) 32. Dobrev, S., Jansson, J., Sadakane, K., Sung, W.-K.: Finding Short Right-Hand-on-the-Wall Walks in Graphs. In: Pelc, A., Raynal, M. (eds.) SIROCCO 2005. LNCS, vol. 3499, pp. 127–139. Springer, Heidelberg (2005) 33. Doerr, B., Friedrich, T.: Deterministic Random Walks on the Two-Dimensional Grid. In: Asano, T. (ed.) ISAAC 2006. LNCS, vol. 4288, pp. 474–483. Springer, Heidelberg (2006)
28
L. Gasieniec ˛ and T. Radzik
34. Duncan, C.A., Kobourov, S.G., Kumar, V.S.A.: Optimal constrained graph exploration. ACM Transaction on Algorithms 2(3), 380–402 (2006) 35. Feige, U.: A tight upper bound on the cover time for random walks on graphs. Random Structures and Algorithms 6(1), 51–54 (1995) 36. Feige, U.: A tight lower bound on the cover time for random walks on graphs. Random Struct. Algorithms 6(4), 433–438 (1995) 37. Feige, U.: Collecting coupons on trees, and the cover time of random walks. Computational Complexity 6(4), 341–356 (1996) 38. Flocchini, P., Mans, B., Santoro, N.: On the impact of sense of direction on message complexity. Information Processing Letters 63(1), 23–31 (1997) 39. Flocchini, P., Mans, B., Santoro, N.: Sense of direction: definition, properties and classes. Networks 32(3), 165–180 (1998) 40. Fraigniaud, P., Gavoille, C., Mans, B.: Interval routing schemes allow broadcasting with linear message-complexity. Distributed Computing 14(4), 217–229 (2001) 41. Fraigniaud, P., Ilcinkas, D.: Digraph exploration with little memory. In: Diekert, V., Habib, M. (eds.) STACS 2004. LNCS, vol. 2996, pp. 246–257. Springer, Heidelberg (2004) 42. Fraigniaud, P., Ilcinkas, D., Peer, G., Pelc, A., Peleg, D.: Graph exploration by a finite automaton. Theoretical Computer Science 345(2-3), 331–344 (2005) 43. Garey, M.R., Johnson, D.S., Tarjan, R.E.: The planar hamiltonian circuit problem is npcomplete. SIAM J. Comput. 5(4), 704–714 (1976) 44. Gasieniec, ˛ L., Klasing, R., Martin, R., Navarra, A., Zhang, X.: Fast Periodic Graph Exploration with Constant Memory. J. Comput. Syst. Sci. 74(5), 808–822 (2007) 45. Gasieniec, ˛ L., Pelc, A., Radzik, T., Zhang, X.: Tree exploration with logarithmic memory. In: SODA, pp. 585–594 (2007) 46. Hoory, S., Wigderson, A.: Universal traversal sequences for expander graphs. Inf. Process. Lett. 46(2), 67–69 (1993) 47. Ikeda, S., Kubo, I., Okumoto, N., Yamashita, M.: Impact of local topological information on random walks on finite graphs. In: Baeten, J.C.M., Lenstra, J.K., Parrow, J., Woeginger, G.J. (eds.) ICALP 2003. LNCS, vol. 2719, pp. 1054–1067. Springer, Heidelberg (2003) 48. Ilcinkas, D.: Setting Port Numbers for Fast Graph Exploration. In: Flocchini, P., Gasieniec, ˛ L. (eds.) SIROCCO 2006. LNCS, vol. 4056, pp. 59–69. Springer, Heidelberg (2006) 49. Impagliazzo, R., Nisan, N., Wigderson, A.: Pseudorandomness for network algorithms. In: Proc. STOC 1994: Proceedings of the twenty-sixth annual ACM symposium on Theory of computing, pp. 356–364. ACM Press, New York (1994) 50. Istrail, S.: Polynomial universal traversing sequences for cycles are constructible. In: Proc. STOC 1988: Proceedings of the twentieth annual ACM symposium on Theory of computing, pp. 491–503. ACM Press, New York (1988) 51. Karloff, H.J., Paturi, R., Simon, J.: Universal traversal sequences of length nO(log n) for cliques. Inf. Process. Lett. 28(5), 241–243 (1988) 52. Koucký, M.: Universal traversal sequences with backtracking. J. Comput. Syst. Sci. 65(4), 717–726 (2002) 53. Koucký, M.: Log-space constructible universal traversal sequences for cycles of length o(n4.03). Theor. Comput. Sci. 296(1), 117–144 (2003) 54. Kozen, D.: Automata and planar graphs. In: Proc. of Fundations Computatial Theory (FCT 1979), pp. 243–254 (1979) 55. Law, C., Siu, K.-Y.: Distributed construction of random expander graphs. In: Proc. 22nd Annual Joint Conference of the IEEE Computer and Communications Societies (April 2003) 56. Panaite, P., Pelc, A.: Impact of topographic information on graph exploration efficiency. Networks 36, 96–103 (2000) 57. Priezzhev, V.B., Dhar, D., Dhar, A., Krishnamurthy, S.: Eulerian walkers as a model of selforganized criticality. Physics Review Letters 77, 5079–5082 (1996)
Memory Efficient Anonymous Graph Exploration
29
58. Rabin, M.O.: Maze threading automata. Technical Report Seminar Talk, University of California at Berkeley (October 1967) 59. Rao, N., Kareti, S., Shi, W., Iyengar, S.: Robot navigation in unknown terrains: Introductory survey of length, non-heuristic algorithms. Technical Report ORNL/TM12410, Oak Ridge National Lab (1993) 60. Reingold, O.: Undirected st-connectivity in log-space. In: Proc. STOC 2005, pp. 376–385 (2005) 61. Rollik, H.A.: Automaten in planaren graphen. Acta Informatica 13, 287–298 (1980) 62. Rubinfeld, R.: The cover time of a regular expander is O(nlogn). Information Processing Letters 35, 49–51 (1990) 63. Winkler, P., Zuckerman, D.: Multiple cover time. Random Structures and Algorithms 9, 403–411 (1996) 64. Yanovski, V., Wagner, I.A., Bruckstein, A.M.: A Distributed Ant Algorithm for Efficiently Patrolling a Network. Algorithmica 37, 165–186 (2003) 65. Zuckerman, D.: A technique for lower bounding the cover time. SIAM J. Discret. Math. 5(1), 81–87 (1992)
Algorithmic Meta Theorems Martin Grohe Institut f¨ ur Informatik, Humboldt-Univerit¨ at zu Berlin Unter den Linden 6, 10099 Berlin, Germany
[email protected]
Abstract. Algorithmic meta theorems are algorithmic results that apply to whole families of combinatorial problems, instead of just specific problems. These families are usually defined in terms of logic and graph theory. An archetypal algorithmic meta theorem is Courcelle’s Theorem [1], which states that all graph properties definable in monadic second-order logic can be decided in linear time on graphs of bounded tree width. More recent examples of such meta theorems state that all first-order definable properties of planar graphs can be decided in linear time [2] and that all first-order definable optimisation problems on classes of graphs with excluded minors can be approximated in polynomial time to any given approximation ratio [3]. In my talk, I gave an overview of algorithmic meta theorems and the main techniques used in their proofs. Reference [4] is a comprehensive survey of the material.
References 1. Courcelle, B.: Graph rewriting: An algebraic and logic approach. In: van Leeuwen, J. (ed.) Handbook of Theoretical Computer Science, vol. B, pp. 194–242. Elsevier Science Publishers, Amsterdam (1990) 2. Frick, M., Grohe, M.: Deciding first-order properties of locally tree-decomposable structures. Journal of the ACM 48, 1184–1206 (2001) 3. Dawar, A., Grohe, M., Kreutzer, S., Schweikardt, N.: Approximation schemes for first-order definable optimisation problems. In: Proceedings of the 21st IEEE Symposium on Logic in Computer Science, pp. 411–420 (2006) 4. Grohe, M.: Logic, graphs, and algorithms. In: Flum, J., Gr¨ adel, E., Wilke, T. (eds.) Logic and Automata – History and Perspectives. Texts in Logic and Games, vol. 2, pp. 357–422. Amsterdam University Press (2007)
H. Broersma et al. (Eds.): WG 2008, LNCS 5344, p. 30, 2008. c Springer-Verlag Berlin Heidelberg 2008
A Most General Edge Elimination Polynomial Ilia Averbouch , Benny Godlin , and Johann A. Makowsky Faculty of Computer Science Israel Institute of Technology Haifa, Israel {ailia,bgodlin,janos}@cs.technion.ac.il Abstract. We look for graph polynomials which satisfy recurrence relations on three kinds of edge elimination: edge deletion, edge contraction and edge extraction, i.e., deletion of edges together with their end points. Like in the case of deletion and contraction only (J.G. Oxley and D.J.A. Welsh 1979), it turns out that there is a most general polynomial satisfying such recurrence relations, which we call ξ(G, x, y, z). We show that the new polynomial simultaneously generalizes the Tutte polynomial, the matching polynomial, and the recent generalization of the chromatic polynomial proposed by K.Dohmen, A.P¨ onitz and P.Tittman (2003), including also the independent set polynomial of I. Gutman and F. Harary, (1983) and the vertex-cover polynomial of F.M. Dong, M.D. Hendy, K.T. Teo and C.H.C. Little (2002). We give three definitions of the new polynomial: first, the most general recursive definition, second, an explicit one, using a set expansion formula, and finally, a partition function, using counting of weighted graph homomorphisms. We prove the equivalence of the three definitions. Finally, we discuss the complexity of computing ξ(G, x, y, z).
1
Introduction
There are several well-studied graph polynomials, among them the chromatic polynomial, [Big93, GR01, DKT05], different versions of the Tutte polynomial, [Bol99, BR99, Sok05], and of the matching polynomial, [HL72, LP86, GR01], which are known to satisfy certain linear recurrence relations with respect to deletion of an edge, contraction of an edge, or deletion of an edge together with its endpoints, which we call extraction of an edge. The generalization of the chromatic polynomial, which was introduced by K.Dohmen, A.P¨ onitz and P.Tittman in [DPT03], happens to satisfy such recurrence relation as well. The question that arises is, what is the most general graph polynomial that satisfies similar linear recurrence relation. In this paper1 all the graphs are unlabeled ; multiple edges and self loops are allowed. We denote by G = (V, E) the graph with vertex set V and edge set E.
1
Partially supported by the Israel Science Foundation for the project “Model Theoretic Interpretations of Counting Functions” (2007–2010) and by a grant of the Fund for Promotion of Research of the Technion–Israel Institute of Technology. Corresponding authors. A preliminary version of this paper has been posted as [AGM07].
H. Broersma et al. (Eds.): WG 2008, LNCS 5344, pp. 31–42, 2008. c Springer-Verlag Berlin Heidelberg 2008
32
I. Averbouch, B. Godlin, and J.A. Makowsky
Our investigation is motivated by the approach of J.G. Oxley and D.J.A. Welsh, [OW79], in defining a most general graph polynomial in five variables which satisfies a recurrence relation based on edge deletion and edge contraction, for which they show, that up to a simple prefactor, the resulting polynomial is the Tutte polynomial. Here we shall look for a most general polynomial which satisfies a recurrence relation based on three edge elimination operations: edge deletion, edge contraction and edge extraction. 1.1
Recursive Definitions of Graph Polynomials
Edge Elimination. We define three basic edge elimination operations on multigraphs: – Deletion. We denote by G−e the graph obtained from G by simply removing the edge e. – Contraction. We denote by G/e the graph obtained from G by unifying the endpoints of e. Note that this operation can cause production of multiple edges and self loops. – Extraction. We denote by G†e the graph induced by V \ {u, v} provided e = {u, v}. Extraction removes also all the edges adjacent to e. Additionally, we require the polynomial to be multiplicative for disjoint unions, i.e., if G1 ⊕ G2 denotes disjoint union of two graphs, then the polynomial P (G1 ⊕ G2 ) = P (G1 )·P (G2 ). This is justified by the fact that the polynomials occurring in the literature are usually multiplicative. The initial conditions are defined for an empty set (graph without vertices, usually, P (∅) = 1) and for a single point P (E1 ). With respect to these operations, we recall the known recursive definitions of graph polynomials: The Matching Polynomial. There are different versions of the matching polynomial discussed polynomial n in ithe literature, for example matching generating n i g(G, λ) = i=0 ai λ and matching defect polynomial μ(G, λ) = i=0 (−1) ai λn−2i , where n = |V | and ai is the number of i-matchings in G. We shall use the bivariate version that incorporates the both above: M (G, x, y) =
n
ai xn−2i y i
(1)
i=0
The recursive definition of The matching polynomial satisfies the initial conditions M (E1 ) = x and M (∅) = 1, and the recurrence relations M (G) = M (G−e ) + y · M (G†e ) M (G1 ⊕ G2 ) = M (G1 ) · M (G2 )
(2)
The Tutte Polynomial. We recall the definition of classical two-variable Tutte polynomial (cf. for example B.Bollob´ as [Bol99]):
A Most General Edge Elimination Polynomial
33
Definition 1. Let G = (V, E) be a (multi-)graph. Let A ⊆ E be a subset of edges. We denote by k(A) the number of connected components in the spanning subgraph (V, A). Then two-variable Tutte polynomial is defined as follows T (G, x, y) =
(x − 1)k(A)−k(E) (y − 1)|A|+k(A)−|V |
(3)
A⊆E
The Tutte polynomial satisfies the initial conditions T (E1 ) = 1 T (∅) = 1 and has linear recurrence relation with respect to the operations above: ⎧ if e is a bridge, ⎨ x · T (G/e , x, y) if e is a loop, T (G, x, y) = y · T (G−e , x, y) ⎩ T (G/e , x, y) + T (G−e , x, y) otherwise T (G1 ⊕ G2 , x, y) = T (G1 , x, y) · T (G2 , x, y)
(4)
However, we shall use in this paper the version of the Tutte polynomial used by A.Sokal [Sok05], known as the (bivariate) partition function of the Pott’s model: q k(A) v |A| (5) Z(G, q, v) = A⊆E
The partition function of the Pott’s model is co-reducible to the Tutte polynomial via (6) T (G, x, y) = (x − 1)−k(E) (y − 1)−|V | Z(G, (x − 1)(y − 1), y − 1). It satisfies the initial conditions Z(E1 ) = q and Z(∅) = 1, and satisfies a recurrence relation which does not distinguish whether the edge e is a loop, a bridge, or none of the two: Z(G, q, v) = v · Z(G/e , q, v) + Z(G−e , q, v) Z(G1 ⊕ G2 , q, v) = Z(G1 , q, v) · Z(G2 , q, v)
(7)
The Bivariate Chromatic Polynomial. K.Dohmen, A.P¨ onitz and P.Tittman in [DPT03] introduced a polynomial P (G, x, y) as follows: there is two disjoint sets of colors Y and Z, and a generalized proper coloring of a graph G = (V, E) is a map φ : V → (Y Z) such that for all {u, v} ∈ E, if φ(u) ∈ Y and φ(v) ∈ Y , then φ(u) = φ(v) (The set Y is called therefore “proper colors”). For two positive integers x > y, the value of the polynomial is the number of generalized proper colorings by x colors, y of them are proper. To make this definition meaningful for graphs with multiple edges we require that a vertex with a self-loop can be colored only by a color in X \ Y and that a multiple edge does not affect colorings. Proposition 1. The polynomial P (G, x, y) satisfies the initial conditions P (E1 ) = x and P (∅) = 1, and the following recurrence relation: P (G, x, y) = P (G−e , x, y) − P (G/e , x, y) + (x − y) · P (G†e , x, y) P (G1 ⊕ G2 , x, y) = P (G1 , x, y) · P (G2 , x, y)
(8)
34
I. Averbouch, B. Godlin, and J.A. Makowsky
Proof. Let G = (V, E) be a graph, and P (G, x, y) be the number of generalized colorings defined above. Let v ∈ V be any vertex. We denote by P v (G, x, y) the number of generalized colorings of G, when v is colored by an ”improper” color, i.e. φ(v) ∈ X \ Y . Observing that a vertex v can have any color in X \ Y , and the coloring of V − {v} does not depend on the color of v, we get: Lemma 2. P v (G, x, y) = (x−y)·P (G−v , x, y), where G−v denotes the subgraph of G induced by V \ {v}. Let e = {u, v} ∈ E be any edge of G, which is not a self-loop and not a multiple edge. Consider the number of colorings of G−e . Any such coloring is either a coloring of G, or a coloring of G/e , when the vertex u = v, which is produced by the contraction, is colored by a proper color. Together with Proposition 2, that raises: P (G, x, y) = P (G−e , x, y) − P (G/e , x, y) + (x − y) · P (G†e , x, y)
(9)
One can easily check that this equation is satisfied also for loops and multiple edges. Together with the fact that a singleton can be colored by any color, and the fact that the number of colorings is multiplicative, this completes the proof. 1.2
A Most General Edge Elimination Polynomial
Recursive Definition. Inspired by the characterization of the Tutte polynomial given in [OW79], see also [Bol99], Theorem 2 of Chapter 10, we look for the most general linear recurrence relation2 , which can be obtained on unlabeled graphs by introducing new variables, and which does not distinguish between local properties of the edge e which is to be eliminated3 . To assure that the polynomial so defined is unique, we have to prove that its definition is not dependent on the order in which the edges are removed. We start with the initial conditions ξ(E1 ) = x and ξ(∅) = 1, and recurrence relation ξ(G) = w · ξ(G−e ) + y · ξ(G/e ) + z · ξ(G†e ) ξ(G1 ⊕ G2 ) = ξ(G1 ) · ξ(G2 )
(10)
We prove: Theorem 3. The recurrence relation (10) defines for each graph G a unique polynomial ξ(G) if and only if one of the following conditions are satisfied: z=0 w=1 2
3
(11) (12)
The first paper to study general conditions under which linear recurrence relations define a graph invariant is D.N.Yetter [Yet90]. It is conceivable that recurrence relations with various case distinctions depending on local properties of e and more variables give other “most general” polynomials. This is the reason why we speak of “a most general” edge elimination polynomial in the title of the paper.
A Most General Edge Elimination Polynomial
35
Under condition (12), which allows a more general graph polynomial to be obtained, the recurrence relation (10) is restricted to ξ(G, x, y, z) = ξ(G−e , x, y, z) + y · ξ(G/e , x, y, z) + z · ξ(G†e , x, y, z) ξ(G1 ⊕ G2 , x, y, z) = ξ(G1 , x, y, z) · ξ(G2 , x, y, z) ξ(E1 , x, y, z) = x; ξ(∅, x, y, z) = 1;
(13)
Remark 4. From this theorem one sees immediately that ξ(G, x, y, z) gives, by choosing appropriate values for the variables and simple prefactors, the partition function of the Pott’s model, the bivariate matching polynomial and the bivariate chromatic polynomial with all their respective substitution instances, including the classical chromatic polynomial, the Tutte polynomial and the independent set polynomial, [DHTL02, GH83]. The latter two polynomials are already substitution instances of the bivariate chromatic polynomial P (G, x, y) of [DPT03]. The following table summarizes these observations. Pott’s model
Z(G, q, v) = ξ(G, q, v, 0) T (G, x, y) = (x − 1)−k(E) · (y − 1)−|V | · Bivariate Tutte polynomial ξ (G, (x − 1)(y − 1), (y − 1), 0) Bivariate matching polynomial M (G, x, y) = ξ(G, x, 0, y) Bivariate chromatic polynomial P (G, x, y) = ξ(G, x, −1, x − y) Explicit definition. We now give an explicit form of the polynomial ξ(G, x, y, z) using 3-partition expansion4 : Theorem 5. Let G = (V, E) be a (multi)graph. Then the edge elimination polynomial ξ(G, x, y, z) can be calculated as ξ(G, x, y, z) = xk(AB)−kcov (B) · y |A|+|B|−kcov (B) · z kcov (B) (14) (AB)⊆E
where by abuse of notation we use (A B) ⊆ E for summation over subsets A, B ⊆ E, such that the subsets of vertices V (A) and V (B), covered by respective subset of edges, are disjoint: V (A) ∩ V (B) = ∅; k(A) denotes the number of spanning connected components in (V, A), and kcov (B) denotes the number of covered connected components, i.e. the connected components of (V (B), B). Remark 6. From Theorem 5 one can see that ξ(G, x, y, z) is a polynomial definable in Monadic Second Order Logic, with quantification over sets of edges (M SOL2 ), where an order over vertices is to be used for stating “number of connected sets”, but the final result is order-independent. We shall not use logic in the sequel of the paper. For details the reader is referred to [Mak05]. 4
A more precise name would be “Pair of two disjoint subsets expansion”. We chose the name 3-partition expansion, as any two disjoint subsets induce a partition into three sets.
36
I. Averbouch, B. Godlin, and J.A. Makowsky
Counting Weighted Graph Homomorphisms. Another common way to define graph polynomials is counting weighted graph homomorphisms. Let the weighted graph H = (VH , EH ) be defined as follows: – H is obtained by joining 3 cliques with all loops: H = KxA KpB KpI , such that KxA has x vertices, KpB and KpI have p vertices each. – We denote by V A the vertices of K A , by V B the vertices of K B and by V I the vertices of K I – The weight function w A= (α,Bβ): α : VH → R and β : EH → R 1 if v ∈ (V ∪ V ) – α(v) = −1 otherwise y + 1 if (u = v) ∧ (u, v ∈ (V A ∪ V B )) – β(u, v) = 1 otherwise In [AGM08] the following is shown: Theorem 7. Let ZH (G) be a homomorphism function of a graph G = (V, E) into a weighted graph H above. ZH (G) =
h : V → VH homomorphism
v∈V
α(h(v))
β(h(u), h(v))
(u,v)∈E
Then, for all nonnegative integers x and p and all y ∈ R, we have ξ(G, x, y, p · y) = ZH (G) Remark 8. A general characterization of graph parameters which can be obtained from homomorphism functions by choosing appropriate weights is given in [FLS07]. This characterization requires that the weights α are positive reals. However, in Theorem 7, we use negative values for α.
2
The Most General Recurrence Relation
We are looking for the most general linear recurrence relation with respect to edge deletion, edge contraction and edge extraction operation that can be obtained by introducing new variables. Recall that we are interested in a graph invariant, e.i. the resulting function should not depend on the order of graph deconstruction. Moreover, this invariant should be a multiplicative graph polynomial. From this consideration alone we obtain the initial condition ξ(∅) = 1; and the product rule: ξ(G1 ⊕ G2 ) = ξ(G1 ) · ξ(G2 ) Indeed, the disjoint union with an empty set gives the same graph, so the resulting function should also remain the same.
A Most General Edge Elimination Polynomial
37
We now formulate the edge elimination rule introducing a new variable wherever we can. We set ξ(G, x, y, z, t) = t · ξ(G−e , x, y, z, t) + y · ξ(G/e , x, y, z, t) + z · ξ(G†e , x, y, z, t) ξ(E1 , x, y, z, t) = x;
(15)
Let G be a graph as presented on Fig. 1. Note that the subgraphs H1 , H1−u , H2 and H2−w can be different and have (in general) different ξ. Since we are
Fig. 1. Testing order invariance of edge removal
looking for a graph invariant, we must obtain the same result by applying the edge elimination rule first on the edge e1 and then on the edge e2 , as in case when we apply the edge elimination rule first on the edge e2 and then on the edge e1 . ξ(G) = t · ξ(G−e1 ) + y · ξ(G/e1 ) + z · ξ(G†e1 ) = = t · ξ(H1 ) · [x · t · ξ(H2 ) + y · ξ(H2 ) + z · ξ(H2−w )] +
y · t · ξ(H1 )ξ(H2 ) + y · ξ(G/e1 /e2 ) + z · ξ(H1−u )ξ(H2−w ) + z · ξ(H1−u )ξ(H2 )
(16)
On the other hand, ξ(G) = t · ξ(G−e2 ) + y · ξ(G/e2 ) + z · ξ(G†e2 ) = = t · ξ(H2 ) · [x · t · ξ(H1 ) + y · ξ(H1 ) + z · ξ(H1−u )] +
y · t · ξ(H1 )ξ(H2 ) + y · ξ(G/e1 /e2 ) + z · ξ(H1−u )ξ(H2−w ) + z · ξ(H2−w )ξ(H1 )
(17)
Solving the above two equations, we get: tz · ξ(H1 )ξ(H2−w ) + z · ξ(H1−u )ξ(H2 ) = tz · ξ(H1−u )ξ(H2 ) + z · ξ(H1 )ξ(H2−w ) Hence, we have the following necessary condition: z = 0 or t = 1 or
(18) (19)
ξ(H1 )ξ(H2−w ) = ξ(H1−u )ξ(H2 ) f or any H1 and H2
(20)
Under condition (20) we get the polynomial ξ(G) = x|V (G)| which we also get under the assumption z = 0 or t = 1. In case of z = 0 it can be easily seen that the resulting function is a substitution instance of the Pott’s model:
38
I. Averbouch, B. Godlin, and J.A. Makowsky
y ξ(G, x, y, 0, t) = t|E| · Z(G, x, ) t
(21)
Since the partition function of the Pott’s model can be also obtained when t = 1, the latter case is considered more general. That brings us back to the recurrence relation (13). To complete the proof of Theorem 3, we need now to show that any two steps of the graph decomposition using (13) are interchangeable. This involves two parts, – Edge elimination and disjoint union, and – Decomposition of a graph by elimination of any two edges in different order. The proof of the first part is simple. Let G be a disjoint union of two graphs: G = H1 ⊕H2 . Without loss of generality, assume that the edge e, which is being eliminated, is in E(H1 ). Then use the linearity of our recurrence relation to show that ξ(G) = ξ(H1−e ) + y · ξ(H1/e ) + z · ξ(H1†e ) · ξ(H2 ) = = ξ(H1−e ) · ξ(H2 ) + y · ξ(H1/e ) · ξ(H2 ) + z · ξ(H1†e ) · ξ(H2 ) The second part requires analyzing of three possible cases:
Fig. 2. Different cases to check order invariance of edge removal
– Case 1: Two the edges have no common vertices (graphs G1 , G2 , G3 ); – Case 2: Two the edges have one common vertex, and at least one exclusive vertex (graphs G4 , G5 ); – Case 3: Two the edges have no exclusive vertices (graphs G6 , G7 ). The detailed analysis of these cases is straightforward.
3
The Explicit Form of ξ(G)
We need to show that the expression (14) satisfies the initial conditions of (13), that it is multiplicative and that it also satisfies the edge elimination rule of (13). Then by induction on the number of edges in G the theorem holds.
A Most General Edge Elimination Polynomial
39
The first fact is trivial; the second one can be easily checked by reader. Indeed, the summation over subsets of edges of G(V, E) = G1 (V1 , E1 ) ⊕ G2 (V2 , E2 ) can be regarded as a summation over the subsets of E1 , and then independently over the subsets of E2 . Therefore, we just need to prove that Lemma 9. The explicit expression given by (14) satisfies the edge elimination rule of (13). Proof. Let G = (V, E) be the (multi)graph of interest. Let N (G) be defined as N (G, x, y, z) = xk(AB)−kcov (B) · y |A|+|B|−kcov (B) · z kcov (B) (22) (AB)⊆E
where k(A) denotes the number of connected components in (V, A), and kcov (B) denotes the number of the connected components of (V (B), B), where V (B) ⊆ V are the vertices covered by the edges of B. Let e be the edge we have chosen to reduce. Any particular choice of A and B can be regarded as a vertex-disjoint edge coloring in 2 colors A and B, when part of the edges remains uncolored. We divide all the coloring into three disjoint cases: – Case 1: e is uncolored; – Case 2: e is colored by B, and it is the only edge of a colored connected component; – Case 3: All the rest. That means, e is colored by A, or e is colored by B but it is not the only edge of a colored connected component. In case 1, we just sum over colorings of G−e : xk(AB)−kcov (B) · y |A|+|B|−kcov (B) · z kcov (B) = N (G−e ) N1 (G) = (AB)|= Case 1
In case 2, the edge e is a connected component of (V (B), B). Therefore, if we analyze now N (G†e ), we will get – – – –
The The The The
number of edges colored by A is the same; number of edges colored by B is reduced by one; total number of colored connected components is reduced by one; number of covered connected components colored B is reduced by one;
This gives us N2 (G) =
xk(AB)−kcov (B) · y |A|+|B|−kcov (B) · z kcov (B) = z · N (G†e )
(AB)|= Case 2
And finally, in case 3, e is a part of a bigger colored connected component, or it is alone a connected component colored by A. In this case, we analyze the colorings of G/e :
40
I. Averbouch, B. Godlin, and J.A. Makowsky
– Either |A| or |B| is reduced by 1, the other remained the same; – The total number of colored connected components remained the same; – The number of covered connected components colored B remained the same. According to the above, N3 (G) = xk(AB)−kcov (B) · y |A|+|B|−kcov (B) · z kcov (B) = y · N (G/e ) (AB)|= Case 3
which together with N (G) = N1 (G) + N2 (G) + N3 (G) completes the proof.
4
Computational Complexity of ξ(G)
In this section we consider the complexity of computation of ξ(G). In general, this polynomial is P-hard to compute, as every instance stated in the Remark 4 is P-hard. Moreover, C. Hoffmann proves in [Hof08] that at every point (x, y, z) ∈ Q, with x = 0, z = −xy, (x, z) ∈ {(1, 0), (2, 0)}, y ∈ {−2, −1, 0}, evaluating ξ(G, x, y, z) is P-hard. Recall that, according to Remark 6, the formula (14) can be used to give an order invariant definition in Monadic Second Order Logic, with quantification over sets of edges, and an auxiliary order. Hence, from the general theorem from [Mak05, Mak04], we immediately get that ξ(G) is polynomial time computable on graphs of tree-width at most k where the exponent of the run time is independent of k. The drawback of the general method of [Mak05, Mak04] lies in the huge hidden constants, which make it practically unusable. However, an explicit dynamic algorithm for computing the polynomial ξ(G) on graphs of bounded tree-width, given the tree decomposition of the graph, where the constants are simply exponential in k, can be constructed along the same ideas as presented in [Tra06, FMR08, MRAG06].
5
Conclusions and Open Questions
We have introduced a new graph polynomial ξ(G, x, y, z) from which the Tutte polynomial, the matching polynomial and the bivariate chromatic polynomial can be obtained by simple evaluations. We have given three equivalent definitions of this polynomial, and we have shown that it is the most general graph polynomial satisfying a recurrence relation (without case distinctions) with respect to three edge elimination operations. There are still some challenging open questions. Recursive Definitions with Case Distinctions. Contrary to the approach in [OW79], we have avoided case distinctions in the recurrence relation. This was justified because it still gives the Tutte polynomials as special cases. Alternatively we could have introduced a polynomial in more variables which does incorporate a case distinction with respect to some local properties of an edge, such as being a bridge or a loop, or we could have allowed the deletion of single vertices, and distinguish between cases where they are isolated with or without loops, etc.
A Most General Edge Elimination Polynomial
41
Question 1. Does one get essentially stronger polynomials if one allows also deletion of single vertices and takes into account case distinctions? Distinctive Power. We know that the polynomial ξ(G) has at least the same distinctive power as the Tutte polynomial and the bivariate chromatic polynomial together, but more than every one of them individually. Indeed, since T (G, x, y) and P (G, x, y) are both substitution instances of ξ(G), if ξ(G) coincides for two graphs, so do T (G, x, y) and P (G, x, y). On the other hand, we do not know whether ξ(G) has more distinctive power. Question 2. Are there two graphs G1 , G2 such that for all x, y we have T (G1 , x, y) = T (G2 , x, y) and P (G1 , x, y) = P (G2 , x, y), but such that for some x, y, z ξ(G, x, y, z) = ξ(G2 , x, y, z)? Complexity on Graph Classes of Bounded Clique-Width. We have noted that for graphs of tree-width at most k computing the edge reduction polynomial ξ(G) is fixed parameter tractable (FPT) in the sense of [DF99, FG06]. Another graph parameter, introduced in [CO00] and discussed there is the clique-width. It was stated as an open problem whether the Tutte polynomial is fixed parameter tractable for graphs of clique-width at most k, [GHN05, MRAG06]. Very recently, F. Fomin, P. Golovach, D. Lokshtanov and S. Saurabh [FGLS08] showed that computing the chromatic number of graphs of clique-width at most k is W [1]hard, and therefore not fixed parameter tractable. It follows from this that it is also true for evaluating the Tutte polynomial and our polynomial ξ(G). Further more, this shows that the results on the complexity of evaluating the chromatic polynomial in [MRAG06] are optimal. Acknowledgments. We would like to thank B. Courcelle, T. Kotek and to the anonymous referees, for their comments on early versions of this paper.
References [AGM07]
[AGM08] [Big93] [Bol99] [BR99] [CO00] [DF99]
Averbouch, I., Godlin, B., Makowsky, J.A.: The most general edge elimination polynomial. arXiv (2007), http://uk.arxiv.org/pdf/0712.3112. pdf Averbouch, I., Godlin, B., Makowsky, J.A.: An extension of the bivariate chromatic polynomial (submitted, 2008) Biggs, N.: Algebraic Graph Theory, 2nd edn. Cambridge University Press, Cambridge (1993) Bollob´ as, B.: Modern Graph Theory. Springer, Heidelberg (1999) Bollob´ as, B., Riordan, O.: A Tutte polynomial for coloured graphs. Combinatorics, Probability and Computing 8, 45–94 (1999) Courcelle, B., Olariu, S.: Upper bounds to the clique–width of graphs. Discrete Applied Mathematics 101, 77–114 (2000) Downey, R.G., Fellows, M.F.: Parametrized Complexity. Springer, Heidelberg (1999)
42
I. Averbouch, B. Godlin, and J.A. Makowsky
[DHTL02]
Dong, F.M., Hendy, M.D., Teo, K.L., Little, C.H.C.: The vertex-cover polynomial of a graph. Discrete Mathematics 250, 71–78 (2002) [DKT05] Dong, F.M., Koh, K.M., Teo, K.L.: Chromatic Polynomials and Chromaticity of Graphs. World Scientific, Singapore (2005) [DPT03] Dohmen, K., P¨ onitz, A., Tittmann, P.: A new two-variable generalization of the chromatic polynomial. Discrete Mathematics and Theoretical Computer Science 6, 69–90 (2003) [FG06] Flum, J., Grohe, M.: Parameterized complexity theory. Springer, Heidelberg (2006) [FGLS08] Fomin, F., Golovach, P., Lokshtanov, D., Saurabh, S.: Clique-width: On the price of generality. Department of Informatics, University of Bergen, Norway (preprint, 2008) [FLS07] Freedman, M., Lov´ asz, L., Schrijver, A.: Reflection positivity, rank connectivity, and homomorphisms of graphs. Journal of AMS 20, 37–51 (2007) [FMR08] Fischer, E., Makowsky, J.A., Ravve, E.V.: Counting truth assignments of formulas of bounded tree width and clique-width. Discrete Applied Mathematics 156, 511–529 (2008) [GH83] Gutman, I., Harary, F.: Generalizations of the matching polynomial. Utilitas Mathematicae 24, 97–106 (1983) [GHN05] Gim´enez, O., Hlin˘en´ y, P., Noy, M.: Computing the Tutte polynomial on graphs of bounded clique-width. In: Kratsch, D. (ed.) WG 2005. LNCS, vol. 3787, pp. 59–68. Springer, Heidelberg (2005) [GR01] Godsil, C., Royle, G.: Algebraic Graph Theory. Graduate Texts in Mathematics. Springer, Heidelberg (2001) [HL72] Heilmann, C.J., Lieb, E.H.: Theory of monomer-dymer systems. Comm. Math. Phys 28, 190–232 (1972) [Hof08] Hoffmann, C.: A most general edge elimination polynomial–thickening of edges (2008) arXiv:0801.1600v1 [math.CO] [LP86] Lovasz, L., Plummer, M.D.: Matching Theory. Annals of Discrete Mathematics, vol. 29. North-Holland, Amsterdam (1986) [Mak04] Makowsky, J.A.: Algorithmic uses of the Feferman-Vaught theorem. Annals of Pure and Applied Logic 126(1-3), 159–213 (2004) [Mak05] Makowsky, J.A.: Colored Tutte polynomials and Kauffman brackets on graphs of bounded tree width. Disc. Appl. Math. 145(2), 276–290 (2005) [MRAG06] Makowsky, J.A., Rotics, U., Averbouch, I., Godlin, B.: Computing graph polynomials on graphs of bounded clique-width. In: Fomin, F.V. (ed.) WG 2006. LNCS, vol. 4271, pp. 191–204. Springer, Heidelberg (2006) [OW79] Oxley, J.G., Welsh, D.J.A.: The Tutte polynomial and percolation. In: Bundy, J.A., Murty, U.S.R. (eds.) Graph Theory and Related Topics, pp. 329–339. Academic Press, London (1979) [Sok05] Sokal, A.: The multivariate Tutte polynomial (alias Potts model) for graphs and matroids. In: Survey in Combinatorics, 2005. London Mathematical Society Lecture Notes, vol. 327, pp. 173–226 (2005) [Tra06] Traldi, L.: On the colored Tutte polynomial of a graph of bounded treewidth. Discrete Applied Mathematics 154(6), 1032–1036 (2006) [Yet90] Yetter, D.N.: On graph invariants given by linear recurrence relations. Journal of Combinatorial Theory, Series B 48(1), 6–18 (1990)
Approximating the Metric TSP in Linear Time Davide Bil`o1 , Luca Forlizzi2 , and Guido Proietti2,3 1 3
Institut f¨ ur Theoretische Informatik, ETH, Z¨ urich, Switzerland 2 Dipartimento di Informatica, Universit` a di L’Aquila, Italy Istituto di Analisi dei Sistemi ed Informatica, CNR, Roma, Italy {davide.bilo,forlizzi,proietti}@di.univaq.it
Abstract. Given a metric graph G = (V, E) of n vertices, i.e., a complete graph with an edge cost function c : V × V → R≥0 satisfying the triangle˘ inequality, ¯the ˆmetricity degree of G is defined as β = ˜ c(x,y) ∈ 12 , 1 . This value is instrumental to estabmaxx,y,z∈V c(x,z)+c(y,z) lish the approximability of several NP-hard optimization problems definable on G, like for instance the prominent traveling salesman problem, which asks for finding a Hamiltonian cycle of G of minimum total cost. In fact, this problem can be approximated quite accurately depending on 2 2−β or 3β 23β , the metricity degree of G, namely by a ratio of either 3(1−β) −2β+1 for β < 23 or β ≥ 23 , respectively. Nevertheless, these approximation algorithms have O(n3 ) and O(n2.5 log1.5 n) running time, respectively, and therefore they are superlinear in the Θ(n2 ) input size. Thus, since many real-world problems are modeled by graphs of huge size, their use might turn out to be unfeasible in the practice, and alternative approaches requiring only O(n2 ) time are sought. However, with this restriction, all the currently available approaches can only guarantee a 2-approximation 2 -approximation ratio ratio for the case β = 1, which means a 2β 22β −2β+1 for general β < 1. In this paper, we show how to enhance –without affecting the space and time complexity– one of these approaches, namely the classic double-MST heuristic, in order to obtain a 2β-approximate solution. This improvement is effective, since we show that the doubleMST heuristic has in general a performance ratio strictly larger that 2β, and we further show that any re-elaboration of the shortcutting phase therein provided, cannot lead to a performance ratio better than 2β. Keywords: Traveling Salesman Problem, Metric Graphs, NP-hardness, Linear-time Approximation Algorithms.
1
Introduction
The Traveling Salesman Problem (TSP, for short) is one of the most prominent and studied combinatorial optimization problems. It is defined as follows: Given a complete, undirected graph G = (V, E) of n vertices, with an edge cost function c : V × V → R≥0 , find a Hamiltonian cycle H = (V, E(H)) of G (i.e., a simple cycle that spans all the vertices of G) of minimum total cost c(H) = e∈E(H) c(e). H. Broersma et al. (Eds.): WG 2008, LNCS 5344, pp. 43–54, 2008. c Springer-Verlag Berlin Heidelberg 2008
44
D. Bil` o, L. Forlizzi, and G. Proietti
The TSP is intractable and does not admit any polynomial-time constantratio approximation algorithm, unless P = NP. On the other hand, when the edge cost function induces a metric on G (i.e., for any x, y, z ∈ V, c(x, z) ≤ c(x, y) + c(y, z)), things improve sensibly. More specifically, in such a case the problem is known as the metric TSP, and it can be approximated by the Christofides algorithm [4] within an approximation factor of 3/2, but still it remains NPhard to find an approximate solution for it within a factor better than 220/219 [9]. In some special metric cases, however, the approximability of the problem becomes really effective. For instance, when vertices of G are actually points in a fixed-dimension Euclidean space, and the edge cost function is their Euclidean distance, then the problem (also known as geometric TSP) admits a polynomialtime approximation scheme [1]. Getting back to the general metric case, it is interesting to notice that one can define suitable approximation algorithms degree depending on the metricity c(x,y) ∈ 12 , 1 . More preof G, which is defined as β = maxx,y,z∈V c(x,z)+c(y,z) 2−β -approximation algorithm [2],1 while cisely, for 12 ≤ β ≤ 23 , there exists a 3(1−β) for 23 < β ≤ 1, the best approximation algorithm is still the Christofides’ one, 2
with a ratio of 3β 2 3β −2β+1 . In the following, we will therefore assume that the input graph is β-metric (i.e., its metricity degree is equal to β), and the metric TSP with this additional parameter will be correspondingly named the β-metric traveling salesman problem (β-MTSP for short, also known as strengthenedmetric TSP). Both the aforementioned best-known approximation algorithms for the βMTSP have a shortcoming, however: their time complexity is superlinear in the input size. Indeed, the former runs in O(n3 ) time,2 while the latter runs in O(n2.5 log1.5 n) time [8]. From a practical point of view, this might result in a severe drawback, since often the input graph is massive. For instance, the wellknown benchmark TSPLIB of TSP instances [10] contains several input graphs with order of 105 vertices (most of them coming from roadmaps, and then most likely metric), for which these algorithms become computationally expensive. In such a case, a linear-time approximation algorithm would be desirable, even if a (possibly small) price in terms of performance ratio has to be paid. In this paper, we exactly aim at this goal. We emphasize that insisting on this trade-off is not completely novel, and linear-time constrained approximation algorithms have been already developed in the past, but as far as we know, this was done only for high-degree polynomial-time solvable problems (e.g., the weighted matching problem [6] and the watchman route problem [11]). 1 2
Notice that for β = 1/2, all the graph edges have the same cost, and the problem becomes trivial. This bound can be obtained after conditioning the costs of the input graph G in such a way that the problem of determining a minimum-cost cycle cover of G, which represents the core procedure of the algorithm in [2], reduces to that of finding a maximum-cost simple 2-matching in the transformed graph, which can be solved in O(n3 ) time [7].
Approximating the Metric TSP in Linear Time
45
Actually, designing a linear-time approximation algorithm for the β-MTSP starting from the efficient implementation given in [8] of the Christofides algorithm sounds prohibitive, since this uses the very efficient O(n2.5 log1.5 n) time approximate minimum-cost perfect matching algorithm as a brick for constructing a feasible solution (and in the worst case such an algorithm runs on a graph having Θ(n) vertices). The same holds for the algorithm of B¨ ockenhauer et al. [2], which makes use of the long-standing O(n3 ) time procedure for computing a maximum-cost perfect 2-matching. Thus, a different approach needs to be used. A well-known approximation algorithm for the metric TSP is the doubletree shortcutting algorithm, which works as follows: first, construct a Minimum Spanning Tree (MST, for short) T of G; after, construct a Eulerian tour D on the multigraph G = T ∪ T , and finally return a Hamiltonian cycle H from D by shortcutting in G repeated vertices in the Eulerian tour. This algorithm (which we will call Double-MST shortcut in the rest of the paper) is easily seen to guarantee a 2-approximation ratio, and then it turns out to be 2 3 a 2β 2 2β −2β+1 -approximation algorithm for the β-MTSP [2]. As a matter of fact, it is then always outperformed by its super-linear counterparts. In an effort of improving this gap, by maintaining the linear-time constraint, we therefore develop an easy modification of such an algorithm, which allows us to obtain, by means of an accurate analysis, a 2β-approximate solution, thus beating the Double-MST shortcut for any 1/2 < β < 1. This improvement is effective, since as a side result, we show that for any 1/2 < β < 1, the performance ratio of the Double-MST shortcut is strictly larger than 2β. As a matter of fact, the reduction of the theoretical gap with respect to the superlinear approximation algorithm is significant: for instance, for all 1/2 < β ≤ 3/4, our algorithm is only about 5% away from it in the worst case, while for the Double-MST shortcut this gap raises to about 26%. It is worth noticing that the Double-MST shortcut approach is at the basis of one of the best-performing heuristics available for the TSP, namely that developed by Deineko and Tiskin[3,5]. This heuristic computes in O(4d n2 ) time (where d denotes the maximum node-degree in T ) the minimum cost Hamiltonian cycle that can be obtained using the Double-MST shortcut approach. From now on, we will call this heuristic with Double-MST Min-weight shortcut. Extensive computational experiments have shown that this strategy allows very good approximations, often better that those obtained with heuristics derived by the Christofides algorithm, although it requires a running time which might be exponential. However, despite its high performances registered in practice, no theoretical approximation guarantee better than that of Double-MST shortcut was exhibited in [5]. Our analysis immediately shows that the algorithm given in [5] has actually an approximation ratio of 2β, for any β < 1. Moreover, we also prove that this ratio is asymptotically tight. Due to the practical relevance 3
This ratio results from the fact that if A is an α-approximation algorithm for the α·β 2 metric TSP, then A is an β 2 +(α−1)(1−β) 2 -approximation algorithm for the β-MTSP (see [2] for further details).
46
D. Bil` o, L. Forlizzi, and G. Proietti
of heuristics based on the minimum-weight shortcutting of D, we see this as a noteworthy consequence of our results. The rest of the paper is organized as follows: in Section 2 we show that the Double-MST shortcut algorithm does not return a 2β-approximate solution; in Section 3 we present an enhanced version of the previous algorithm and prove it computes a 2β-approximate solution; in Section 4 we prove that Double-MST Min-weight shortcut does not compute a solution within a constant factor smaller than 2β, thus proving that no algorithm based on the Double-MST shortcut approach can be significantly better than the one presented in the previous section. Finally, in Section 5, we provide a graphical comparison (in terms of approximation ratio) between our algorithm and its counterparts.
2
Double-MST Shortcut Is Not a 2β-Apx Algorithm
From now on, we will assume that the input graph G = (V, E) is an instance of the β-MTSP. Moreover, paths and cycles will be expressed explicitly throughout the sequence of constituting vertices. The Double-MST shortcut algorithm does not prescribe how to shortcut repeated vertices in the Eulerian cycle obtained by merging the two copies of the MST. An easy to state and widely used rule, is to perform shortcut according to the visiting order of vertices in a depth-first search of the MST. Applying this rule, the Double-MST shortcut algorithm can be stated as follows: Algorithm 1. An implementation of the Double-MST shortcut algorithm Input: A β-metric graph G = (V, E). Step 1. Construct an MST T of G. Step 2. Perform a depth-first search on T starting from an arbitrary vertex v0 . Let v0 , v1 , . . . , vn−1 be the sequence of vertices in the order they are visited. Output: Return the cycle H = v0 v1 . . . vn−1 v0 of G. 2
As said in the introduction, this algorithm turns out to be a 2β 2 2β −2β+1 -approximation algorithm for the β-MTSP. Although this ratio has not been proven to be tight, in the following we provide an input instance showing that the cost of the Hamiltonian cycle computed by Double-MST shortcut can be strictly larger than 2β times the optimal one. For a given 12 < β < 1, let G = (V, E) be a β-metric graph with vertex set V = {v0 , x1 , y1 , z1 , . . . , xh , yh , zh }, and such that the edge costs are defined as follows: – c(v0 , xi ) = 1, c(v0 , yi ) =
β 1−β , c(v0 , zi )
= 2β, ∀1 ≤ i ≤ h;
– c(yi , v) = ∀1 ≤ i ≤ h and ∀v ∈ V \ {yi }; – c(xi , xj ) = 2β, ∀1 ≤ i, j ≤ h; – c(zi , zj ) = 2β, ∀1 ≤ i, j ≤ h; β 1−β ,
Approximating the Metric TSP in Linear Time
47
– c(xi , zj ) = 1, ∀1 ≤ i ≤ j ≤ h; – c(xi , zj ) = 2β 2 + β, ∀1 ≤ j < i ≤ h. An MST T of G is formed by edges (v0 , xi ), (xi , yi ), (xi , zi ), for each 1 ≤ i ≤ h.In Figure 1 the MST for the case h = 3 is depicted. Assume now that the Double-MST shortcut algorithm takes v0 as root of T , and performs a depthfirst search visiting yi before zi , for all 1 ≤ i ≤ h. Then, the algorithm builds the solution H = v0 x1 y1 z1 x2 y2 z2 . . . xh yh zh v0 , having cost (see Figure 2 for the case h = 3) v0 1 x1
β 1−β
β 1−β
1
y1
1
1
y2
z1
x2
β 1−β
1 z2
y3
x3 1 z3
Fig. 1. An MST of G
1 h(3β + β 2 − 2β 3 ) + 1 − 3β 2 + 2β 3 . 1−β Consider the solution H ∗ = y1 y2 . . . yh v0 xh zh xh−1 zh−1 . . . x1 z1 y1 which has cost (see Figure 2 for the case h = 3) c(H) =
c(H ∗ ) =
v0
H x1 β 1−β
2β 2 + β
x2
2β 2 + β
β 1−β β 1−β
z1
y2
v0
H∗
1
y1
1 (h(2 − β) + β) . 1−β
1
2β x3
β 1−β β 1−β
z2
y3
β 1−β β 1−β
z3
x2
x1
y1
1
z1
1
1 y2
β 1−β
z2
x3 1
y3
β 1−β
1 z3 β 1−β
Fig. 2. The solution H constructed by the Double-MST shortcut algorithm on the left, and the solution H ∗ on the right
Therefore, if Opt denotes an optimal solution, we have c(H) h(3β + β 2 − 2β 3 ) + 1 − 3β 2 + 2β 3 c(H) ≥ = > 2β, ∗ c(Opt) c(H ) h(2 − β) + β where the last inequality holds whenever h >
2 β(1−β)
−
1−β β .
48
3
D. Bil` o, L. Forlizzi, and G. Proietti
The 2β-Approximation Algorithm
In this section we provide a refinement of Double-MST shortcut which returns a 2β-approximate solution for the β-MTSP (its pseudo-code is given in Algorithm 2). In the following, given a vertex v of the considered rooted tree T , we denote by Tv the subgraph of T induced by v and by its children in T . We say that v ∈ Tv is a closest child of v if c(v, v ) ≤ c(v, v ), ∀v ∈ Tv . Algorithm 2. The Refined Double-MST shortcut algorithm Input: A β-metric graph G = (V, E). Step 1. Construct an MST T of G. Step 2. Root T at any arbitrary vertex of degree 1. Starting from the root, do a careful depth-first search of T , i.e., a depth-first search with the following additional rule: when the visit of an internal vertex of T begins, choose one of its closest children as the next vertex to visit. Let v0 , v1 , . . . , vn−1 be the sequence of vertices in the order they are visited. Output: Return the cycle H = v0 v1 . . . vn−1 v0 of G.
3.1
Algorithm Analysis
In this section we prove that Refined Double-MST shortcut returns a 2β-approximate solution. The core idea of the proof is to use properties of a careful depth first search together with the fact that in β-metric graphs, the cost of a direct edge between two vertices u and v is never larger than β times the cost of any other path between u and v. More formally, a simple proof by induction shows that Lemma 1. Let P = v0 v1 . . . vk be a simple path in G of length k ≥ 3. Then
k−1−j k−2 j c(v0 , vk ) ≤ β c(P ) − (1 − β) c(vi , vi+1 ) . β j=1
i=0
Let us denote by A the set of edges of T belonging to H, and by B = E(H) \ A the remaining edges in H. The following lemma holds: Lemma 2. For every non-leaf vertex vj of T , we have that |A ∩ E(Tvj )| = 1. Proof. Clearly, the lemma holds for j = 0. Hence, assume that j > 0. There are exactly two edges in E(H) incident to vj . One of them connects vj to vj−1 , so it does not belong to Tvj (indeed, for the depth-first search properties, vj−1 cannot be a descendent of vj ). If vj is not a leaf, one of its children is visited immediately after vj , hence (vj , vj+1 ) ∈ E(Tvj ). Observe that edges in A are exactly edges of the form (u, v), where u is an internal node of T while v is a closest child of u. Moreover, observe that since the root v0 has degree 1, then edges (v0 , v1 ), (v1 , v2 ) always belong to A. For any
Approximating the Metric TSP in Linear Time
49
edge e ∈ E(H), let Pe denote the unique path in T joining the two endpoints of e (notice that if e ∈ A, then Pe consists of e). Because of the depth-first search properties, it is not hard to see that, for any e ∈ E(T ), there are exactly two edges of H, say e1 , e2 , that cover e, i.e., e ∈ E(Pe1 ) and e ∈ E(Pe2 ). Let us denote by Opt an optimal solution and by e∗ an edge of Opt of maximum cost. As Opt minus e∗ is a spanning tree of G, we can claim that ∗ c(Opt) ≥ c(T ) + c(e ). In the remaining part of this section we will prove that c(H) ≤ 2β c(T ) + c(e∗ ) , thus proving that c(H) ≤ 2β c(Opt). The idea of the proof is to charge the cost of H to the edges in T plus e∗ in such a way that each of these edges will be charged with at most 2β times its cost. This can be done in a simple way because every edge f in H is associated with Pf , a path in T . Therefore, it is quite natural to start charging the cost of f to the edges of Pf according to the formula in Lemma 1. Let e be an edge of T , and let e1 , e2 ∈ E(H) be such that Pe1 , Pe2 cover e. Using the formula in Lemma 1, we can observe the following – if e ∈ A then e is charged with at most 2β times its cost, as both Pe1 , Pe2 are different from e; – if e ∈ A then e is charged with at most 1 + β times its cost, as either Pe1 or Pe2 must be different from e. Therefore, the unique problem to solve is how to uncharge edges in A and still keep every other edge with a charge of 2β times its cost. By the careful depth-first search, we know that A contains only edges of the form (u, v), where u is an internal node of T while v is a closest child of u. By definition of closest child, we have that c(u, v) ≤ c(u, v ), ∀(u, v ) ∈ E(Tu ). Moreover, it is possible to prove that c(e) ≤ c(e∗ ), ∀e ∈ E(T ). Finally, in β-metric graphs, with 12 ≤ β < 1, β c(f ) (see [2]). Since from Lemma 1, two adjacent edges f, f satisfies c(f ) ≤ 1−β some edges may be charged with less than 2β times their cost, we can therefore uncharge (u, v) using the quantities we are saving on its adjacent edges in T plus e∗ using the above rules. In what follows, we will prove that this can always be done in such a way that each edge of T plus e∗ will be charged by at most 2β times its cost. The quality of the solution computed by Refined Double-MST shortcut is better than the one computed by Double-MST shortcut because, whenever an edge (u, v ) ∈ E(Tu ) has been charged with (2β − δ)c(u, v ), thanks to the careful depth-first search, we can uncharge (u, v) by δ c(u, v) instead of uncharging it by the smaller value 1−β β δ c(u, v). Before providing a formal proof of the above idea, we point out that the restriction of having a vertex of degree 1 as the root of T is only for the purpose of avoiding technicalities. All the results contained in this section can be extended to the general case in which T is rooted at any arbitrary vertex. For any e ∈ E(H), with Pe = x0 x1 . . . xk , we define Ve as the set of vertices {x1 , x2 , . . . , xk−2 }, and V = e∈E(H),|E(Pe )|≥3 Ve . The following holds: Lemma 3. Let e = (vj , vj+1 ) ∈ E(H) be such that Pe = x0 x1 . . . xk , with x0 = vj , xk = vj+1 , and assume that k ≥ 3. Then, for 1 ≤ i ≤ k − 1, xi is the parent in T of xi−1 .
50
D. Bil` o, L. Forlizzi, and G. Proietti
Proof. Since Pe is a simple path in T , all the vertices in Pe but one, say xh , have their parent in T contained in Pe . Suppose by contradiction that h < k − 1. Then xk is a descendent of xh+1 in T . It follows that xh+1 is visited after x0 and before xk . But this is not possible since (x0 , xk ) ∈ E(H) implies that xk is visited immediately after x0 . Therefore, it must be either h = k − 1 or h = k. In both cases, this implies that xk−1 is the parent of xk−2 in T , which in its turn is the parent of xk−3 in T , and so on. From this, the claim follows. Let L denote the set of leaves of T . We have that Lemma 4. V = V \ (L ∪ {v0 , v1 }). Proof. Lemma 3 implies that V cannot contain any of the vertices in L∪{v0 , v1 }. Hence, in order to prove the claim, it is enough to show that any internal vertex vj of T but v0 and v1 belongs to Ve , for some e ∈ E(H). As vj is an internal vertex and because of the depth-first search properties, there is an edge in H, say e = (vh−1 , vh mod n ), with h − 1 > j, such that vh−1 is a proper descendent of vj while vh mod n is not a descendent of vj . Then, in order to conclude that vj ∈ Ve , it suffices to observe that from the depth-first search properties, vh mod n cannot be the parent of vj in T . From now on, we will denote by A the set of edges in A but (v0 , v1 ), (v1 , v2 ). Moreover, we define a function σ : A → V which maps each edge e ∈ A into the endpoint of e which is the parent in T of the other endpoint. From the above lemma and from Lemma 2, it is easy to derive that σ is a bijective function. We can now prove the following Lemma 5. For every e ∈ B such that Pe = x0 x1 . . . xk contains k ≥ 3 edges, we have that
k−1−j k−2 j c(xi , xi+1 ) ≥ c(σ −1 (x)). (1) β j=1
i=0
x∈Ve
Proof. Grouping together terms with respect to the edge costs, the left-hand side of (1) becomes k−2
β j c(x0 , x1 ) +
j=1
k−2 k−1−i i=1
β j c(xi , xi+1 ).
By suitably rearranging its terms, (2) can be rewritten as ⎛ ⎞ k−2 k−1−i ⎝ β j c(xi−1 , xi ) + β k−1−i c(xi , xi+1 )⎠ . i=1
(2)
j=1
(3)
j=1
Now we bound the i-th term of the external summation in (3) with respect to the cost of edge σ −1 (xi ). Recall that (see [2]) for any two adjacent edges β e1 , e2 of G, it is c(e1 ) ≤ 1−β c(e2 ). Then, for each xi ∈ Ve it is c(σ −1 (xi )) ≤
Approximating the Metric TSP in Linear Time
51
c(xi , xi+1 ). Moreover, c(σ −1 (xi )) ≤ c(xi−1 , xi ), since σ −1 (xi ) and (xi−1 , xi ) are both edges of Txi . Then we have β 1−β
(3) ≥
k−2 i=1
=
k−2 i=1
≥
k−2
⎛ ⎝ ⎛ ⎝ ⎛ ⎝
i=1
k−1−i
⎞ β j c(σ −1 (xi )) + β k−2−i (1 − β) c(σ −1 (xi ))⎠
j=1 k−2−i j=1 k−2−i j=1
⎞ β j + β k−2−i ⎠ c(σ −1 (xi )) ⎞ k−2 1 1 ⎠ −1 + (x )) = c(σ −1 (xi )) = c(σ −1 (x)) c(σ i j k−2−i 2 2 i=1 x∈Ve
where the last inequality holds because β ≥ 12 . We are now ready to give our main result:
Theorem 1. The Refined Double-MST shortcut algorithm is a 2β-approximation algorithm for the β-MTSP. Proof. Let us start by setting B = 2≤i≤n Bi , where Bi = {e ∈ B s.t. |E(Pe )| = i}. For any e ∈ E(H), let Pe = xe0 xe1 . . . xek . We can bound the total cost of H with c(H) =
c(e) +
e∈A
c(e) +
e∈B2
+
⎛
n
n
c(e) ≤
k=3 e∈Bk
e∈A
c(e) + β
k−2
βj
c(Pe ) − (1 − β)
k=2 e∈Bk
c(Pe )+
e∈B2 k−1−j
j=1
n
c(e) + β
e∈A
⎝β c(Pe ) − (1 − β)
k=3 e∈Bk
≤
⎞
c(xei , xei+1 ) ⎠
i=0
n
c(σ −1 (x))
k=3 e∈Bk x∈Ve
where the first inequality holds from the β-metricity of G and from Lemma 1, while the last inequality holds from Lemma 5. Since each edge of T is covered by exactly two edges of H, then n k=2 e∈Bk
c(Pe ) =
c(e) + 2
e∈A
c(e).
e∈E(T )\A
By definition, observe that each e ∈ E(H) for which Ve ⊆ V is in Bj for some j ≥ 3. From this fact and because σ is bijective we can derive n k=3 e∈Bk x∈Ve
c(σ −1 (x)) ≥
x∈V
c(σ −1 (x)) =
c(f )
f ∈A
(in fact, here we could prove that equality holds, since e = e ⇒ Ve ∩ Ve = ∅).
52
D. Bil` o, L. Forlizzi, and G. Proietti
To conclude the proof, let e∗ be a maximum-cost edge of any optimal solution Opt. Observe that, c(e) ≤ c(e∗ ) for every e ∈ E(T ). Indeed, let us consider the cut induced by the removal of e from T , and let e ∈ E(H) be an edge traversing that cut. Then, since T is an MST, we have c(e) ≤ c(e ) ≤ c(e∗ ). Using previous observations we have c(e) c(H) ≤ c(v0 , v1 ) + c(v1 , v2 ) + e∈A
⎛
+ β ⎝c(v0 , v1 ) + c(v1 , v2 ) + ⎛ = 2β ⎝
c(e) +
e∈E(T )\A
≤ 2β ⎝
c(e) + 2
e∈A
e∈A
⎛
e∈A
c(e) +
⎞
⎞
c(e)⎠ − (1 − β)
e∈E(T )\A
c(e)
e∈A
c(e)⎠ + (1 + β) c(v0 , v1 ) + c(v1 , v2 ) ⎞ c(e)⎠ + c(v0 , v1 ) + c(v1 , v2 ) + 2β c(e∗ )
e∈E(T )\A
≤ 2β c(T ) + 2β c(e∗ ) ≤ 2β c(Opt) where the last but two inequality holds because c(e∗ ) ≥ c(e), ∀e ∈ E(T ), the last but one inequality holds because β ≥ 12 , and the last inequality follows from the fact that by removing e∗ from Opt, one obtains a spanning tree.
4
Lower Bound for Double-MST Min-Weight Shortcut
In the introduction we have mentioned one of the best heuristics available for the TSP, i.e., the heuristic we called Double-MST Min-weight shortcut [3,5]. We said that this heuristic computes in O(4d n2 ) time (where d denotes the maximum node-degree in T ) the minimum cost Hamiltonian cycle that can be obtained using the Double-MST shortcut approach. It is worth noticing that the result proved for the algorithm we proposed in Section 3 immediately implies that Double-MST Min-weight shortcut is a 2β-approximation algorithm. In this section we prove that Double-MST Min-weight shortcut cannot compute an approximate solution within a factor which is significantly better than 2β. As a consequence, 2β is an asymptotic lower bound for the approximation ratio of all the algorithms based on the Double-MST shortcut approach. Hence, the Refined Double-MST shortcut is one of the best approximation algorithms based on this approach. Consider the β-metric graph of n+1 vertices given in Figure 3. All √ the internal vertices of the MST T √ represented with solid edges have degree n. A feasible solution is given by the n dotted paths arbitrarily linked one another and with x √ to form a Hamiltonian cycle. As the cost of each dotted path is n−1 and as the cost of any other edge is at most 2β, we √ have √ that the cost √ of an optimal solution √ Opt is upper bounded by c(Opt) ≤ n( n − 1) + 2β( n + 1) ≤ n + 2β n.
Approximating the Metric TSP in Linear Time
53
x
Fig. 3. A β-metric graph of n + 1 vertices showing the asymptotic lower bound of 2β on the approximation ratio of Double-MST Min-weight shortcut. Both solid and dotted edges have cost 1, while the cost of missing edges is 2β. An MST T is given by the set √ of solid edges The degree of all the internal vertices of the MST is n.
approximation ratio 2
3/2 4/3
1 1/2
2/3
1
β
Fig. 4. The approximation ratio of our algorithm (solid line), as compared to that provided by the Double-MST shortcut (dotted) and the currently best-known approximation algorithm (dashed)
Concerning the solution built by Double-MST Min-weight √ shortcut, first of all notice that no Hamiltonian√cycle contains more than 2 n solid edges, as these edges are all incident to the n internal vertices of T but x, and the degree of every vertex in a Hamiltonian cycle is 2. Now, observe that every dotted edge is a shortcut of some path in D = T ∪ T containing 2 solid edges which are √ incident to x. As the degree of x in D is 2 n, we have that √ every solution built by Double-MST Min-weight shortcut contains at most n dotted edges. As a consequence, the solution √ √ computed by Double-MST Min-weight shortcut contains at least n + 1 − 3 n edges of cost 2β. As c(Opt) ≤ n + 2β n, we therefore have that Double-MST Min-weight shortcut does not return a (2β−)approximate solution, for every > 0.
54
5
D. Bil` o, L. Forlizzi, and G. Proietti
Conclusion
In Figure 4, we provide a comparison between the approximation algorithms for the β-MTSP discussed in this paper, namely the Double-MST shortcut, that obtained by composing the algorithms given in [4,2], and finally our one. It is worth noticing that our algorithm induces a significant improvement in the gap with respect to the superlinear approximation algorithm: for instance, for all 1/2 < β ≤ 3/4, our algorithm is only about 5% away from it in the worst case, while for the Double-MST shortcut this gap raises to about 26%. Thus, especially for this range of values of β, from a practical point of view one can make use of our very simple linear-time algorithm—instead of pursuing a very complicate implementation of the superlinear algorithm—by only paying a little bit more in terms of approximation ratio.
References 1. Arora, S.: Polynomial time approximation schemes for Euclidean traveling salesman and other geometric problems. J. ACM 45(5), 753–782 (1998) 2. B¨ ockenhauer, H.-J., Hromkoviˇc, J., Klasing, R., Seibert, S., Unger, W.: Approximation algorithms for the TSP with sharpened triangle inequality. Information Processing Letters 75, 133–138 (2000) 3. Burkard, R.E., Deineko, V.G., Woeginger, G.J.: The travelling salesman and the pq-tree. Mathematics of Operations Research 23(3), 613–623 (1998) 4. Christofides, N.: Worst-case analysis of a new heuristic for the traveling salesman problem. Technical report, Graduate School of Industrial Administration, Carnegy–Mellon University (1976) 5. Deineko, V.G., Tiskin, A.: Fast minimum-weight double-tree shortcutting for metric TSP. In: Demetrescu, C. (ed.) WEA 2007. LNCS, vol. 4525, pp. 136–149. Springer, Heidelberg (2007) 6. Drake Vinkemeier, D.E., Hougardy, S.: A linear-time approximation algorithm for weighted matchings in graphs. ACM Transactions on Algorithms 1(1), 107–122 (2005) 7. Gabow, H.N.: An efficient reduction technique for degree-constrained subgraph and bidirected network flow problems. In: Proc. of the 15th Annual ACM Symp. on Theory of Computing (STOC), pp. 448–456 (1983) 8. Gabow, H.N., Tarjan, R.E.: Faster scaling algorithms for general graph-matching problems. J. ACM 38(4), 815–853 (1991) 9. Papadimitriou, C.H., Vempala, S.: On the approximability of the traveling salesman problem. Combinatorica 26(1), 101–120 (2006) 10. Reinelt, G.: TSPLIB library, University of Heidelberg, http://www.iwr.uni-heidelberg.de/groups/comopt/software/tsplib95/ 11. Tan, X.: Approximation algorithms for the watchman route and zookeeper’s problems. Discrete Applied Mathematics 136(2-3), 363–376 (2004)
The Valve Location Problem in Simple Network Topologies Hans L. Bodlaender1 , Alexander Grigoriev2, Nadejda V. Grigorieva3, and Albert Hendriks1 1
Institute of Information and Computing Sciences, Utrecht University, P.O. Box 80.089, 3508 TB Utrecht, the Netherlands
[email protected],
[email protected] 2 Department of Quantitative Economics, Maastricht University, P.O. Box 616, 6200 MD Maastricht, The Netherlands
[email protected] 3 Institute of Power Resources Transport (IPTER), 144/3, pr. Octyabrya, Ufa-450055, Russia n
[email protected]
Abstract. To control possible spills in liquid or gas transporting pipe systems, the systems are usually equipped with shutoff valves. In case of an accidental leak these valves separate the system into a number of pieces limiting the spill effect. In this paper, we consider the problem, for a given edge-weighted network representing a pipe system and for a given number of valves, to place the valves in the network in such a way that the maximum possible spill, i.e. the maximum total weight of a piece, is minimized. We show that the problem is NP-hard even if restricted to any of the following settings: (i) for series-parallel graphs and hence for graphs of treewidth two; (ii) if all edge weights equal one. If the network is a simple path, a cycle, or a tree, the problem can be solved in polynomial time. We also give a pseudo-polynomial time algorithm and a fully polynomial approximation scheme for networks of bounded treewidth. Keywords: Valve location problem; computational complexity; bounded treewidth; dynamic programming; binary search.
1
Introduction
In this paper, we consider a combinatorial problem that arose from a number of applications connected to operations and maintenance of a broad variety of transportation systems; for applications related to the long oil and gas pipelines see e.g. [10]; for applications in water supply engineering see [15]; for applications in electrical grid maintenance see [7]. Let us briefly discuss the related problem arising in oil and gas transportation. A pipeline is the most efficient and environmentally friendly way to transport hazardous liquids and gases, e.g. crude oil or natural gas, over land. In normal daily operations, pipelines do not produce any pollution. However, due to external factors or pipe corrosion, accidents on H. Broersma et al. (Eds.): WG 2008, LNCS 5344, pp. 55–65, 2008. c Springer-Verlag Berlin Heidelberg 2008
56
H.L. Bodlaender et al.
pipelines sometimes happen and the accidental damage can be substantial. To control possible spills, every pipe system is usually equipped with special shutoff valves. Whenever the pipe system is depressurized, the valves automatically and instantly separate the pipe system into pieces. Therefore, the quantity of hazardous liquid or gas potentially leaving the system equals the total length of the pipes in the damaged piece of the system separated by shutoff valves. In the application at hand, there is a given edge-weighted network representing a pipe system and a given number of valves that can be placed in the vertices of the network. We want to solve the following problem: find a valve location in the network that minimizes the maximum total weight of a piece separated by shutoff valves. This paper is organized as follows. In Section 2, we give a precise graph theoretic formulation of the problem. In Section 3, we show that using dynamic programming the problem can be solved in polynomial time on simple network topologies: paths, cycles and trees. In Section 4, we consider a more general case, namely the graphs of bounded treewidth. For these graphs, we give a pseudo-polynomial time dynamic programming algorithm, and then we turn this algorithm into a fully polynomial approximation scheme (FPTAS). Finally, in Section 5, we discuss the complexity of the problem. Here, we show that the problem is NP-hard even for series-parallel graphs and hence for graphs of treewidth at most two. We also show that the unweighted version of the problem, i.e. the problem where all edge weights equal one, is also NP-hard.
2
Graph Theoretic Formulation
The problem can be formulated in graph theoretic terms in a natural way. Let G = (V, E) be an undirected graph representing a pipe network. Edges of the graph represent pipes. Let ωe ∈ Z+ denote the length of pipe e ∈ E. Vertices of the graph represent connection points between the pipes. Let k be a number of valves to be installed. We assume that a valve can be located in any vertex v ∈ V. Consider a set of vertices V ⊆ V . If we use V as valve locations, we use |V | valves, and partition G into pieces as follows. The set of edges E is partitioned into sets with two edges in the same set of the partition if and only if they are on a path in G that does not contain a valve. Thus, E is partitioned into subsets E1 , E2 , . . . , ES where edges in Es , 1 ≤ s ≤ S, form a connected component in G called a piece, and for any two subsets, Es and Et , the set of endpoints in Es intersects the set of endpoints in Et only in elements of V . The cost of V , denoted Wmax (V ), is Wmax (V ) = max ωe , 1≤s≤S
e∈Es
i.e., the maximum total length of a piece or the maximum spill. The valve location problem then is to find a subset V of vertices in G such that |V | ≤ k and the cost Wmax (V ) is minimized. In other words, we have
The Valve Location Problem in Simple Network Topologies
57
to find a k-elementary separator in G such that the maximum length connected component is minimized. We consider also the unweighted version of the problem where ωe = 1 for all e ∈ E. Throughout the paper, n denotes the number of vertices in G, ωmax the maximum length of an edge: ωmax = max ωe , e∈E
and ωΣ the total length of all edges: ωΣ =
ωe .
e∈E
Clearly, the maximum spill is yet another network vulnerability measure. This concept is very close to many other known vulnerability measures, e.g. vertex integrity of a graph defined as I(G) = min{|S| + m(G − S) : S ⊂ V }, where m(H) denotes the maximum order of a component of H, see [2,3]; minimum balanced separator defined as a minimum order separator S such that the maximum component in G− S contains at most βn vertices for a given 0 < β < 1, see [1,8,14]; and some other, see e.g. [13]. The key difference between the maximum spill and the known vulnerability measures is that the maximum spill measures vulnerability of a graph in terms of the total edge weight (or length) of a component when all other measures are related to the maximum order (number of vertices) in a component. Of course, practical suitability of a certain measure depends heavily on applications. Throughout the paper, we measure run time of the algorithms using the widely accepted convention that we can do an addition or multiplication of two integers in O(1) time. If we want to count bit operations, we must multiply run times by a factor log ωΣ .
3
Simple Networks: Paths, Cycles and Trees
In this section, we give dynamic programming algorithms to solve the problem in simple network topologies: paths, cycles and trees. 3.1
The Valve Location Problem on a Path
We first consider the valve location problem on a path. This simple case appears frequently in the practical settings of the long oil pipelines, and thus is of practical relevance; see [10]. We have two different exact algorithms. One uses ‘text book’ dynamic programming. Proposition 1. The valve location problem on a path can be solved by dynamic programming in O(kn2 ) time. The other algorithm is obtained by using a binary search for the optimal spill value and by checking feasibility of each spill value with a greedy algorithm.
58
H.L. Bodlaender et al.
Proposition 2. Given a path and a value L, we can decide in O(n) time if there is a solution to the valve location problem with k valves with cost at most L. The same idea also gives the minimum number of valves needed to guarantee a cost that is at most L. Using binary search for the optimal value in the range of integers between 0 and ωΣ , we directly obtain the following result. Corollary 1. For a given path, we can solve the valve location problem in O(n log ωΣ ) time. It is also possible to construct a fast 2-approximation algorithm using a greedy strategy for paths. Proposition 3. The valve location problem on a path admits a 2-approximation algorithm that uses O(n) time. Finally, we can sharpen Proposition 3 when ωmax ≥ 3Ap . Proposition 4. Consider the valve location problem on a path. Let k be the number of valves. If ωmax ≥ 3ωΣ /(k + 1), then the optimal solution has cost ωmax . An optimal solution can be found in this case in O(n) time. 3.2
Cycles
If G is a cycle, then we can obtain exact and approximate solutions for the valve location by using variants to the algorithms for paths. Proposition 5. The valve location problem on a cycle admits a 2-approximation algorithm that uses O(n) time. Proposition 6. Consider the valve location problem on a cycle. Let k be the number of valves. If ωmax ≥ 3ωΣ /k, then the optimal spill equals ωmax . An optimal valve location can be found in this case in O(n) time. Theorem 1. The valve location problem on a cycle can be solved by solving O(n/k) valve location problems on paths of length at most n. Corollary 2. The valve location problem on a cycle can be solved in O(n min {log ωΣ , n/k}) time. 3.3
Trees
Very recently, see [7], we became aware of the fact that the valve location problem on trees is an important modern research topic in electrical engineering. Whenever a regional power supply network (a tree) should be maintained, the engineers are shutting down some small subtree and they are interested in an optimal location of switchers. This application brings us to the valve location in trees. Surprisingly enough, already this special case of the problem is quite complicated: according to [7], a typical modern approach to the problem is a
The Valve Location Problem in Simple Network Topologies
59
genetic algorithm. In this section, we present a nontrivial algorithm that solves the problem on trees in polynomial time. More specifically, we show: Theorem 2. The valve location problem on a tree can be solved in O(nk 2 log(nωmax )) time. The global structure of the algorithm is a binary search on the optimal value in the range of integers between 0 and nωmax . Thus, we directly obtain Theorem 2 as a corollary of the next result. Proposition 7. Given a tree, and an integer L, we can decide in O(nk 2 ) time if we can place k valves with maximum piece size at most L. Proof. We choose an arbitrary vertex vr as root of the tree. For rooted subtrees T , and integers i, 0 ≤ i ≤ k, we define AT ,L (i) = the minimum over all possible ways to put at most i valves in T such that no piece in T has a total length of more than L, of the total length of the piece that contains the root node of T . AT ,L (i) = 0, if there is a way to put at most i valves in T such that no piece in T has a total length of more than L, such that there is a valve in the root node of T . AT ,L (i) = ∞, if there is no possible way to put at most i valves in T such that no piece in T has a total length of more than L. PT ,L (i) = true if and only if AT ,L (i) = 0, i.e. if we can put at most i valves in T such that no piece in T has a total length of more than L, such that there is a valve in the root node of T . We will compute tables AT ,L and PT ,L for several subtrees of T : – For each vertex v in T except vr , we compute a table for the subtree, consisting of the parent of v in T , v, and all the descendants of v. The root of this subtree is the parent of v. Call this subtree Tv+ . – For each vertex v in T : if v has i children w1 , w2 , . . . , wi , then for each j, 0 ≤ j ≤ i, we compute a table for the subtree, consisting of v, w1 , . . . , wj , and all descendants of w1 , w2 , . . . , wj . Vertex v is the root of this subtree. Call this subtree Tv,j . For the case j = i, write Tv = Tv,i ; this is the tree consisting of v and all its descendants. The following two lemmas give recursive formulations that show how to compute these tables. Lemma 1. Let T be obtained by taking the union of trees T and T such that the root r of T and T is the only vertex that belongs to both trees. Let 0 ≤ i ≤ k. 1. PT,L (i), if and only if there are i , i with i + i = i − 1, 0 ≤ i ≤ k, 0 ≤ i ≤ k, such that PT ,L (i ) and PT ,L (i ). 2. If PT,L (i), then AT,L (i) = 0.
60
H.L. Bodlaender et al.
3. If not PT,L (i), then AT,L (i) =
min
i ,i ,i +i =i,0≤i,i
AT ,L (i ) + AT ,L (i )
if this term is at most L, otherwise AT,L (i) = ∞. Lemma 2. Let T be a tree with root r, and let T + be obtained by adding an edge {r, r } to a new vertex r with length . Let r be the root of T + . Let 0 ≤ i ≤ k, and L be an integer. 1. PT + ,L (i) holds if and only if i > 0 and AT,L (i − 1) + ≤ L. 2. If PT + ,L (i), then AT + ,L (i) = 0. 3. If not PT + ,L (i), then AT + ,L (i) = AT + ,L (i) + , if this term is at most L, and AT + ,L (i) = ∞ otherwise. Using Lemmas 1 and 2, we can compute all desired tables. Recall that L is fixed during the computation. Now, for all vertices in the tree, in postorder, we compute all values ATv ,L (i), and PTv ,L (i), for all i, 0 ≤ i ≤ k. This is done in the following way. If v is a leaf of T , then computing these values is trivial. Otherwise, suppose v has s children, say w1 , w2 , . . . , ws . For all j, 1 ≤ j ≤ s, we compute all values ATv,j ,L (i), and PTv,j ,L (i) for all i, 0 ≤ i ≤ k. In case j = 1, we note that Tv,1 is the same subtree as Tw+1 . Thus, using Lemma 2, we can compute the values ATv,1 ,L (i), and PTv,1 ,L (i) from the already earlier computed tables ATw1 ,L and PTw1 ,L . For 2 ≤ j ≤ s, we note that Tv,j is the union of Tv,j−1 and Tw+j . Thus, we first compute the tables ATw+ , L and PTw+ , L given the tables j j ATwj ,L and PTwj ,L using Lemma 2. Then, we compute the tables ATv,j ,L and PTv,j ,L from the tables ATw+ ,L , PTw+ ,L , ATv,j−1 ,L and PTv,j−1 ,L , using Lemma 1. j j Finally, note that Tv,s = Tv . When we have the tables ATvr ,L and PTvr ,L , we can easily decide whether we can place k valves in T with maximum piece size at most L, using the following simple observation. Proposition 8. Let vr be the root of T . There is a solution to the valve location problem with k valves and cost at most L if and only if ATvr ,L (k) < ∞. If T has n vertices, then we compute O(n) tables: O(1) per edge in T . Each table can be computed in O(k 2 ) time. This can be easily observed from Lemmas 1 and 2. Simply, iterate over all possible values of k and k , and compute the necessary value of k . Each step involves O(1) computations. Actually, the step that uses Lemma 2 needs only O(k) time. This finishes the proof of Proposition 7. Notice that for trees, a result similar to Propositions 4 and 6 holds. However, in this case, this does not lead to an approximation algorithm with constant performance guarantee. Proposition 9. Consider the valve location problem on a tree. Let k be the number of valves. If ωmax ≥ 3ωΣ /k, then the optimal spill equals ωmax .
The Valve Location Problem in Simple Network Topologies
4
61
Algorithms for Graphs of Bounded Treewidth
In practice, most of the transportation systems are more complicated than trees. This makes the problem more difficult from algorithmic perspective. Fortunately, real-life networks in majority of applications (e.g., for oil and gas pipeline transportation) are outerplanar or, taking this more generally, the corresponding graphs have bounded treewidth; see e.g. [5,6,11]. For this type of networks we have the following results. Theorem 3. The valve location problem on graphs of treewidth q admits a O(q) . dynamic programming algorithm running in time (nωmax ) This dynamic programming algorithm follows the lines of several algorithms for other problems on graphs of bounded treewidth. For easier description, we use a nice tree decomposition of width at most q; for definition see below. As a first step, we must find a tree decomposition of width at most q. This can be done in O(n) time for fixed q; see [4]. At this point, we would like to make a remark concerning practical implementations. The algorithm in [4] has such a large hidden constant, that it is not of use in a practical setting. Fortunately, there are several heuristics that often give good bounds. Also, there are fast algorithms that construct tree decompositions of optimal width for graphs of treewidth at most three (including outerplanar graphs), see e.g. [6] for a discussion. Given a tree decomposition, in O(n) time one can transform it to a nice tree decomposition [12] with the same width. We now give the definition of a nice tree decomposition. A nice tree decomposition of a graph G = (V, E) is a rooted binary tree T = (I, F ), where each node i ∈ I is a subset Xi ⊆ V , called bag, such that 1. 2. 3. 4. 5.
i∈I Xi = V . For all {v, w} ∈ E, there exists an i ∈ I, with v, w ∈ Xi . For all v ∈ V , the set {i ∈ I | v ∈ Xi } forms a subtree of T . If i ∈ I has two children j1 , j2 , then Xi = Xj1 = Xj2 (Join Node). If i ∈ I has one child j, then either there is a v ∈ Xi with Xj ∪ {v} = Xi (Introduce Node) or there is a v ∈ Xj with Xi ∪ {v} = Xj (Forget Node). 6. If i ∈ I is a leaf in T , then |Xi | = 1 (Leaf Node).
The width of a nice tree decomposition is maxi∈I |Xi | − 1. In our dynamic programming algorithm, we compute in postorder for each node of T a table. Associate to node i ∈ I the subgraph Gi = G[Vi ], induced by the set of vertices in Xi or a bag Xj with j a descendant of i: Vi = Xj , with the union taken over all j in the subtree of T rooted at j. A placement of valves on the vertices of Gi has a characteristic, which is a 5-tuple (j, Z, L, f, ∼), consisting of
62
H.L. Bodlaender et al.
– – – –
The number j of used valves in Gi . The subset Z ⊂ Xi of the vertices in Xi that contain a valve. The maximum length of a piece in Gi . A function f : Xi → N, giving for each vertex v ∈ Vi the total length of the piece that contains v; if there is a valve on v, then f (v) = 0. – An equivalence relation ∼ on Xi , with for all v, w ∈ Xi , v ∼ w, if and only if there is a path from v to w in Gi that does not contain a vertex with a valve. In the table of i, we store all possible characteristics of all placements of valves O(q) . in Gi . Note that in this way, tables have a size that is bounded by (nωmax ) A somewhat tedious case analysis, typical for dynamic programming algorithms on graphs of bounded treewidth, shows that we can compute for each of the four types of nodes the table of all characteristics for a node, given such a table for each of the children of the node, in time polynomial in the table size. Then, computing these tables for all nodes in postorder gives an algorithm computing the table for the root node, and as Gr for the root node r equals G, we obtain the optimal valve location from this table. We remark that the described dynamic programming is only a pseudo-polynomial time algorithm for the weighted version of the valve location problem on graphs of bounded treewidth. Using standard scaling arguments, we derive the following corollary. Corollary 3. The valve location problem on graphs of bounded treewidth admits a fully polynomial approximation scheme.
5
Complexity Results
In this section, we show that two restricted versions of the valve location problem are NP-hard. For general networks it is strongly NP-hard as even the unweighted version of the problem is NP-hard, while for series-parallel graphs (a special case of graphs of treewidth at most two) the problem is weakly NPhard. Note that this complements the result that the problem is solvable in pseudo-polynomial time on graphs of bounded treewidth. Theorem 4. The valve location problem is NP-hard even if ωe = 1 for all e ∈ E. The proof of Theorem 4 is quite straightforward and it is based on a reduction from the strongly NP-hard problem 3-partition. The second complexity result is less trivial. For this result let us remind a definition of a series-parallel graph. A series-parallel graph is a graph G = (V, E) with two special vertices, called its terminals, often denoted s and t, that can be formed with the following operations: – A graph consisting of a single edge {s, t} between its terminals is a seriesparallel graph.
The Valve Location Problem in Simple Network Topologies
63
– If G and H are terminal graphs, with terminals sG , tG , and sH and tH , then the series composition of G and H is a series-parallel graph. In the series composition, we take the disjoint union, then identify tG and sH , and take sG and tH as terminals of the resulting graph. – If G and H are terminal graphs, with terminals sG , tG , and sH and tH , then the parallel composition of G and H is a series-parallel graph. In the parallel composition, we take the disjoint union, then identify sG and sH and identify tG and tH . The two vertices obtained by identification are the terminals of the resulting graph. Theorem 5. The valve location problem is weakly NP-hard for seriesparallel graphs. Proof. We show that the valve location problem is weakly NP-hard for the following graphs: we have two vertices s and t, and a number of internally disjoint paths from s to t of length exactly five. We use a reduction from partition; see e.g. [9]. Suppose we are given positive integers a1 , a2 , . . . , an . The partition problem asks if these integers can be partitioned into two sets with equal sum, i.e. we look for two sets, each of sum B = ni=1 ai /2. We may assume B is integer, as if ni=1 ai is odd, the partition problem trivially has no solution. As the corresponding instance for the valve location problem, we take n disjoint paths from s to t. Each of these paths has length five, i.e., four intermediate vertices, which we call vi,1 , vi,2 , . . . , vi,4 . The successive lengths of the edges on the ith path are 1, ai , B − ai + n, ai , 1. Call the resulting graph G, see Figure 1. Proposition 10. Set A = {a1 , a2 , . . . , an } can be partitioned into two sets, both of sum B, if and only if we can place at most 2n valves in G such that each part has total length at most B + n. s 1
1
1 v1,1 a1 v1,2 B − a1 + n
1 v3,1 a3
v2.1 a2
vn,1 an vn,2 B − an + n
v1,3 a1
v3,2 v2,2 B − a2 + n B − a3 + n v3,3 v2,3 a3 a2
v1,4
v2,4
vn,4
1
v3,4 1
1
vn,3 an
1
t Fig. 1. The series-parallel graph constructed in Theorem 5
64
H.L. Bodlaender et al.
The NP-hardness of the valve location problem on series-parallel graphs now follows, by noting that G is series-parallel: a path can be constructed by a sequence of series compositions, and by parallel compositions, we can identify the endpoints of the paths. As series-parallel graphs have treewidth two, the results of the previous section show that (unless P=NP), the problem on series-parallel graphs cannot be strongly NP-hard. Moreover, Theorem 5 excludes the possibility for fixedparameter tractability of the problem with respect to the parameter ”graph treewidth”.
6
Conclusions
In this paper we presented fast algorithms for several practically relevant classes of instances of the valve location problem. Moreover, applying literally the same techniques to the vertex integrity problem, we can tackle this later problem as well.
Acknowledgments We thank Alexandr Kostochka for pointing on several very useful references on graph integrity.
References 1. Alon, N., Seymour, P., Thomas, R.: A separator theorem for graphs with an excluded minor and its applications. In: Proc. of the 22nd Symposium on Theory of Computing, STOC 1980, pp. 293–299. ACM Press, New York (1980) 2. Barefoot, C.A., Entringer, R., Swart, H.C.: Vulnerability in graphs: a comparative survey. J. Comb. Math. Comb. Comput. 1, 12–22 (1987) 3. Barefoot, C.A., Entringer, R., Swart, H.C.: Integrity of trees and the diameter of a graphs. Congressus Numerantium 58, 103–114 (1987) 4. Bodlaender, H.L.: A linear time algorithm for finding tree-decompositions of small treewidth. SIAM J. Comput. 25, 1305–1317 (1996) 5. Bodlaender, H.L.: A partial k-arboretum of graphs with bounded treewidth. Theor. Comp. Sc. 209, 1–45 (1998) 6. Bodlaender, H.L.: Treewidth: Characterizations, applications, and computations. In: Fomin, F.V. (ed.) WG 2006. LNCS, vol. 4271, pp. 1–14. Springer, Heidelberg (2006) 7. Bouwman, S.: A survey of OR models and techniques for electrical grid companies. In: Proceedings of the 33rd Conference on the Mathematics of Operations Research, Lunteren 2008, Landelijk Netwerk Mathematische Besliskunde, The Netherlands (2008) 8. Feige, U., Mahdian, M.: Finding small balanced separators. In: Proceedings of the 37th Annual Symposium on Theory of Computing, STOC 2006, pp. 375–384. ACM Press, New York (2006)
The Valve Location Problem in Simple Network Topologies
65
9. Garey, M.R., Johnson, D.S.: Computers and intractability: A guide to the theory of NP-completeness. W. H. Freeman, San Francisco (1979) 10. Grigorieva, N.V., Grigoriev, A.: Optimal valve location in long oil pipelines. Research Memorandum RM/07/007, Maastricht Research School of Economics of Technology and Organizations (METEOR), Maastricht University, Maastricht, The Netherlands (2007), http://ideas.repec.org/p/dgr/umamet/2007007.html 11. Hicks, I.V., Koster, A.M.C.A., Kolotoglu, E.: Branch and tree decomposition techniques for discrete optimization. In: Smith, J.C. (ed.) TutORials 2005, INFORMS Tutorials in Operations Research Series, ch. 1, pp. 1–29. INFORMS Annual Meeting (2005) 12. Kloks, T.: Treewidth. Computations and Approximations. LNCS, vol. 842. Springer, Berlin (1994) 13. Kratsch, D., Kloks, T., M¨ uller, H.: Measuring the vulnerability for classes of intersection graphs. Discrete Applied Mathematics 77(3), 259–270 (1997) 14. Marx, D.: Parameterized Graph Separation Problems. In: Downey, R.G., Fellows, M.R., Dehne, F. (eds.) IWPEC 2004. LNCS, vol. 3162, pp. 71–82. Springer, Heidelberg (2004) 15. Ozger, S., Mays, L.W.: Optimal location of isolation valves: A reliability approach. In: Water Supply Systems Security, Digital Engineering Library. McGraw-Hill, New York (2004), http://dx.doi.org/10.1036/0071455663.CH13
A 3/2-Approximation Algorithm for Finding Spanning Trees with Many Leaves in Cubic Graphs Paul Bonsma and Florian Zickfeld Institut f¨ ur Mathematik, Technische Universit¨ at Berlin, Straße des 17. Juni 136, 10623 Berlin, Germany {bonsma,zickfeld}@math.tu-berlin.de
Abstract. We consider the problem of finding a spanning tree that maximizes the number of leaves (MaxLeaf). We provide a 3/2-approximation algorithm for this problem when restricted to cubic graphs, improving on the previous 5/3-approximation for this class. To obtain this approximation we define a graph parameter x(G), and construct a tree with at least (n − x(G) + 4)/3 leaves, and prove that no tree with more than (n − x(G) + 2)/2 leaves exists. In contrast to previous approximation algorithms for MaxLeaf, our algorithm works with connected dominating sets instead of constructing a tree directly. The algorithm also yields a 4/3-approximation for Minimum Connected Dominating Set in cubic graphs. Keywords: approximation algorithm, maximum leaf, connected dominating set, cubic graph.
1
Introduction
The problem MaxLeaf is defined as follows: given a connected graph G, find a spanning tree of G that maximizes the number of leaves. This problem is NPhard, even for cubic graphs [14]. Cubic graphs are graphs in which every vertex has degree 3. This problem is closely related to the problem MinCD-Set, which asks for a smallest possible connected dominating set or CD-set, which is a set S ⊆ V (G) such that G[S] is connected, and every vertex of G is either in S or adjacent to S (a dominating set). Observing that the non-leaves of a spanning tree form a CD-set, it is easily seen that G has a spanning tree with at least k leaves if and only if G has a CD-set of size at most |V (G)| − k (provided that G = K2 ), and that these can be constructed from each other in polynomial time. These problems have many theoretical and practical applications; in particular, recently they have received a lot of attention due to their importance in wireless networks [3]. Therefore it is not surprising that they have been considered from many different viewpoints, such as purely combinatorial settings
Supported by the Graduate School “Methods for Discrete Structures” in Berlin, DFG grant GRK 1408. Supported by the Studienstiftung des deutschen Volkes.
H. Broersma et al. (Eds.): WG 2008, LNCS 5344, pp. 66–77, 2008. c Springer-Verlag Berlin Heidelberg 2008
A 3/2 Approximation for Finding Leafy Trees in Cubic Graphs
67
(see below), and using most of the different algorithmic paradigms for solving hard problems, such as approximation algorithms (see below), fixed parameter tractable algorithms [2,7] and fast exact algorithms [8]. Generalizations such as to directed graphs have been studied [6]. Restrictions to different graph classes have also been considered. Motivated by the wireless networking applications, unit disk graphs have been widely studied [3]. In this paper, we study the two problems when restricted to cubic graphs, which was done before in [4,10,14,15]. Let n(G) denote |V (G)|, and let δ(G) and Δ(G) denote the minimum and maximum degree of G, respectively. If there is no cause for confusion we will simply write n, δ and Δ. With regard to the approximability of MaxLeaf, it is known that a polynomial time approximation scheme is unlikely to exist, since the problem is known to be MAX SNP-complete [9]. A 3-approximation was given by Lu and Ravi [16], and later a 2-approximation was given by Solis-Oba [18], which is the current best approximation ratio for general graphs. Lory´s and Zwo´zniak initiated the study of approximation algorithms for MaxLeaf in cubic graphs, and gave a 7/4approximation for this class [15]. This was recently improved to 5/3 by Correa et al [4]. In this paper, we will give a 3/2-approximation for MaxLeaf for cubic graphs. From an approximation viewpoint MaxLeaf and MinCD-Set behave quite differently: Guha and Khuller [12] showed that it is unlikely that constant factor approximation algorithms exist for MinCD-Set for general graphs. The current best approximation is 2 + ln Δ(G), given by Ruan et al [17]. For cubic graphs our algorithm will approximate MinCD-Set with a guarantee of 4/3. In another branch of research, a number of tight lower bounds is given for the maximum number of leaves that can be obtained, for (connected) graphs from different classes. Linial and Sturtevant first proved that every graph with δ ≥ 3 has a spanning tree with at least n/4 + 2 leaves (unpublished). A short proof appears in [13], where it is also shown that in graphs with δ ≥ 4, 2n/5 + 8/5 leaves can be obtained. For graphs with δ ≥ 5, n/2 + 2 leaves are possible [11]. The n/4 + 2 bound is also tight for cubic graphs, but when in addition diamonds are forbidden as subgraphs, Griggs et al [10] showed that n/3 + 4/3 leaves can be obtained. A diamond is a K4 minus one edge. Recently it was shown that when in addition to diamonds, a certain subgraph on seven vertices is forbidden, the n/3 + 4/3 bound also holds for graphs with δ ≥ 3 [2,19]. This generalizes an earlier result [1] that proves the same bound for graphs with δ ≥ 3 without triangles. However, because of some useful features (see Section 2), it is this earlier result that we will apply in this paper. In [19], a number of these bounds and similar bounds have been generalized to graphs with arbitrary degrees. Even though the algorithmic viewpoint is not stressed in the results mentioned above, all proofs easily give polynomial time algorithms that construct a tree satisfying the bounds. This leads us back to approximation algorithms. For instance, note that the n/4 + 2 lower bound trivially gives a 4-approximation when MaxLeaf is restricted to graphs with δ ≥ 3. It is straightforward to show that spanning trees in cubic graphs have at most n/2 + 1 leaves. Combined with the n/4 + 2 lower
68
P. Bonsma and F. Zickfeld
bound, this then gives a 2-approximation for cubic graphs. (Note that these bounds in terms of CD-sets show that any CD-set in a cubic graph contains at least n/2 − 1 vertices, and that a CD-set with at most 3n/4 − 2 vertices can be constructed. So for CD-sets in cubic graphs these bounds give a 3/2approximation.) The 5/3-approximation given by Correa et al [4] is based on a more sophisticated version of this idea which we will now treat in more detail, since we use a similar strategy. The goal of [4] was to match the upper bound n/2 + 1 for the number of leaves in cubic graphs with the lower bound n/3 + 4/3 for cubic graphs without diamonds. To make this work, only diamonds have to be treated in some way. This was done by defining a graph parameter c(G) that depends on the number and positions of diamonds in G: for a subgraph H of G, the internal vertices of H are those with only neighbors in H. Note that diamonds in cubic graphs always have two internal vertices. The parameter c(G) now denotes the number of components obtained when removing all internal vertices of diamonds from G. Using the bound from [10], it was shown that a spanning tree with at least 3 (n − 2c(G) + 4) leaves can be constructed, and it was (3n − 2c(G) + 17)/10 > 10 shown that any spanning tree has at most (n − 2c(G) + 4)/2 leaves. Together 3 = 53 approximation. It was also conjectured in [4] that a 3/2this gives a 12 / 10 approximation algorithm is possible for MaxLeaf. Our contribution. We prove this conjecture by providing a 3/2-approximation for MaxLeaf in cubic graphs. The algorithm itself is very simple, although the analysis is more involved. It is necessary to extend the study of problematic structures further, beyond only diamonds. This is indicated by the examples from [4]: there it is shown that graphs G with c(G) = 0 exist that have no spanning tree with more than (3n + 17)/10 leaves, hence considering only the parameter c(G) is not good enough. We consider all triangles of G, identify different types of them, and use their positions in G to define a number of graph parameters. This is done in Section 3. Then in Section 4, we state the algorithm, and prove it yields at least (n − x(G) + 4)/3 leaves, where x(G) is a function of the defined graph parameters. In Section 5 we prove that spanning trees in cubic graphs have at most (n − x(G) + 2)/2 leaves. Together, this yields the 3/2-approximation for MaxLeaf, and the 4/3-approximation for MinCD-Set (see Section 6). We believe that the two bounds we prove, and the identified graph parameters are interesting in their own right, showing exactly in which cases diamonds and triangles make it hard or even impossible to find spanning trees with at least n/3 + 4/3 leaves in graphs with δ ≥ 3. Unlike the previous algorithms, our algorithm is in fact an algorithm that constructs a CD-set instead of a tree. In [1] it was proved that in graphs with δ ≥ 3 without triangles, any CD-set S that satisfies some simple properties has |S| ≤ 2n/3 − 4/3. We observe that this bound can be generalized to graphs with triangles, but with a correction term that (sloppily speaking) depends on the number of triangles in G[S]. Our algorithm constructs S such that it contains at most x(G) triangles, such that the bound yields |S| ≤ (2n + x(G) − 4)/3. This in turn gives the bound for spanning trees mentioned above. More details on the
A 3/2 Approximation for Finding Leafy Trees in Cubic Graphs
69
bounds for CD-sets are given in Section 2, together with some basic definitions. We end in Section 7 with a discussion. The easier proofs are omitted because of space constraints.
2
Preliminaries
Basic notations and terminology. For basic graph theoretic notions we refer to [5]. We assume all graphs to be simple (i.e. without parallel edges and loops), with the exception that we allow edge contractions to yield parallel edges and loops. When applying edge contractions, edges are assumed to be labeled, that is, edge identities are preserved even if the labels of their end vertices change. The set resulting from removing element v from S is denoted by S − v, and adding an element is denoted by S + v. The number of components of a graph G is denoted by cc(G). Internal vertices of a subgraph H of G are those vertices that only have neighbors in H. Let Int(H) denote the set of internal vertices of H (with respect to its supergraph G). We say that a subgraph H of G is a block of G if it is a maximal 2-connected subgraph. The vertex degree of v ∈ V (G) is denoted by dG (v), or d(v) if possible. Minimal CD-sets. A CD-set S is called a 2-CD-set if every vertex in V (G)\S has at most two neighbors in S. Formulated just for cubic graphs, the results in [1] yield the following bound. Theorem 1. Let G = (V, E) be a connected cubic graph. Let S be a minimal 2-CD-set of G where G[S] contains no triangles, and let S ⊆ S be a minimal CD-set of G. Then |S | ≤ (2n(G) − 4)/3. This theorem can be applied to graphs without triangles, in that case it holds for any minimal 2-CD-set. But when considering the proof in [1], it can be seen that actually the following stronger statement is proved. Theorem 2. Let G = (V, E) be a connected cubic graph. Let S be a minimal 2-CD-set of G where G[S] has bΔ blocks that contain triangles, and let S ⊆ S be a minimal CD-set of G. Then |S | ≤ (2n(G) + bΔ (S ) − 4)/3. The strength of Theorem 2 lies not in the combination of the bound and the graph class itself (as we remarked in the introduction, in that sense it is strengthened and generalized for instance by the bound from [2]), but in the fact that it holds for any minimal 2-CD-set. This allows us to first construct a 2-CD-set S ∗ that satisfies some useful properties, namely that it contains few triangles, and then consider a minimal 2-CD-set S ⊆ S ∗ .
3
Subgraphs Obtained by Removing Triangles
The operations and notions defined in this section are illustrated in Figure 1. This figure introduces the example of G that we will use to illustrate most proofs
70
P. Bonsma and F. Zickfeld f1 (G):
G:
f2 (G):
2
: V Δ (G) : T-bridge
1
0 1
0 2
1
1 2
3
cc(f1 (G)) = 2 ⇒ cc1 (G) = 1
cc(f2 (G)) = 4⇒ cc2 (G) = 2
Fig. 1. An example of G, f1 (G) and f2 (G)
in the paper. For a graph G with Δ(G) ≤ 3, let V Δ (G)⊆ V (G) be those vertices of G that are part of a triangle. We distinguish a number of triangle types of G. First we distinguish between triangles of G that are part of diamonds, and those that are not. From now on, when we talk about triangles of G, we mean those triangles that are not part of diamonds, except when explicitly noted otherwise. Note that since Δ(G) ≤ 3, all diamonds of G are pairwise vertex disjoint, and all triangles of G are pairwise vertex disjoint (since they are not part of diamonds). We say that a triangle or diamond H of G is of type i if it is incident with i edges that have an end vertex not in V Δ (G). So triangles can be of type i for i ∈ {0, 1, 2, 3}, and diamonds can be of type i for i ∈ {0, 1, 2}. Let Ti (G) (Di (G)) denote the number of triangles (diamonds) of type i in G. In Figure 1, the numbers next to the triangles and diamonds of G indicate their types. An edge uv of G is a triangle bridge or T-bridge if u, v ∈ V Δ (G) but u and v are not part of the same triangle or diamond. The graph f1 (G) is obtained by deleting all vertices of G that are part of type 0 triangles or type 0 diamonds, and in addition deleting all T-bridges. The graph f2 (G) is obtained from G by deleting all vertices in V Δ (G), so f2 (G) is a subgraph of f1 (G). Let cc1 (G)= cc(f1 (G))−cc(G), and let cc2 (G)= cc(f2 (G))−cc(f1 (G)). We will always consider G to be connected, so cc1 (G) ≥ −1, and this is only an equality when V Δ (G) = V (G). Since every component of f1 (G) contains a vertex not in V Δ (G), we have cc2 (G) ≥ 0. We remark that the graph parameter x(G) that we mentioned in the introduction can now be defined as x(G) = 2cc1 (G) + cc2 (G) + D0 (G) + T0 (G). If the graph in question is clear, we will also write cc1 and T0 etc. instead of cc1 (G), T0 (G), etc.
4
Constructing and Bounding the CD-Set
In this section we present our algorithm to construct a minimal 2-CD-set S, and prove an upper bound for the number of triangles in G[S] (Theorem 3), which gives a suitable upper bound for the size of any minimal CD-set S ⊆ S using Theorem 2. The algorithm is shown in Algorithm 1. Note that the algorithm is non-deterministic in the sense that in every step many choices are possible. For any of these choices the bound we prove will hold.
A 3/2 Approximation for Finding Leafy Trees in Cubic Graphs
71
Algorithm 1. An algorithm for finding small CD-sets in cubic graphs INPUT: A connected, cubic graph G. OUTPUT: A minimal CD-set S (which is a subset of a minimal 2-CD-set S) (Stage 1:) S1 := V (G). while ∃ T-bridge uv in G[S1 ] s.t. S1 − u − v is a CD-set of G do S1 := S1 − u − v. (Stage 2:) S2 := S1 . repeat if ∃ type 3 triangle T with V (T ) ⊆ S2 s.t. S2 \V (T ) is a CD-set of G then S2 := S2 \V (T ). if ∃ type 2 diamond D with V (D) ⊆ S2 s.t. S2 \Int(D) is a CD-set of G then S2 := S2 \Int(D). until no change was made. (Stage 3:) S := S2 . Remove vertices (possibly pairwise) from S until it is a minimal 2-CD-set of G. S := S. Remove vertices from S until it is a minimal CD-set of G.
The idea of the algorithm is that we try to minimize the number of triangles and diamonds that are present in the final CD-set S, since this makes the bound from Theorem 2 stronger. The stages reflect the priorities; a single change in Stage 1 can remove two triangles or diamonds from the current CD-set. In Stage 2, we can only remove one triangle or diamond per change. After these stages no further gain can be made, and we simply find minimal sets S and S in order to apply Theorem 2. Lemma 1. Algorithm 1 has a polynomial time implementation, and yields a minimal 2-CD-set S of G and minimal CD-set S ⊆ S of G. Theorem 3. Let S be a minimal 2-CD-set of G constructed by Algorithm 1. Then the number of triangles plus the number of diamonds in G[S] is at most 2cc1 (G) + T0 (G) + D0 (G) + cc2 (G). Proof: First we analyze Stage 1. Let S1 denote the set S1 as it is when Stage 1 has finished. We will show that the number of triangles of type 0, 1 and 2 plus the number of diamonds of type 0 and 1 with all vertices still in S1 is bounded by 2cc1 + T0 + D0 . In particular, if V Δ = V (G), the number of triangles and diamonds with all vertices in S1 is bounded by T0 + D0 − 2. The following definitions are illustrated in Figure 2. A T-bridge uv of G is called an S1 -bridge if u, v ∈ S1 . Let nB (S1 ) denote the number of S1 -bridges in G[S1 ]. A bridge is an edge for which the removal increases the number of components. We can observe the following.
72
P. Bonsma and F. Zickfeld
G:
: removed from S1
G[S1 ]:
G :
: S1 -bridge
Fig. 2. The set S1 after Stage 1 and G obtained from G[S1 ] by deleting S1 -bridges
Claim 1. An S1 -bridge uv is a bridge of G[S1 ]. Let G be the subgraph of G[S1 ] obtained by removing all S1 -bridges. The components of G are of two types: those that are part of components of f1 (G), and those that are part of the type 0 triangles and diamonds of G. Hence G has 1+cc1 +T0 +D0 components. (Note that because of the way vertices are removed from S1 during Stage 1, for every f1 (G) component and every type 0 triangle or diamond, at least one vertex remains in S1 .) Since all S1 -bridges are bridges of G[S1 ] (Claim 1), contracting every edge of G[S1 ] that is not an S1 -bridge gives a tree on cc(G ) vertices, so the number of S1 -bridges is nB (S1 ) = cc1 + T0 + D0 . Let Ti,j (Di,j ) denote the number of type i triangles (diamonds) of G that contain j vertices of S1 . By counting the number of S1 -bridges that every such triangle or diamond is incident with, we obtain T2,3 + T1,2 + 2T1,3 + T0,1 + 2T0,2 + 3T0,3 + 2D0,4 + D0,3 + D1,4 ≤ 2nB (S1 ). Using the above two inequalities, we can bound the number of type 0, 1, 2 triangles and type 0, 1 diamonds of G that are still fully part of G[S1 ]: T0,3 + T1,3 + T2,3 + D0,4 + D1,4 ≤ 2nB (S1 ) − 2T0,3 − T0,1 − 2T0,2 − T1,2 − T1,3 − D0,4 − D0,3 = 2cc1 + 2T0 + 2D0 − 2T0,3 − T0,1 − 2T0,2 − T1,2 − T1,3 − D0,4 − D0,3 = 2cc1 + T0 + D0 − T0,3 − T0,2 − T1,2 − T1,3 ≤ 2cc1 + T0 + D0 . Here we used T0 = T0,1 + T0,2 + T0,3 and D0 = D0,3 + D0,4 . Now we will analyze Stage 2. Let S2 denote the set S2 as it is when Stage 2 has finished. Type 3 triangles T with V (T ) ⊆ S2 are called S2 -triangles, and type 2 diamonds D with V (D) ⊆ S2 are called S2 -diamonds. We will show that the number of S2 -triangles plus the number of S2 -diamonds is at most cc2 . The following arguments are illustrated in Figure 3 (which is not based on the graph G that we have used as example earlier). For a component C of f1 (G),
A 3/2 Approximation for Finding Leafy Trees in Cubic Graphs
73
the number of components of f2 (G) that are part of C is cc2 (C) + 1. We will first show that the number of S2 -triangles plus the number of S2 -diamonds in C is at most cc2 (C). In the example of Figure 3, cc(f2 (C)) = 5, so cc2 (C) = 4, and there are two S2 -triangles and one S2 -diamond. C:
: removed from S2 during Stage 2. : V (C)\V Δ (G)
G[S2 ]:
G :
: cut vertex in an S2 -triangle or S2 -diamond : V (C)\V Δ (G)
Fig. 3. A component C of f1 (G), the set S2 after Stage 2, and G
Consider an S2 -triangle T in C. The set S2 still contains all vertices of V (G)\V Δ , so since T is of type 3, after removing V (T ) from S2 , the set would still be a dominating set of G. Therefore, since V (T ) was not removed during Stage 2, G[S2 \V (T )] is not connected. Since T is a triangle and G is cubic, this implies that V (T ) contains at least one cut vertex of C. Similarly, for S2 -diamonds it also holds that they contain a cut vertex of C (two actually). Consider the graph G defined as follows. For every S2 -triangle and every S2 diamond in C, we add a black vertex to G , and for every f2 (G) component in C we add a white vertex to G . When an S2 -triangle or S2 -diamond is adjacent to an f2 (G) component, we add an edge between the corresponding vertices. This gives a bipartite graph G with cc2 (C) + 1 white vertices. Note that since every S2 -triangle and every S2 -diamond contains a cut vertex of C, all black vertices are cut vertices of G . Using a simple induction argument it then follows that the number of black vertices of G is at most the number of white vertices minus one, hence is bounded by cc2 (C). Every S2 -triangle and S2 -diamond of G is part of some component C of f1 (G). In addition, if C is the set of components of f1 (G), then cc2 (G) = C∈C cc2 (C). It follows that the number of type 3 triangles plus the number of type 2 diamonds in S2 is at most cc2 (G). Since S is a subset of S1 and of S2 , we know that the number of type 0, 1, 2 triangles plus the number of type 0, 1 diamonds of G that are fully in S is also bounded by 2cc1 + T0 + D0 , and that the number of type 3 triangles plus the number of type 2 diamonds of G that are fully in S is bounded by cc2 . Now all types of triangles and diamonds of G have been considered, which proves the statement. The number of triangles and diamonds in G[S] is an upper bound for the number of blocks of G[S] that contain triangles (here we do also mean triangles that
74
P. Bonsma and F. Zickfeld
are part of diamonds): since S is a minimal 2-CD-set, it is not possible that a diamond of G is not fully part of S but three of its vertices that together form a triangle are. So by combining Lemma 1, Theorem 2 and Theorem 3 we obtain: Theorem 4. In polynomial time, Algorithm 1 returns a CD-set S of G with |S | ≤ (2n(G) + 2cc1 (G) + cc2 (G) + T0 (G) + D0 (G) − 4)/3.
5
An Upper Bound for the Number of Leaves
We only have to prove the upper bound for trees of the following form. Proposition 1. A spanning tree T of G with maximum number of leaves exists that contains two edges of every type 0, 1 and 2 triangle of G, and contains either zero or two edges of every type 3 triangle of G.
G :
G and T :
: E(T )
T :
T :
: E(G)
Fig. 4. The graphs G, T , G , T and T from the proof of Theorem 5
Theorem 5. Let T be a spanning tree of a cubic graph G. Then T has at most (n(G) − 2cc1 (G) − cc2 (G) − D0 (G) − T0 (G) + 2)/2 leaves. Proof: We will assume T has the properties stated in Proposition 1. The following constructions are illustrated in Figure 4. Let G be the graph obtained from G by contracting every diamond and every triangle into a single black vertex, and by contracting every component of f2 (G) into a single white vertex. Let B (W ) denote the set of black (white) vertices of G . We construct the following spanning subgraph T of G . An edge of G is added to T if and only if for the corresponding edge e ∈ E(G): – e ∈ E(T ), and – e is not incident with a leaf of T that is part of a triangle or diamond. Type 3 triangles that contain three leaves of T will correspond to isolated vertices v of T at this point. To ensure that T is connected, in addition we add one arbitrary edge of G incident with v to T . Using the assumptions from Proposition 1, the following claims about T can be proved. Claim 2. T is connected.
A 3/2 Approximation for Finding Leafy Trees in Cubic Graphs
75
Claim 3. If a black vertex v has degree i in T , then the corresponding subgraph Hv of G contains at least i − 1 vertices that have degree 2 in T . Since T is connected (Claim 2), we have |E(T )| ≥ |V (T )| − 1 = |B| + |W | − 1. Note that all edges of G are incident with at least one black vertex. Consider the subgraph T of T that has vertex set V (G ) again, but only contains those edges of T that are incident with at least one white vertex. Note that cc(T ) ≥ D0 (G) + T0 (G) + cc1 + 1. When we add the edges of T one by one until T is obtained, clearly every edge addition can only decrease the number of components by at most one. Hence cc(T ) − 1 is a lower bound for the number of edges of T that are incident with two black vertices. The degree sum of black vertices in T is then at least the number of edges of T plus the number of edges of T incident with two black vertices. This yields the following bound. (dT (v) − 1) ≥ |E(T )| + (cc(T ) − 1) − |B| ≥ v∈B
|B| + |W | − 1 + D0 + T0 + cc1 − |B| = 2cc1 + cc2 + D0 + T0 . For the last equality we used |W | = cc1 + cc2 + 1. Since vertices of T with degree 2 account for at least one vertex of degree 2 in T , and vertices of degree 3 account for at least two such vertices (Claim 3), the above number is also a lower bound for the number of degree 2 vertices in T . Now let di denote the number of vertices of T with degree i, and n = V (T ). So d1 + d3 = n − d2 . For trees with Δ ≤ 3 it is easy to see that d3 = d1 − 2. This yields 2d1 = n − d2 + 2 ≤ n − (2cc1 + cc2 + D0 + T0 ) + 2, which gives the stated bound.
6
The Approximation Guarantee
Theorem 6. Algorithm 1 is a 4/3-approximation for MinCD-Set in cubic graphs, and gives a 3/2-approximation for MaxLeaf in cubic graphs. Proof: Let x(G) = 2cc1 (G) + cc2 (G) + T0 (G) + D0 (G) and n = n(G). Let S be the minimal CD-set returned by the algorithm, and let S ∗ be a minimum CD-set of G. By Theorem 4, |S | ≤ (2n + x(G) − 4)/3 ≤ 2(n + x(G) − 2)/3. By Theorem 5, any spanning tree of G has at most (n − x(G) + 2)/2 leaves, so any CD-set of G, in particular S ∗ , has |S ∗ | ≥ n−(n−x(G)+2)/2 = (n+x(G)−2)/2. It follows that 2(n + x(G) − 2) (n + x(G) − 2) / = 4/3. |S |/|S ∗ | ≤ 3 2 Similarly, using S , a spanning tree T with lA ≥ n − (2n + x(G) − 4)/3 = (n − x(G) + 4)/3 leaves can easily be constructed in polynomial time. Since an optimal spanning tree has at most l∗ ≤ (n − x(G) + 2)/2 < (n − x(G) + 4)/2 leaves, the approximation guarantee for MaxLeaf is l∗ /lA <
(n − x(G) + 4) (n − x(G) + 4) / = 3/2. 2 3
76
7
P. Bonsma and F. Zickfeld
Discussion
It would be interesting to know if the 3/2-approximation ratio can be improved. We expect however that this will be hard to do by extending our method: the upper bound is tight for many values of cc1 and cc2 , and it also seems hard to improve the lower bound (see also [10]). Many additional graph structures would need to be taken into account beyond those that we considered. A more promising and important goal is to establish the MAX SNP-completeness of MaxLeaf for cubic graphs, which was also asked in [4]. Another question that remains is whether the 2-approximation for general graphs [18] can be improved. The approximability of MaxLeaf generalized to directed graphs has also been studied recently. √ This problem seems much harder; already much effort is needed to prove a OPT-approximation [6]. We expect however that there is still room for improvement for directed graphs. Is it even possible to prove a constant factor approximation ratio for directed graphs? We used the novel approach of [4] of defining a (polynomial time computable) graph parameter x(G), and proving upper and lower bounds in terms of x(G). An algorithm is given that attains the lower bound, and combining the bounds gives the approximation ratio. This works well for MaxLeaf in cubic graphs, since known bounds without such a parameter already give a good approximation ratio. For which other problems does this approach work well?
References 1. Bonsma, P.: Spanning trees with many leaves in graphs with minimum degree three. SIAM J. Discrete Math. 22(3), 920–937 (2008) 2. Bonsma, P., Zickfeld, F.: Spanning trees with many leaves in graphs without diamonds and blossoms. In: Laber, E.S., Bornstein, C., Nogueira, L.T., Faria, L. (eds.) LATIN 2008. LNCS, vol. 4957, pp. 531–543. Springer, Heidelberg (2008) 3. Cheng, X., Huang, X., Li, D., Wu, W., Du, D.: A polynomial-time approximation scheme for the minimum-connected dominating set in ad hoc wireless networks. Networks 42(4), 202–208 (2003) 4. Correa, J.R., Fernandes, C.G., Matamala, M., Wakabayashi, Y.: A 5/3approximation for finding spanning trees with many leaves in cubic graphs. In: Kaklamanis, C., Skutella, M. (eds.) WAOA 2007. LNCS, vol. 4927, pp. 184–192. Springer, Heidelberg (2008) 5. Diestel, R.: Graph Theory. Springer, New York (1997) 6. Drescher, M., Vetta, A.: An approximation algorithm for the max leaf spanning arborescence problem. ACM transactions on algorithms (to appear) 7. Estivill-Castro, V., Fellows, M.R., Langston, M.A., Rosamond, F.A.: FPT is Ptime extremal structure I. In: ACiD 2005. Texts in algorithmics, vol. 4, pp. 1–41. King’s College Publications (2005) 8. Fomin, F.V., Grandoni, F., Kratsch, D.: Solving connected dominating set faster than 2n . In: Arun-Kumar, S., Garg, N. (eds.) FSTTCS 2006. LNCS, vol. 4337, pp. 152–163. Springer, Heidelberg (2006) 9. Galbiati, G., Morzenti, A., Maffioli, F.: On the approximability of some maximum spanning tree problems. Theoret. Comput. Sci. 181(1), 107–118 (1997)
A 3/2 Approximation for Finding Leafy Trees in Cubic Graphs
77
10. Griggs, J.R., Kleitman, D.J., Shastri, A.: Spanning trees with many leaves in cubic graphs. J. Graph Theory 13(6), 669–695 (1989) 11. Griggs, J.R., Wu, M.: Spanning trees in graphs of minimum degree 4 or 5. Discrete Math. 104(2), 167–183 (1992) 12. Guha, S., Khuller, S.: Approximation algorithms for connected dominating sets. Algorithmica 20(4), 374–387 (1998) 13. Kleitman, D.J., West, D.B.: Spanning trees with many leaves. SIAM J. Discrete Math. 4(1), 99–106 (1991) 14. Lemke, P.: The maximum-leaf spanning tree problem in cubic graphs is NPcomplete. IMA publication no. 428, University of Minnesota, Mineapolis (1988) 15. Lory´s, K., Zwo´zniak, G.: Approximation algorithm for the maximum leaf spanning tree problem for cubic graphs. In: M¨ ohring, R.H., Raman, R. (eds.) ESA 2002. LNCS, vol. 2461, pp. 686–697. Springer, Heidelberg (2002) 16. Lu, H., Ravi, R.: Approximating maximum leaf spanning trees in almost linear time. Journal of Algorithms 29(1), 132–141 (1998) 17. Ruan, L., Du, H., Jia, X., Wu, W., Li, Y., Ko, K.: A greedy approximation for minimum connected dominating sets. Theoret. Comput. Sci. 329(1-3), 325–330 (2004) 18. Solis-Oba, R.: 2-approximation algorithm for finding a spanning tree with maximum number of leaves. In: Bilardi, G., Pietracaprina, A., Italiano, G.F., Pucci, G. (eds.) ESA 1998. LNCS, vol. 1461, pp. 441–452. Springer, Heidelberg (1998) 19. Zickfeld, F.: Geometric and combinatorial structures on graphs. PhD thesis, Technische Universit¨ at Berlin, Berlin (2007)
On the Pseudo-achromatic Number Problem Jianer Chen1 , Iyad A. Kanj2 , Jie Meng1 , Ge Xia3 , and Fenghui Zhang1 1
Department of Computer Science, Texas A&M University, College Station, TX 77843, USA {chen,jmeng,fhzhang}@cs.tamu.edu 2 School of Computing, DePaul University, 243 S. Wabash Avenue, Chicago, IL 60604, USA. Supported by a DePaul University Competitive Research Grant
[email protected] 3 Department of Computer Science, Lafayette College, Easton, PA 18042, USA Supported by a Lafayette College Research Grant
[email protected]
Abstract. We study the parameterized complexity of the pseudoachromatic number problem: Given an undirected graph and a parameter k, determine if the graph can be partitioned into k groups such that every two groups are connected by at least one edge. This problem has been extensively studied in graph theory and combinatorial optimization. We show that the problem has a kernel √ of at most (k − 2)(k + 1) vertices that is constructable in time O(m n), where n and m are the number of vertices and edges, respectively, in the graph, and k is the parameter. This directly implies that the problem is fixed-parameter tractable. We also study generalizations of the problem and show that they are parameterized intractable. Keywords: pseudo-achromatic number, parameterized complexity, kernel, fixed-parameter tractability.
1
Introduction
The pseudo-achromatic number problem is to determine whether an undirected graph G can be partitioned into k groups/classes (G1 , G2 , . . . , Gk ) such that every two groups Gi and Gj , 1 ≤ i < j ≤ k, are connected by at least one edge. The problem is also referred to in the literature as the graph complete partition problem, and is formally defined as follows: Definition 1. Let G be an undirected graph. The pseudo-achromatic number of G is the largest integer p such that there exists a surjective function f : V (G) → {1, . . . , p} satisfying: for all i, j, where 1 ≤ i, j ≤ p and i = j, there exist u ∈ f −1 (i), v ∈ f −1 (j) such that (u, v) ∈ E(G), where f −1 (h) denotes the preimage set of h under f . The pseudo-achromatic number problem is: pseudo-achromatic number. Given a graph G and a positive integer k, determine if the pseudo-achromatic number of G is at least k. H. Broersma et al. (Eds.): WG 2008, LNCS 5344, pp. 78–89, 2008. c Springer-Verlag Berlin Heidelberg 2008
On the Pseudo-achromatic Number Problem
79
We will be using the informal definition more frequently than the formal one. It is easy to see that the pseudo-achromatic number problem is a variation of the graph coloring problem (or the achromatic number problem), the latter problem requiring the groups in the partition to be independent sets. The pseudo-achromatic number problem was first introduced by Gupta in 1969 [11], and since then it has been studied extensively [1,2,3,4,9,12,13]. The problem is NP-complete even on restricted classes of graphs [3,9,12]. Kortsarz et al. [12] studied the approximability of the pseudo-achromatic number problem. It was proved in [12] that the problem has a randomized √ polynomial-time approximation algorithm of ratio O( lg n), which can be derandomized in polynomial time. This upper bound on the approximation ratio was shown to be asymptotically tight under the randomized model. The pseudo-achromatic number problem was also considered from the extremal graph-theoretic point of view on special classes of graphs [2,4,13,14,15]. Balsubramanian et al. [1] gave a complete characterization of when the pseudoachromatic number of the join of two graphs is the sum of the pseudo-achromatic numbers of the two graphs. In the current paper we study the parameterized complexity of the pseudoachromatic number problem. We show that the problem has a√kernel of size at most (k − 2)(k + 1) vertices that is computable in time O(m n), where n and m are the number of vertices and edges, respectively, in the graph. This kernelization result directly gives an algorithm for√the pseudo-achromatic 2 number problem running in time O(k k −k+2 + m n), thus showing that the problem is fixed-parameter tractable. The upper bound on the kernel size is obtained by developing elegant and highly non-trivial structural results, that are of independent interest. We also study generalizations of the pseudo-achromatic number problem and prove that they are parameterized intractable. In particular, we consider the vertex grouping problem, in which an input instance has the form (G, H, k), where G and H are two graphs, and k = |V (H)|. The problem asks for the existence of a surjective function f : V (G) −→ V (H) satisfying the property that ∀u, v ∈ V (H), if (u, v) ∈ E(H) then there exists x ∈ f −1 (u), y ∈ f −1 (v) such that (x, y) ∈ E(G). The pseudo-achromatic number problem is a special case of the vertex grouping problem in which the graph H is the complete graph on k vertices. The vertex grouping problem falls into the category of clustering problems, where a clustering of the graph G into |V (H)| clusters is sought such that the inter-cluster properties are imposed by the graph H. We prove some (parameterized) intractability results for the vertex grouping problem. For example, we show that the problem is W [1]-hard, even when the graph H is the h-star graph (i.e., K1,h−1 ).
2
Preliminaries
The reader is referred to Downey and Fellows’ book [8] for more details about parameterized complexity theory.
80
J. Chen et al.
A parameterized problem is a set of instances of the form (x, k), where x ∈ Σ ∗ for a finite alphabet set Σ, and k is a non-negative integer called the parameter. A parameterized problem Q is fixed parameter tractable, or simply FPT, if there exists an algorithm A that on input (x, k) decides if (x, k) is a yes-instance of Q in time f (k)nO(1) , where f is a recursive function independent of n = |x|. In analogy to the polynomial time hierarchy, a hierarchy for parameterized complexity, called the W-hierarchy, has been defined. At the 0th level of this hierarchy lies the class FPT of fixed-parameter tractable problems. The class of all problems at the i-th level of the W-hierarchy (i > 0) is denoted by W [i]. A parameterizedcomplexity preserving reduction (FPT-reduction) has been defined as follows. A parameterized problem Q is FPT-reducible to a parameterized problem Q if there exists an algorithm of running time f (k)|x|c that on an instance (x, k) of Q produces an instance (x , g(k)) of Q such that (x, k) is a yes-instance of Q if and only if (x , g(k)) is a yes-instance of Q , where the functions f and g depend only on k, and c is a constant. A parameterized problem Q is W [i]-hard if every problem in W [i] is FPT-reducible to Q. Many well-known problems have been proved to be W [1]-hard including: clique, independent set, set packing, dominating set, hitting set and set cover. The parameterized complexity hypothesis, which is a working hypothesis for parameterized complexity theory, states that W [i] = FPT for every i > 0. The notion of the fixed-parameter tractability of a problem turns out to be closely related to the notion of the problem having a good data reduction (or preprocessing) algorithm. Formally speaking, a parameterized problem Q is kernelizable if there exists a polynomial-time reduction that maps an instance (x, k) of Q to another instance (x , k ) of Q such that: (1) |x | ≤ g(k) for some recursive function g, (2) k ≤ k, and (3) (x, k) is a yes-instance of Q if and only if (x , k ) is a yes-instance of Q. The instance x is called the kernel of x. It was shown that a parameterized problem is fixed-parameter tractable if and only if it is kernelizable [10]. For a graph G we denote by V (G) and E(G) the set of vertices and edges of G, respectively. A matching M in a graph G is a set of edges such that no two edges in M share an endpoint. A matching M of G is said to be maximum if the cardinality of M is maximum over all matchings in G. For a vertex v and a set of vertices Γ in G, we say that v is connected to Γ if v is adjacent to some vertex in Γ . Similarly, for two sets of vertices Γ and Γ in G, we say that Γ is connected to Γ if there exists a vertex in Γ that is connected to Γ . For a vertex v ∈ G we denote by N (v) the set of neighbors of v in G. For a set of vertices Γ in G we denote by N (Γ ) the set of neighbors of all the vertices of Γ in G, i.e., N (Γ ) = v∈Γ N (v). We denote by Sh the (h + 1)-star graph (i.e., K1,h ). The vertex of degree h in Sh is referred to as the root of the star, and the other h vertices are referred to as the leaves of the star. The size of the star Sh is the number of vertices in it, which is h + 1. We say that a graph G contains Sh if Sh is a subgraph (not necessarily induced) of G. For a background on network flows we refer the reader to [7], or to any standard book on combinatorial optimization.
On the Pseudo-achromatic Number Problem
3
81
The Kernel
In this section we show how to construct a kernel of size (number of vertices) at most (k − 2)(k + 1) for the parameterized pseudo-achromatic number problem. We start by presenting some structural results that are essential for the kernelization algorithm, and that are of independent interest on their own. 3.1
Structural Results
The following lemma ascertains that graphs with large matchings have large pseudo-achromatic number. Lemma 1. If a graph G contains a matching of size at least (k −1)k/2, then the instance (G, k) is a yes-instance of the pseudo-achromatic number problem. Proof. Assuming that G contains a matching of at least (k−1)k/2 edges, we show how to group the vertices of G into k groups (G1 , G2 , . . . , Gk ) so that every pair of groups is connected. For every pair of groups (Gi , Gj ) where 1 ≤ i < j ≤ k, we use a distinct edge (u, v) of the matching to connect the two groups by mapping the vertex u to Gi and v to Gi . The remaining vertices of G are mapped arbitrarily to the groups. Since there are exactly (k − 1)k/2 pairs of groups and at least (k − 1)k/2 edges in the matching, every pair of groups is connected under this mapping. It follows that (G, k) is a yes-instance of the pseudo-achromatic number problem. Lemma 2. If a graph G contains a set of k − 1 (mutually) vertex-disjoint stars of sizes 2, . . . , k, respectively, then the instance (G, k) is a yes-instance of the pseudo-achromatic number problem. Proof. Let S = {s1 , . . . , sk−1 } be a set of vertex-disjoint stars in G, where si is the star graph Si . We will map the vertices in S to k groups (G1 , G2 , . . . , Gk ) such that every pair of groups is connected. For i = 1, . . . , k − 1, we map the root of si to group Gi+1 , and we map its leaves, in a one-to-one fashion, to groups (G1 , G2 , . . . , Gi ). The remaining vertices in G are mapped arbitrarily to the groups. Since there is no overlap between the vertices of any two stars in S, this mapping is well defined. It is easy to verify now that every two distinct groups in (G1 , G2 , . . . , Gk ) are connected under the defined mapping. It follows that (G, k) is a yes-instance of the pseudo-achromatic number problem. Lemma 3. If a graph G contains a collection of (mutually) vertex-disjoint stars each of size at least 2 and at most k+1, and such that the total number of vertices in all the stars is more than (k − 2)(k + 1), then the instance (G, k) is a yesinstance of the pseudo-achromatic number problem. Proof. Suppose that G contains a collection P of vertex-disjoint stars, each containing at least two vertices and at most k + 1 vertices, and such that the total
82
J. Chen et al.
number of vertices of the stars in P is more than (k − 2)(k + 1). Assume, to get a contradiction, that (G, k) is a no-instance of the pseudo-achromatic number problem. Let s be the star graph Sh and s be the star graph Sh such that s and s are vertex-disjoint. By merging s and s we mean creating the star graph Sh+h by identifying the roots of s and s . Note that the size of the merged star is 1 less than the size of s plus the size of s . We construct from P a sequence of vertex-disjoint stars S = sk−1 , . . . , sr , for some integer r ≥ 1, such that si has size at least i + 1, for r ≤ i ≤ k − 1. The procedure that constructs these stars is as follows. For i = k − 1 down to 1 do: if the largest star in P is an Sj , where j ≥ i, assign it to si , and remove it from P; otherwise, recursively merge the two stars of largest size in P and add the resulting star to P until either there is only one star left in P, and in which case the procedure halts, or the largest star in P is an Sj , where j ≥ i, and in which case we assign it to si , remove it from P, and proceed to the next value of i in the for loop. If a star si in S was created without merging stars in P, we call si a single star, otherwise, we call si a merged star. Note the following: if si is a merged star created from merging a collection of stars, and if si is used to produce a valid grouping of G, then clearly the stars that si was merged from can replace si to produce a valid grouping of G. Therefore, assuming that (G, k) is a no-instance of the pseudo-achromatic number problem, the last star sr constructed by the above procedure before halting must satisfy r ≥ 2. Otherwise, the sequence S would contain a set of k − 1 vertex-disjoint stars of sizes 2, . . . , k, and by Lemma 2, the instance (G, k) would be a yes-instance of the problem, contradicting our assumption. Now assume that the above procedure halts after constructing a sequence of vertex-disjoint stars S = sk−1 , . . . , sr , such that si has size at least i + 1, for 2 ≤ r ≤ i ≤ k − 1. We define a monotone subsequence of S to be a consecutive subsequence si , si−1 . . . , sj of S such that either si , si−1 . . . , sj are all single stars, or they are all merged stars. A monotone subsequence si , si−1 . . . , sj of S is maximal if it is maximal under containment. Let si , si−1 . . . , si−+1 , ≥ 1, be a maximal monotone subsequence of S, and note that i−+1 ≥ 2 (since r ≥ 2). We will show that the total number of vertices in the stars of P that were used to form the subsequence si , si−1 . . . , si−+1 is at most 2(i + (i − 1) + . . . + (i − + 1)). We distinguish two cases: – Case 1. si , si−1 , . . . , si−+1 consists of single stars. We distinguish two subcases: • Subcase 1.1. i = k − 1. Since every single star contains at most k + 1 vertices by the statement of the lemma, the total number of vertices in the stars in the subsequence is bounded by (k + 1) ≤ 2(k − 1 + k − 2 + . . . + k − ). The last inequality is true because ((k − 1) − + 1) ≥ 2. • Subcase 1.2. i < k − 1. By the maximality of the subsequence, si+1 is a merged star. Since si is a single star, it is easy to verify that si has size
On the Pseudo-achromatic Number Problem
83
exactly i+1. The total number of vertices in the stars in the subsequence is bounded by (i + 1) ≤ 2(i + i − 1 + . . .+ i − + 1) because i − + 1 ≥ 2. – Case 2. si , si−1 , . . . , si−+1 consists of merged stars. Let sj be any star in this subsequence, and suppose that sj was constructed by merging stars t1 , . . . , tq in P. By the construction of sj , the total number of leaves in the stars t1 , . . . , tq−1 is less than j (otherwise these stars would be sufficient to produce sj ), and the size of tq is not larger than any of the sizes of t1 , . . . , tq−1 . Therefore, we have: |t1 | − 1 + |t2 | − 1 + . . . + |tq−1 | − 1 ≤ j − 1,
(1)
|tq | ≤ (|t1 | + |t2 | + . . . + |tq−1 |)/(q − 1).
(2)
and
Combining Inequality (1) with Inequality (2), and noting that q ≤ j, we obtain: |t1 | + |t2 | + . . . + |tq | ≤ 2j.
(3)
Inequality (3) shows that the total number of vertices in the stars of P forming sj is at most 2j. By applying this inequality to each star sj in the maximal monotone subsequence si , si−1 , . . . , si−+1 of merged stars, and by the linearity of addition, we obtain that the total number of vertices of P used to form the stars in si , si−1 , . . . , si−+1 is at most 2(i + (i − 1) + . . . + (i − + 1)). It follows from the above that, for any maximal monotone subsequence si , si−1 , . . . , si−+1 of S, the total number of vertices of P used to form the stars in this subsequence is at most 2(i + (i − 1) + . . . + (i − + 1)). Applying the above bound to every maximal monotone subsequence of S, and by the linearity of addition, we conclude that the total number of vertices in P forming all the stars in S is at most (k − r)(k + r − 1). Noting that the number of remaining non-empty stars in P cannot form an sr−1 , the total number of leaves in the remaining stars is at most r − 2, and consequently, the total number of vertices in the remaining stars is at most 2(r − 2). Therefore, the total number of vertices in P is at most (k − r)(k + r − 1) + 2(r − 2) = k 2 − k − (r2 − 3r + 4). Since r ≥ 2, P has the maximum number of vertices when r = 2. It follows that the total number of vertices in P is at most (k − 2)(k + 1), contradicting the hypothesis of the lemma. This completes the proof. 3.2
The Auxiliary Flow Network and the Graph Pseudo-achromatic Number
Let G be a graph with pseudo-achromatic number at least k, and let H be a vertex grouping that partitions the vertices of G into k groups such that every pair of groups is connected.
84
J. Chen et al.
We will show a nice relationship between the pseudo-achromatic number of a graph and graph matchings. Let M be a maximum matching in G. Let I = V (G) \ V (M ), and note that I is an independent set. For a vertex u ∈ V (M ) we denote by NI (u) the set N (u) ∩ I. Let M2 be the set of edges in M whose both ends are connected to I. Lemma 4. Let (u, v) be an edge in M2 . Then NI (u) = NI (v) and |NI (u)| = 1. Proof. By definition, both NI (u) and NI (v) are nonempty. Therefore, either NI (u) = NI (v) or |NI (u)| > 1 would imply the existence of two different vertices w1 ∈ NI (u) and w2 ∈ NI (v). However, this would give an augmenting path (w1 , u, v, w2 ) with respect to M , contradicting the maximality of the matching M . Let NI (M2 ) be the set N (V (M2 )) ∩ I, and let D = I \ NI (M2 ). We partition the edges of M \ M2 into two sets M1 and M0 , where M1 consists of all the edges in M \ M2 that have exactly one end connected to D, and M0 = M \ (M2 ∪ M1 ). Note that the edges in M0 ∪ M2 have no end connected to D (however, an edge in M0 or in M1 may have an end connected to NI (M2 )). The vertices in V (M1 ) are further partitioned into R and L, such that R is the set of vertices in V (M1 ) that are connected to D, and L is the set of remaining vertices in V (M1 ). By definition, each edge in M1 has exactly one end in R and one end in L. Moreover, by the definition of the set M0 and by Lemma 4, the vertices in the set D can only be connected to vertices in R (note that D is an independent set). Let J be the subgraph of G with vertex set R ∪ D and edge set {(u, v) | u ∈ R and v ∈ D}. We construct a flow network Jk from J as follows. Convert each undirected edge (u, v) in J, where u ∈ R and v ∈ D, into a directed edge u, v of capacity 1. Add a source s and a sink t. For each vertex u ∈ R, add a directed edge s, u of capacity k − 1; and for each vertex v ∈ D, add a directed edge v, t of capacity 1. Let f ∗ be an integer-valued maximum flow in Jk . In case of no confusion, we will identify the vertices and edges in Jk − {s, t} with their counterparts in G. For a vertex u, denote by fu∗ the flow through u, i.e., the total outgoing flow from u. Let Tk = {u | u ∈ D and fu∗ = 0}. We have the following theorem whose proof is omitted due to the lack of space. The proof can be found in [6]. Theorem 1. The instance (G, k) is a yes-instance of the pseudo-achromatic number problem if and only if (G − Tk , k) is a yes-instance of the pseudoachromatic number problem. The above theorem shows that the vertex set Tk can be safely removed from the graph G. Moreover, the graph G − Tk has the following nice property. Lemma 5. The vertices in the graph G = G − Tk can be decomposed into a collection P of vertex-disjoint stars, each star of size at least 2 and at most k + 1.
On the Pseudo-achromatic Number Problem
85
Proof. We will exhibit the collection of vertex-disjoint stars P in G . We will denote by VP the set of vertices of the stars in the collection P, and by EP the set of edges of the stars in P. The set of vertices of G consists of the vertices in the matching M , the vertices in NI (M2 ), and the vertices in D with a non-zero flow value. For a vertex u in R, let S(u) be the star graph formed by the incident edge to u in M1 , together with the set of saturated edges in G incident on u. Clearly, each such star S(u) has size at least 2 and at most k + 1 since the capacity of u in Jk is k − 1. Moreover, for any two vertices u and v in R, the two star graphs S(u) and S(v) share no vertices; otherwise, there would be a shared vertex w ∈ S(u) ∩ S(v) of capacity 1 in Jk with two saturated edges incident on it, contradicting the flow properties. We add all such stars S(u) to the collection P. We also include in P a maximal set of disjoint S2 stars such that the root of each S2 star is a vertex in NI (M2 ) and its leaves are the end points of the same edge in M2 . Moreover, for every edge in M2 whose endpoints are not yet in VP , we include it in P as an S1 stars. Finally we include in P the matching edges in M0 as S1 stars. It is clear that all the stars included in P are vertex-disjoint, and that each star has size at least 2 and at most k + 1. We claim that VP contains all the vertices of G . First observe that VP contains the endpoints of all the edges in M . Second, since every vertex v in D − Tk is incident on a saturated edge in G , v is included in P. Moreover, since by definition every vertex u ∈ NI (M2 ) forms an S2 star with two vertices w and v, where (w, v) is an edge in M2 , and since by Lemma 4 no other vertex in NI (M2 ) can form a star with the vertices w and v, it follows from the construction of P that u ∈ VP . Therefore, every vertex u in NI (M2 ) is in P, and VP contains all the vertices of G as desired. 3.3
Putting It All Together: The Kernelization Algorithm
Consider the decomposition of G defined in Subsection 3.2, and let M and Tk be as defined in Subsection 3.2. The kernelization algorithm is given in Figure 1.
Algorithm PseudoAchromaticNumberKernel Input: (G, k) Output: (G , k ) 1. construct a maximum matching M of G; 2. if |M | ≥ (k − 1)k/2 then return yes; 3. compute the set Tk of vertices as described in Subsection 3.2; G = G − Tk ; 4. if |V (G )| > (k − 2)(k + 1) then return yes; 5. return (G , k = k); Fig. 1. The kernelization algorithm
86
J. Chen et al.
Theorem 2. Given an instance (G, k) of the pseudo-achromatic number problem, the algorithm PseudoAchromaticNumberKernel either decides the instance (G, k) correctly, or returns an instance (G , k ) of the problem such that G is a subgraph of G, k ≤ k, and (G, k) is a√yes-instance if and only if (G , k ) is. Moreover, the algorithm runs in time O(m n), where n and m are the number of vertices and edges, respectively, in G. Proof. If the size of the maximum matching M in G is at least (k−1)k/2, then by Lemma 3.1, G is a yes-instance of the pseudo-achromatic number problem. Therefore, the algorithm PseudoAchromaticNumberKernel makes the right decision in step 2. By Theorem 1, (G, k) is a yes-instance of the pseudo-achromatic number problem if and only if (G , k ) is. It suffices to argue that if |V (G )| > (k − 2)(k + 1) (note that k = k), then (G , k ), and hence (G, k), is a yes-instance of the pseudo-achromatic number problem, and the algorithm makes the right decision in step 4. By Lemma 5, the set V (G ) can be decomposed into a collection of vertexdisjoint stars P, each star of size at least 2 and at most k + 1. Since |V (G )| > (k−2)(k+1), it follows that the number of vertices in P is more than (k−2)(k+1). Consequently, P satisfies the statement of Lemma 3, and (G , k ) is a yes-instance of the pseudo-achromatic number problem. Finally, to √ see that the algorithm PseudoAchromaticNumberKernel runs in time √ O(m n), note first that the maximum matching M can be computed in O(m n) time by a standard maximum matching algorithm [7]. Noting that the flow network Jk is a bipartite graph with at most O(n) vertices √ and O(m) edges, the maximum flow f ∗ in Jk can be computed in time O(m n) [7]. All other steps can be performed in time O(m), and the theorem follows. Corollary 1. The pseudo-achromatic number problem has √ a kernel of at most (k − 2)(k + 1) vertices that is computable in time O(m n), where n and m are the number of vertices and edges, respectively, in the graph, and k is the parameter. Using the (k−2)(k+1) upper bound on the kernel size, we can solve the pseudoachromatic number problem by enumerating all possible assignments of the vertices in the graph to the k groups, then checking whether any such assignment yields a valid grouping. We have the following corollary: Corollary 2. The √ pseudo-achromatic number problem can be solved in time 2 O(k k −k+2 + m n), and hence is fixed-parameter tractable, where n and m are the number of vertices and edges, respectively, in the graph. Proof. Given an instance (G, k) of the pseudo-achromatic number problem, where G has n vertices and m edges, we apply the algorithm √ PseudoAchromaticNumberKernel to (G, k). The algorithm runs in O(m n) time and either accepts the instance (G, k) correctly, or returns a kernel (G , k) where G has at most (k−2)(k+1) vertices. Now if G can be partitioned into k groups that are
On the Pseudo-achromatic Number Problem
87
mutually connected, then every vertex in G must belong to one of the k groups. Therefore, there are at most k (k−2)(k+1) ways to partition G into k groups. For each such partitioning, we can check whether the corresponding groups are mutually connected; this can be done in time O(k 4 ). If we do not succeed in finding a valid partitioning then clearly the algorithm can reject the instance; otherwise, the algorithm returns a valid√partitioning. The total running √ time of 2 the algorithm is O(k 4 · k (k−2)(k+1) + m n), which is O(k k −k+2 + m n).
4
Hardness Results for the Vertex Grouping Problem
Recall from Section 1 that in the vertex grouping problem we are given an instance (G, H, k), where G and H are two graphs, and k = |V (H)|, and the problem asks for the existence of a surjective function f : V (G) −→ V (H) satisfying the property that for all u, v ∈ V (H), if (u, v) ∈ E(H) then there exist x ∈ f −1 (u) and y ∈ f −1 (v) such that (x, y) ∈ E(G). The vertex grouping problem can be defined more intuitively as follows. Let G be an undirected graph. We define an operation on G, called vertex grouping, applied to a subset of vertices S as follows: remove all the vertices in S from G, add a new vertex w, and connect w to all the neighbors of S in G − S. The vertex grouping problem is: vertex grouping: Given two graphs G and H, where H is a graph of k vertices, and k is the parameter, decide if H can be obtained from G by a sequence of vertex grouping operations. If H in the above definition is the complete graph on k vertices, then the vertex grouping problem becomes the pseudo-achromatic number problem, and hence is fixed parameter tractable. The following theorem shows that the vertex grouping problem is parameterized intractable in general. Theorem 3. The vertex grouping problem is W [1]-hard. Proof. We reduce the W [1]-hard problem independent set to the vertex grouping problem. Let (G, k) be an instance of the independent set problem. Construct a graph G by adding a new vertex w to G and connecting w to every vertex in G. Let H be a (k + 1)-star with root rH . Define the mapping π that, on an instance (G, k) of independent set, produces the instance (G , H, k + 1) of vertex grouping. Clearly, the mapping π is computable in polynomial time, and hence π is an FPT-reduction. We show that (G, k) is a yes-instance of independent set if and only if (G , H, k + 1) is a yes-instance of vertex grouping. In effect, suppose that (G, k) is a yes-instance of independent set, and let I be an independent set in G of size k. Consider the function f : V (G ) −→ V (H) that maps the k vertices of I in G to the k leaves of the star H, in a one-to-one fashion, and maps all other vertices of G to the root rH of H. Then it is easy to verify that H is a vertex grouping of G under the function f .
88
J. Chen et al.
Conversely, suppose that H is a vertex grouping of G under a function f . Consider any set of vertices I in G of cardinality k satisfying f (I) = V (H)\{rH }. Clearly, such a set I exists by the definition of the vertex grouping. Note that f is a bijection from I to V (H)\ {rH }. Now for any two distinct vertices u and v of I, u and v are not adjacent in G, otherwise, by the definition of vertex grouping, f (u) and f (v) would be adjacent in H. It follows that I is an independent set of size k in G. This completes the proof. The Exponential Time Hypothesis (ETH) states that many NP-hard problems including 3-sat, independent set, and vertex cover, cannot be solved in time 2o(n) (n is the number of variables for 3-sat, and the number of vertices for independent set and vertex cover). ETH has become a working hypothesis for many researchers in the area of exact and parameterized algorithms. It was shown in [5] that, unless ETH fails, independent set cannot be solved in time no(k) . It was also shown in [5] that if a parameterized problem Q is reducible to a parameterized problem Q by an FPT reduction, called linear fpt-reduction, that preserves the order of the parameter and does not increase the size of the instance by more than a polynomial factor, and if Q cannot be solved in time no(k) then it follows that Q cannot be solved in time no(k) . Clearly, the reduction from independent set to vertex grouping, given in the proof of Theorem 3, is a linear fpt-reduction. Therefore, we have the following theorem: Theorem 4. Unless ETH fails, the vertex grouping problem cannot be solved in time no(k) , where n and k are the number of vertices in G and H, respectively. We illustrate a relationship between the graph isomorphism problem and the vertex grouping problem. Let G1 and G2 be two graphs on n vertices. We are interested in knowing how “similar” G1 and G2 are, under the notion of vertex grouping defined above. For this purpose, we introduce the following parameterized problem: graph structural similarity: given two graphs G1 and G2 on n vertices, and a parameter k, decide if there exists a graph H of k vertices such that both (G1 , H, k) and (G2 , H, k) are yes-instances of the vertex grouping problem. Intuitively, the graph structural similarity measures the degree of similarity (i.e., k) between two graphs under the notion of vertex grouping. In particular, if k = n, then the graph structural similarity problem is equivalent to the graph isomorphism problem. Theorem 5. The graph structural similarity problem is W [1]-hard. Proof. As was shown in Theorem 3, the vertex grouping problem is W [1]hard when the graph H is a star. An FPT-reduction can be constructed that takes an instance (G, H, k), where G has n vertices and H is a k-star, of the vertex grouping problem to an instance (G1 , G2 , k) of the graph structural similarity problem, where G1 = G and G2 is the n-star. Observing that any
On the Pseudo-achromatic Number Problem
89
sequence of vertex grouping operations that are applied to G2 can only result in a star graph, the W [1]-hardness of graph structural similarity follows. The reduction described in the proof of the above theorem is clearly a linear fpt-reduction. Therefore, it follows from Theorem 4 that: Theorem 6. Unless ETH fails, the graph structural similarity problem cannot be solved in time no(k) , where n is the number of vertices in G1 and G2 , and k is the parameter.
References 1. Balasubramanian, R., Raman, V., Yegnanarayanan, V.: On the pseudoachromatic number of join of graphs. International Journal of Computer Mathematics 80(9), 1131–1137 (2003) 2. Bhave, V.: On the pseudoachromatic number of a graph. Fundamenta Mathematicae 102(3), 159–164 (1979) 3. Bodlaender, H.: Achromatic number is NP-complete for cographs and interval graphs. Information Processing Letters 32(3), 135–138 (1989) 4. Bollob´ as, B., Reed, B., Thomason, A.: An extremal function for the achromatic number. Graph Structure Theory, 161–166 (1991); pp. 18–37 (2005) 5. Chen, J., Huang, X., Kanj, I., Xia, G.: Strong computational lower bounds via parameterized complexity. Journal of Computer and System Sciences 72(8), 1346– 1367 (2006) 6. Chen, J., Meng, J., Kanj, I., Xia, G., Zhang, F.: On the pseudo-achromatic number problem. Technical report 08-006 at:http://www.cdm.depaul.edu/research/ Pages/TechnicalReports.aspx. 7. Cormen, T., Leiserson, C., Rivest, R., Stein, C.: Introduction to Algorithms, 2nd edn. McGraw-Hill Book Company, Boston (2001) 8. Downey, R., Fellows, M.: Parameterized Complexity. Springer, Heidelberg (1999) 9. Edwards, K., McDiarmid, C.: The complexity of harmonious coloring for trees. Discrete Applied Mathematics 57, 133–144 (1995) 10. Downey, R., Fellows, M., Stege, U.: Parameterized complexity: a framework for systematically confronting computational intractability, in Contemporary Trends in Discrete Mathematics. In: Graham, R., Kratochv´ıl, J., Neˇsetˇril, J., Roberts, F. (eds.) Proc. DIMACS-DIMATIA Workshop, Prague. AMS-DIMACS Series in Discrete Mathematics and Theoretical Computer Science, vol. 49, pp. 49–99 (1997) 11. Gupta, R.P.: Bounds on the chromatic and achromatic numbers of complementary graphs. In: Tutte, W.T. (ed.) Recnet Progress in Combinatorics, Proc. 3rd Waterloo Conference on Combinatorics, Waterloo, pp. 229–235. Academic Press, New York (1969) 12. Kortsarz, G., Radhakrishnan, J., Sivasubramanian, S.: Complete partitions of graphs. In: Proc. 16th Annual ACM-SIAM symposium on Discrete algorithms, pp. 860–869 (2005) 13. Sampathkumar, E., Bhave, V.: Partition graphs and coloring numbers of graphs. Discrete Mathematics 16, 57–60 (1976) 14. Yegnanarayanan, V.: On pseudocoloring of graphs. Utilitas Mathematica 62, 199–216 (2002) 15. Yegnanarayanan, V.: The pseudoachromatic number of a graph. Southern Aian Bulletin of Mathematics 24, 129–136 (2002)
Making Role Assignment Feasible: A Polynomial-Time Algorithm for Computing Ecological Colorings Pilu Crescenzi1 , Miriam Di Ianni2 , Federico Greco3 , Gianluca Rossi2 , and Paola Vocca4 1
Dipartimento di Sistemi e Informatica, Universit`a di Firenze, Firenze, Italy Dipartimento di Matematica, Universit`a di Roma “Tor Vergata”, Roma, Italy {miriam.di.ianni,gianluca.rossi}@uniroma2.it 3 Dipartimento di Matematica, Universit`a di Perugia, Perugia, Italy
[email protected] Dipartimento di Matematica “Ennio De Giorgi”, Universit`a del Salento, Lecce, Italy
[email protected] 2
4
Abstract. In this paper, we study the problem of ecologically coloring a graph. Intuitively, an ecological coloring of a graph is a role assignment to the nodes of the graph, such that two nodes surrounded by the same set of roles must be assigned the same role (Borgatti and Everett, 1992). We prove that, for any simple undirected graph G with nG distinct neighborhoods and for any integer k with 1 ≤ k ≤ nG , G admits an ecological coloring which uses exactly k roles, and that this coloring can be computed in polynomial time. Our result strongly contrasts with the NP-completeness result of the regular coloring problem, where it is required that two nodes with the same role must be surrounded by the same set of roles (Fiala and Paulusma, 2005). Hence, we conclude that not only the ecological coloring is easier to understand as a model of social relationships (Borgatti and Everett, 1994), but it is also feasible from a computational complexity point of view.
1 Introduction One of the main goals of the analysis of a social network consists of determining patterns of relationships and interactions among social actors (such as persons and groups) in order to identify the social structure of the network [4,5]. To this aim, a social network is usually represented as a graph, whose nodes denote the network members and whose edges denote their relationships, which is analyzed from a structural point of view by means of methods that broadly fall into one of the following two categories: relational analysis methods that are often used in order to identify central members or to partition the graph into clusters, and positional analysis methods that examine the similarity between the connection of two network members with the other members. Role assignment is one of the main positional analysis methods, whose goal consists of classifying the members of a social network, so that members which are equally classified can be considered to behave in a similar way or to play a similar role [9]. If the
This work was partially supported by the EU under the EU/IST Project 15964 AEOLUS.
H. Broersma et al. (Eds.): WG 2008, LNCS 5344, pp. 90–100, 2008. c Springer-Verlag Berlin Heidelberg 2008
Making Role Assignment Feasible: A Polynomial-Time Algorithm
91
number of roles is limited, this kind of classification can turn out to be extremely useful while trying to understand the overall structure of very complex social networks. Different kinds of role assignment have been introduced in the literature. A strong structural role assignment, for example, imposes that if two actors play the same role, then they must have the same neighborhood [10], while a regular role assignment imposes that if two actors play the same role, then they must be surrounded by the same set of roles [1,12]. In this paper we are interested in another kind of role assignment, that is, ecological role assignments, according to which if two network members are surrounded by the same set of roles, then they must play the same role: in other words, the role played by a social actor is completely determined by the roles played by its neighbors [2]. The relationship imposed by an ecological role assignment is the opposite of the one imposed by a regular role assignment: a role assignment that satisfies both constraints is called perfect [3]. As stated by Borgatti and Everett, an ecological role assignment is easier to understand as a model of social relationships, in which a member’s neighborhood tends to shape this member into that or this kind. Computing a role assignment for a given network is equivalent to computing a coloring of the network nodes, such that the constraint imposed by the role assignment is satisfied by the colors assigned to the nodes. For instance, an ecological coloring of a graph is an assignment of colors to the nodes of the graph such that if two nodes “see” the same set of colors, then they are assigned the same color. Our main contribution is proving that, for any simple undirected graph G with nG distinct neighborhoods and for any integer k with 1 ≤ k ≤ nG , G admits an ecological coloring which uses exactly k colors, and that this coloring can be computed in polynomial time by means of a bottom-up approach and by making use of some combinatorial properties of graphs whose nodes have all distinct neighborhoods. Our results strongly contrast with the results obtained in [7,11] according to which deciding whether a graph can be regularly colored with k colors is NP-complete, for any k ≥ 2. This somehow implies that an ecological role assignment not only is easier to understand but it is also more useful from a computational point of view than a regular role assignment, since it can be always efficiently computed. This allows the network analyzer to reduce the size of complex social networks to a desired size: this feature is extremely important in network analysis for which different aspects can be studied depending on network dimension (for example, the degree of relevance in information retrieval and the degree of relationship in e-communities discovery). The paper is structured as follows. In the rest of this section, we give some preliminary definitions and results concerning the regular and the ecological coloring of a graph. In Section 2 we introduce the notion of twin-free graph [6,8], we prove how we can restrict our attention to this kind of graphs and we show some properties of these graphs that will be useful for designing the main algorithm. In Section 3 we prove our main result, that is, that any graph can be ecologically colored by using any reasonable number of colors. Finally, in Section 4 we conclude by stating our main open question. 1.1 Preliminaries In the following, the term ‘graph’ will always denote a simple (that is, with no selfloops and multiple edges) undirected graph (unless otherwise specified). Given a graph
92
P. Crescenzi et al.
G = (V, E), for any node u ∈ V , N (u) denotes the neighborhood of u. A coloring of G which uses k colors is a surjective function r : V → [k].1 Given a coloring r of G which uses k colors, the colorhood of a node u ∈ V with respect to r is defined as the set Cr (u) = i ∈ [k] : ∃v ∈ N (u) [r(v) = i] A coloring r of a graph G = (V, E) is regular [1] if, for any u, v ∈ V , r(u) = r(v) ⇒ Cr (u) = Cr (v). Observe that a graph can be regularly colored with one color if and only if either it contains no isolated nodes or its nodes are all isolated. Furthermore, any graph can be regularly colored with n colors, where n is the number of nodes of the graph. The k-R EGULAR ROLE A SSIGNMENT (in short, k-R E RA) decision problem consists in deciding whether a graph G admits a regular coloring which uses k colors: in [7,11] it is proved that k-R E RA is NP-complete for any k ≥ 2. A coloring r of a graph G = (V, E) is ecological [2] if, for any u, v ∈ V , Cr (u) = Cr (v) ⇒ r(u) = r(v). Observe that any graph can be ecologically colored with one color. However, it is not true that any graph can be ecologically colored with n colors, where n is the number of nodes of the graph (see the results of Section 2). In general, an ecological coloring is not necessarily regular and a regular coloring is not necessarily ecological. The kE COLOGICAL ROLE A SSIGNMENT (in short, k-E C RA) decision problem consists in deciding whether a graph G admits an ecological coloring which uses k colors.
2 Twin-Free Graphs According to the definition of an ecological coloring, two nodes with the same neighborhood must be colored with the same color. The number of distinct neighborhoods contained in a graph is thus an upper bound on the number of colors that can be used by any ecological coloring. The following definition and results formalize this statement. Definition 1 ([6,8]). A graph G = (V, E) is twin-free if, for any u, v ∈ V , N (u) = N (v). Observe that any twin-free graph with n nodes can clearly be ecologically colored with n colors. Given a graph G = (V, E), we define an equivalence relation ρN on the vertices of G as follows: two vertices u, v ∈ V are equivalent if and only if N (u) = N (v). The neighborhood graph corresponding to G is the twin-free graph GN = (VN , EN ) where VN is the set of equivalence classes with respect to the relation ρN , and2 (x, y) ∈ EN if all nodes in the equivalence class x are adjacent to all nodes in the equivalence class y. The neighborhood degree nG of G is defined as the number of nodes in GN . The following two results can be easily proved. 1 2
In the following, for any positive integer n, [n] will denote the set {1, 2, . . . , n}. In the following, we will indicate an edge of a graph by using brackets instead of curly brackets, in order to avoid confusion with other two-elements sets.
Making Role Assignment Feasible: A Polynomial-Time Algorithm
93
Theorem 1. A graph can be ecologically colored with k colors if and only if its neighborhood graph can be ecologically colored with k colors. Corollary 1. Each graph G can be ecologically colored with nG colors and it cannot be ecologically colored with k > nG colors. The following structural property of twin-free graphs has been independently proved in [6]: for the sake of completeness, we include our self-contained proof in the Appendix. Theorem 2. Let G = (V, E) be a twin-free graph with n nodes. Then, there exists a node u ∈ V , such that the graph induced by V − {u} is a twin-free graph with n − 1 nodes. The previous theorem allows us to prove the following result, which will be used as a subroutine within the second phase of the general ecological coloring algorithm (see line 9 of Figure 3). Theorem 3. Let G = (V, E) be a twin-free graph with n nodes. Then, G can be ecologically colored with n − 1 colors. Proof. Let G = (V, E) be a twin-free graph with n nodes. From Theorem 2 it follows that there exist two nodes u and v such that the graph Gu,v induced by V − {u, v} is a twin-free graph with n − 2 nodes. Let r be any coloring of G that assigns n − 2 different colors to the nodes of Gu,v and that assigns the same new color to u and v. In order to prove that r is ecological, we proceed by contradiction and assume that there exist two nodes p and q such that r(p) = r(q) and Cr (p) = Cr (q). We then distinguish the following cases. 1. {p, q} = {u, v}. In this case, r(p) = r(q), and, hence, we get a contradiction. 2. {p, q} ⊆ V − {u, v}. In this case, since Gu,v is twin-free and since all its nodes are colored with different colors, Cr (p) must be different from Cr (q), and, hence, we get a contradiction. 3. p ∈ {u, v} ∧ q ∈ V − {u, v}. In this case, since all the nodes of Gu,v are colored with different colors and since Cr (p) = Cr (q), we have that N (p)∩(V −{u, v}) = N (q) ∩ (V − {u, v}). Moreover, p and q cannot be adjacent, since otherwise r(q) ∈ Cr (p) − Cr (q), contradicting the fact that Cr (p) = Cr (q). Since G is twin-free, exactly one node among p and q must be adjacent to the node in {u, v} − {p}: this implies that either r(p) ∈ Cr (p) − Cr (q) or r(p) ∈ Cr (q) − Cr (p), and, hence, we get a contradiction. 4. p ∈ V − {u, v} ∧ q ∈ {u, v}. This case is symmetric to the previous one.
We conclude this section by stating two other interesting properties of twin-free graphs. The first one is formalized in the following result. Lemma 1. Let G = (V, E) be a twin-free graph of n nodes and let I = {I1 , . . . , Ih } be a partition of V into h non-empty independent sets with 2 ≤ h < n. Then, there exist p, q ∈ [h] such that the pair of sets Ip and Iq induces a non-complete bipartite graph with at least one edge.
94
P. Crescenzi et al.
Proof. The proof proceeds by contradiction. Assume that all pairs of independent sets in I induce either a complete bipartite graph or an independent set. This, in turn, implies that, since h < n and, hence, at least one independent set is not a singleton, there must exist at least two nodes u and v in the same independent set which, for any i ∈ [h], are adjacent either to all nodes or to no node in Ii . That is, u and v have the same neighborhood, thus contradicting the twin-free property of G.
In order to state the last property of twin-free graphs that we will use in the next section, we need the following definition. Definition 2. Let G = (V, E) be a graph and I = {I1 , . . . , Ih } be a partition of V into h ≥ 1 non-empty sets such that I1 , . . . , Ih−1 are independent sets. We say that I is an ecological family for G of size h if either h = 1 or, for any i, j ∈ [h] with i = j and for any u ∈ Ii and v ∈ Ij , there exists t ∈ [h] such that u is adjacent to some node in It and v is not adjacent to any node in It . Lemma 2. Let G = (V, E) be a twin-free graph of n nodes and let I = {I1 , . . . , Ih } be an ecological family for G of size h < n. Then, there exists an ecological family I for G of size h + 1 or h + 2. Furthermore, I can be computed in polynomial time. Proof. If Ih is not an independent set, then let Ih1 be a maximal independent set for the subgraph of G induced by Ih , Ih2 = Ih − Ih1 and I = I − {Ih } ∪ {Ih1 , Ih2 }. For any i ∈ [h − 1] and for any j ∈ [h] such that i = j, let u ∈ Ii ∈ I and v ∈ Ij ∈ I and let It ∈ I be such that u is adjacent to some node in It and v is not adjacent to any node in It : clearly, this is still true in I with It possibly replaced by Ih1 or by Ih2 . If, instead, i = h1 and j = h2 , that is, u ∈ Ih1 and v ∈ Ih2 , then, since Ih1 is a maximal independent set for the subgraph of G induced by Ih , v has to be adjacent to some node in Ih1 while u is not adjacent to any other node in Ih1 . Assume now that Ih is an independent set. In this case, from Lemma 1 it follows that there exist p, q ∈ [h] such that the subgraph of G induced by Ip ∪ Iq is not an independent set and is not bipartite complete. We now find a partition of Ip into Ip1 ∪Ip2 and a partition of Iq into Iq1 ∪Iq2 such that Ip1 = ∅, Iq1 = ∅, Ip2 ∪Iq2 = ∅ and Ip1 ∪Iq1 is an independent set. Since, the subgraph of G induced by Ip ∪ Iq is not an independent set and is not a bipartite complete graph, it has to contain two adjacent nodes, u1 ∈ Ip and v1 ∈ Iq , and two non-adjacent nodes u2 ∈ Ip and v2 ∈ Iq . Notice that they are not necessarily distinct, that is, it could happen that either u1 ≡ u2 or v1 ≡ v2 (but not both). Without loss of generality assume that u1 ≡ u2 . Let Iq1 = {x ∈ Iq : (u2 , x) ∈ E}, Ip1 = {x ∈ Ip : ∀y ∈ Iq1 [(x, y) ∈ E]}, Ip2 = Ip − Ip1 and Iq2 = Iq − Iq1 : notice that u2 ∈ Ip1 and v2 ∈ Iq1 . Furthermore, if v1 ≡ v2 then u1 ∈ Ip2 , otherwise v1 ∈ Iq2 . Finally, Ip1 ∪ Iq1 is an independent set by construction. Notice that Iq2 could be empty: this happens if no node in Iq is adjacent to u2 , that is, only if u2 is an isolated node in the subgraph induced by Ip ∪ Iq . We now define I as follows. 1. I = I − {Ip , Iq } ∪ {Ip1 , Ip2 , Iq1 , Iq2 } if Iq2 = ∅ and Ip2 = ∅. 2. I = I − {Ip , Iq } ∪ {Ip1 , Ip2 , Iq1 } if Iq2 = ∅. 3. I = I − {Ip , Iq } ∪ {Ip1 , Iq1 , Iq2 } if Ip2 = ∅.
Making Role Assignment Feasible: A Polynomial-Time Algorithm
95
It remains to show that I is an ecological family for G. To this aim, consider a pair of nodes u ∈ Ii ∈ I and v ∈ Ij ∈ I with i = j and let It ∈ I be such that u is adjacent to some node in It and v is not adjacent to any node in It . This is still true in I with It eventually replaced by one set out of Ip1 , Ip2 , Iq1 , Iq2 . Hence, assume i = j. One of the following cases may occur. – u ∈ Ip1 and v ∈ Ip2 : in this case, by construction, u is not adjacent to any node in Iq1 and v has to be adjacent to some node in Iq1 (otherwise, v should be contained in Ip1 ). – u ∈ Iq1 and v ∈ Iq2 : this case is similar to the previous one. Hence, I is an ecological family for G and its size is either h + 1 or h + 2.
3 The Ecological Coloring Algorithm In this section we prove the existence of ecological colorings with any feasible number of colors. According to Theorem 1 we can state our main result in terms of twin-free graphs. Let G = (V, E) be a twin-free graph of n nodes and k < n the number of colors we are interested in. Our algorithm works in two phases. During the first phase, an ecological family for G of size either k − 1 or k is computed by using Lemma 2. If the size of such a family is k an ecological coloring is directly derived from the family. Conversely, if the size of the ecological family is smaller than k then the second phase is started and the informations conveyed by the ecological family are used to compute the k-ecological coloring of G. The algorithm is described in Figure 1. Input: A twin-free graph G = (V, E) with |V | = n and integer k with 1 ≤ k ≤ n. Output: An ecological coloring r for G which uses k colors. 1: Phase 1: apply Algorithm Partitioning with input G and k to compute an ecological family I for G of size h ≤ k; 2: if h = k then 3: for (i ← 1; i ≤ k; i ← i + 1) do 4: ∀u ∈ Ii : r(u) ← i; 5: else 6: Phase 2: apply Algorithm Refining with input I and k to compute an ecological coloring r for G which uses k colors; Fig. 1. The ecological coloring algorithm
In the next two subsections the two phases are detailed and the proof that they are in fact correct is drawn. This allows us to prove our main result, stated in the following theorem. Theorem 4. For any twin-free graph G = (V, E) with n nodes and for any k ∈ [n], G admits an ecological coloring which uses k colors. Such a coloring can be computed in polynomial time.
96
P. Crescenzi et al.
Proof. Lemma 3 insures that Algorithm Partitioning computes indeed an ecological family I for G. If |I| = k, lines 2–4 are executed. We now show that they compute an ecological coloring for G. Let u and v be two nodes such that r(u) = p = r(v) = q. Hence, u ∈ Ip ∈ I and v ∈ Iq ∈ I. Since I is an ecological family for G, then there exists t such that u is adjacent to some node in It and v is not adjacent to any node in It . Since r(x) = t if and only if x ∈ It , Cr (u) = Cr (v). Hence, r is an ecological coloring of G. Conversely, if the else statement is executed then the computed coloring is ecological by Lemma 4.
3.1 Phase 1: Computing an Ecological Family This phase iteratively applies Lemma 2 in order to construct an ecological family for G. More formally, Algorithm Partitioning performing this task is described in Figure 2. Input: A twin-free graph G = (V, E) with |V | = n and integer k with 1 ≤ k ≤ n. Output: An ecological family I for G of size at most k. 1: I ← {V }; 2: while |I| < k − 1 do 3: Let I the ecological family for G obtained by applying Lemma 2 to I; 4: I ← I; Fig. 2. Partitioning: Phase 1 of the ecological coloring algorithm
Lemma 3. Let G be a twin-free graph with n nodes and k a positive integer such that k ≤ n. Algorithm Partitioning computes an ecological family for G of size either k − 1 or k. Proof. The condition of the while loop (line 2)requires |I| < k − 1: since k ≤ n, then Lemma 2 can be actually applied to set I at each iteration. The algorithm ends by computing an ecological family for G of size either k − 1 or k.
3.2 Phase 2: The Last Refinement In order to describe this phase, we need to introduce the notion of color graph. Given a coloring r of a graph G = (V, E) which uses k colors, the color graph C G,r = ([k], E G,r ) includes the edge (i, j) if and only there exist u, v ∈ V such that r(u) = i, r(v) = j and (u, v) ∈ E (note that, in general, a color graph is not simple). If Phase 1 ends with an ecological family for G of size k − 1, the second phase is started and the ecological family for G of size (k − 1) is used to compute the k-ecological coloring of G. Algorithm Refining shown in Figure 3 first tries to increase by 1 the size of the ecological family (according to Lemma 2) in order to color it in the same way as in lines 2–4 of the Algorithm in Figure 1. If this is not possible, then it both increases the size of I by 2 (always according to Lemma 2) and it computes a (k − 2)-coloring r2 of I. In order to perform the last step, it builds the color graph C G,r1 of G with respect to the (k − 1)-coloring r1 deriving from I and applies to it Theorem 2: observe that this
Making Role Assignment Feasible: A Polynomial-Time Algorithm
97
Input: An ecological family I = {I1 , I2 , . . . , Ik−1 } for a twin-free graph G = (V, E) with |V | = n, and a positive integer k ≤ n . Output: An ecological coloring r of G which uses k colors. 1: Let r1 be the coloring according to which all nodes in Ii are colored with color i, i = 1, . . . , k − 1; 2: if ∃1 ≤ p ≤ k − 1 and u, v ∈ Ip such that Cr1 (u) = Cr1 (v) then 3: Ip1 ← {x ∈ Ip : Cr1 (x) = Cr1 (u)}; 4: ∀u ∈ Ip1 , r(u) ← r1 (u); ∀u ∈ Ip1 , r(u) ← k; 5: else 6: Let Ip , Iq ∈ I such that Ip ∪ Iq is not an independent set and induces a non-complete bipartite graph with at least two nodes in Ip and at least two nodes in Iq ; 7: Partition Ip into Ip1 , Ip2 and Iq into Iq1 , Iq2 such that all of them are not empty, Ip1 ∪ Iq1 is an independent set, and both Ip1 ∪ Iq2 and Ip2 ∪ Iq1 are not independent sets (see proof of Lemma 2); 8: C G,r1 ← color graph of G with respect to r1 ; 9: Color C G,r1 with k − 2 colors by applying Theorem 3: let r2 be such a coloring; 10: Transform r2 into a coloring r3 of G: ∀I ∈ C G,r1 ∀u ∈ I : r3 (u) ← r2 (I); 11: ∀u ∈ Ip1 ∪ Iq2 : r(u) ← r3 (u); ∀u ∈ Ip1 : r(u) ← k − 1; ∀u ∈ Iq2 : r(u) ← k; Fig. 3. Refining: Phase 2 of the ecological coloring algorithm
is possible since C G,r1 is simple because nodes with the same color belong to the same independent set. Finally, by exploiting both r2 and the ecological family of size k + 1, it computes the ecological coloring r for G that uses k colors. Lemma 4. Let G be a graph and I an ecological family for G of size k − 1. Then, Algorithm Refining computes an ecological coloring of G with k colors. Proof. Notice that the coloring computed at line 1 is the same as that computed at line 3 of the algorithm in Figure 1 and, hence, it is ecological. When the if statement is executed (line 2), the partition I − {Ip } ∪ {Ip1 , Ip2 } computed at line 3 is ecological by Lemma 2. Hence, the coloring r computed at line 4 can be easily proved to be ecological by the same arguments in the proof of Lemma 3. Conversely, assume the else statement is executed (lines 5–11). In this case, from Lemma 1 it follows that there exists a pair of independent sets Ip and Iq that does not induce either an independent set or a complete bipartite graph. Moreover, since each pair of nodes in Ip (respectively, Iq ) has the same colorhood, then Ip (respectively, Iq ) contains at least two nodes. It hence follows that line 6 successfully terminates its execution. By the same arguments used in the proof of Lemma 2 it also follows that the partition described at line 7 can be computed and results into an ecological partition for G of size k + 1. In turn, this corresponds to a (k + 1)-coloring of G. Hence, it is now needed to decrease the number of colors. To this aim, the color graph C G,r1 is considered. Observe that, since r1 is ecological, C G,r1 is a twin-free graph with k − 1 nodes. From Theorem 3 it follows that C G,r can be ecologically colored with k − 2 colors: hence, coloring r2 of line 9 can be computed. Line 10 then computes a new coloring r3 of G which uses k − 2 colors as follows: for any node x of G, r3 (x) = r2 (r1 (x)). It is easy to prove that r3 is ecological. Indeed, since all nodes contained in the same independent set have the same colorhood, then for any
98
P. Crescenzi et al.
node u ∈ V it holds that Cr3 (u) = Cr2 (r1 (u)). As a consequence, since for any u, v ∈ V such that r3 (u) = r3 (v) it holds that r2 (r1 (u)) = r2 (r1 (v)) and r2 is ecological, hence Cr3 (u) = Cr2 (r1 (u)) = Cr2 (r1 (v)) = Cr3 (v). Finally, coloring r is computed by modifying r3 at line 11. Nodes u ∈ Ip1 are assigned color r(u) = k − 1 and nodes u ∈ Iq1 are assigned color r(u) = k; colors of all the remaining nodes are left unchanged. This still results in an ecological coloring for G. In order to prove this last assertion, let us consider two nodes u and v such that r(u) = r(v) and prove that Cr (u) = Cr (v). If u, v ∈ Ip ∪Iq , then the assertion follows since Cr3 (x) ⊆ Cr (x) for any x ∈ Ip ∪Iq . The same reasoning applies if u, v ∈ Ip ∪Iq and r3 (u) = r3 (v). Finally, if u, v ∈ Ip ∪Iq and r3 (u) = r3 (v), then (without loss of generality) u ∈ Ip1 and v ∈ Iq2 : in this case assume by contradiction that Cr (u) = Cr (v). This might happen only if, in the graph induced by Ip ∪ Iq , u is adjacent only to nodes in Iq1 and v is adjacent only to nodes in Ip2 : this is not possible, since Ip1 ∪ Iq1 is an independent set.
4 Conclusions and Open Questions In this paper we have proved that any graph can be ecologically colored in polynomialtime by making use of any reasonable number of colors. A rough analysis of the coloring algorithm yields a O(k 3 n2 ) time complexity. Indeed, Algorithm Partitioning requires O(k 3 n2 ) time: this is due to the fact that the most expensive step of this algorithm is searching for the two independent sets Ip and Iq defined in the proof of Lemma 2. The time complexity of Algorithm Refining, instead, is dominated either by the execution of line 6 of the algorithm, which requires O(k 2 n2 ), or by the execution of the application of Theorem 3 to the color graph, which contains k−1 nodes: it is easy to verify that this latter step requires time O(k 4 log k). Hence, the overall time complexity of the coloring algorithm is O(max{k 3 n2 , k 2 n2 , k 4 log k}) = O(k 3 n2 ). We think that, by using more sophisticated data structures, this analysis could be slightly improved. It is easy to verify that different ecological colorings can be produced for a given graph and for a given number of colors. The E C RA(R) decision problem consists in deciding whether a graph G admits an ecological coloring whose color graph is R; it is easy to prove that E C RA(K3 ) is NP-complete. It is then a very interesting open question to look for a complete classification of the complexity of the E C RA(R) problem similar to the one proposed in [7].
References 1. Borgatti, S.P., Everett, M.G.: The class of regular equivalences: algebraic structure and computation. Social Networks 11, 65–88 (1989) 2. Borgatti, S.P., Everett, M.G.: Graph colorings and power in experimental exchange networks. Social Networks 14, 287–308 (1992) 3. Borgatti, S.P., Everett, M.G.: Ecological and perfect colorings. Social Networks 16, 43–55 (1994) 4. Brandes, U., Erlebach, T. (eds.): Network Analysis: Methodological Foundations. In: Brandes, U., Erlebach, T. (eds.) Network Analysis. LNCS, vol. 3418. Springer, Heidelberg (2005)
Making Role Assignment Feasible: A Polynomial-Time Algorithm
99
5. Breiger, R.L.: The Analysis of Social Networks. In: Hardy, M.A., Bryman, A. (eds.) Handbook of Data Analysis, pp. 505–526. Sage Publications, London (2004) 6. Charon, I., Honkala, I., Hudry, O., Lobstein, A.: Structural Properties of Twin-Free Graphs. The Electronic Journal of Combinatorics 14 (2007) 7. Fiala, J., Paulusma, D.: A complete complexity classification of the role assignment problem. Theoretical Computer Science 349, 67–81 (2005) 8. Kotlov, A., Lov´asz, L.: The rank and size of graphs. Journal of Graph Theory 23, 185–189 (1996) 9. Lerner, J.: Role assignments. In: ch. 6 [4] 10. Lorrain, F., White, H.C.: Structural equivalence of individuals in social networks. Journal of Mathematical Sociology 1, 49–80 (1971) 11. Roberts, F.S., Sheng, L.: How hard is to determine if a graph has a 2-role assignment? Networks 37(2), 67–73 (2001) 12. White, D.R., Reitz, K.P.: Graph and semigroup homomorphisms on networks of relations. Social Networks 5, 193–234 (1983)
A Proof of Theorem 2 The proof of the theorem immediately follows from the following result. Lemma 5. Let F = {N1 , . . . , Nn } be a family of n distinct subsets of [n]. Then, there exists i ∈ [n] such that, for any pair Nj , Nk ∈ F, Nj = Nk ∪ {i}. Proof. The proof is by contradiction. Assume that, for any i ∈ [n], there exists a pair of two distinct sets Li , Si ∈ F such that Li = Si ∪ {i}: if there exist more than one such pairs of sets, then we arbitrarily choose one of them as the only one associated with i. Observe that, for any distinct i, j ∈ [n], Li = Lj or Si = Sj since otherwise the distinctness between Li and Si would imply that i = j. Let us define a directed graph GF = (F , AF ) as follows. For any h, k ∈ [n], (Nh , Nk ) ∈ AF if and only if there exists i ∈ [n] such that Si = Nh and Li = Nk . Clearly, GF is acyclic, since otherwise there would exist a sequence X0 , . . . , Xh−1 of h distinct subsets of [n] such that Xi ⊂ Xi+1 for 0 ≤ i < h − 1 and Xh−1 ⊂ X0 : this would imply that X0 ⊂ X0 . We now prove that also the undirected graph corresponding to GF does not contain any cycle. This implies that GF contains at most n − 1 arcs: since, for any distinct i, j ∈ [n], Li = Lj or Si = Sj , this contradicts the fact that there must be exactly n arcs in GF , thus proving that there must exist i ∈ [n] such that, for any pair Nj , Nk ∈ F, Nj = Nk ∪ {i}. Assume, by contradiction, that the undirected graph corresponding to GF contains a cycle X0 , . . . , Xh−1 with h ≥ 3. Then, there must exist r with 0 ≤ r ≤ h − 1 such that (Xr , Xr−1 ) ∈ AF ∧(Xr , Xr+1 ) ∈ AF (in the following, we assume that all operations are performed modulo h). Indeed, either r = 0 or there exists an incoming arc incident to X0 : in this latter case, we can follow the chain of incoming arcs starting from X0 and, since GF is acyclic, we certainly encounter a node Xr with no incoming arcs (see, for example, the cycle in Figure 4 for which r = 4). Let i ∈ [n] be the element such that i ∈ Xr−1 ∧ i ∈ Xr and let us prove that i ∈ Xs , for any s = r with 0 ≤ s ≤ h − 1. This is due to the fact that if i ∈ Xt , for some t
100
P. Crescenzi et al.
X1 = X2 ∪ {k = i} ⇒ i ∈ X1 X1
X0 X0 ⊂ X1 ⇒ i ∈ X0
X2 ⊂ X3 ⇒ i ∈ X2 X2
X6 X6 ⊂ X0 ⇒ i ∈ X6
i ∈ X3 X3
5 ⊂ X6 ⇒ i ∈ X5 X5 X j ∈ X5
i ∈ X4 X4 j ∈ X4
Fig. 4. The proof of Lemma 5
with 0 ≤ t ≤ h − 1, and (Xt , Xs ) ∈ AF or (Xs , Xt ) ∈ AF , then i ∈ Xs . Indeed, if (Xt , Xs ) ∈ AF , then Xt ⊂ Xs ; otherwise, if (Xs , Xt ) ∈ AF , then Xt − Xs = {i} since s = r and, for any i ∈ [n], there exist only two adjacent nodes of GF whose difference is equal to {i}. Hence, in both cases we have that i ∈ Xs . We then have that i ∈ Xr+1 (see, for example, the cycle in Figure 4 where i ∈ X4 ∧ i ∈ X5 ). On the other hand, there must exist j = i such that j ∈ Xr+1 ∧ j ∈ Xr : hence, Xr+1 − Xr ⊇ {i, j} which contradicts the fact that (Xr , Xr+1 ) ∈ AF (in the example, we have that X5 − X4 ⊇ {i, j}). This completes the proof of the fact that the undirected graph corresponding to GF is acyclic and, hence, the proof of the lemma.
Faster Exact Bandwidth, Marek Cygan and Marcin Pilipczuk Department of Mathematics, Computer Science and Mechanics, University of Warsaw, Warsaw, Poland {cygan,malcin}@mimuw.edu.pl
Abstract. We deal with exact algorithms for Bandwidth, a long studied NP-hard problem. For a long time nothing better than the trivial O∗ (n!) exhaustive search was known. In 2000, Feige an Kilian [4] came up with a O∗ (10n )-time algorithm. Since then there has been a growing interest in exponential time algorithms but this bound has not been improved. In this paper we present a new and quite simple O∗ (5n ) algorithm. We also obtain even better bound in some special cases.
1
Introduction
In this paper we focus on exact exponential-time algorithms for the Bandwidth problem. Let G = (V, E) be an undirected graph, where n = |V | and m = |E|. For a given one-to-one function π : V → {1, 2 . . . , n} (called ordering) its bandwidth is the maximum difference between positions of adjacent vertices, i.e. maxuv∈E |π(u) − π(v)|. The bandwidth of the graph, denoted by bw(G), is the minimum bandwidth over all orderings. The Bandwidth problem asks to find an ordering with bandwidth bw(G). Bandwidth problem seems to be hard from many perspectives. Although on special families of graphs bw(G) can be computed in polynomial time [1,6], in general Bandwidth is NP-hard even on some subfamilies of trees [5,7]. Moreover Unger [9] showed that Bandwidth problem does not belong to APX even in a very restricted case when G is a caterpillar, i.e. a very simple tree. It is also hard for any fixed level of the W hierarchy [2]. The √ best known polynomialtime approximation, due to Feige [3], has O(log3 n log n log log n) approximation guarantee. From now on, we assume that the input for our problem contains additionally an integer b, 1 ≤ b < n. An ordering of V with bandwidth at most b will be called a b-ordering. We focus on checking if there exists a b-ordering and if that is the case, finding it. Note that once we can do it in some time bound T , using binary search we can also find an optimal ordering in O(T log bw(G)) time. This
We would like to thank INFO.RO for sponsoring the WG 2008 Best Student Paper Award that has been awarded to this paper. This research is partially supported by a grant from the Polish Ministry of Science and Higher Education, project N206 005 32/0807.
H. Broersma et al. (Eds.): WG 2008, LNCS 5344, pp. 101–109, 2008. c Springer-Verlag Berlin Heidelberg 2008
102
M. Cygan and M. Pilipczuk
approach is also used by two exact algorithms for Bandwidth problem for general graphs. First of them, due to Saxe [8] is a nontrivial O(nb+1 )-time and -space dynamic programming. It works well when b is small, in particular for b ≤ lgnn the time becomes O∗ (2n ). For arbitrary b, the best result we are aware of is a O∗ (10n )-time algorithm due to Feige and Kilian [4]. The main result of this paper is an algorithm for arbitrary b that works in O∗ (5n ) time and O∗ (2n ) space (see Section 4). Moreover, in Section 3 we present an approach that works more efficiently for large b, in particular we give: – O∗ (22n−b ) = O(2.83n ) time and O(2n−b ) = O(1.42n ) space algorithm for b ≥ n2 , – O∗ (4n ) time and O(2b ) = O(1.42n ) space algorithm for n3 ≤ b < n2 . Note that these algorithms approach the problem from the different side than the Saxe’s one. Saxe’s algorithms works efficiently for small b, whereas presented algorithms cope better with big b. It is worth mentioning that exponential space in our algorithms is no problem for practical implementations, since in every case space bound is less than square root of the time bound, thus space will not be a bottleneck in a real life applications, at least considering today’s