+ All Categories
Home > Documents > Graph-Theoretic Concepts in Computer Science

Graph-Theoretic Concepts in Computer Science

Date post: 08-Dec-2016
Category:
Upload: lamtram
View: 254 times
Download: 4 times
Share this document with a friend
363
Lecture Notes in Computer Science 5911 Commenced Publication in 1973 Founding and Former Series Editors: Gerhard Goos, Juris Hartmanis, and Jan van Leeuwen Editorial Board David Hutchison, UK Josef Kittler, UK Alfred Kobsa, USA John C. Mitchell, USA Oscar Nierstrasz, Switzerland Bernhard Steffen, Germany Demetri Terzopoulos, USA Gerhard Weikum, Germany Takeo Kanade, USA Jon M. Kleinberg, USA Friedemann Mattern, Switzerland Moni Naor, Israel C. Pandu Rangan, India Madhu Sudan, USA Doug Tygar, USA Advanced Research in Computing and Software Science Subline of Lectures Notes in Computer Science Subline Series Editors Giorgio Ausiello, University of Rome ‘La Sapienza’, Italy Vladimiro Sassone, University of Southampton, UK Subline Advisory Board Susanne Albers, University of Freiburg, Germany Benjamin C. Pierce, University of Pennsylvania, USA Bernhard Steffen, University of Dortmund, Germany Madhu Sudan, Microsoft Research, Cambridge, MA, USA Deng Xiaotie, City University of Hong Kong Jeannette M. Wing, Carnegie Mellon University, Pittsburgh, PA, USA
Transcript
Page 1: Graph-Theoretic Concepts in Computer Science

Lecture Notes in Computer Science 5911Commenced Publication in 1973Founding and Former Series Editors:Gerhard Goos, Juris Hartmanis, and Jan van Leeuwen

Editorial Board

David Hutchison, UK

Josef Kittler, UK

Alfred Kobsa, USA

John C. Mitchell, USA

Oscar Nierstrasz, Switzerland

Bernhard Steffen, Germany

Demetri Terzopoulos, USA

Gerhard Weikum, Germany

Takeo Kanade, USA

Jon M. Kleinberg, USA

Friedemann Mattern, Switzerland

Moni Naor, Israel

C. Pandu Rangan, India

Madhu Sudan, USA

Doug Tygar, USA

Advanced Research in Computing and Software Science

Subline of Lectures Notes in Computer Science

Subline Series Editors

Giorgio Ausiello, University of Rome ‘La Sapienza’, Italy

Vladimiro Sassone, University of Southampton, UK

Subline Advisory Board

Susanne Albers, University of Freiburg, Germany

Benjamin C. Pierce, University of Pennsylvania, USA

Bernhard Steffen, University of Dortmund, Germany

Madhu Sudan, Microsoft Research, Cambridge, MA, USA

Deng Xiaotie, City University of Hong Kong

Jeannette M. Wing, Carnegie Mellon University, Pittsburgh, PA, USA

Page 2: Graph-Theoretic Concepts in Computer Science

Christophe Paul Michel Habib (Eds.)

Graph-TheoreticConceptsin Computer Science

35th International Workshop, WG 2009Montpellier, France, June 24-26, 2009Revised Papers

13

Page 3: Graph-Theoretic Concepts in Computer Science

Volume Editors

Christophe PaulCNRS - LIRMM161 rue Ada34392 Montpellier Cedex 5, FranceE-mail: [email protected]

Michel HabibUniversité Paris DiderotLIAFAcase 701475205 Paris Cedex 13FranceE-mail: [email protected]

Library of Congress Control Number: 2009941869

CR Subject Classification (1998): G.2.2, I.2.8, E.1, G.1.6, C.2, J.2

LNCS Sublibrary: SL 1 – Theoretical Computer Science and General Issues

ISSN 0302-9743ISBN-10 3-642-11408-3 Springer Berlin Heidelberg New YorkISBN-13 978-3-642-11408-3 Springer Berlin Heidelberg New York

This work is subject to copyright. All rights are reserved, whether the whole or part of the material isconcerned, 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 publicationor 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 liableto prosecution under the German Copyright Law.

springer.com

© Springer-Verlag Berlin Heidelberg 2010Printed in Germany

Typesetting: Camera-ready by author, data conversion by Scientific Publishing Services, Chennai, IndiaPrinted on acid-free paper SPIN: 12823185 06/3180 5 4 3 2 1 0

Page 4: Graph-Theoretic Concepts in Computer Science

Preface

The 35th International Workshop on Graph-Theoretic Concepts in ComputerScience (WG 2009) took place at Montpellier (France), June 24–26 2009. About80 computer scientists from all over the world (Australia, Belgium, Canada,China, Czech Republic, France, Germany, Greece, Israel, Japan, Korea, TheNetherlands, Norway, Spain, UK, USA) attended the conference.

Since 1975, it has taken place 20 times in Germany, four times in The Nether-lands, twice in Austria, as well as once in Italy, Slovakia, Switzerland, the CzechRepublic, France, Norway, and the UK. The conference aims at uniting theoryand practice by demonstrating how graph-theoretic concepts can be applied tovarious areas in computer science, or by extracting new problems from applica-tions. The goal is to present recent research results and to identify and exploredirections of future research. The conference is well-balanced with respect toestablished researchers and young scientists.

There were 69 submissions. Each submission was reviewed by at least three,and on average four, Program Committee members. The Committee decided toaccept 28 papers. Due to the competition and the limited schedule, some goodpapers could not be accepted.

The program also included excellent invited talks: one given by Daniel Kràl on“Algorithms for Classes of Graphs with Bounded Expansion,” the other by DavidEppstein on “Graph-Theoretic Solutions to Computational Geometry Problems.”The proceedings contains two survey papers on these topics.

For the second year, the Best Student Paper was awarded. The recipientsof the 2009 edition were Zhentao Li and Ignasi Sau for their paper “GraphPartitioning and Traffic Grooming with Bounded Degree Request Graph.”

We wish to thank all those who contributed to the success of WG 2009,especially the authors for submitting high-quality papers, the referees and theProgram Committee for their work, the speakers for their pedagogical talks andall the participants. We are grateful to all those who helped in the organization,especially the members and students of the ALGCO team of the LIRMM (Lab-oratoire d’Informatique, Robotique et Microélectronique de Montpellier), CélineBerger and Elisabeth Greverie. Special thanks to Alexandre Pinlou, who led allthe local organization.

We should thank the EasyChair team for the service they offer, which saves tothe Program Committee a lot of time. Finally, we would like to thank our sponsors:the LIRMM, Montpellier 2 University, the CNRS (Centre National de la RechercheScientifique), the town of Montpellier and the Languedoc Roussillon district.

September 2009 Christophe PaulMichel Habib

Page 5: Graph-Theoretic Concepts in Computer Science

Conference Organization

The Tradition of WG

1975 U. Pape – Berlin, Germany1976 H. Noltemeier – Göttingen, Germany1977 J. Mühlbacher – Linz, Austria1978 M. Nagl, H.J. Schneider – Castler Feuerstein, Germany1979 U. Pape – Berlin, Germany1980 H. Noltemeier – Bad Honnef, Germany1981 J. Mühlbacher – Linz, Austria1982 H.J. Schneider, H. Göttler – Neuenkirchen, Germany1983 M. Nagl, J. Perl – Haus Ohrbeck near Onasbrück, Germany1984 U. Pape – Berlin, Germany1985 H. Noltemeier – Castle Schwanberg near Würzburg, Germany1986 G. Tinhofer, G. Schmidt – Bernried near Munich, Germany1987 H. Göttler, H.J. Schneider – Kloster Banz near Bamberg, Germany1988 J. van Leeuwen – Amsterdam, The Netherlands1989 M. Nagl – Castle Rolduc, The Netherlands1990 R.H. Möhring – Berlin, Germany1991 G. Schmidt, R. Berghammer – Fischbachau near Munich, Germany1992 E.W Mayr – Wiesbaden-Naurod, Germany1993 J. van Leeuwen – Utrecht, The Netherlands1994 G. Tinhofer, E.W. Mayr, G. Schmidt – Herrsching near Munich, Germany1995 M. Nagl – Aachen, Germany1996 G. Ausiello, A. Marchetti-Spaccamela – Como, Italy1997 R.H. Möhring – Berlin, Germany1998 J. Hromkovič, O. Sýkora – Smolenice Castle, Slovak Republic1999 P. Widmayer – Ascona, Switzerland2000 D. Wagner – Konstanz, Germany2001 A. Brandstädt, Boltenhagen near Rostock, Germany2002 L. Kučera – Český Krumlov, Czech Republic2003 H.L. Bodlaender – Elspeet, The Netherlands2004 J. Hromkovič, M. Nagl – Bad Honnef, Germany2005 D. Kratsch – Metz, France2006 F.V. Fomin – Bergen, Norway2007 A. Brandstädt, D. Kratsch, H. Müller – Dornburg near Jena, Germany2008 H. Broersma, T. Erlebach – Durham, UK2009 C. Paul, M. Habib – Montpellier, France

Page 6: Graph-Theoretic Concepts in Computer Science

VIII Organization

Program Chairs

Michel Habib (Co-chair) LIAFA, Université Paris-Diderot, Paris,France

Christophe Paul(Co-chair) CNRS - LIRMM - Université de

Montpellier 2, France

Program Committee

Hans L. Bodlaender Universiteit Utrecht, The NetherlandsAndreas Brandstädt University of Rostock, GermanyLeizhen Cai The Chinese University of Hong Kong, ChinaFeodor F. Dragan Kent State University, USAJirí Fiala Charles University, Prague, Czech RepublicPinar Heggernes University of Bergen, NorwayMichael Kaufmann Universität Tübingen, GermanyDieter Kratsch University of Metz, FranceAlberto Marchetti

Spaccamela Università di Roma La Sapienza, ItalyErnst Wilhelm Mayr Technische Universität München, GermanyRoss McConnell Colorado State University, United States of

AmericaHaiko Müller University of Leeds, United KingdomRolf Niedermeier Friedrich-Schiller-Universität Jena, GermanySang-Il Oum KAIST, Republic of KoreaDimitrios M. Thilikos National and Kapodistrian University of

Athens, GreeceIoan Todinca LIFO - Université d’Orléans, FranceBernhard Westfechtel Universität Bayreuth, Germany

Local Organization

Stéphane BessyJean DaligaultPhilippe GambetteÉmeric GioanDaniel GonçalvesChistophe PaulAnthony PerezAlexandre Pinlou (Chair)Stéphan Thomassé

Page 7: Graph-Theoretic Concepts in Computer Science

Organization IX

External Reviewers

Bampas, EvangelosBang-Jensen, JørgenBarat, JanosBasavaraju, ManuBayer, DanielBessy, StéphaneBetzler, NadjaBrandstadt, AndreasBrass, PeterBui-Xuan, Binh-MinhChapelle, MathieuChepoi, VictorChudnovsky, MariaCorneil, DerekDaligault, JeanDijk, Thomas C. vanDom, MichaelDorn, BrittaDorn, FredericDurocher, StephaneEffinger, PhilipEscoffier, BrunoFomin, FedorFouquet, Jean-LucFraigniaud, PierreGaspers, SergeGerasch, AndreasGeyer, MarkusGiannopoulou, ArchontiaGioan, EmericGolovach, PetrGrandoni, FabrizioGuo, JiongHoang, ChinhKaminski, MarcinKim, Seog-JinKnipe, DavidKolliopoulos, StavrosKomusiewicz, ChristianKral, DanielLau, Lap ChiLe, Van Bang

van Leeuwen, Erik JanLiedloff, MathieuLimouzy, VincentLipshteyn, MarinaMancini, FedericoMatamala, MartínMazoit, FrédéricMeister, DanielMnich, Matthiasde Montgolfier, FabienMoscardelli, LucaMoser, HannesNikolopoulos, StavrosNisse, NicolasPalios, LeonidasPapadopoulos, CharisPerez, AnthonyPettie, SethPinlou, AlexandreRao, MichaelRicherby, Davidvan Rooij, Johan M. M.Rossmanith, PeterRue, JuanjoSamal, RobertSau, IgnasiSaurabh, SaketSerna, MariaSritharan, SriSuchan, KarolTelle, Jan ArneTittmann, PeterUetz, MarcUhlmann, JohannesVanherpe, Jean-MarieVaxès, YannVillanger, YngveVoloshin, VitalyWanke, EgonXiang, YangYamazaki, KoichiYeh, Roger

Page 8: Graph-Theoretic Concepts in Computer Science

Table of Contents

Graph-Theoretic Solutions to Computational Geometry Problems(Invited Talk) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

David Eppstein

Algorithms for Classes of Graphs with Bounded Expansion(Invited Talk) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

Zdenek Dvorak and Daniel Kral’

A Graph Polynomial Arising from Community Structure(Extended Abstract) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

Ilia Averbouch, Johann A. Makowsky, and Peter Tittmann

Fast Exact Algorithms for Hamiltonicity in Claw-Free Graphs . . . . . . . . . 44Hajo Broersma, Fedor V. Fomin, Pim van ’t Hof, andDaniel Paulusma

Maximum Series-Parallel Subgraph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54Gruia Calinescu, Cristina G. Fernandes, and Hemanshu Kaul

Low-Port Tree Representations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66Shiri Chechik and David Peleg

Fully Dynamic Representations of Interval Graphs . . . . . . . . . . . . . . . . . . . 77Christophe Crespelle

The Parameterized Complexity of Some Minimum Label Problems . . . . . 88Michael R. Fellows, Jiong Guo, and Iyad A. Kanj

Exact and Parameterized Algorithms for Max Internal Spanning

Tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100Henning Fernau, Serge Gaspers, and Daniel Raible

An Exact Algorithm for Minimum Distortion Embedding . . . . . . . . . . . . . 112Fedor V. Fomin, Daniel Lokshtanov, and Saket Saurabh

Sub-coloring and Hypo-coloring Interval Graphs . . . . . . . . . . . . . . . . . . . . . 122Rajiv Gandhi, Bradford Greening Jr., Sriram Pemmaraju, andRajiv Raman

Parameterized Complexity of Generalized Domination Problems . . . . . . . 133Petr A. Golovach, Jan Kratochvıl, and Ondrej Suchy

Connected Feedback Vertex Set in Planar Graphs . . . . . . . . . . . . . . . . . . . . 143Alexander Grigoriev and Rene Sitters

Page 9: Graph-Theoretic Concepts in Computer Science

XII Table of Contents

Logical Locality Entails Frugal Distributed Computation over Graphs(Extended Abstract) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154

Stephane Grumbach and Zhilin Wu

On Module-Composed Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166Frank Gurski and Egon Wanke

An Even Simpler Linear-Time Algorithm for Verifying MinimumSpanning Trees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178

Torben Hagerup

The k-Disjoint Paths Problem on Chordal Graphs . . . . . . . . . . . . . . . . . . . . 190Frank Kammer and Torsten Tholey

Local Algorithms for Edge Colorings in UDGs . . . . . . . . . . . . . . . . . . . . . . . 202Iyad A. Kanj, Andreas Wiese, and Fenghui Zhang

Directed Rank-Width and Displit Decomposition . . . . . . . . . . . . . . . . . . . . 214Mamadou Moustapha Kante and Michael Rao

An Algorithmic Study of Switch Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226Bastian Katz, Ignaz Rutter, and Gerhard Woeginger

Hardness Results and Efficient Algorithms for Graph Powers . . . . . . . . . . 238Van Bang Le and Ngoc Tuy Nguyen

Graph Partitioning and Traffic Grooming with Bounded DegreeRequest Graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250

Zhentao Li and Ignasi Sau

Injective Oriented Colourings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262Gary MacGillivray, Andre Raspaud, and Jacobus Swarts

Chordal Digraphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273Daniel Meister and Jan Arne Telle

A New Intersection Model and Improved Algorithms for ToleranceGraphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285

George B. Mertzios, Ignasi Sau, and Shmuel Zaks

Counting the Number of Matchings in Chordal and Chordal BipartiteGraph Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296

Yoshio Okamoto, Ryuhei Uehara, and Takeaki Uno

Distance d-Domination Games . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308Stephan Kreutzer and Sebastian Ordyniak

Cycles, Paths, Connectivity and Diameter in Distance Graphs . . . . . . . . . 320Lucia Draque Penso, Dieter Rautenbach, and Jayme Luiz Szwarcfiter

Page 10: Graph-Theoretic Concepts in Computer Science

Table of Contents XIII

Smallest Odd Holes in Claw-Free Graphs (Extended Abstract) . . . . . . . . . 329Shimon Shrem, Michal Stern, and Martin Charles Golumbic

Finding Induced Paths of Given Parity in Claw-Free Graphs . . . . . . . . . . . 341Pim van ’t Hof, Marcin Kaminski, and Daniel Paulusma

Author Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353

Page 11: Graph-Theoretic Concepts in Computer Science

Graph-Theoretic Solutionsto Computational Geometry Problems

David Eppstein

Computer Science Department, University of California, Irvine

Abstract. Many problems in computational geometry are not stated in graph-theoretic terms, but can be solved efficiently by constructing an auxiliary graphand performing a graph-theoretic algorithm on it. Often, the efficiency of the al-gorithm depends on the special properties of the graph constructed in this way. Wesurvey the art gallery problem, partition into rectangles, minimum-diameter clus-tering, rectilinear cartogram construction, mesh stripification, angle optimizationin tilings, and metric embedding from this perspective.

1 Introduction

Graph algorithms and computational geometry form separate communities with sepa-rate conferences such as the International Workshop on Graph-Theoretic Concepts inComputer Science and the ACM Symposium on Computational Geometry, respectively,but they also meet in broader algorithms conferences, and there has been much interplaybetween the research topics in the two areas.

Many classical graph algorithm problems have geometric analogues, algorithmicproblems on graphs defined by a geometric input. In most cases, problems of this typecan be solved directly by constructing the graph and then applying a general-purposegraph algorithm, but can be sped up by examining the graph algorithm’s structure moreclosely and applying appropriate geometric data structures. A notable instance of thisphenomenon is the Euclidean minimum spanning tree (the spanning tree of a completegraph in which the vertices represent points and edge lengths are Euclidean distances):by using a Delaunay triangulation in place of a complete graph, the quadratic time ofa naive algorithm can be improved to O(n logn) [67]. Other work along these linesincludes algorithms for Euclidean matching [1, 71] and bipartiteness testing [26].

Graph drawing, the visualization of graphs via geometric graph representations [19,45, 59], forms another community represented by the annual International Symposiumon Graph Drawing. Most work in the area concerns drawings in which a graph’s ver-tices are represented as geometric points, disks, or polygons, and its edges are repre-sented as line segments or curves. Researchers in this area seek algorithms that optimizemathematical stand-ins for their aesthetic quality and readability such as the number ofcrossings, the number of bends in non-straight edges, the angles formed by adjacentedges, the area of the drawing, or the amount of symmetry that the drawing displays;the interplay between these different measures provides much scope for research.

Geometric techniques have sometimes also been applied to solve problems that wereoriginally defined in purely graph-theoretic terms. One instance concerns parametric

C. Paul and M. Habib (Eds.): WG 2009, LNCS 5911, pp. 1–16, 2010.c© Springer-Verlag Berlin Heidelberg 2010

Page 12: Graph-Theoretic Concepts in Computer Science

2 D. Eppstein

minimum spanning trees, minimum spanning trees of graphs whose edge weights arelinear functions of a parameter. Dey proved [18] that O(mn1/3) different trees may beformed in this way from a parametric graph with m edges and n vertices, using thecrossing number inequality that s simple plane curves with n shared endpoints haveΩ(s3/n2) crossings [4, 50], while the best known lower bound, Ω(mα(n)), involves areduction from another geometric problem, lower envelopes of line segments [22].

In this paper we survey connections between computational geometry and graph al-gorithms of yet another type: problems in computational geometry that, although notinitially defined graph-theoretically, may be solved by constructing an auxiliary graphfrom the input, applying a purely graph-theoretic algorithm to this auxiliary graph, andtranslating the output of this algorithm back into geometric terms. We discuss prob-lems including the art gallery problem, partition into rectangles, minimum-diameterclustering, rectilinear cartogram construction, mesh stripification, angle optimization intilings, and metric embedding. The ordering of the problems is roughly chronological,and the selection of topics is idiosyncratic and (especially for the later problems) largelydrawn from the author’s own research rather than being comprehensive.

2 Art Gallery Problems

Most computer scientists are familiar both with Chvatal’s art gallery theorem [13, 61]that every n-vertex simple polygon has a set of �n/3� guard points from which thewhole polygon may be seen, and with Fisk’s elegant graph-theoretic proof [36]. Onebegins the proof by adding a maximal set of non-crossing diagonals to the polygon,partitioning it into triangles. Graph-theoretically, the vertices, sides, and added diago-nals of the polygon form a maximal outerplanar graph; the weak dual of this graph (theadjacency graph of the triangles, omitting the outer face) is a tree (Figure 1, center).Every maximal outerplanar graph may be colored with three colors, as may be provenby induction: the result is clearly true when the graph is a triangle, and any larger max-imal planar graph may be colored by removing a leaf from the dual tree, coloring theremaining graph, restoring the leaf, and observing that the restored vertex has only twoneighbors and therefore has a free color available. Each triangle has one vertex of eachcolor, so each color class forms a valid guard set, and the smallest of the color classeshas at most �n/3� vertices. This proof technique translates into an efficient algorithm:polygons may be triangulated in linear time [10], and the induction proof leads to alinear-time algorithm for 3-coloring maximal planar graphs.

A less well-known variant of the art gallery problem concerns simple orthogonalpolygons, simple polygons all of whose sides are parallel to the coordinate axes. Sim-ple orthogonal polygons need only �n/4� guards, as can be shown again by graph col-oring. Every simple orthogonal polygon can be partitioned by diagonals into convexquadrilaterals [46]; the resulting tree of quadrilaterals can be viewed as a special typeof squaregraph, a planar graph in which every bounded face has four sides and everyvertex either belongs to the unbounded face or has at least four incident edges [12, 6].Adding the two diagonals of each quadrilateral to a squaregraph forms a kinggraph [12](Figure 1, right). As with maximal outerplanar graphs, the kinggraphs derived fromsimple orthogonal polygons may be shown to be 4-chromatic by removing leaves of the

Page 13: Graph-Theoretic Concepts in Computer Science

Graph-Theoretic Solutions to Computational Geometry Problems 3

Fig. 1. The art gallery problem. Left: a comb polygon requiring �n/3� guards. Center: triangulat-ing an input polygon produces a maximal outerplanar graph, the weak planar dual of which is atree. Right: The kinggraph formed by adding diagonals (dashed) to a partition of an orthogonalpolygon into convex quadrilaterals.

dual tree.1 In any four-coloring, each quadrilateral has a vertex of each color, so eachcolor class forms a guard set, and the smallest color class has at most �n/4� guards.This bound is tight: a comb-shaped orthogonal polygon requires �n/4� guards, just asa comb-shaped simple polygon requiring �n/3� guards shows that the bound for thestandard art gallery problem is tight (Figure 1, left).

The biggest remaining open problem in art gallery theory concerns edge guards: howmany edges must one select, from a simple polygon, so that every point of the polygonmay be seen from some point on some selected edge? It is not clear, in this case, whatgraph one should define on the edges of the polygon to force the color classes of acoloring of the graph to form edge guard sets.

3 Partition into Rectangles

Many geometric algorithms take as input a complicated polygonal domain and coveror partition it using simpler shapes [65]; the partitions into triangles and quadrilateralsfrom the previous section are important examples. Another problem of this type con-cerns the partition into rectangles of an orthogonal polygon. The input polygon mayhave polygonal holes, unlike the simple orthogonal polygons of the previous section,and the rectangles are not required to meet edge-to-edge and vertex-to-vertex. The goalis to minimize the total number of rectangles in the partition (Figure 2).

Rectangular partitions have many applications. In VLSI design, it is necessary to de-compose masks into the simpler shapes available in lithographic pattern generators [62],and similar mask decomposition problems also arise in DNA microarray design [39].Rectangular partitions can simplify convolution operations in image processing [35]and can be used to compress bitmap images [11]. Closely related matrix decomposi-tion problems have been applied to radiation therapy planning [21,47], and rectangularpartitions have also been used to design robot self-assembly sequences [51].

Define a good diagonal to be an axis-parallel line segment interior to the input poly-gon that connects two concave vertices of the polygon. As several authors independently

1 More generally, every kinggraph is 4-chromatic, but a proof is beyond the scope of this survey.

Page 14: Graph-Theoretic Concepts in Computer Science

4 D. Eppstein

Fig. 2. Partitioning an orthogonal polygon (left) into the minimum number of rectangles (center).The right figure shows the axis-parallel diagonals that connect pairs of concave vertices; therectangle partition problem may be solved by finding a maximum independent set in the bipartiteintersection graph of these diagonals.

discovered [35, 55, 60], the minimum number of rectangles in a partition of a polygonwith n vertices and h holes is n/2 + h− g− 1, where g is the maximum size of a setof disjoint good diagonals. To see this, consider the number of corners of rectanglesin a partition, four times the number of rectangles. Let G be a maximal set of disjointgood diagonals that form a subset of the line segments in some partition of an orthog-onal polygon, and define a bad vertex to be a nonconvex polygon vertex that is not anendpoint of G. Each polygon vertex forms at least one rectangle corner. Additionally,for each bad vertex v, let s be an interior line segment of the partition having v as anendpoint. Then either s crosses a segment in G, and the two corners formed by the cross-ing that are on the same side as v with respect to the crossed segment can be chargedto v, or s ends at a non-vertex and the two corners formed at its other endpoint can becharged to v. This charging scheme shows that the number of rectangle corners in thepartition is at least n plus twice the number of bad vertices. The number of noncon-vex vertices in any orthogonal polygon with h holes is n/2 + 2h−2, so the number ofbad vertices is n/2 + 2h−2|G|−2, and a lower bound of n/2 + h−|G|−1 rectanglesfollows. Conversely, if G is any set of disjoint good diagonals, a partition with exactlyn/2 + h− |G|− 1 rectangles may be found by considering the bad vertices for G, oneat a time, and extending a line segment from each bad vertex to the closest previously-added segment or polygon side. Thus, finding a partition into a minimum number ofrectangles is equivalent to finding a maximum number of disjoint good diagonals.

The intersection graph of the good diagonals is bipartite: each horizontal diagonalintersects only vertical diagonals and vice versa. Therefore, finding the maximum num-ber of disjoint good diagonals translates, in graph-theoretic terms, into finding a max-imum independent set in a bipartite graph. By Konig’s theorem [49], in any n-vertexbipartite graph the maximum independent set has size n−M, where M is the cardi-nality of a maximum matching; an independent set of this size may be found from amaximum matching by partitioning the vertices according to the lengths of the short-est alternating paths from an unmatched vertex to the given vertex, and including thevertices at even levels of this partition. Therefore, the maximum independent set ofthe intersection graph, the corresponding maximum set of disjoint good diagonals,and a partition into a minimum number of rectangles, may all be found in polynomialtime.

Page 15: Graph-Theoretic Concepts in Computer Science

Graph-Theoretic Solutions to Computational Geometry Problems 5

A naive implementation of an algorithm that reduces the problem to a bipartite graphand then applies a general-purpose bipartite graph matching algorithm would solve theproblem in time O(n2.5), where n denotes the number of vertices of the input polygon:this is the time needed to apply the Hopcroft–Karp matching algorithm [41] to theintersection graph of the good diagonals, which may have Θ(n) vertices and Θ(n2)edges. However, by using geometric range searching data structures to speed up thesearch for alternating paths within the matching algorithm, it is possible to improve theoverall running time to O(n3/2 logn) [42, 53, 54].

4 Minimum Diameter Clustering

The diameter of a set of points is the maximum distance of any two of its points. Theproblem of finding low-diameter subsets of larger sets of input points [3, 27] may beformulated in several different ways: one may take as input a number k and produce asoutput the subset of k points with minimum diameter, one may take as input a numberD and produce as output the largest subset with diameter at most D, or one may solvethe decision problem in which D and k are both given and the task is to determinewhether there exists a set of k points with diameter at most D. Since there are onlyO(n2) potential diameter values and n different values of k, an efficient algorithm forany one of these tasks leads to efficient algorithms for the other two tasks as well.

Finding the largest size k of a set with diameter at most a given value D has a di-rect translation to a graph theoretic problem, but the very directness of the translationmeans that it is unhelpful: it provides merely a restatement of the problem rather thanconveying any new insight. We may scale the input point set so that D = 2; then whatwe seek is the largest clique in a unit disk graph, the intersection graph of unit diskscentered at the points (Figure 3, left); note that a set of disks forming a clique need nothave a common intersection point. Maximum cliques in unit disk graphs may be foundin polynomial time, given a disk representation of the graph [15] but this is just a trivialrestatement of the minimum diameter clustering problem; it is NP-hard to find a diskrepresentation given only a graph-theoretic description of a unit disk graph [8].

However, just as in the rectangle partition problem, minimum diameter clusteringmay be reduced to a more basic graph-theoretic problem, maximum independent setsin bipartite graphs [3, 15]. Suppose that we know or can guess the two points p and qforming the diametral pair in a cluster. Then, all the other points of the cluster mustbe within the lune formed by intersecting the two circles with pq as radius, centeredon p and q. The largest possible cluster within the lune is the maximum clique of theunit disk graph with disk centers inside this lune, or equivalently the maximum inde-pendent set of the complement G of this restricted unit disk graph. But G is bipartite: ifthe lune is bisected by line pq, then a point in G can be connected by an edge only toother points on the other side of the bisection line (Figure 3, right). Therefore, its max-imum independent set may be found in polynomial time, as discussed in the previoussection.

Based on this idea, one could test all Θ(n2) pairs pq, find the bipartite graph derivedfrom each pair and apply a bipartite matching algorithm to it, and return the best clus-ter found from all of these separate tests. However it is more efficient to use dynamic

Page 16: Graph-Theoretic Concepts in Computer Science

6 D. Eppstein

Fig. 3. Minimum diameter clustering. Left: a unit disk graph and its largest clique (the five darkercircles in the upper left). Right: for any two specified points, the largest cluster having those twopoints as its diametral pair may be found as a maximum independent set of a bipartite graph inwhich the two sides of the bipartition are two halves of a lune defined by the two specified points.

graph algorithms to share work between multiple different matching problems [27].Suppose we seek the size of the largest cluster for a given D. For each point p thatcould be an endpoint of a diametral pair, consider the lune defined by a segment oflength D with p as one endpoint. If the defining segment rotates through an angle of2π around p, the lune rotates with it, and the set of input points inside the lune un-dergoes a sequence of O(n) discrete changes in which some point joins or leaves theset. After each change, one may update the maximum matching of the bipartite graphdefined from the lune by a single alternating path search. Thus, the overall algorithmloops through all n possible choices of p, and performs a nested loop through the O(n)set insertion and deletion operations defined by rotating a size-D lune around p. Foreach set update operation the algorithm performs an alternating path search to updatea maximum matching and the maximum independent set in the bipartite graph definedfrom the lune, and when the nested loops terminate the algorithm returns the largestcluster found in each of these searches. As Aggarwal et al. [3] describe, each step ofan alternating path search may be performed in logarithmic time with the aid of thecircular hull data structure of Hershberger and Suri [40]. Therefore, each alternatingpath search takes time O(n logn), the sequence of O(n) alternating path searches fora single choice of p takes time O(n2 logn), and the overall clustering algorithm takestime O(n3 logn) [27].

If k rather than D is given as input, the problem may be solved by a binary searchamong the O(n2) different distances defined by the input points, that checks for eachdistance whether it is the diameter of some k-point cluster. For this variant, the time maybe further improved to O(n logn+ k2n log2 k) by using a k-nearest-neighbor calculationto reduce the problem to O(n/k) subproblems with O(k) points per subproblem [27].

It appears to be open whether there exist polynomial time algorithms for solving theanalogous minimum diameter clustering problems in higher dimensions (equivalently,finding maximum cliques in intersection graphs of unit balls in higher dimensions) orfor finding a maximum clique in a unit disk graph when a geometric representation ofthe graph is not given.

Page 17: Graph-Theoretic Concepts in Computer Science

Graph-Theoretic Solutions to Computational Geometry Problems 7

NL

BE LU

FR

DE

Fig. 4. A rectilinear cartogram of five countries in northwestern Europe. Map based on a CC-BY-SA licensed image by Brianski, Canuckguy, Zaparojdik, Madman2001, Roke, and Ssolbergj,online at http://commons.wikimedia.org/wiki/File:Blank Map of Europe -w boundaries.svg.

5 Bend Minimization

A rectilinear cartogram [64,72,58] is a diagram in which geographic regions have beenreplaced by orthogonal polygons, with approximately the same shapes and in approx-imately the same positions with respect to each other as they hold geographically, butin which the areas of the regions have been distorted to represent numerical data aboutthe regions unrelated to their physical areas. In introducing these diagrams in 1934,Raisz [64] wrote, “it should be emphasized that the statistical cartogram is not a map,”and the stylization inherent in using orthogonal polygons helps perform this emphasis.

We have studied algorithms for constructing cartograms that can accomodate arbi-trary area assignments [31] and in which the adjacencies between regions have desiredorientations [30] but a more basic problem, constructing a cartogram in which the re-gion shapes are as simple as possible, had already been solved in a different context, thatof graph drawing [69]. Simple shapes such as rectangles aid the viewer in measuringand comparing areas and hence in understanding the data represented by a cartogram.We would like to find a cartogram that represents a given map with a minimum numberof bends (corners interior to the boundary between two adjacent regions); for instance,in Figure 4 there is one bend, between Belgium and Luxembourg; this is optimal, asLuxembourg is surrounded by only three countries and hence must have at least onebend on its boundary. As Tamassia [69] shows, this problem of bend minimization canbe solved in polynomial time by translating it into a network flow problem.

To form a flow problem that represents the bends of some given cartogram, constructa graph that has a single “circulation” vertex, a vertex for each region of the cartogram(including the exterior of the diagram as one of the regions), and a vertex for eachjunction where three or four regions of the cartogram meet (four regions at a junctionmay be needed to model places like the Four Corners in the southwest of the U.S.where four states meet, but five or more regions cannot meet at a single junction in anorthogonal cartogram). Include edges from the circulation vertex to each other vertex,between each two vertices that represent adjacent regions, and between two verticesthat represent an incident junction-region pair. Label this graph with flow amounts,as follows: each junction vertex has four incoming units of flow from the circulation

Page 18: Graph-Theoretic Concepts in Computer Science

8 D. Eppstein

vertex, and sends one unit of flow to the vertices representing the regions in the fourquadrants incident to the junction. For each bend in the cartogram, send one unit of flowfrom the region that has a convex vertex at the bend to the region that has a concavevertex. For each interior region having k junctions on its boundary, send 4− 2k unitsof flow to the circulation vertex (or equivalently, if 4− 2k < 0, send 2k− 4 units fromthe circulation vertex to the region vertex). And for an exterior region with k junctionson its boundary, send 2k + 4 units of flow to the circulation vertex. The result can beshown to be a valid circulation: that is, for each vertex of the flow graph, the numbersof incoming and outgoing flow units are equal. For the junction vertices, this is clearbecause the four incoming units are balanced by the four quadrants into which a unitof flow is sent. An interior region with k junctions and no bends must form a rectangle,as a junction cannot form a concave corner; thus, it has four incident junction verticesthat send a single unit of flow, and the remaining k−4 incident junctions send two unitsof flow into the region, for a total of 2k− 4 incoming units, balancing the flow to thecirculation vertex. Each additional cave corner at a bend causes one unit of incomingflow from another region, but must be balanced by an additional convex corner; if thatconvex corner belongs to a bend, it provides a unit of outgoing flow, and if it belongsto a junction then that junction sends one fewer unit of incoming flow, in either caseleading to the same total flow balance. A similar argument shows that the flow into andout of the exterior region vertex is also balanced, from which it follows that the flowmust be balanced at the single remaining vertex, the circulation vertex.

Conversely, as Tamassia shows, one can assign costs and flow capacities to this net-work in order to force a minimum cost circulation to correspond to a minimum-benddrawing. Capacity constraints are needed to force the incoming flow to each junc-tion vertex to be exactly four units; the edges between adjacent region vertices areassigned unit cost, and all other edges have zero cost. With these constraints and costs,the flow described above has cost equal to its number of bends. Conversely, any inte-ger solution to the capacitated circulation problem can be translated into a drawing inwhich the total number of bends is equal to the cost of the circulation, so a cartogramwith the minimum number of bends can be found from a minimum-cost circulation,which can be constructed in polynomial time. The flow graph is an apex graph: ifone vertex, the circulation vertex, is removed, the rest is planar. Therefore, special-ized techniques for finding flows in planar graphs may be used to speed up this algo-rithm [38, 43, 57].

6 Mesh Stripification

Stripification refers to the problem in computer graphics of partitioning a triangulatedsurface model of a three-dimensional object into triangle strips, sequences of trianglesmeeting edge-to-edge [5, 29, 34, 73]. Such a partition allows for fast rendering by re-quiring the coordinates of only one vertex per triangle to be transmitted to the graphicshardware; the other two vertex locations may be found from the previous triangle in thestrip. Triangle strips aid in data compression of geometric models: a predicted locationthat aids in compressing the coordinates of each successive vertex may be found byextrapolation from the previous triangle in a strip [17]. Additionally, if a mesh can be

Page 19: Graph-Theoretic Concepts in Computer Science

Graph-Theoretic Solutions to Computational Geometry Problems 9

Fig. 5. Left: a single strip in a triangulated torus, rendered by M. Gopi, from [25]. Right: a localmove at a vertex allows three cycles to be merged into a single cycle.

represented as a single cyclic triangle strip, as in Figure 5 (left), the structure of thestrip may be used to cover the surface of the model with a space-filling curve [29],and contractions of the boundary edges of the strip can be used for topology-preservingsimplifications of the model [20].

Finding such a strip may be viewed graph-theoretically, as finding a Hamiltoniancycle in the 3-regular dual graph of the triangulation, a graph with one vertex per tri-angle and one edge for each pair of adjacent triangles. However, this is problematicfor two reasons. First, the Hamiltonian cycle problem is NP-complete and the knownexponential-time algorithms for the problem [25, 44] are only capable of solving itwithin a reasonable time for models of at most a few hundred triangles. Second, andmore importantly, not all triangulated models, even with spherical topology, have sin-gle triangle strips of this type. Tutte’s counterexample to Tait’s conjecture that 3-regularpolyhedra are Hamiltonian [68, 70] dualizes to become a triangulated mesh that cannotbe represented as a single cycle of triangles.

However, it is important to realize that the dual graph does not uniquely representthe geometry: we may change the triangulation, and hence change the graph, withoutchanging the model’s shape. The dual graph of any triangulated model is both 3-regularand bridgeless; therefore, by a theorem of Petersen [63], it has a perfect matching, whichmay be found efficiently [7]. The set of edges complementary to the matching formsa partition of the triangulation into a collection of disjoint cycles [29]; however, theremay be more than one of these cycles. As we observed [29], in many cases a local moveat a vertex of the triangulation, that swaps matched and unmatched edges connectingthe triangles sharing that vertex, may reduce the number of cycles (Figure 5, right).If no such move is available, two adjacent triangles from two different cycles may bebisected across their shared edge, leading to a new triangulation of the same surfacewith the property that a cycle-reducing local move is available at the newly createdvertex. By repeating this subdivision process, one eventually reaches a triangulationthat covers a surface identical to the input model, but one that has a different dual graphthan the input and that can be represented as a single strip. Although theoretically thiscould increase the total number of triangles by as much as a factor of 3/2, in practicewe saw at most a 2% increase.

Page 20: Graph-Theoretic Concepts in Computer Science

10 D. Eppstein

Fig. 6. Two drawings of the squaregraph dual to a 5-chromatic triangle-free circle graph describedby Ageev [2], from [6]

7 Angle Optimization of Tilings

The planar dual of any arrangement of lines in the plane may be represented as a tilingof a convex subset of the plane by centrally symmetric convex polygons; this tilinghas one polygon for each crossing point of the arrangement, which may be chosen tohave unit-length edges perpendicular to the lines crossing at that point. De Bruijn [16]used this construction to form aperiodic tilings (including the rhombic Penrose tiling)from overlaid families of evenly-spaced parallel lines. More generally the dual of aweak pseudoline arrangement (a set of curves that are the image of a line under ahomeomorphism of the plane, that have at most one point of intersection per pair ofcurves, and that cross each other at their intersection points), may be represented asa tiling of a nonconvex simple polygon by centrally-symmetric polygons, and everysuch tiling arises in this way [24,28]; this provides a convenient method for visualizingsquaregraphs, which are the duals of triangle-free hyperbolic line arrangements [6].

However, the tilings obtained directly from this construction may be hard to readdue to having polygons with very sharp angles, as is true for instance for the tilingin Figure 6 (left). In unpublished work with Kevin Wortman [32], we considered theproblem of finding a combinatorially equivalent tiling that maximizes the minimumangle in the tiling (the so-called angular resolution [9, 56]), such as the one in Figure 6(right); we showed that this optimal tiling could be found by a parametric shortest pathcomputation in an auxiliary graph derived from the input.

Our algorithm constructs a graph in which the edges have weights that are linearfunctions of a parameter λ that represents the angular resolution of the drawing. In atiling of this type, one can define an equivalence relation on the sides of tiles in whichopposite pairs of sides on the same side are equivalent; the equivalence classes formzones of line segments that are required to be parallel and to have the same length. Ourgraph has one vertex per zone, and an additional start vertex that has a zero-length edgeto each other vertex; the distance from the start vertex to a zone’s vertex represents the

Page 21: Graph-Theoretic Concepts in Computer Science

Graph-Theoretic Solutions to Computational Geometry Problems 11

adjustment in angle for the segments in the zone between an initial tiling and the optimaltiling. The constraint that the angle between two sides of a polygon be at least λ can thenbe expressed by the existence of an edge between the vertices representing the zonescontaining the two sides, with length θi−θ j−λ, where θi and θ j are the angles formedby the two zones in the initial tiling. Similarly, the constraint that an interior angle beconvex can be expressed by an edge with length π+θi−θ j. With these vertices and edgelengths, it can be shown that there exists a tiling with angular resolution at least λ if andonly if the result of substituting that value into each edge weight function is a graph withno negative cycles. Therefore, the optimal angular resolution is the largest value of λgiving no negative cycles. Due to the special form of the weights in the parametric graph(each weight is either constant or a constant minus λ) this parametric negative cycledetection problem can be solved in O(n3) time by an algorithm of Karp and Orlin [48].The translation from the tiling angular resolution problem to the parametric negativecycle detection problem and back can be performed within the same time bound.

8 Metric Embedding into Stars

There has been a large amount of interest recently within the theoretical computer sci-ence community in problems of embedding unstructured metric spaces (which may bespecified, for instance, as a distance matrix) into simpler and more highly constrainedmetrics, with low distortion [52]. Such embeddings may be used, for instance, in ap-proximation algorithms: one can design an approximation algorithm for the constrainedclass of metrics, and apply it to arbitrary metrics, incurring the distortion of the embed-ding as a penalty factor in the approximation ratio of the algorithm. The construction ofgraph spanners [23] may also be seen as an instance of this type of problem: one wishesto approximate a metric describing the shortest paths in an arbitrary graph, by a morehighly constrained metric of shortest paths in a sparse graph. Most work in this areahas concentrated on finding embeddings that guarantee low but non-optimal distortion;however there has also been some work on finding the best possible embedding [33,37].In particular, we describe here our work on finding optimal embeddings into star met-rics, which (as in the angle optimization of the previous section) involves translatingthe problem into one of parametric negative cycle detection in an auxiliary graph.

Following [33], we define a star metric to be a metric space in which there exists adistinguished point h (the hub) of the metric) such that, for every two points p and q, hlies on a shortest path from p to q. Expressed algebraically: d(p,q) = d(p,h)+d(h,q).Thus, in contrast to arbitrary n-point finite metric spaces which have n(n−1)/2 degreesof freedom, a star metric has only n−1 degrees of freedom. We wish to find a map froman arbitrary finite metric space (represented as a distance matrix D) to a star metric space(represented as a vector H of distances from each point to the hub) that minimizes thedistortion of the embedding; we do not require that the hub be the image of any pointin the input space. By scaling H, if necessary, we can assume without loss of generalitythat the map does not decrease any distance; thus, what we seek is a vector H satisfyingthe constraint that, for all p and q, D[p,q]≤ H[p]+ H[q], and minimizing the dilation

δ = maxp,q

H[p]+ H[q]D[p,q]

.

Page 22: Graph-Theoretic Concepts in Computer Science

12 D. Eppstein

Fig. 7. The parametric network into which an optimal star embedding problem is translated.From [33].

This is a linear program: it may be rephrased as the problem of finding H and δ sub-ject to the linear nondecreasing-distance constraints and the linear constraints that, foreach p and q, D[p,q]δ−H[p]−H[q]≥ 0, and, among all tuples of H and δ that satisfythe constraints, finding the tuple minimizing δ. However, it may be solved more effi-ciently, in strongly polynomial time, by transforming it into a parametric negative cycledetection problem.

Specifically, as our paper shows, we may find the optimal star embedding using anauxiliary graph defined from the input, having two vertices p and p for each metricspace point p, as well as a special start vertex s. There is an edge with length zero froms to each vertex p and from each vertex p to the corresponding p. In addition, for eachpair of points p and q, there is an edge of length −D[p,q] from p to q and another edgeof length λD[p,q] from p to q. As we show, the optimal dilation δ is the smallest valuethat can be assigned to λ such that the resulting graph has no negative cycles, and forthis value of λ the distance D[p] of p from the hub in the optimal embedding may becomputed as half of the difference between the two distances from s to p and p.

Thus, the star metric embedding problem may be solved optimally by a single para-metric negative cycle detection calculation similar to that in the previous section. How-ever, in this case the edge weight functions of the parametrized network no longer havethe special form needed to apply the Karp–Orlin algorithm; instead, we developed amore general algorithm that solves any parametric negative cycle detection problem instrongly polynomial time. The basic idea of the algorithm is to use a matrix squaringmethod of Savage [66] to calculate the parametrized function representing the weightsof paths between each pair of vertices; after i iterations of squaring a matrix whose en-tries represent these functions, they will correctly describe the lengths of the shortestpath between each pair of vertices among paths constrained to have at most 2i hops.After each matrix-squaring step, the entries of the matrix will not be linear functionsbut rather more general piecewise linear concave functions; we perform a binary searchamong the set of breakpoints of these functions to narrow down the range of values ofλ within which the optimal value must lie, allowing us to simplify the functions to be

Page 23: Graph-Theoretic Concepts in Computer Science

Graph-Theoretic Solutions to Computational Geometry Problems 13

linear once again. Each binary search step involves applying the Bellman-Ford algo-rithm to determine whether a specific value of λ causes the parametrized graph to havea negative cycle. The negative cycle detection algorithm resulting from this parametricsearch procedure has total running time O(n3 log2 n), which is therefore also the timefor using this approach to solve the optimal star metric embedding problem.

9 Conclusions

As we have seen, a graph-theoretic point of view can be useful in many algorithmicproblems that do not, initially, seem to have much to do with graphs. The graph prob-lems occurring in the solutions of the geometry problems discussed here are mostlywell-known and classical: they include the maximum independent set and maximumclique problems, maximum cardinality matching, shortest paths, and minimum costflow. However, sometimes these problems occur in a somewhat different form than theyhave been studied elsewhere in the literature: the star metric embedding problem, forinstance, required parametric negative cycle detection at a level of generality that hadpreviously not been considered.

Special classes of graphs, and specialized algorithms that take advantage of thesespecial classes, seem to be ubiquitous in this area. In the examples here, we have seennatural applications of trees, maximal outerplanar graphs, squaregraphs and kinggraphs,bipartite graphs, unit disk graphs, apex graphs, and 3-regular bridgeless graphs. Thesimple coloring algorithm for maximal outerplanar graphs described in the section onthe art gallery theorem generalizes to chordal graphs (maximal outerplanar graphs arechordal) and to perfectly orderable graphs [14].

There are undoubtedly many more applications of graph-theoretic concepts in com-putational geometry waiting to be discovered, and it is important that the lines ofcommunication remain open between the graph algorithm and computational geometrycommunities, so that computational geometers will know where to find the algorithmsthey need and so that graph algorithms researchers can focus their efforts on the prob-lems and graph classes with the greatest benefit in geometric applications.

Acknowledgements. This work was supported in part by NSF grant 0830403 and bythe Office of Naval Research under grant N00014-08-1-1015.

References

1. Agarwal, P.K., Efrat, A., Sharir, M.: Vertical decomposition of shallow levels in 3-dimensional arrangements and its applications. SIAM J. Comput. 29(3), 912–953 (2000)

2. Ageev, A.A.: A triangle-free circle graph with chromatic number 5. Discrete Mathemat-ics 152, 295–298 (1996)

3. Aggarwal, A., Imai, H., Katoh, N., Suri, S.: Finding k points with minimum diameter andrelated problems. J. Algorithms 12(1), 38–56 (1991)

4. Ajtai, M., Chvatal, V., Newborn, M., Szemeredi, E.: Crossing-free subgraphs. In: Theory andPractice of Combinatorics. North-Holland Mathematics Studies, vol. 60, pp. 9–12 (1982)

5. Arkin, E.M., Held, M., Mitchell, J.S.B., Skiena, S.S.: Hamiltonian triangulations for fastrendering. The Visual Computer 12(9), 429–444 (1996)

Page 24: Graph-Theoretic Concepts in Computer Science

14 D. Eppstein

6. Bandelt, H.-J., Chepoi, V., Eppstein, D.: Combinatorics and geometry of finite and infinitesquaregraphs. Electronic preprint arxiv:0905.4537 (2009)

7. Biedl, T.C., Bose, P., Demaine, E.D., Lubiw, A.: Efficient algorithms for Petersen’s matchingtheorem. J. Algorithms 38, 110–134 (2001)

8. Breu, H., Kirkpatrick, D.G.: Unit disk graph recognition is NP-hard. Computational Geom-etry Theory and Applications 9(1–2), 3–24 (1998)

9. Carlson, J., Eppstein, D.: Trees with convex faces and optimal angles. In: Kaufmann, M.,Wagner, D. (eds.) GD 2006. LNCS, vol. 4372, pp. 77–88. Springer, Heidelberg (2007)

10. Chazelle, B.: Triangulating a simple polygon in linear time. Discrete & Computational Ge-ometry 6(1), 485–524 (1991)

11. Cheng, Y., Iyengar, S.S., Kashyap, R.L.: A new method of image compression using irre-ducible covers of maximal rectangles. IEEE Trans. Software Engineering 14(5), 651–658(1988)

12. Chepoi, V., Dragan, F., Vaxes, Y.: Center and diameter problem in planar quadrangulationsand triangulations. In: Proc. 13th Annu. ACM–SIAM Symp. on Discrete Algorithms (SODA2002), pp. 346–355. ACM Press, New York (2002)

13. Chvatal, V.: A combinatorial theorem in plane geometry. Journal of Combinatorial Theory,Series B 18, 39–41 (1975)

14. Chvatal, V.: Perfectly orderable graphs. In: Berge, C., Chvatal, V. (eds.) Topics in PerfectGraphs. Annals of Discrete Mathematics, vol. 21, pp. 63–68. North-Holland, Amsterdam(1984)

15. Clark, B.N., Colbourn, C.J., Johnson, D.S.: Unit disk graphs. Discrete Mathematics 86, 165–177 (1990)

16. de Bruijn, N.G.: Algebraic theory of Penrose’s non-periodic tilings of the plane. IndagationesMathematicae 43, 38–66 (1981)

17. Deering, M.: Geometry compression. In: Proc. 22nd Conf. Computer Graphics and Interac-tive Techniques (SIGGRAPH), pp. 13–20 (1995)

18. Dey, T.K.: Improved bounds for planar k-sets and related problems. Discrete & Computa-tional Geometry 19(3), 373–382 (1998)

19. Di Battista, G., Eades, P., Tamassia, R., Tollis, I.G.: Graph Drawing: Algorithms for theVisualization of Graphs. Prentice-Hall, Englewood Cliffs (1998)

20. Dıaz-Gutierrez, P.: Using graph algorithms for geometry processing on surfaces. PhD thesis,Univ. of California, Irvine (2009)

21. Engel, K.: Optimal matrix-segmentation by rectangles. Discrete Applied Mathemat-ics 157(9), 2015–2030 (2009)

22. Eppstein, D.: Geometric lower bounds for parametric matroid optimization. Discrete & Com-putational Geometry 20, 463–476 (1998)

23. Eppstein, D.: Spanning trees and spanners. In: Sack, J.-R., Urrutia, J. (eds.) Handbook ofComputational Geometry, ch. 9, pp. 425–461. Elsevier, Amsterdam (2000)

24. Eppstein, D.: Algorithms for drawing media. In: Pach, J. (ed.) GD 2004. LNCS, vol. 3383,pp. 173–183. Springer, Heidelberg (2005)

25. Eppstein, D.: The traveling salesman problem for cubic graphs. J. Graph Algorithms andApplications 11(1), 61–81 (2007)

26. Eppstein, D.: Testing bipartiteness of geometric intersection graphs. ACM Trans. Algo-rithms 5(2), 15 (2009)

27. Eppstein, D., Erickson, J.: Iterated nearest neighbors and finding minimal polytopes. Discrete& Computational Geometry 11(3), 321–350 (1994)

28. Eppstein, D., Falmagne, J.-C., Ovchinnikov, S.: Media Theory. Springer, Heidelberg (2007)29. Eppstein, D., Gopi, M.: Single-strip triangulation of manifolds with arbitrary topology. Euro-

graphics Forum 23(3), 371–379 (2004); Proc. 25th Conf. Eur. Assoc. for Computer Graphics(EuroGraphics 2004)

Page 25: Graph-Theoretic Concepts in Computer Science

Graph-Theoretic Solutions to Computational Geometry Problems 15

30. Eppstein, D., Mumford, E.: Orientation-constrained rectangular layouts. In: Dehne, F., et al.(eds.) WADS 2009. LNCS, vol. 5664, pp. 266–277. Springer, Heidelberg (2009)

31. Eppstein, D., Mumford, E., Speckmann, B., Verbeek, K.A.B.: Area-universal rectangularlayouts. In: Proc. 25th ACM Symp. Computational Geometry, pp. 267–276 (2009)

32. Eppstein, D., Wortman, K.: Optimal angular resolution for face-symmetric drawings. Elec-tronic preprint arxiv:0907.5474 (2009)

33. Eppstein, D., Wortman, K.: Optimal embedding into star metrics. In: Dehne, F., et al. (eds.)WADS 2009. LNCS, vol. 5664, pp. 290–301. Springer, Heidelberg (2009)

34. Evans, F., Skiena, S.S., Varshney, A.: Optimizing triangle strips for fast rendering. In: Proc.7th IEEE Conf. Visualization, pp. 319–326 (1996)

35. Ferrari, L., Sankar, P.V., Sklansky, J.: Minimal rectangular partitions of digitized blobs. Com-puter Vision, Graphics, and Image Processing 28(1), 58–71 (1984)

36. Fisk, S.: A short proof of Chvatal’s watchman theorem. Journal of Combinatorial Theory,Series B 24(3), 374 (1978)

37. Fomin, F., Lokshtanov, D., Saurabh, S.: An exact algorithm for minimum distortion embed-ding. In: Paul, C., Habib, M. (eds.) WG 2009. LNCS, vol. 5911. Springer, Heidelberg (2009)

38. Garg, A., Tamassia, R.: A new minimum cost flow algorithm with applications to graphdrawing. In: North, S.C. (ed.) GD 1996. LNCS, vol. 1190, pp. 201–216. Springer, Heidelberg(1997)

39. Hannenhalli, S., Hubbell, E., Lipshutz, R., Pevzner, P.A.: Combinatorial algorithmsfor design of DNA arrays. In: Chip Technology. Advances in Biochemical Engineer-ing/Biotechnology, vol. 77, pp. 1–19. Springer, Heidelberg (2002)

40. Hershberger, J., Suri, S.: Finding tailored partitions. J. Algorithms 12(3), 431–463 (1991)41. Hopcroft, J.E., Karp, R.M.: An n5/2 algorithm for maximum matchings in bipartite graphs.

SIAM J. Comput. 2(4), 225–231 (1973)42. Imai, H., Asano, T.: Efficient algorithms for geometric graph search problems. SIAM J. Com-

put. 15, 478–494 (1986)43. Imai, H., Iwano, K.: Efficient sequential and parallel algorithms for planar minimum cost

flow. In: Asano, T., Imai, H., Ibaraki, T., Nishizeki, T. (eds.) SIGAL 1990. LNCS, vol. 450,pp. 21–30. Springer, Heidelberg (1990)

44. Iwama, K., Nakashima, T.: An improved exact algorithm for cubic graph TSP. In: Lin, G.(ed.) COCOON 2007. LNCS, vol. 4598, pp. 108–117. Springer, Heidelberg (2007)

45. Junger, M., Mutzel, P.: Graph Drawing Software. Springer, Heidelberg (2004)46. Kahn, J., Klawe, M., Kleitman, D.: Traditional galleries require fewer watchmen. SIAM

Journal on Algebraic and Discrete Methods 4(2), 194–206 (1983)47. Kalinowski, T.: A dual of the rectangle-segmentation problem for binary matrices. Electronic

J. Combinatorics 16(1), R89 (2009)48. Karp, R.M., Orlin, J.B.: Parametric Shortest Path Algorithms with an Application to Cyclic

Staffing. Technical Report OR 103-80, MIT Operations Research Center (1980)49. Konig, D.: Grafok es matrixok. Matematikai es Fizikai Lapok 38, 116–119 (1931)50. Leighton, T.: Complexity Issues in VLSI. Foundations of Computing Series. MIT Press,

Cambridge (1983)51. Li, G., Zhang, H.: A rectangular partition algorithm for planar self-assembly. In: Proc.

IEEE/RSJ Int. Conf. Intelligent Robots and Systems, pp. 3213–3218 (2005)52. Linial, N.: Finite metric spaces–combinatorics, geometry and algorithms. In: Proc. Interna-

tional Congress of Mathematicians, Beijing, vol. 3, pp. 573–586 (2002)53. Lipski Jr., W.: Finding a Manhattan path and related problems. Networks 13, 399–409 (1983)54. Lipski Jr., W.: An O(n logn) Manhattan path algorithm. Information Processing Letters 19,

99–102 (1984)55. Lipski Jr., W., Lodi, E., Luccio, F., Mugnai, C., Pagli, L.: On two-dimensional data organi-

zation II. Fundamenta Informaticae 2, 245–260 (1979)

Page 26: Graph-Theoretic Concepts in Computer Science

16 D. Eppstein

56. Malitz, S., Papakostas, A.: On the angular resolution of planar graphs. SIAM J. DiscreteMathematics 7, 172–183 (1994)

57. Miller, G.: Flow in planar graphs with multiple sources and sinks. SIAM J. Comput. 24(5),1002–1017 (1995)

58. Mumford, E.: Drawing Graphs for Cartographic Applications. PhD thesis, Technische Uni-versiteit Eindhoven (2008)

59. Nishizeki, T., Rahman, M.S.: Planar Graph Drawing. World Scientific, Singapore (2004)60. Ohtsuki, T.: Minimum dissection of rectilinear regions. In: Proc. IEEE Int. Symp. Circuits

and Systems, pp. 1210–1213 (1982)61. O’Rourke, J.: Art Gallery Theorems and Algorithms. Oxford University Press, Oxford (1987)62. Patel, K.: Computer-aided decomposition of geometric contours into standardized areas.

Computer-Aided Design 9(3), 199–203 (1977)63. Petersen, J.P.C.: Die theorie der regularen graphs. Acta Mathematica 15, 193–220 (1891)64. Raisz, E.: The rectangular statistical cartogram. Geographical Review 24(2), 292–296 (1934)65. Sack, J.-R., Urrutia, J.: Polygon decomposition. In: Sack, J.-R., Urrutia, J. (eds.) Handbook

of Computational Geometry, pp. 491–518. Elsevier, Amsterdam (1999)66. Savage, C.: Parallel Algorithms for Graph Theoretic Problems. PhD thesis, University of

Illinois, Urbana-Champaign (1977)67. Shamos, M.I., Hoey, D.: Closest-point problems. In: Proc. 16th IEEE Symp. Foundations of

Computer Science, pp. 151–162 (1975)68. Tait, P.G.: Listing’s Topologie. Philosophical Magazine (5th ser.) 17, 30–46 (1884)69. Tamassia, R.: On embedding a graph in the grid with the minimum number of bends. SIAM

J. Comput. 16(3), 421–444 (1987)70. Tutte, W.T.: On Hamiltonian circuits. Journal of the London Mathematical Society (2nd

ser.) 21(2), 98–101 (1946); Reprinted in Scientific Papers, vol. II, pp. 85–9871. Vaidya, P.M.: Geometry helps in matching. SIAM J. Comput. 18(6), 1201–1225 (1989)72. van Kreveld, M., Speckmann, B.: On rectangular cartograms. Computational Geometry The-

ory and Applications 37(3), 175–187 (2007)73. Xiang, X., Held, M., Mitchell, J.S.B.: Fast and effective stripification of polygonal surface

models. In: Proc. Symp. Interactive 3D Graphics, pp. 71–78 (1999)

Page 27: Graph-Theoretic Concepts in Computer Science

Algorithms for Classes of Graphs with BoundedExpansion

Zdenek Dvorak� and Daniel Kral’

Institute for Theoretical Computer Science (ITI),Faculty of Mathematics and Physics, Charles University,

Malostranske namestı 25, 118 00 Prague 1, Czech Republic{rakdver,kral}@kam.mff.cuni.cz

Abstract. We overview algorithmic results for classes of sparse graphsemphasizing new developments in this area. We focus on recently in-troduced classes of graphs with bounded expansion and nowhere-densegraphs and relate algorithmic meta-theorems for these classes of graphsto their analogues for proper minor-closed classes of graphs, classes ofgraphs with bounded tree-width, locally bounded tree-width and locallyexcluding a minor.

1 Introduction

It is well-known that many hard problems are tractable for classes of graphswith restricted structure. A classical example of this phenomenon is the resultof Courcelle [5] that every graph property that can be described by a monadicsecond order logic formula can solved in linear time for graphs with boundedtree-width. In particular, some NP-hard problems including graph coloring orvertex domination can be solved in linear time for graphs with bounded tree-width.

In this paper, we focus on algorithmic meta-theorems for classes of graphswhose structure is limited in some sense. To motivate the results we want topresent, let us switch from the algorithmic to the structural point of view andlook at the chromatic number. Graphs with bounded tree-width are degenerateand thus their chromatic number is bounded. Similarly, the chromatic numberof planar graphs and more generally graphs that can be embedded on a fixedsurface is bounded. Graphs with bounded tree-width, planar graphs and graphsthat can be embedded on a fixed surface form minor-closed classes of graphs. Ageneral experience says that most structural (and algorithmic) properties thathold both for classes of graphs with bounded tree-width and for classes of graphsembedded on a fixed surface are also true for classes of graphs excluding a fixedminor. The chromatic number being bounded is an example.

� Institute for Theoretical computer science is supported as project 1M0545 byCzech Ministry of Education. This work was also supported by the grant GACR201/09/0197.

C. Paul and M. Habib (Eds.): WG 2009, LNCS 5911, pp. 17–32, 2010.c© Springer-Verlag Berlin Heidelberg 2010

Page 28: Graph-Theoretic Concepts in Computer Science

18 Z. Dvorak and D. Kral’

However, the chromatic number is not bounded only for classes of graphsexcluding a fixed minor. Other classes of graphs with bounded chromatic numberinclude graphs with bounded maximum degree or d-degenerate graphs (for fixedinteger d). Since any graph is a minor of a cubic graph, these classes of graphsare clearly not minor-closed. A more tricky example of such class is the class ofgraphs obtained from planar graphs by adding at most two (not necessarily non-crossing) edges to each face. Still it turns out that some algorithmic propertiesof planar graphs also hold for the above mentioned graph classes.

Based on these examples, one would maybe guess that the only requirementwe need is that the number of edges of a graph is bounded by the function linearin the number of its vertices, i.e., its average degree is bounded. This is howevernot sufficient since the average degree can be decreased by adding a sparse partto the graph (a set of isolated vertices being the simplest example, but one caneasily think of more sophisticated ways which also preserve connectivity or otherparameters). Similarly, the maximum average degree is not fine enough since sub-dividing each edge of an input graph decreases maximum average degree belowfour but most of the structural properties of an input graph are preserved. So,one needs a more robust structural parameter to capture the common propertiesof the above graph classes that are essential for the algorithmic results we areinterested in.

A framework of classes of graphs with bounded expansion and a more generalframework of classes of nowhere-dense graphs that have been introduced in aseries of papers by Nesetril and Ossona de Mendez [19,20,21,22,23,24,25] seemsto be the right one to be considered in this setting. In this paper, we will surveyknown structural and algorithmic results, including recent results of the authorsand Thomas on decidability of first order logic properties, for classes of graphswith bounded expansion and classes of nowhere-dense graphs and relate theseresults to the earlier results for other graph classes. We will also provide proofsof some easier facts and those that are essential for algorithmic applications.

2 Definitions

In this section, we present definitions and notions important for our exposition.Though some of the notions we present are fairly standard, we decided to includethem for the sake of completeness.

2.1 Graph Decompositions, Graph Minors

The graph minor project of Robertson and Seymour is one of the basic stones ofmodern graph theory. In this subsection, we recall some definitions and resultsfrom this area which we need in our further exposition.

A tree-decomposition of a graph G is a tree T whose vertices correspond tosubsets of vertices of G, referred to as bags, and the following three propertieshold:

1. every vertex of G is in at least one of the bags,

Page 29: Graph-Theoretic Concepts in Computer Science

Algorithms for Classes of Graphs with Bounded Expansion 19

2. for every edge of G, there is a bag containing both its end-vertices, and3. if a vertex v of G is contained in the bags associated with vertices u and u′

of T , then v is contained in all the bags associated with the vertices on thepath between u and u′ in T .

The order of a tree-decomposition T is the maximum size of a bag associatedto a vertex of T decreased by one. The tree-width tw(G) of a graph G is theminimum order of a tree-decomposition of G. Graphs with tree-width zero areedge-less and those with tree-width at most one are forests.

More restricted width parameter is the tree-depth. The tree-depth td(G) of agraph G is the minimum depth of a rooted tree T with the same vertex set asG that for every edge vv′ of G, v is an ancestor of v′ or v′ is an ancestor of v.To fix our terminology, the depth of a rooted tree T is the maximum number ofvertices in a path from the root to a vertex of T , e.g., the depth of the one-vertexrooted tree is one. Vertices on the path from a vertex v to the root are ancestorsof v. Those vertices v′ such that v is an ancestor of v′ are descendents of v.

It is not hard to see that the tree-width of a graph G is bounded by its tree-depth decreased by one (consider the optimum tree T from the definition of thetree-depth, form bags as sets of vertices on the paths from the root to the leavesand associate them with vertices of a path in the order in which the leaves of Tare visited during the depth-first search). On the other hand, the tree-depth of agraph is not bounded by any function of its tree-width (the tree-depth of the n-vertex path is �log2(n+1)�). In fact, the tree-depth of a graph G is proportionalto the length � of the longest path in G since �log2(� + 2)� ≤ td(G) ≤ (

�+32

)− 1.It also holds [3] that td(G) ≤ (tw(G) + 1) log2(n + 1) where n is the number ofvertices of G.

An alternative definition of the tree-depth can be given by means of a vertex-coloring [26]. The ranking number of a graph G, as defined in [2], is the minimumnumber k of colors 1, . . . , k needed to color the vertices of G such that any pathjoining two vertices of the same color contains a vertex with a bigger color. Itcan be shown that the tree-depth of a graph G is equal to its ranking number(to obtain the coloring, color the vertices of the tree T from the definition ofthe tree-depth based on their distance from the root, giving the root the largestcolor; to obtain a decomposition, proceed conversely).

A minor of a graph G is a graph obtained by deleting vertices and edges andcontracting edges. Recall that the operation of contracting an edge e consists ofremoving e, identifying its end-vertices and deleting any loops and parallel edgesthat arise. A class G of graphs is minor-closed if every minor of a graph from Gis also contained in G. Examples of minor-closed classes of graphs include graphsembeddable in a fixed surface, graphs with tree-width at most k for an integer k,graphs with tree-depth at most k and many others. Proper minor-closed classesof graphs are degenerate, i.e., for every proper minor-closed class G, there existsan integer k such that every graph G ∈ G is k-degenerate which means that Gand each of its subgraphs has a vertex of degree at most k.

One of the main results in the graph minor series of Robertson and Sey-mour [30] asserts that every minor-closed class G of graphs has a finite list of

Page 30: Graph-Theoretic Concepts in Computer Science

20 Z. Dvorak and D. Kral’

obstructions, i.e., there exist G1, . . . , Gk such that G ∈ G if and only if G doesnot contain any of the graphs G1, . . . , Gk as a minor (these graphs are also calledobstructions). E.g., the tree-width of a graph G is at most one if and only if Gdoes not contain K3 as a minor, and at most two if and only if G does not containK4 as a minor. The complete list containing four obstructions for graphs withtree-width at most three was given in [1]. A minor-closed class of graphs cancontain graphs with arbitrary big tree-width (planar graphs being an example),but it is known that the tree-width of graphs in a minor-closed class G of graphsis bounded if and only if one of the obstructions for G is planar [29].

2.2 Local Parameters

First order logic graph properties are of localized nature as we discuss in Subsec-tion 4.2. Because of this, graphs with locally restricted structure are importantfrom the algorithmic point of view: classes of graphs with locally bounded tree-width were introduced by Eppstein [12] (using somewhat different notation) andclasses of graphs locally excluding a minor were defined by Dawar, Grohe andKreutzer [6].

Before we define these graph classes, we need to recall several definitions. IfG is a graph and v is a vertex of G, then Nd(v) is the d-neighborhood of v, i.e.,the set of vertices of G at distance at most d from v. If A is a set of vertices of agraph G, then G[A] is the subgraph of G induced by A, i.e., the subgraph withvertex set A that contains all edges of G with both end-vertices from A.

We say that a class G of graphs has locally bounded tree-width if there existsa function f : N → N such that the tree-width of G[Nd(v)] is at most f(d) forevery graph G ∈ G, every vertex v of G and every d ≥ 1. Similarly, a class Gof graphs locally excludes a minor if there exists an infinite sequence of graphsH1, H2, . . . such that for every graph G ∈ G, every vertex v of G and every d ≥ 1,the graph G[Nd(v)] does not contain Hd as a minor.

Observe that every class of graphs with locally bounded tree-width locallyexcludes a minor. Similarly, every proper minor-closed class of graphs locallyexclude a minor. We later define other locally restricted graph classes.

2.3 Grad and Expansion

We now present the framework of classes of graphs with bounded expansion andclasses of nowhere-dense graph which was introduced by Nesetril and Ossona deMendez in [24]. An r-shallow minor of a graph G is a graph obtained from G byremoving some vertices and edges of G and contracting several vertex-disjointsubgraphs of radius at most r. Recall that the radius of a graph is the minimumr such that G = G[Nr(v)] for some vertex v of G, i.e., every vertex of G is atdistance at most r from v. If G is a class of graphs, then G � r is the class of allr-shallow minors of graphs contained in G.

The edge-density of a graph G is ||G||/|G|, i.e., the ratio of the number ofedges of G and the number of its vertices. The grad �r(G) with rank r (greatest

Page 31: Graph-Theoretic Concepts in Computer Science

Algorithms for Classes of Graphs with Bounded Expansion 21

reduced average density) of a graph G is the maximum edge-density of an r-shallow minor of G. Observe that if d ≥ 2�0(G), then a graph G is d-degenerate.A class G of graphs has bounded expansion if there exists a function f : N → N

such that �r(G) ≤ f(r) for every graph G ∈ G and every r ≥ 1.Let us give few examples of classes of graphs with bounded expansion. Since

every proper minor-closed class G of graphs is degenerate, the grads of all ranksof graphs contained in G are bounded by a constant. Hence, all proper minor-closed classes of graphs have bounded expansion. Another example of a classof graphs with bounded expansion are graphs with bounded maximum degree:if G has maximum degree Δ, then �r(G) ≤ Δ(Δ − 1)r/2. Hence, classes ofgraphs with bounded maximum degree have also bounded expansion. Anotherexample is the class of graphs that can be embedded to the plane in such a waythat each edge is crossed by at most one other edge; this class contains graphswith arbitrary large degrees and is not minor-closed. Other examples of classesof graphs with bounded expansion can be found in [27].

Analogously to already introduced definitions, a class G of graphs has lo-cally bounded expansion if there exists a function f : N × N → N such that�r(G[Nd(v)]) ≤ f(r, d) for every graph G ∈ G, every vertex v of G and anytwo integers r and d. It can be shown that every class G of graphs with locallybounded expansion has almost bounded expansion in the following sense: forevery ε > 0, there exist functions fr(n) : N → N such that fr(n) ∈ O(nε) forevery r = 0, 1, . . . and �r(G) ≤ fr(n) for every n-vertex graph G ∈ G.

This leads us to the definition of nowhere-dense graphs. If G is a class ofgraphs and f a real-valued function on the set of all graphs, then

lim supG∈G

f(G)

is the supremum of all reals α such that there exists an infinite sequence ofdistinct graphs G1, G2, . . . from G with α = limk→∞ f(Gk). The trichotomytheorem of Nesetril and Ossona de Mendez [24] asserts the following:

Theorem 1. For every infinite class G of graphs, the following holds:

limr→∞ lim sup

G∈G�r

log ||G||log |G| ∈ {0, 1, 2} . (1)

Let us give the proof of this (at the first sight very surprising) theorem since itgives more insight into the structure of classes of graphs achieving each of thevalues of the limit.

Proof. If there exists a constant C such that every graph in G has at most C

edges, then limk→∞log ||Gk||log |Gk| = 0 for every infinite sequence G1, G2, . . . of distinct

graphs from G � r (the number of vertices of the graphs Gi must grow to theinfinity but the number of their edges is bounded by C).

If there is no constant C bounding the number of edges of every graph in G,proceed as follows: choose G1 to be K2, clearly, K2 ∈ G � 0. If G1, G2, . . . , Gk

have already been fixed, choose Gk to be any graph of G � 0 containing more

Page 32: Graph-Theoretic Concepts in Computer Science

22 Z. Dvorak and D. Kral’

edges than Gk−1 and subject to this with the minimum number of vertices.Observe that |Gk| ≤ 2||Gk|| for every k (otherwise, Gk contains an isolatedvertex which contradicts our choice of Gk). It follows that

lim infk→∞

log ||Gk||log |Gk|| ≥ 1 .

Since G � 0 ⊆ G � 1 ⊆ · · ·, it follows that if the limit in (1) is not equal to zero,then the limit is at least one.

Assume now that the limit given in (1) is greater than 1 for G. Hence, thereexist r, ε > 0 and an infinite sequence of graphs G1, G2, . . . ∈ G � r such that||Gk|| ≥ |Gk|1+ε. We now apply the following result from [8, Lemma 3.13]: forevery ε > 0, there exist an integer d and δ > 0 such that every n-vertex graphwith average degree nε contains Knδ as a d-shallow minor. It follows that theclass G � rd contains complete graphs of arbitrary order and the limit (1) is atleast two. Since ||G|| ≤ |G|2/2 for every graph G, the limit in (1) is at most twoand the proof of the theorem is completed.

The classes G of graphs with the limit (1) equal to 0 or 1 are called classes ofnowhere-dense graphs. It follows that every class of graphs with locally boundedexpansion is a class of nowhere-dense graphs.

We finish this section with Figure 1 where the reader can find inclusionsbetween graph classes we have introduced in this section.

Star forests Path forests

Bounded tree-depth Outerplanar graphs

Bounded tree-width Planar graphsBounded degree

Bounded genus

Excluding a minor Locally bounded tree-width

Bounded expansion Locally excluding a minor

Locally bounded expansion

Nowhere dense

Fig. 1. Overview of inclusions between various graph classes

Page 33: Graph-Theoretic Concepts in Computer Science

Algorithms for Classes of Graphs with Bounded Expansion 23

3 Structural Properties

In this section, we will introduce the notion of fraternal augmentations of orien-tations of graphs as defined by Nesetril and Ossona de Mendez in [20]. Since allthe algorithms for classes of graphs with bounded expansion as well as classesof nowhere dense graphs are based on this notion, we decided to present it withfull detail. The proofs follow the lines of those given in [20].

3.1 Orientations with Small In-Degree

Every graph G admits an orientation with maximum in-degree at most �0(G).The purpose is to develop a technique of augmenting orientations with small in-degrees preserving the fact that the grads remain small. To achieve this, we willneed the following definition and lemma. Two vertices v and v′ of a digraph1 �Gare k-reachable for an integer k, if there exists a vertex w and oriented paths Pand P ′ from v and v′ to w of lengths � and �′, respectively, such that � + �′ ≤ k.The paths P and P ′ form an (�, �′)-wedge between v and v′.

We now state a key lemma for our further considerations.

Lemma 1. There exist polynomials Pk(x, y), k = 1, 2, . . ., with the followingproperties. Let G be a graph and �G an orientation of G with maximum in-degreeΔ−. If Hk is the graph with the vertex set of G and two vertices adjacent if theyare k-reachable, then

�0(Hk) ≤ Pk(Δ−,�k−1(G)) .

Proof. The proof proceeds by induction on k. If k = 1, then the graphs H1 andG are the same (observe that two vertices are 1-reachable if and only if they areadjacent in �G). Hence, �0(H1) = �0(G) and we can set P1(x, y) = y.

Assume now that k > 1. Consider a proper vertex coloring of Hk−1 with2Pk−1(Δ−,�k−2(G)) + 1 colors (the existence of this coloring follows from thefact that Hk−1 is 2Pk−1(Δ−,�k−2(G))-degenerate). Color now the arcs uv of�G with pairs [α, β] of colors where α is the color of v and the color β is chosenin such a way that no two arcs coming to the same vertex have the same color.Since Δ− choices of colors β suffice at each vertex, the arcs of �G can be coloredwith at most (2Pk−1(Δ−,�k−2(G)) + 1)Δ− colors. Let K be this number ofcolors.

A type of an (�, �′)-wedge formed by paths P and P ′ of lengths � and �′ is thepair of two sequences of lengths � and �′ formed by the colors of the arcs of Pand P ′, respectively. Fix two integers � and �′ such that �+�′ = k and 0 < � ≤ �′.Observe that the type of any (�, �′)-wedge contains mutually distinct colors sincethe vertices with incoming arcs in an (�, �′)-wedge have mutually distinct colors(they are (k − 1)-reachable).

1 We allow digraphs to have parallel arcs oriented in the opposite way. If we want toexclude parallel arcs, we will say that a digraph is simple.

Page 34: Graph-Theoretic Concepts in Computer Science

24 Z. Dvorak and D. Kral’

Fix now two sequences σ and σ′ of arc colors with lengths � and �′ such that�G contains an (�, �′)-wedge of type [σ, σ′]. Let F be the set of all arcs containedin an oriented path whose arcs are colored with the colors as in σ (respectingthe order of the colors) and F ′ the set of all arcs contained in an oriented pathwhose arcs are colored as in σ′. Finally, F ′′ is the set of the arcs of F ′ that donot have the last color of σ′.

Now consider two paths P and Q of lengths � with arc colors as in σ. Sincethe colors of all the �+1 vertices of P are mutually distinct as well as the colorsof the � + 1 vertices of Q and no vertex has two incoming arcs with the samecolor, P and Q are either vertex-disjoint or P ∩Q is the initial sequence of boththe paths. Hence, the arcs of F form (vertex-disjoint) out-branchings of depth �

in �G. The analogous reasoning also applies to F ′ and thus the arcs of F ′ formout-branchings of depth �′.

Consider now two paths P and P ′ of lengths � and �′ with arc colors as inσ and σ′, respectively. Since only the pair of the first vertices of P and P ′ orthe pair of last vertices (or both these pairs) can have the same color, either Pand P ′ are vertex-disjoint, or they share their first vertices, or they share theirlast vertices, or they share both their first and last vertices. Hence, F ∪F ′′ formout-branchings rooted at their original vertices.

Let �G′ be the graph obtained from �G by removing vertices not incident witharcs of F ∪F ′′ and contracting the out-branchings of F ∪F ′′. Since every leaf ofany out-branching of F ∪ F ′′ is at distance at most max{�, �′ − 1} ≤ k − 1, thegraph �G′ is a (k − 1)-shallow minor of G (after disregarding the orientations ofits arcs). If v and v′ are k-reachable because of an (�, �′)-wedge of type [σ, σ′],then v and v′ are roots of out-branchings in F ∪ F ′′ and they are adjacent aftercontracting these out-branchings (through the arc with the last color in σ′). Weconclude that the edges between vertices v and v′ that are k-reachable becauseof an (�, �′)-wedge of type [σ, σ′] can be oriented in such a way that the in-degreeof any vertex is at most �k−1(G).

Ranging through all choices of � + �′ = k with � > 0 and �′ > 0 and allchoices of σ and σ′, we obtain an upper bound of 2(k − 1)Kk �k−1 (G) on thenumber of incoming arcs added to Hk. If � = 0 and �′ = k, then we just orientthe new edges based on the direction of the paths they correspond to whichincreases the in-degree of each vertex by at most (Δ−)k. Taking into accountthe edges present in Hk−1, we obtain that Hk has an orientation of its edgeswith maximum in-degree at most

�0(Hk−1) + (Δ−)k + 2(k − 1)Kk �k−1 (G)

which is bounded by

2(k − 1)((2Pk−1(Δ−,�k−1(G)) + 2)(Δ− + 1))k �k−1 (G) .

The sought polynomial Pk(x, y) can be set to be equal to 4(k− 1)((Pk−1(x, y)+1)(x + 1))ky.

Page 35: Graph-Theoretic Concepts in Computer Science

Algorithms for Classes of Graphs with Bounded Expansion 25

We now define a crucial notion of transitive fraternal augmentations. If �G isa simple digraph, then the transitive fraternal augmentation of �G is a simpledigraph obtained from �G by adding the following arcs:

1. transitive arcs: if uv and vw are arcs of �G, then the arc uw is added unless�G already contains the arc uw or the arc wu.

2. fraternal arcs: if uv and u′v are arcs of �G, then the arc uu′ or the arc u′uis added unless �G already contains the arc uu′ or the arc u′u.

Our aim is to add fraternal arcs (where it is possible to make a choice whicharc to add) in such a way that the maximum in-degree of �G does not increasesignificantly. To choose the fraternal arcs, we can apply Lemma 1. However, wewould like to iterate the process and thus we need to have a bound on gradsof the transitive fraternal augmentation. Such a bound is given in the followingtheorem from [20]:

Theorem 2. There exists polynomial Q1(x, y), Q2(x, y), . . . with the followingproperties. Let G be a graph and �G an orientation of G with maximum in-degree Δ−. If H is the graph containing all the edges of the transitive fraternalaugmentation of �G, then the following holds for every r ≥ 1:

�r(H) ≤ Qr(Δ−,�2r+1(G))

Proof. Let V1, . . . , Vn be subsets of vertices of H such that the radius of H [Vi]is at most r for every i = 1, . . . , n. Let vi be the center of H [Vi]. Consider theshortest distance tree Ti in H [Vi] rooted at vi and orient the edges of Ti in thedirection from vi. We now modify the simple digraph �G in another digraph �G′

which need not be simple. If the arc uw of Ti corresponds to an edge of G,add the arc uw to �G. If the arc uw is a transitive edge corresponding to arcswv and vu, add the arc vw. If the arc uw is a transitive edge corresponding toarcs uv and vw, no action is required. Finally, if the arc uw is a fraternal edgecorresponding to arcs uv and wv, add arcs uv and vw.

Observe that the maximum in-degree of �G′ is at most 2Δ−+1: if an arc leadingto v is added because of an arc uw of some Ti, then both u and w are in thesame Vi and uv or wv is an arc of �G. Since the sets Vi are disjoint, at most Δ−

arcs leading to v can be added. The extra one in the estimate corresponds to anarc added because of the tree containing v.

If the subgraphs H [Vi] and H [Vj ] are joined by an edge in H , then vi and vj

are 2(r +1)-reachable in �G′. In particular, the subgraph H ′ obtained from H byremoving the vertices not contained in V1∪· · ·∪Vn and contracting the subgraphsH [Vi] is a subgraph of the graph H2r+2 as defined in Lemma 1. Consequently,�0(H ′) ≤ P2r+2)(2Δ−,�2r+1(G)) and thus �r(H) ≤ P2(r+1)(2Δ−,�2r+1(G)).

Theorem 2 guarantees us that there is a choice of fraternal arcs to be addedsuch that the maximum in-degree of the transitive fraternal augmentation of �Gis at most (Δ−)2 + 2Q0(Δ−,�1(G)). Moreover, since the grads of the transitivefraternal augmentations are bounded by polynomials in Δ− and grads of G,

Page 36: Graph-Theoretic Concepts in Computer Science

26 Z. Dvorak and D. Kral’

the process can be iterated. In particular, we obtain the following corollaries.Note that since the existence of an orientation with small maximum in-degreeis guaranteed by the fact that the grad with rank 0 is bounded, we can use agreedy algorithm to construct it.

Corollary 1. Let G be a class of graphs with bounded expansion. There existΔ0, Δ1, . . . such that every graph G ∈ G has an orientation �G0 with maximumin-degree Δ0 and �Gi has a transitive fraternal augmentation �Gi+1 with maximumin-degree Δi+1 for every i ≥ 0. Moreover, for every i, �Gi can be computed intime linear in the number of vertices of G.

Corollary 2. Let G be a class of nowhere dense graphs. For every ε > 0, thereexist functions fi : N→ N, i = 0, 1, . . ., fi(n) ∈ O(nε), such that every n-vertexgraph G ∈ G has an orientation �G0 with maximum in-degree f0(n) and �Gi hasa transitive fraternal augmentation �Gi+1 with maximum in-degree fi+1(n) forevery i ≥ 0. Moreover, for every i, �Gi can be computed in time O(n1+ε) in thenumber of vertices of G.

3.2 Low Tree-Width and Low-Tree-Depth Coloring

We now mention one structural result on a special type of vertex colorings ofgraphs which is important for algorithmic applications and is of independentinterest. In [7], DeVos et al. established the existence of low tree-width colorwith bounded number of colors for proper minor-closed classes of graphs:

Theorem 3. Let G be a proper minor-closed class of graphs. For every k, thereexists K such that every graph G ∈ G has a vertex coloring with K colors suchthat any k′ color classes, 1 ≤ k′ ≤ k, induce a subgraph of G with tree-width atmost k′ − 1.

Theorem 3 was strengthened by Nesetril and Ossona de Mendez in [20] in twodirections: first, the result holds for more general graph classes and second itguarantees the existence of low tree-depth colorings.

Theorem 4. Let G be a class of graphs with bounded expansion. For every k,there exists K such that ever graph G ∈ G has a vertex coloring with K colorssuch that any k′ color classes, 1 ≤ k′ ≤ k, induce a subgraph of G with tree-depthat most k′. Moreover, such a coloring can be constructed in linear time for anygraph G from G.Theorem 4 is implied by the following lemma; we provide its short proof forcompleteness.

Lemma 2. For every p ≥ 1 and d ≥ 1, the following holds: if �G0 is an ori-entation of G, �G1, �G2, . . . a series of its transitive fraternal augmentations andH a connected subgraph of G with tree-depth at most d, then �G3pd[V (H)] eithercontains a clique of order p or an out-branching T of depth at most p such that

Page 37: Graph-Theoretic Concepts in Computer Science

Algorithms for Classes of Graphs with Bounded Expansion 27

1. the end-vertices of every edge of H are joined by a directed path in T , and2. if two vertices u and u′ are joined by a directed path in T , then �G3pd[V (H)]

contains the arc uu′ or the arc u′u.

Proof. Fix p and let the proof proceed by induction on d. If d = 1, H is a singlevertex and the claim clearly holds. Assume that d > 1 and let v be a vertexof H such that the tree-depth of each component of H \ v is at most d − 1.Let V1, . . . , Vk be the vertex sets of the components of H \ v. By induction,�G3pd−3p[Vi] either contains a clique of order p or an out-branching Ti such thatany edge of G[Vi] joins a vertex with one of its ancestors and directed paths in Ti

give rise to arcs in �G3pd−3p[Vi]. If �G3pd−3p[Vi] for some i contains a clique of orderp, then so does �G3pd[V (H)]. Hence, we assume the existence of out-branchingsTi for all i = 1, . . . , k.

Let ri be the root vertex of Ti, i = 1, . . . , k. We claim that ri and v are adjacentin �G3pd−2p−1: since H is connected, v is adjacent to one of the descendants of ri

in Ti, say w. Let riw1 . . . w� be the oriented path in Ti from ri to w = w�. Sincethe depth of Ti is at most p, � ≤ p− 1. Applying the transitive or the fraternalrule (depending on the orientation of the arc between v and w�), we obtain that�G3pd−3p+1[Vi] contains an arc between v and w�−1. Repeating the argument,we get that the vertices v and ri are adjacent in �G3pd−3p+p−1[Vi] = �G3pd−2p−1.Observe that we have actually proven that if v is adjacent to a vertex u of anout-branching Ti in �G3pd−3p, then v is adjacent in �G3pd−2p−1 to all the verticeson the path from ri to u.

Let q be the first index such that the in-degree of v is the same in �G3pd−2p−1+q

and �G3pd−2p−1+q+1. If q ≥ p, then the in-degree of v in �G3pd−2p−1+p is at leastp and thus �G3pd−p contains a clique of order p (on the in-neighbors of v in�G3pd−p−1). Consequently, �G3pd[V (H)] contains a clique of order p. Hence, wecan assume that q ≤ p− 1.

Let W be the set of vertices w of H such that �G3pd−2p−1+q contains the arcwv and all the vertices on the path from the ri to w in the out-branching Ti

containing w are in-neighbors of v. Since �G3pd−2p+q contains an arc between anytwo vertices of W by the fraternity rule, �G3pd−2p+q[W ∪{v}] contains a directedHamilton path, say w1, . . . , w�. Observe that w� = v because of the choice of W .

Let T ′1, . . . , T′k′ be the out-branchings obtained from Ti by removing the ver-

tices contained in W and let r′1, . . . , r′k′ be their roots. Consider now the out-branching T in �G3pd−2p+q formed by the path w1 . . . w�, the out-branchingsT ′1, . . . , T

′k′ and the arcs wir

′j for j = 1, . . . , k′ where i is the maximum index

such that �G3pd−2p+q contains the arc wir′j . Such an index i must exist since either

r′j is a root of one of the out-branchings T1, . . . , Tk and thus �G3pd−2p+q containsthe arc w�r

′j or W contains the in-neighbor of r′j in one of the out-branchings

T1, . . . , Tk. Hence, T is an out-branching contained in �G3pd−2p+q.We now verify that the end-vertices of every edge uu′ of H are joined by a

directed path in T . If u = v, then either u′ ∈ W (and thus the existence ofthe path follows) or u′ is contained in one of the out-branchings T ′1, . . . , T

′k′ , say

Page 38: Graph-Theoretic Concepts in Computer Science

28 Z. Dvorak and D. Kral’

T ′j. Since r′j �∈ W , T contains the arc vr′j (here, we use that all the verticesbetween the root of Ti and a vertex of Ti adjacent to v are also adjacent to v in�G3pd−2p−1 ⊆ �G3pd−2p+q). The case u′ = v is symmetric and thus we can assumethat neither u nor u′ is v.

If neither u nor u′ is contained in W , then, by induction, they are contained inthe same out-branching T ′j and are joined by a directed path in T . If both u andu′ are contained in W , then they are clearly joined by a directed path in T sincethey are both contained in the path w1 . . . w�. It remains to consider the casewhen u ∈W and u′ �∈W . Let m the index such that wm = u. Since u and u′ areadjacent in G, they are contained in the same out-branching Ti. Further assumethat u′ is contained in an out-branching T ′j . By induction, �G3pd−3p containseither the arc ur′j or the arc r′ju. If the arc ur′j is present in �G3pd−3p, then r′j isadjacent to a vertex wm′ with m′ ≥ m in T . If the arc r′ju is present in �G3pd−3p,then �G3pd−2p+q contains an arc between r′j and v since �G3pd−2p−1+q containsthe arc uv. If �G3pd−2p+q contained the arc r′jv, the choice of q would imply that�G3pd−2p−1+q also contained the arc r′jv which would imply that r′j should havebeen included in W . Otherwise, �G3pd−2p+q contains the arc vr′j , thus the arc vr′jis also contained in T and u and u′ are joined by a directed path in T .

We have shown that the out-branching T satisfies that any two end-verticesof an edge of H are joined by a directed path in T . Since q ≤ p − 1, T isan out-branching in �G3pd−p. We claim that if u0, . . . , um is a directed path in�G3pd−p, then the vertices u0, . . . , um form a clique in �G3pd−p+m. Proceed byinduction on m: if m = 1, there is nothing to prove. Otherwise, �G3pd−p+m−1

contains a clique on the vertices u1, . . . , um. By the fraternity or transitivityrule, �G3pd−p+m contains an arc between u0 and each of the vertices u1, . . . , um.Hence, the vertices u0, . . . , um form a clique in �G3pd−p+m. We conclude that ifthe depth of T is at least p, �G3pd[V (T )] = �G3pd[V (H)] contains a clique of orderp, and if the depth of T is less than p, then any two vertices joined by a directedpath in T are adjacent in �G3pd. The proof of the lemma is now finished.

4 Testing Graph Properties

In the final section of the paper, we want to focus on meta-algorithmic resultsfor classes of graphs with restricted structure. Let us remark that the results wepresent in this section readily translate to relational structures by consideringthe concept of Gaifman graph. If R is a relational structure with a domain D,then the Gaifman graph of R is the graph with vertex set D where two distinctelements x and y of D are joined by an edge if R contains a relation includingboth x and y. For instance, if a graph G is viewed as a binary relational structure,then the Gaifman graph of G is G itself. Graph concepts we have introducedtranslate to relational structures by considering corresponding Gaifman graphs;e.g., the class of relational structures has bounded expansion, if the class of theirGaifman graphs has bounded expansion. The results we present further also hold

Page 39: Graph-Theoretic Concepts in Computer Science

Algorithms for Classes of Graphs with Bounded Expansion 29

for corresponding classes of relational structures under the assumption that thevocabulary is finite, i.e., the number of different types of relations is finite.

4.1 Σ1-Properties

Analogously to Σ1-formulas, which are first-order formulas with existential quan-tifiers only, a Σ1-property is a property that can be described by Σ1-formula.The easiest problem of this kind is testing the existence of a subgraph. Epp-stein [10, 11] constructed a linear-time algorithm for deciding the existence ofa fixed subgraph for planar graphs. He then extended his algorithm to minor-closed classes of graphs with locally bounded tree-width [12]. All these resultswere generalized to classes of graphs with bounded expansion by Nesetril andOssona de Mendez in [21, 23]. In fact, they established a more general result ontesting arbitrary Σ1-properties:

Theorem 5. Let Φ be a Σ1-property and G a class of graphs with bounded ex-pansion. There exists a linear time algorithm deciding Φ for graphs G ∈ G.

The main idea of the algorithm is that if Φ holds for G ∈ G, then the witnessassignment to variables can use at most k colors where k is the number ofquantifiers of Φ. Hence, using Theorem 4, we can color vertices with K colors insuch a way that any k colors induce a graph with tree-depth at most k. Afterfinding the coloring (in linear time), the problem is reduced to deciding Φ for(Kk

)subgraphs of an input graph, each subgraph having tree-depth at most k

(which can be solved, e.g., using the classical Courcelle’s result mentioned at thebeginning of the paper).

Following the lines of the above reasoning, we can obtain an analogous resultsfor classes of nowhere-dense graphs, see [24] for further details. An algorithm isalmost linear, if for any ε > 0 which is part of the input of the algorithm, thealgorithm runs in time O(n1+ε) where n is the number of vertices of an inputgraph.

Theorem 6. Let Φ be a Σ1-property and G a class of nowhere dense graphs.There exists an almost linear time algorithm deciding Φ for graphs G ∈ G.

Let us now focus on a particular case of Σ1-properties, the existence of shortpaths between two vertices. Kowalik and Kurowski [17,18] designed a data struc-ture with linear build-up time and constant query time answering the existenceof a path of length at most d between two vertices of an input planar graph for afixed integer d. In fact, they approach readily generalize to classes of graphs withbounded expansion. Let us sketch the main idea of the algorithm: let G be aninput graph and consider the sequence of its transitive fraternal augmentations�G0, . . . , �Gd as defined in Corollary 1. If two vertices u and v are joined by a pathof length at most d, then they are either adjacent in �Gd or they have a com-mon in-neighbor in �Gd (this can easily be proved by induction on d). Since themaximum in-degree of �Gd is bounded, the existence of an edge joining the two

Page 40: Graph-Theoretic Concepts in Computer Science

30 Z. Dvorak and D. Kral’

vertices or the existence of their common in-neighbor can be done in constanttime.

The data structure can be dynamized using the result of Brodal and Fager-berg [4] on maintaining orientations with small in-degrees of degenerate graphs,see [16]. The arguments readily translate to a setting of classes of graphs withbounded expansion, see [9]:

Theorem 7. Let G be a class of graphs with bounded expansion and d a fixedinteger. There exists a dynamic data structure for answering the existence of apath of length at most d in a graph G ∈ G with the following parameters:

– the data structure can be built in linear time,– each query can be answered in constant time,– an edge can be added to the represented graph in time O(logd n) where n is

its number of vertices, and– an edge can be removed in constant time.

4.2 First-Order Properties

We now address the complexity of deciding general first-order properties, i.e.,those properties that can be described by formulas with quantifications overgraph vertices only (quantification over sets of vertices is not allowed). As exam-ples of first-order properties, we can mention deciding the existence of a dominat-ing set of a fixed size or the existence of a vertex cover of a fixed size. First-orderproperties can always be decided in polynomial time (with degree depending onthe property) but we are interested in fixed parameter results. The first resultin this direction is the result of Seese [31] that every first-order property canbe tested in linear time for any class of graphs with bounded maximum degree.The result is not that surprising after we realize that first-order properties areof very localized nature which is captured in the following classical result ofGaifman [15]:

Theorem 8. Every first-order formula Φ for graphs is equivalent for some r toa Boolean combination of formulas of the form

∃x1 · · · ∃xk

(∧i�=jdist(xi, xj) > 2r

∧∧i=1,...,kΦr(xi)

)

where each Φr(xi) is r-local with respect to xi, i.e., all quantifiers contained inΦr(xi) have domain restricted to the r-neighborhood of xi.

In the light of Theorem 8, deciding first-order properties for graphs with max-imum degree Δ decomposes into a linear number of finite problems (the r-neighborhood of each vertex contains at most Δ(Δ − 1)r−1 vertices) whoseBoolean combination yields the result on whether the formula is satisfied foran input graph.

Frick and Grohe [13, 14] extended this result by considering classes of graphswith locally bounded tree-width. They have shown that any first-order property

Page 41: Graph-Theoretic Concepts in Computer Science

Algorithms for Classes of Graphs with Bounded Expansion 31

can be decided in almost linear time for any class of graphs with locally boundedtree-width. In the particular case of planar graphs, they were able to obtaina linear time algorithm using a different covering algorithm. Their algorithmuses the following covering result of Peleg [28] which has applications in otheralgorithms in the area and thus we would like to mention it explicitly.

Lemma 3. Let k ≥ 1 be a fixed integer. There is an algorithm that given r ≥ 1and a graph G, outputs sets A1, . . . , Am of vertices of G such that

– for every vertex v of G, there exists Ai containing the r-neighborhood of v,– every Ai is contained in the 2kr-neighborhood of a vertex of G, and– the sum |A1|+ · · ·+ |Am| is at most O(n1+1/k).

The running time of the algorithm is linear in the sum of the numbers of edgescontained in G[Ai], i = 1, . . . , k.

Another meta-theorem on graphs with locally restricted structure was obtainedby Dawar, Grohe and Kreutzer [6] who showed that deciding first-order prop-erties Φ is fixed-parameter tractable for classes of graphs locally excluding aminor, i.e., there exists a polynomial-time algorithm where the exponent doesnot depend on Φ. Nesetril and Ossona de Mendez [25] gave a linear time algo-rithm for deciding the existence of a dominating set of a fixed size for classesof graphs with bounded expansion. Their result indicates that the results wemention earlier could hold for classes of graphs with bounded expansion. Thisturns out to be true as proven by the authors and Thomas in [9]:

Theorem 9. Let Φ be a first order formula and G a class of graphs with boundedexpansion. There exists a linear-time algorithm deciding Φ for graphs G ∈ G.Theorem 10. Let Φ be a first order formula and G a class of nowhere densegraphs. There exists an almost linear time algorithm deciding Φ for graphs G ∈ G.

References

1. Arnborg, S., Proskurowski, A., Corneil, D.G.: Forbidden minors characterizationof partial 3-trees. Discrete Math. 80, 1–19 (1990)

2. Bodlaender, H.L., Deogun, J.S., Jansen, K., Kloks, T., Kratsch, D., Muller, H.,Tuza, Z.: Ranking of graphs. In: Mayr, E.W., Schmidt, G., Tinhofer, G. (eds.) WG1994. LNCS, vol. 903, pp. 292–304. Springer, Heidelberg (1995)

3. Bodlaender, H.L., Gilbert, J.R., Hafsteinsson, H., Kloks, T.: Approximatingtreewidth, pathwidth, frontsize and shortest elimination tree. J. Algorithms 25,1305–1317 (1996)

4. Brodal, G.S., Fagelberg, R.: Dynamic representations of sparse graphs. In: Dehne,F., Gupta, A., Sack, J.-R., Tamassia, R. (eds.) WADS 1999. LNCS, vol. 1663, pp.342–351. Springer, Heidelberg (1999)

5. Courcelle, B.: The monadic second-order logic of graph I. Recognizable sets of finitegraphs. Inform. and Comput. 85, 12–75 (1990)

6. Dawar, A., Grohe, M., Kreutzer, S.: Locally excluding a minor. In: Proc. LICS2007, pp. 270–279. IEEE Computer Society Press, Los Alamitos (2007)

Page 42: Graph-Theoretic Concepts in Computer Science

32 Z. Dvorak and D. Kral’

7. DeVos, M., Ding, G., Oporowski, B., Sanders, D.P., Reed, B., Seymour, P.D.,Vertigan, D.: Excluding any graph as a minor allows a low tree-width 2-coloring.J. Combin. Theory Ser. B 91, 25–41 (2004)

8. Dvorak, Z.: Assymptotical structure of combinatorial objects, PhD thesis, CharlesUniversity (2007)

9. Dvorak, Z., Kral’, D., Thomas, R.: Deciding first order properties for nowheredense graphs (manuscript) (2009)

10. Eppstein, D.: Subgraph isomorphism in planar graphs and related problems. In:Proc. SODA 1995, pp. 632–640. ACM&SIAM (1995)

11. Eppstein, D.: Subgraph isomorphism in planar graphs and related problems.J. Graph Algorithms Appl. 3, 1–27 (1999)

12. Eppstein, D.: Diameter and treewidth in minor-closed graph families. Algorith-mica 27, 275–291 (2000)

13. Frick, M., Grohe, M.: Deciding first-order properties of locally tree-decomposablestructures. In: Wiedermann, J., Van Emde Boas, P., Nielsen, M. (eds.) ICALP1999. LNCS, vol. 1644, pp. 331–340. Springer, Heidelberg (1999)

14. Frick, M., Grohe, M.: Deciding first-order properties of locally tree-decomposablestructures. J. ACM 48, 1184–1206 (2001)

15. Gaifman, H.: On local and non-local properties. In: Proc. Herbrand Symp. LogicColloq. North-Holland, Amsterdam (1982)

16. Kowalik, L.: Adjacency queries in dynamic sparse graphs. Inf. Process. Lett. 102,191–195 (2007)

17. Kowalik, L., Kurowski, M.: Oracles for bounded-length shortest paths in planargraphs. ACM Trans. Algorithms 2, 335–363 (2006)

18. Kowalik, L., Kurowski, M.: Short path queries in planar graphs in constant time.In: Proc. STOC 2003, pp. 143–148 (2003)

19. Nesetril, J., Ossona de Mendez, P.: First order properties of nowhere dense struc-tures (manuscript) (2008)

20. Nesetril, J., Ossona de Mendez, P.: Grad and classes with bounded expansionI. Decompositions. European J. Combin. 29, 760–776 (2008)

21. Nesetril, J., Ossona de Mendez, P.: Grad and classes with bounded expansion II.Algorithmic aspects. European J. Combin. 29, 777–791 (2008)

22. Nesetril, J., Ossona de Mendez, P.: Grad and classes with bounded expansionIII. Restricted graph homomorphism dualities. European J. Combin. 29, 1012–1024 (2008)

23. Nesetril, J., Ossona de Mendez, P.: Linear time low tree-width partitions and al-gorithmic consequences. In: Proc. STOC 2006, pp. 391–400 (2006)

24. Nesetril, J., Ossona de Mendez, P.: On nowhere dense graphs (manuscript) (2008)25. Nesetril, J., Ossona de Mendez, P.: Structural properties of sparse graphs

(manuscript) (2008)26. Nesetril, J., Ossona de Mendez, P.: Tree depth, subgraph coloring and homomor-

phism bounds. European J. Combin. 27, 1022–1041 (2006)27. Nesetril, J., Ossona de Mendez, P., Wood, D.: Characterizations and examples of

graph classes with bounded expansion (manuscript) (2008)28. Peleg, D.: Distance-dependent distributed directories. Info. Computa. 103, 270–298

(1993)29. Robertson, N., Seymour, P.D.: Graph minors V: Excluding a planar graph. J. Com-

bin. Theory Ser. B 41, 92–114 (1986)30. Robertson, N., Seymour, P.D.: Graph Minors XX. Wagner’s conjecture. J. Combin.

Theory Ser. B 92, 325–357 (2004)31. Seese, D.: Linear time computable problems and first-order descriptions.

Math. Structu. Comput. Sci. 6, 505–526 (1996)

Page 43: Graph-Theoretic Concepts in Computer Science

A Graph PolynomialArising from Community Structure

(Extended Abstract)

I. Averbouch1,�, J.A. Makowsky1,��, and P. Tittmann2

1 Department of Computer Science,Technion–Israel Institute of Technology, 32000 Haifa, Israel

2 Fachbereich Mathematik–Physik–InformatikHochschule Mittweida, Mittweida, Germany

Abstract. Inspired by the study of community structure in connectionnetworks, we introduce the graph polynomial Q (G;x, y), as a bivariategenerating function which counts the number of connected componentsin induced subgraphs. We analyze the features of the new polynomial.First, we re-define it as a subset expansion formula. Second, we give a re-cursive definition of Q (G;x, y) using vertex deletion, vertex contractionand deletion of a vertex together with its neighborhood, and prove a uni-versality property. We relate Q (G;x, y) to the universal edge eliminationpolynomial introduced by I. Averbouch, B. Godlin and J.A. Makowsky(2008), which subsumes other known graph invariants and graph polyno-mials, among them the Tutte polynomial, the independence and match-ing polynomials, and the bivariate extension of the chromatic polynomialintroduced by K. Dohmen, A. Ponitz, and P. Tittmann (2003). Finallywe show that the computation of Q (G; x, y) is �P-hard, but Fixed Pa-rameter Tractable for graphs of bounded tree-width and clique-width.

1 Introduction

1.1 Motivation: Community Structure in Networks

In the last decade stochastic social networks have been analyzed mathematicallyfrom various points of view. Understanding such networks sheds light on manyquestions arising in biology, epidemology, sociology and large computer networks.Researchers have concentrated particularly on a few properties that seem to becommon to many networks: the small-world property, power-law degree distribu-tions, and network transitivity. For a broad view on the structure and dynamicsof networks, see [30]. M. Girvan and M.E.J. Newman, [19], highlight another

� Partially supported by a grant of the Graduate School of the Technion–Israel Insti-tute of Technology.

�� Partially supported by a grant of the Fund for Promotion of Research of theTechnion–Israel Institute of Technology and grant ISF 1392/07 of the Israel Sci-ence Foundation (2007-2010).

C. Paul and M. Habib (Eds.): WG 2009, LNCS 5911, pp. 33–43, 2010.c© Springer-Verlag Berlin Heidelberg 2010

Page 44: Graph-Theoretic Concepts in Computer Science

34 I. Averbouch, J.A. Makowsky, and P. Tittmann

property that is found in many networks, the property of community structure,in which network nodes are joined together in tightly knit groups, between whichthere are only looser connections.

Motivated by [29], and the third author’s involvement in a project studyingsocial networks, we were led to study the graph parameter qij (G), the numberof vertex subsets X ⊆ V with i vertices such that G [X ] has exactly j compo-nents. qij (G), counts the number of degenerated communities which consist ofi members, and which split into j isolated subcommunities.

The ordinary bivariate generating function associated with qij (G) is the two-variable graph polynomial

Q (G; x, y) =n∑

i=0

n∑

j=0

qij (G) xiyj.

We call Q (G; x, y) the subgraph component polynomial of G. The coefficient ofyk in Q (G; x, y) is the ordinary generating function for the number of vertexsets that induce a subgraph of G with exactly k components.

1.2 Q(G; x, y) as a Graph Polynomial

There is an abundance of graph polynomials studied in the literature, and slowlythere is a framework emerging, [20,25,26], which allows to compare graph poly-nomials with respect to their ability to distinguish graphs, to encode other graphpolynomials or numeric graph invariants, and their computational complexity.In this paper we study the subgraph component polynomial Q (G; x, y) as agraph polynomial in its own right and explore its properties within this emerg-ing framework.

Like the bivariate Tutte polynomial, see [9, Chapter 10], the polynomialQ (G; x, y) has several remarkable properties. However, its distinguishing poweris quite different from the Tutte polynomial and other well studied polynomials.

Our main findings are 1:

– The Tutte polynomial satisfies a linear recurrence relation with respect to edgedeletion and edge contraction, and is universal in this respect. Q (G; x, y) alsosatisfies a linear recurrence relation, but with respect to three kinds of vertexelimination, and is universal in this respect. (Theorems 2 and 3).

– A graph polynomial in three indeterminates, ξ(G; x, y, z), which satisfies alinear recurrence relation with respect to three kinds of edge elimation, andwhich is universal in this respect, was introduced in [4,5]. It subsumes boththe Tutte polynomial and the matching polynomial. For line graph L(G) ofa graph G, we have Q (L(G); x, y) is a substitution instance of ξ(G; x, y, z)(Theorem 4).

– Distinguishing power of Q (G; x, y) is incomparable with that of the Tuttepolynomial, the characteristic polynomial and the bivariate chromatic poly-nomial introduced in [15] (Section 2).

1 More results regarding Q(G;x, y) are available in preprint [36].

Page 45: Graph-Theoretic Concepts in Computer Science

A Graph Polynomial Arising from Community Structure 35

– Also like for the Tutte polynomial, cf. [22], Q(G; x0, y0) has the DifficultPoint Property, i.e. it is �P-hard to compute for all fixed values of (x0, y0) ∈R

2 − E where E is a semi-algebraic set of lower dimension (Theorem 5).In [26] it is conjectured that the Difficult Point Property holds for a wideclass of graph polynomials, the graph polynomials definable in Monadic Sec-ond Order Logic. The conjecture has been verified for various special cases,[6,7,8].

– Q(G; x, y) is fixed parameter tractable in the sense of [16] when restrictedto graphs classes of bounded tree-width (Proposition 3) or even to classesof bounded clique-width (Proposition 4). For the Tutte polynomial, this isknown only for graph classes of bounded tree-width, [2,28,31].

2 Distinguishing Power

We denote by m(G; x) =∑

i mi(G)xi be the matching polynomial with mi(G)the number of i-matchings of G, by p(G; x) be the characteristic polynomial, byχ(G; x) the chromatic polynomial, by T (G; x, y) the Tutte polynomial, and byP (G; x, y) the bivariate chromatic polynomial introduced in [15].

Fig. 1. Distinguishing power of Q(G;x, y)

Proposition 1. For the graphs Gi; i = 1, . . . 6 from Figure 1, and for P4 andK1,3 we have

(1) p(G1; x) = p(G2; x) but Q(G1; x, y) �= Q(G2; x, y).(2) m(G3; x) = m(G4; x) but Q(G3; x, y) �= Q(G4; x, y).(3) P (G5; x, y) = P (G6; x, y) but Q(G5; x, y) �= Q(G6; x, y).(4) T (P4; x, y) = T (K1,3; x, y) but Q(P4; x, y) �= Q(K1,3; x, y).

Proposition 2. For the graphs G7 and G8 from Figure 1, we have: Q(G7; x, y)= Q(G8; x, y) but χ(G7; x) �= χ(G8; x)

Page 46: Graph-Theoretic Concepts in Computer Science

36 I. Averbouch, J.A. Makowsky, and P. Tittmann

Corollary 1. The distinguishing power of Q(G; x, y) is incomparable neitherwith that of the chromatic polynomial nor with that of any generalization ofthe chromatic polynomial discussed above (Tutte polynomial, bivariate chromaticpolynomial).

Problem 1. Are there simple graphs distinguished by p(G; x) or m(G; x), whichare not distinguished by Q(G; x, y)?

3 Subset Expansion and Definability in Logic

Q(G; x, y) was defined as a generating function. Let us rewrite the definition ofQ(G; x, y) in a slightly different way. Instead of summation over the number ofthe used vertices i, and the number of induced connected components j, we shallsum over all the possible subsets of vertices:

Q(G; x, y) =∑

A⊆V

x|A|yk(G[A]) =∑

A⊆V

(∏

v∈A

x

)⎛

⎝∏

u∈F (A)

y

⎠ . (1)

where k(G[A]) is the number of connected components of the subgraph of Ginduced by A.

This is a subset expansion formula, a term coined in [37]. The relationshipbetween recursive definitions of graph polynomials and the existence of subsetexpansion formulas has been studied from a logical point of view in [20]. Sub-set expansion formulas can often be used to show that a graph polynomial isdefinable in Monadic Second Order Logic, as studied in [23,26] . However, theexponent k(G[A]) in the left part of Equation (1) causes a problem. To remedythis, we use, like in [24], an auxiliary order ≺ over the vertices. Then we de-note by F (A) the subset of the smallest vertices in every respective connectedcomponent. Note that the result does not depend on the used auxiliary order.

Without having to go in the details of graph polynomials definable in MonadicSecond Order Logic2, Equation (1) shows that Q(G; x, y) is a graph polynomialdefinable in Monadic Second Order Logic for graphs G = (V, E) with universeV and a binary edge relation. Therefore all the theorems from [23,27] can beapplied. In particular, the Feferman-Vaught-type theorems from [23] guaranteeexistence of reduction formulas like multiplicativity from Theorem 1 not onlyfor the disjoint union or the join operation, but for a wide class of MSOL-definable operations. Also, a general theorem from [27] guarantees the existenceof recurrence formulas, for a wide class of recursively defined families of graphs,as studied also in [33]. Among these we have the wheels Wn, the ladders Ln andthe stars Starn. It should not be difficult to compute the recurrence relationsfor these explicitly.

We shall exploit MSOL-definability also for our complexity analysis in Sec-tion 6.2.2 The interested reader can consult [17] for the use Monadic Second Order Logic in

finite model theory, and [10] for its use in graph theory.

Page 47: Graph-Theoretic Concepts in Computer Science

A Graph Polynomial Arising from Community Structure 37

4 Recursive Definition and Universality

4.1 Recurrence Relation for Vertex Elimination

We turn now our attention to the investigation of properties of the subgraphpolynomial that support its computation.

Theorem 1 (Multiplicativity). Let G = G1 �G1 be the disjoint union of thegraphs G1 and G2. Then

Q(G; x, y) = Q(G1; x, y) ·Q(G2; x, y).

Theorem 2 (Recurrence relation). Let G = (V, E) be a graph and v ∈ V .Then the subgraph polynomial satisfies the decomposition formula

Q (G; x, y) = Q (G− v; x, y) + x (y − 1)Q (G−N [v] ; x, y) + xQ (G/v; x, y) ,

where three types of vertex elimination are used:

Fig. 2. Vertex elimination operations

Vertex deletion: For a given vertex v ∈ V (G), let G − v the graph obtainedfrom G by removal of v and all edges that are incident to v. We call thisoperation vertex deletion.

Vertex extraction: Similarly, let G − X be the graph obtained from G byremoval of all vertices of the set X ⊆ V . Let N (v) be the set of verticesthat are adjacent to v in G (the neighborhood of v). We denote by N [v] theclosed neighborhood of a vertex v in G, i.e. the set of all vertices adjacent tov including v itself. The operation G−N [v] is called vertex extraction.

Vertex contraction: A further special graph operation is needed here – thecontraction of a vertex. That is the graph G/v obtained from G by removalof v and insertion of edges between all pairs of non-adjacent neighbor verticesof v.

The proof is available in [36].

4.2 The Universality Property of Q (G; x, y)

The vertex decomposition formula represented in Theorem 2 can be considered asa vertex equivalent to the well-known edge decomposition (deletion-contraction

Page 48: Graph-Theoretic Concepts in Computer Science

38 I. Averbouch, J.A. Makowsky, and P. Tittmann

relations). Edge decomposition formulae of the form f (G) = α (e) f (G− e) +β (e) f (G/e) apply to the Tutte polynomial and derived graph invariants, for in-stance the number of spanning trees or the reliability polynomial. Indeed, it wasshown by J.G. Oxley and D.J.A. Welsh, [35], that the Tutte polynomial is in acertain sense universal, meaning that all other graph invariants that satisfy edgedecomposition formulae can be derived from the Tutte polynomial by substitutionof variables. A textbook presentation is given in [9]. A general framework analyz-ing universality properties of graph polynomials is studied in [20].

It seems natural to ask for the most general vertex decomposition formula.Let us assume that we try to construct an ordinary generating function f (G)that counts some type of vertex induced subgraphs with respect to the numberof vertices. Which properties should such a function have? If the subgraphs inquestion are composed from subgraphs of the components then we can expectmultiplicativity of f with respect to components of the graph. In order to assignthe value f (G) uniquely to a graph G by application of a decomposition formulaas given in Theorem 2, certain initial values for the null graph and the emptygraph have to be given. Therefore, we presuppose the following five propertiesof f :

(a) (Multiplicativity) If G1 and G2 are components of G then

f (G) = f (G1) f (G2) .

(b) (Recurrence relation) Let α, β, γ ∈ R and let v be a vertex of G, then

f (G) = αf (G− v) + βf (G−N [v]) + γf (G/v) . (2)

(c) (Initial condition) There exists δ ∈ R such that f (∅) = δ for the null graph∅ = (∅, ∅).

(d) (Initial condition) There exists ε ∈ R such that f (E1) = ε for a graphE1 = ({v} , ∅) consisting of one vertex.

(e) (Order invariance) The result of computing f has to be the same, irrespectiveof the order in which we apply the enabled computation steps, in particular,of the order of the vertices which we use to apply the relation (b).

In general we may choose α, β, γ, δ, ε from a field of characteristic zero or from aring. A graph invariant is proper if there are two graphs G1 and G2 with the samenumber of vertices such that f(G1) �= f(G2). In [36] it is proved that Q(G; x, y)is universal among polynomials recursively defined using vertex deletion, vertexextraction and vertex contraction. More precisely:

Theorem 3 (Universality of Q(G; x, y))

(1) For a graph polynomial f(G; α, β, γ, δ, ε) to be proper and well-defined byconditions (a)-(d) we have α = 1, δ = 1 and ε = 1 + β + γ.

(2) There is a unique proper graph polynomial U(G; β, γ) which is well-definedby conditions (a)-(d) and we have

Page 49: Graph-Theoretic Concepts in Computer Science

A Graph Polynomial Arising from Community Structure 39

Q(G; x, y) = U(G; x(y − 1), x) (3)

and

U(G; β, γ) = Q(G; γ,β

γ+ 1). (4)

5 Vertex Eliminations vs Edge Elimination

We have seen in Theorem 3 that Q(G; x, y) is universal among the polynomialsdefined recursively via deletion, extraction and contraction of vertices. In [4,5]the polynomial ξ(G; x, y, z) was shown to be universal among the polynomialsdefined recursively via deletion, extraction and contraction of edges. In this sec-tion we will show the connection of G(G; x, y) to the universal edge eliminationpolynomial ξ(G; x, y, z).

The polynomial ξ(G; x, y, z) generalizes both the Tutte and the matchingpolynomials, as well as the bivariate chromatic polynomial of [15]. We shall usethe recursive decomposition of ξ(G; x, y, z) from [5]:

ξ(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

ξ(∅) = 1 (5)

where G1 � G2 denotes the disjoint union of graphs G1 and G2, and the threeedge elimination operations are defined as follows:

Edge deletion: We denote by G − e the graph obtained from G by simplyremoving the edge e.

Edge extraction: We denote by G†e the graph induced by V \{u, v} providede = {u, v}. This operation removes also all the edges adjacent to e.

Edge contraction: We denote by G/e the graph obtained from G by unifyingthe endpoints of e.

Now we rewrite the decomposition of Q(G; x, y) using Theorem 2.

Q(G; x, y) = Q(G− v; x, y) + xQ(G/v; x, y) + x(y − 1)Q(G−N [v]; x, y)Q(G1 �G2; x, y) = Q(G1; x, y)Q(G2; x, y)Q(E1; x, y) = xy + 1Q(∅) = 1 (6)

Theorem 4. Let G = (V, E) be a graph. Let L(G) = (Ve, Ee) denote the linegraph of G. Then the following equation holds:

ξ(G; 1, x, x(y − 1)) = Q(L(G); x, y)

The proof is available in [36].

Problem 2. How does the distinguishing power of ξ(G; x, y, z) compare to thedistinguishing power of Q(G; x, y)?

Page 50: Graph-Theoretic Concepts in Computer Science

40 I. Averbouch, J.A. Makowsky, and P. Tittmann

6 Computational Complexity of Q(G; x, y)

6.1 Complexity of Evaluation

We deal with a problem of evaluation of Q(−; x, y) at a given point (x, y) ∈ Q2

for arbitrary input graph G.

Theorem 5. For every point (x, y) ∈ Q2, possibly except for the lines xy = 0,

y = 1, x = −1 and x = −2, the evaluation of Q(G; x, y) for an input graph G is�P-hard.

C.Hoffmann in [21] showed the following:

Theorem 6 (Hoffmann 2008). For every point (x, y, z) ∈ Q3, except possibly

for the subsets x = 0, z = −xy, (x, z) ∈ {(1, 0), (2, 0)} and y ∈ {−2,−1, 0}, theevaluation of ξ(−; x, y, z) for an input graph G is �P-hard.

Proof (Proof of Theorem 5:). We use Theorem 6 and our Theorem (4). Underthe conditions of Theorem (4), Hoffmann’s exception sets are mapped to the linesxy = 0, y = 1, x = −1 and x = −2. It follows that for every point (x, y) ∈ Q

2

that does not lay on one of those lines, the polynomial Q(−; x, y) is �P-hard toevaluate even for an input line graph L(G). �

The evaluation of Q(−; x, y) is polynomial time computable for xy = 0 and fory = 1. It remains open whether it is polynomial time computable for x = −1and x = −2. One can also ask, whether there is some point (x, y) ∈ Q

2, in whichQ(−; x, y) is hard to evaluate for general input graph, but easy for input linegraph.

6.2 Parameterized Complexity

Here we discuss the computational complexity of Q(G; x, y) for input graphs ofbounded tree with, and for input graphs for bounded clique width. We do notneed the exact definitions here. For background on tree-width the reader canconsult [14]. Clique-width was defined in [12]. Both are discussed in [23].

Recall that the subgraph component polynomial is definable using theMSOL-formalism (formula (1)) with auxiliary order, while the result is order-independent. Hense, using a general theorem from [23,24], we have

Proposition 3. Q(G; x, y) is polynomial time computable on graphs of tree-width at most k where the exponent of the run time is independent of k.

Moreover, applying the result of Courcelle, Makowsky and Rotics [11], combinedwith the results from [34], we have similar result for graphs of bouded cliquewidth:

Proposition 4. Q(G; x, y) is polynomial time computable on graphs of clique-width at most k where the exponent of the run time is independent of k.

Page 51: Graph-Theoretic Concepts in Computer Science

A Graph Polynomial Arising from Community Structure 41

The drawback of the general methods of [23,24] and [11], lies in the huge hid-den constants, which make it practically unusable. However, an explicit dynamicalgorithm for computing the polynomial Q(G; x, y) on graphs of bounded tree-width, given the tree decomposition of the graph, where the constants are simplyexponential in k, can be constructed along the same ideas as presented in [18,38].For the graphs of bounded clique width, given the clique decomposition of thegraph, we know an algorithm with constants doubly-exponential in k. It is openwhether an algorithm with constants simply exponential in k exists. For a com-parison of the complexity of computing graph polynomials on graphs classes ofbounded clique-width, cf. [28].

7 Conclusions and Open Problems

We have shown that Q(G; x, y) is a universal vertex elimination polynomial. Wehave looked at the graph polynomial Q(G; x, y) from various angles and com-pared its behaviour and distinguishing power with the characteristic polynomial,the matching polynomial the Tutte polynomial and the universal edge elimina-tion polynomial. We have not discussed the relationship of Q(G; x, y) to othergraph polynomials, such as the interlace polynomial, [1,3], or the many othergraph polynomials listed in [26].

We have seen that Q(G; x, y) distinguishes between graphs where these poly-nomials do not. For the chromatic polynomial and its generalizations we have alsoshown the opposite direction. We have not found cases where the matching andthe characteristic polynomials do distinguish between graphs where Q(G; x, y)does not. This is probably due to our lack of computerized tools for searching forsuch cases, cf. Problem 1. In Problem 2 we ask about comparing distinguishingpower of Q(G; x, y) and the universal edge elimination polynomial ξ(G; x, y, z).

References

1. Aigner, M., van der Holst, H.: Interlace polynomials. Linear Algebra and Applica-tions 377, 11–30 (2004)

2. Andrzejak, A.: Splitting formulas for Tutte polynomials. Journal of CombinatorialTheory, Series B 70(2), 346–366 (1997)

3. Arratia, R., Bollobas, B., Sorkin, G.B.: The interlace polynomial of a graph. Journalof Combinatorial Theory, Series B 92, 199–233 (2004)

4. Averbouch, I., Godlin, B., Makowsky, J.A.: The most general edge eliminationpolynomial (2007), http://uk.arxiv.org/pdf/0712.3112.pdf

5. Averbouch, I., Godlin, B., Makowsky, J.A.: An extension of the bivariate chromaticpolynomial (submitted) (2008)

6. Blaser, M., Dell, H.: Complexity of the cover polynomial. In: Arge, L., Cachin,C., Jurdzinski, T., Tarlecki, A. (eds.) ICALP 2007. LNCS, vol. 4596, pp. 801–812.Springer, Heidelberg (2007)

7. Blaser, M., Dell, H.: Complexity of the Bollobas-Riordan polynomia. exceptionalpoints and uniform reductions. In: Hirsch, E.A., Razborov, A.A., Semenov, A.,Slissenko, A. (eds.) Computer Science – Theory and Applications. LNCS, vol. 5010,pp. 86–98. Springer, Heidelberg (2008)

Page 52: Graph-Theoretic Concepts in Computer Science

42 I. Averbouch, J.A. Makowsky, and P. Tittmann

8. Blaser, M., Hoffmann, C.: On the complexity of the interlace polynomial. In:STACS, pp. 97–108 (2008)

9. Bollobas, B.: Modern Graph Theory. Springer, Heidelberg (1999)10. Courcelle, B.: Graph Structure and Monadic Second Order Logic. Cambridge Uni-

versity Press, Cambridge (in preparation)11. Courcelle, B., Makowsky, J.A., Rotics, U.: On the fixed parameter complexity

of graph enumeration problems definable in monadic second order logic. DiscreteApplied Mathematics 108(1-2), 23–52 (2001)

12. Courcelle, B., Olariu, S.: Upper bounds to the clique–width of graphs. DiscreteApplied Mathematics 101, 77–114 (2000)

13. de Mier, A., Noy, M.: On graphs determined by their Tutte polynomials. Graphsand Combinatorics 20(1), 105–119 (2004)

14. Diestel, R.: Graph Decompositions, A Study in Infinite Graph Theory. ClarendonPress, Oxford (1990)

15. Dohmen, K., Ponitz, A., Tittmann, P.: A new two-variable generalization of thechromatic polynomial. Discrete Mathematics and Theoretical Computer Science 6,69–90 (2003)

16. Downey, R.G., Fellows, M.F.: Parametrized Complexity. Springer, Heidelberg(1999)

17. Ebbinghaus, H., Flum, J.: Finite Model Theory. Springer, Heidelberg (1995)18. 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)

19. Girvan, M., Newman, M.E.J.: Community structure in social and biological net-works. Proc. Natl. Acad. Sci. USA 99, 7821–7826 (2002)

20. Godlin, B., Katz, E., Makowsky, J.A.: Graph polynomials:From recursive definitions to subset expansion formulas (2008),http://uk.arxiv.org/pdf/0812.1364.pdf

21. Hoffmann, C.: A most general edge elimination polynomial–thickening of edges.arXiv:0801.1600v1 [math.CO] (2008)

22. Jaeger, F., Vertigan, D.L., Welsh, D.J.A.: On the computational complexity of theJones and Tutte polynomials. Math. Proc. Camb. Phil. Soc. 108, 35–53 (1990)

23. Makowsky, J.A.: Algorithmic uses of the Feferman-Vaught theorem. Annals of Pureand Applied Logic 126(1-3), 159–213 (2004)

24. Makowsky, J.A.: Colored Tutte polynomials and Kauffman brackets on graphs ofbounded tree width. Disc. Appl. Math. 145(2), 276–290 (2005)

25. Makowsky, J.A.: From a zoo to a zoology: Descriptive complexity for graph poly-nomials. In: Beckmann, A., Berger, U., Lowe, B., Tucker, J.V. (eds.) CiE 2006.LNCS, vol. 3988, pp. 330–341. Springer, Heidelberg (2006)

26. Makowsky, J.A.: From a zoo to a zoology: Towards a general theory of graphpolynomials. Theory of Computing Systems 43, 542–562 (2008)

27. Makowsky, J.A., Fischer, E.: Linear recurrence relations for graph polynomials.In: Avron, A., Dershowitz, N., Rabinovich, A. (eds.) Pillars of Computer Science.LNCS, vol. 4800, pp. 266–279. Springer, Heidelberg (2008)

28. Makowsky, J.A., Rotics, U., Averbouch, I., Godlin, B.: Computing graph polyno-mials on graphs of bounded clique-width. In: Fomin, F.V. (ed.) WG 2006. LNCS,vol. 4271, pp. 191–204. Springer, Heidelberg (2006)

29. Newman, M.E.J.: Detecting community structure in networks. Eur. Phys. J.B. 38,321–330 (2004)

30. Newman, M.E.J., Barabasi, A.L., Watts, D.: The Structure and Dynamics of Net-works. Princeton University Press, Princeton (2006)

Page 53: Graph-Theoretic Concepts in Computer Science

A Graph Polynomial Arising from Community Structure 43

31. Noble, S.D.: Evaluating the Tutte polynomial for graphs of bounded tree-width.Combinatorics, Probability and Computing 7, 307–321 (1998)

32. Noy, M.: On graphs determined by polynomial invariants. TCS 307, 365–384 (2003)33. Noy, M., Ribo, A.: Recursively constructible families of graphs. Advances in Ap-

plied Mathematics 32, 350–363 (2004)34. Oum, S.: Approximating rank-width and clique-width quickly. In: Kratsch, D. (ed.)

WG 2005. LNCS, vol. 3787, pp. 49–58. Springer, Heidelberg (2005)35. 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. AcademicPress, London (1979)

36. Tittmann, P., Averbouch, I., Makowsky, J.A.: The Enumeration of Ver-tex Induced Subgraphs with Respect to the Number of Components (2009),http://uk.arxiv.org/pdf/0812.4147.pdf (To appear in the European Journalof Combinatorics, 2010)

37. Traldi, L.: A subset expansion of the coloured Tutte polynomial. Combinatorics,Probability and Computing 13, 269–275 (2004)

38. Traldi, L.: On the colored Tutte polynomial of a graph of bounded tree-width.Discrete Applied Mathematics 6, 1032–1036 (2006)

Page 54: Graph-Theoretic Concepts in Computer Science

Fast Exact Algorithms for Hamiltonicityin Claw-Free Graphs

Hajo Broersma1, Fedor V. Fomin2, Pim van ’t Hof1, and Daniel Paulusma1

1 Department of Computer Science, University of Durham,Science Laboratories, South Road, Durham DH1 3LE, England�

{hajo.broersma,pim.vanthof,daniel.paulusma}@durham.ac.uk2 Institutt for informatikk, Universitet i Bergen,

Postboks 7803, 5020 Bergen, [email protected]

Abstract. The Hamiltonian Cycle problem asks if an n-vertex graphG has a cycle passing through all vertices of G. This problem is a classicNP-complete problem. So far, finding an exact algorithm that solves it inO∗(αn) time for some constant α < 2 is a notorious open problem. Fora claw-free graph G, finding a hamiltonian cycle is equivalent to findinga closed trail (eulerian subgraph) that dominates the edges of some as-sociated graph H . Using this translation we obtain two exact algorithmsthat solve the Hamiltonian Cycle problem for the class of claw-freegraphs: one algorithm that uses O∗(1.6818n) time and exponential space,and one algorithm that uses O∗(1.8878n) time and polynomial space.

1 Introduction

In this paper we study the well-known NP-complete decision problem Hamil-

tonian Cycle (cf. [7]) that asks whether a graph G has a hamiltonian cycle,i.e., a cycle that passes through all vertices of G. The Hamiltonian Cycle

problem can be seen as a special case of the well-known Traveling Salesman

problem. The input of the latter problem is a complete graph together with anedge weighting. The goal is to find a hamiltonian cycle of minimum total weight.Held & Karp [11] present a classic dynamic programming algorithm that solvesthe Traveling Salesman problem in O∗(2n) time and O∗(2n) space for graphson n vertices. The O∗-notation indicates that we suppress factors of polynomialorder, and we use this notation throughout the paper. The slightly easier Hamil-

tonian Cycle problem can be solved using O∗(2n) time and polynomial space,as was shown by Karp [13] and independently by Bax [1]. It is a major andlong outstanding open problem if the Hamiltonian Cycle and the Travel-

ing Salesman problem can be solved in O∗(αn) time for some constant α < 2,even if the polynomial space restriction is dropped.

For some graph classes for which the Hamiltonian Cycle, and consequentlythe Traveling Salesman problem, remains NP-complete, faster algorithms

� This work has been supported by EPSRC (EP/D053633/1).

C. Paul and M. Habib (Eds.): WG 2009, LNCS 5911, pp. 44–53, 2010.c© Springer-Verlag Berlin Heidelberg 2010

Page 55: Graph-Theoretic Concepts in Computer Science

Fast Exact Algorithms for Hamiltonicity in Claw-Free Graphs 45

have been designed. For planar graphs, the Hamiltonian Cycle problem canbe solved in O∗(c√n) for some constant c (cf. [19]). The Traveling Salesman

problem can be solved inO∗(1.251n) time for cubic graphs [12] and inO∗(1.890n)time for graphs with maximum degree 4 [5]. Both algorithms use polynomialspace. For graphs with maximum degree 4, an algorithm with time complex-ity O∗(1.733n) is known [8], but this algorithm uses exponential space. Moregenerally, Bjorklund et al. [2] present an algorithm that solves the Traveling

Salesman problem in O∗((2−ε)n) for graphs with bounded degree, where ε > 0only depends on the maximum degree but not on the number of vertices. Theyshow that this bound can be improved further for regular triangle-free graphs.These algorithms use exponential space. They also present an O∗((2− ε)n) timealgorithm that uses polynomial space for bounded degree graphs in which theedges have bounded integer weights.

Our Results. We consider the class of claw-free graphs. This is a rich class con-taining, e.g., the class of line graphs and the class of complements of triangle-freegraphs. It is also an intensively studied graph class, both within structural graphtheory and within algorithmic graph theory; see [6] for a survey. The Hamilto-

nian Cycle problem is NP-complete for claw-free graphs; the authors of [14]show that the problem is already NP-complete for 3-connected cubic planarclaw-free graphs. We present two exact algorithms that solve the Hamiltonian

Cycle problem for claw-free graphs: our first algorithm uses O∗(1.6818n) timeand exponential space, and our second algorithm uses O∗(1.8878n) time andpolynomial space. Our techniques are based on a (known) transformation of theproblem to the problem of finding a dominating closed trail in a graph and a new,more careful study of such trails. Hence, these techniques are different from theones used in the already known algorithms, and as such may be of independentinterest.

Preliminaries. All graphs in this paper are finite, undirected and without mul-tiple edges and loops. For notation and terminology not defined in this paper werefer to [4]. Let G = (V (G), E(G)) be a graph. The neighborhood of a vertex v inG is denoted by NG(v) := {w ∈ V (G) | vw ∈ E}, and dG(v) = |NG(v)| denotesthe degree of v. A 2-factor of G is a spanning subgraph of G in which all verticeshave degree 2. The subgraph of G induced by some U ⊆ V is denoted by G[U ].

A graph is called triangle-free if it does not contain a subgraph isomor-phic to the cycle on three vertices. A graph is called claw-free if it has noinduced subgraph isomorphic to the claw, i.e., the four-vertex star K1,3 =({u, a, b, c}, {ua, ub, uc}). Let G be a claw-free graph. Then, for each vertex vof G, the set of neighbors of v in G induces a subgraph with at most two com-ponents. If this subgraph has two components, both of them must be cliques. Ifthe subgraph induced by NG(x) is connected but not complete, we can performan operation called local completion of G at x by adding edges joining all pairsof nonadjacent vertices in NG(x).

The line graph of a graph H with edges e1, . . . , ep is the graph L(H) with ver-tices u1, . . . , up such that there is an edge between any two vertices ui and uj if andonly if ei and ej share one end vertex in H . Note that L(K3) = L(K1,3) = K3;

Page 56: Graph-Theoretic Concepts in Computer Science

46 H. Broersma et al.

it is well-known that every connected line graph F �= K3 has a unique H withF = L(H) (see e.g. [9]). We call H the preimage graph of F . For K3 we let K1,3

be its preimage graph. A graph is called even if all its vertices have even degree.A graph is called a closed trail (or eulerian) if it is a connected even graph. Let Tbe a closed trail in a graph H . If V (H) \ V (T ) is an independent set in H , thenwe say that T is a dominating closed trail, abbreviated DCT. Note that the lattermeans that every edge of H has at least one vertex in T , so in this context “dom-inating” means “edge-dominating”. For any integer k ≥ 1, a graph H is calledk-degenerate if every non-empty subgraph of H has a vertex of degree at most k.We say that H is k-ordered if H allows a vertex ordering π = v1, . . . , v|V (H)| suchthat for 1 ≤ i ≤ |V (H)|, H [{v1, . . . , vi}] is connected and vi has at most k neigh-bors in H [{v1 . . . , vi}].Paper organization. In Section 2 we translate the Hamiltonian Cycle prob-lem for claw-free graphs into the problem of finding a dominating closed trailin triangle-free graphs. In Section 3 we show that every graph with a span-ning closed trail has a 2-degenerate 3-ordered spanning closed trail. We use thisstructural result in Section 4, where we present two exact algorithms for find-ing a dominating closed trail in a graph. Section 5 contains the conclusions andmentions some open problems.

2 The Two Exact Algorithms

Here we explain our two algorithms that solve the Hamiltonian Cycle problemfor a claw-free graph G on n vertices. For the first step we do not have to developany new theory or algorithms, but can rely on the beautiful existing machineryfrom the literature.

Step 1: restrict to the preimage graph H of the closure of G

We recursively repeat the local completion operation, as long as this is possible.This way we obtain the closure cl(G) of G. Ryjacek [17] showed that the closure ofG is uniquely determined, i.e., that the ordering in which one performs the localcompletions does not matter. This means we can obtain cl(G) in polynomialtime. Ryjacek [17] also showed that G is hamiltonian if and only if cl(G) ishamiltonian. Furthermore he showed that for any claw-free graph G there isa unique (triangle-free) graph H such that L(H) = cl(G). We can obtain thepreimage graph of a line graph in polynomial time (see e.g. [16]). Hence, we canefficiently compute the unique graph H with L(H) = cl(G).

Step 2: find a DCT of H

Harary and Nash-Williams [10] showed that the line graph of any connectedgraph with at least three vertices is hamiltonian if and only if the graph itselfcontains a DCT. This result combined with the results from the previous stepimplies that G has a hamiltonian cycle if and only if H has a DCT. In Section 4we present two exact algorithms for finding such a DCT in a graph with n

Page 57: Graph-Theoretic Concepts in Computer Science

Fast Exact Algorithms for Hamiltonicity in Claw-Free Graphs 47

edges: one algorithm that uses O∗(1.6818n) time and exponential space, and onealgorithm that uses O∗(1.8878n) time and polynomial space.

Step 3: translate the DCT of H back into a hamiltonian cycle of cl(G)

Suppose we have obtained a DCT T in Step 2. Then we construct a hamiltoniancycle of cl(G) by traversing T , picking up the edges (corresponding to verticesin cl(G)) one by one and inserting dominated edges as soon as an end vertex ofa dominated edge is encountered. For traversing T we use the polynomial-timealgorithm that finds a eulerian tour in an even connected graph (cf. [4]).

Step 4: translate the hamiltonian cycle in cl(G) to one in G

We can do this in polynomial time by using exactly the same method as describedin [3]. There, we show how to translate a 2-factor of cl(G) into a 2-factor of G.Since a hamiltonian cycle is a connected 2-factor we are done.

From the above it is clear that all steps except the third one can be performedin polynomial time. Hence, we have found the following.

Theorem 1. The Hamiltonian Cycle problem for a claw-free graph on nvertices can be solved in O∗(1.6818n) time, using exponential space. It can alsobe solved in O∗(1.8878n) time, using polynomial space.

3 Closed Trails of Low Degeneracy and Ordering

A cycle C of a connected graph H is called removable if the graph H − E(C)is connected and non-separating if H − V (C) is connected. The following usefulresult is due to Thomassen and Toft [18].

Theorem 2 ([18]). Any connected graph with minimum degree 3 has an inducednon-separating cycle.

Theorem 2 immediately yields the following result.

Corollary 1. Any connected graph with minimum degree 3 has a removablecycle.

Proof. Let H be a connected graph with minimum degree 3. By Theorem 2,H has an induced non-separating cycle C. Since H − V (C) is connected, allvertices of V (H) \ V (C) belong to the same component of H − E(C). SinceH has minimum degree 3 and C is an induced cycle, every vertex of C has aneighbor in V (H) \V (C). Hence H −E(C) is connected, so C is removable. ��

Using Corollary 1 we can prove the following theorem, which will help us toobtain the time complexity of the exact algorithms described in Section 4.

Theorem 3. Every graph with a spanning closed trail contains a 2-degenerate3-ordered spanning closed trail.

Page 58: Graph-Theoretic Concepts in Computer Science

48 H. Broersma et al.

Proof. We first show that every graph with a spanning closed trail contains a2-degenerate spanning closed trail. Let H∗ be a counterexample with |E(H∗)|minimum. Let T be a spanning closed trail in H∗. We repeatedly remove verticesfrom T with degree at most 2 in T as long as possible. Let T ′ be the subgraph ofT we obtain this way. Since H∗ is a counterexample, T ′ is not empty. Let T1 bea component of T ′. Since T ′ has minimum degree at least 3, T1 has a removablecycle C by Corollary 1. Then C is also a removable cycle of H∗, since H∗ is asupergraph of T1. This contradicts the minimality of |E(H∗)|.

So, every graph H with a spanning closed trail contains a 2-degenerate span-ning closed trail T . Suppose T is not 3-ordered. We repeatedly remove verticesfrom T with degree at most 3 in T until T becomes disconnected. Let T ′ be theresulting (connected) subgraph of T . Since T is not 3-ordered, T ′ is not empty.Let U consist of all vertices of degree at most 3 in T ′. By our procedure, everyvertex of U is a cut-vertex of T ′, and since T is 2-degenerate, U is nonempty. Letu ∈ U be such that T ′[V (T ′) \ {u}] contains a component D without vertices ofU . Then all vertices of D have degree at least 3, contradicting the 2-degeneracyof T . ��

4 Two Exact Algorithms for Finding a DCT

We present two exact algorithms for solving the following problem.

Dominating Closed Trail (DCT)

Instance: a connected graph H .Question: does H have a dominating closed trail?

To solve the DCT problem for an instance H , both algorithms start by branch-ing on vertices of low degree by the same branching procedure, explained inSection 4.1. This way both algorithms obtain a set of subproblems. Each sub-problem has the original graph H as input. However, for some subset of edgesof H it is already decided whether they will be included in or excluded fromthe dominating closed trail. Our first algorithm, described in Section 4.2, solveseach of the subproblems using dynamic programming. Our second algorithm, de-scribed in Section 4.3, solves each of the subproblems by guessing the remainingedges of a possible dominating closed trail.

4.1 Branching on Vertices of Low Degree

Let H = (V, E) be an instance of the DCT problem. We assign a so-called paritylabel �(v) ∈ {0, 1} to each vertex v of H . Note that if H has a dominating closedtrail T , then dT (v) is even for every v ∈ V . After all, a vertex is either not inT (i.e., dT (v) = 0, in which case all of its neighbors must be in T ), or a vertexhas an even number of incident edges in T (since T is a closed trail). Hence weinitially set �(v) = 0 for every v ∈ V .

The first stage of both algorithms consists of branching on vertices of degreeat most d∗, thus creating a number of subproblems; more specifically, d∗ = 4 for

Page 59: Graph-Theoretic Concepts in Computer Science

Fast Exact Algorithms for Hamiltonicity in Claw-Free Graphs 49

our first algorithm, and d∗ = 12 for our second algorithm. The choice of thesevalues of d∗ is explained in the next sections. During the branching process,the size of the graphs under consideration decreases, and we might change the�-labels of certain vertices.

Suppose v is a vertex of degree d ≤ d∗ in H . If �(v) = 0 (respectively�(v) = 1), then the algorithm branches into 2d−1 subproblems, each subproblemcorresponding to a possible way of choosing an even (respectively odd) number0 ≤ p ≤ d of edges incident with v that are guessed to be in the dominatingclosed trail. We call the chosen edges old trail edges. For each choice W of oldtrail edges, we perform the following two operations:

1. set �(w) := �(w) + 1 (mod 2) for every w with vw ∈W ;2. delete v and all its d incident edges.

Repeat this procedure as long as the remaining graph contains a vertex of degreeat most d∗. Let H ′ be the resulting graph. Then H ′ has minimum degree d∗+ 1and each vertex u ∈ V (H ′) has some label �(u) ∈ {0, 1}. Let E(H) = E(H ′) ∪R(H ′) ∪W (H ′), where W (H ′) contains all old trail edges and R(H ′) containsall other edges we removed from H . In the next stage, edges in W (H ′) will beassumed to be in the dominating closed trail we are looking for, whereas edges inR(H ′) will be assumed not to be in the dominating closed trail. Suppose R(H ′)contains an edge e = xy with x, y ∈ V (H) \ V (H ′) such that both x and yare not incident with any old trail edge. Then e will not be dominated by anyclosed trail that we might discover in the next stage. Hence, we discard thissubproblem. For the same reason, we also discard the subproblem if there is avertex v ∈ V (H)\V (H ′) incident with an odd number of old trail edges. If thesetwo cases do not occur, we keep the subproblem and call the tuple (H ′, W (H ′), �)a stage-2 tuple.

Lemma 1. The branching phase of the algorithm creates T (n1) = O∗(2 d∗−1d∗ n1).

stage-2 tuples, where n1 is the total number of edges deleted during this phase.

Proof. Since for a vertex v of degree d we remove d edges and create 2d−1

subgraphs, we find T (n1) = 2d−1 · T (n1 − d), which yields T (n1) = O∗(2 d−1d n1).

Since d ≤ d∗, we end up with O∗(2 d∗−1d∗ n1) stage-2 tuples. ��

We point out that the time complexity mentioned in Lemma 1 is O∗(1.6818n1)if d∗ = 4 and O∗(1.8878n1) if d∗ = 12.

4.2 An O∗(1.6818n) Time Algorithm That Uses Exponential Space

Let H = (V, E) be an input of the DCT problem. In case H has vertices of degreeat most 4, we apply the branching procedure described in Section 4.1. Supposethat during the branching process n1 edges were deleted (possibly n1 = 0). Then,by Lemma 1, O∗(1.6818n1) stage-2 tuples (H ′, W (H ′), �) have been created.Each of these stage-2 tuples will be processed using the dynamic programming

Page 60: Graph-Theoretic Concepts in Computer Science

50 H. Broersma et al.

procedure described below. If at least one of them leads to a dominating closedtrail of H , then the algorithm outputs Yes; the algorithm outputs No otherwise.

Let (H ′, W (H ′), �) be a stage-2 tuple. We write H ′ = (V ′, E′). We output Yes

if W (H ′) forms a dominating closed trail of H . If this is not the case, we enterthe dynamic programming phase. In this procedure, we consider each u ∈ V ′

and say that ({u}, �(u)) is an option if u ∈ V ′ is incident with at least one oldtrail edge. Otherwise ({u}, �(u)) is not an option. Furthermore, ({u}, �(u)) with�(u) = �(u) + 1 (mod 2) is not an option.

Suppose we know for all sets S ⊆ V ′ of size at most k and all labelings�′ : S → {0, 1} whether (S, �′) is an option or not. Then for each set S ⊆ V ′ ofsize k, for each vertex v ∈ V ′ \S, and for each {0, 1}-labeling �′ of S∪{v}, we doas follows. Let p be the number of old trail edges incident with v. We considerevery possible way of choosing 0 ≤ q ≤ 3 edges incident with v and a vertex inS. The chosen edges will be referred to as new trail edges. For each choice N ofnew trail edges, we set �′(x) := �′(x) + 1 (mod 2) for every x ∈ S with vx ∈ N .We perform the following three tests.

(1) Check if (S, �′) is an option.(2) Check if p + q is even if �′(v) = 0 and odd if �′(v) = 1.(3) If q = 0, check if there is a path from v to S in H only using old trail edges.

Only if tests (1), (2), (3) are all three affirmative, we say that (S ∪ {v}, �′) is anoption. If so, we also check whether

(4) each old trail edge allows a path to a vertex in S ∪ {v} that uses only oldtrail edges;

(5) each vertex x in S∪{v} has label �′(x) = 0 and each vertex y ∈ V ′\(S∪{v})incident with an old trail edge has label �(y) = 0;

(6) there is no edge e = ab in H ′ for some a, b ∈ V ′ \ (S ∪ {v}) such that botha and b are not incident with an old trail edge.

If the answers to tests (4), (5), (6) are all three affirmative, the algorithm con-cludes that H has a dominating closed trail (cf. Theorem 4) and returns Yes. Ifno Yes-answer has been returned and k < |V ′|, the algorithm considers all setsS ⊆ V ′ of size k + 1, all vertices v ∈ V ′ \ S and all {0, 1}-labelings �′ of S ∪ {v}.Otherwise, the algorithm outputs No.

Theorem 4 (Correctness). When run on a connected graph H, the algorithmreturns Yes if H has a dominating closed trail, and returns No otherwise.

Proof. Our algorithm only returns a Yes-answer if it has found a stage-2 tuple(H ′, W (H ′), �) with some option (S, �) for which tests (4), (5), (6) are all positive.In that case, let T be the subgraph of H consisting of all old trail edges in W (H ′)plus all new trail edges that have been added between vertices of S. The dynamicprogramming, together with tests (3) and (4), ensures that T is connected. Tests(1), (2) and (5) together with the definition of a stage-2 tuple ensure that T iseven, and (6) ensures that T is dominating. Hence, T is a dominating closedtrail.

Page 61: Graph-Theoretic Concepts in Computer Science

Fast Exact Algorithms for Hamiltonicity in Claw-Free Graphs 51

It remains to show that if H has a dominating closed trail, then the algorithmoutputs Yes. Suppose H has a dominating closed trail T . Due to Theorem 3we may assume that T is 3-ordered. We show that our algorithm finds T , unlessit finds another dominating closed trail of H first. Let V ′ consist of all verticesthat are not removed in the branching procedure, so V (H ′) = V ′ for the graphH ′ in every stage-2 tuple. Let T ′ be the subgraph of T with V (T ′) = V (T )∩V ′.Then there exists a stage-2 tuple (H ′, W (H ′), �) such that W (H ′) is exactly theset of edges of T that are incident with at least one vertex in V (T ) \ V ′, andsuch that �(v) = 0 if v ∈ V ′ \ V (T ′), and �(v) = 0 (respectively �(v) = 1) ifv ∈ V (T ′) and v is incident with an even (respectively odd) number of edges inW (H ′). Since our algorithm considers all possible stage-2 tuples, it will detecttuple (H ′, W (H ′), �). As T is 3-ordered, each component of T ′ is 3-ordered. Thismeans that our dynamic programming procedure based on the number of waysa vertex can be made adjacent to a set S with at most three edges will find alabeling �′ such that (Ti, �

′) is an option for each component Ti of T . As thesecomponents are connected to each other via old trail edges, at some moment(T ′, �) will be formed. Then tests (1)-(6) will all be successful and a Yes-answeris returned. ��Below we give the overall running time of our algorithm.

Theorem 5 (Running time). The algorithm runs in O∗(1.6818n) time.

Proof. We first prove that the dynamic programming procedure runs in O∗(3p)time on any p-vertex graph. Let H ′ = (V ′, E′) be a graph on p vertices. Thereare

(pk

)sets S ⊆ V ′ of cardinality k, each of those sets has 2k possible labelings

�, and there are(k0

)+

(k1

)+

(k2

)+

(k3

)= O(k3) ways to attach a new vertex v to

a subset of cardinality k by using at most 3 edges. Each of the tests (1)-(6) canbe done in polynomial time. Hence the time complexity of this procedure is

O∗( p∑

k=1

(p

k

)· 2k · O(k3)

)= O∗(3p).

Let H be an instance of the DCT problem having n edges. Suppose we repeat-edly branch on vertices of degree at most d∗ = 4, and suppose n1 is the numberof edges we delete during this branching phase. Then we obtain O∗(1.6818n1)stage-2 tuples by Lemma 1. Let (H ′, W (H ′), �) be such a stage-2 tuple, whereH ′ = (V ′, E′) is a graph of minimum degree 5 having n2 := n − n1 edgesand, say, p vertices. As shown above, the dynamic programming procedure usesO∗(3p) time. Since the minimum degree in H ′ is 5, we obtain n2 ≥ 5p/2,or equivalently p ≤ 2n2/5. Hence we can process each stage-2 tuple in timeO∗(3 2n2

5 ) = O∗(1.5519n2). This means that the overall running time of our al-gorithm on a graph H having n = n1 + n2 edges is

O∗(1.6818n1 · 1.5519n2) = O∗(1.6818n).

If we choose d∗ �= 4, then the above upper bound is no longer guaranteed. ��

Page 62: Graph-Theoretic Concepts in Computer Science

52 H. Broersma et al.

4.3 An O∗(1.8878n) Time Algorithm That Uses Polynomial Space

We describe our second algorithm in the proof of the following theorem.

Theorem 6. The DCT problem for a graph H on n edges can be solved inO∗(1.8878n) time, using polynomial space.

Proof. Let H be an instance of the DCT problem with n edges. We execute thebranching procedure described in Section 4.1, but this time we perform branchingon vertices of degree at most d∗ = 12. Suppose we delete n1 edges during thebranching process. By Lemma 1, this yields O∗(211n1/12) = O∗(1.8878n1) stage-2 tuples (H ′, W (H ′), �), where each graph H ′ has p vertices of minimum degree13 and n2 = n− n1 edges. Note that n2 ≥ 13p/2, or equivalently p ≤ 2n2/13.

If H has a dominating closed trail T , then T may be assumed to be 2-degenerate, due to Theorem 3. Let T ′ denote the (2-degenerate) subgraph ofT that remains after the branching procedure; note that T ′ is a subgraph ofsome graph H ′. A 2-degenerate graph on p vertices has at most 2p edges. Thismeans that we only have to check in every H ′ for every possible subset of edgesup to cardinality 2p whether this subset together with the old trail edges inW (H ′) forms a dominating closed trail of H . Using Sterling’s approximationn2! ≈ nn2

2 e−n2√

2πn2 and the fact p ≤ 2n2/13, the total number of checks canbe estimated as follows:

2p∑

k=1

(n2

k

)≤ 2p

(n2

2p

)≤ 2p

(n24n213

)= O∗

(( 1αα(1− α)1−α

)n2),

where α = 4/13, which leads to O∗(1.8539n2) checks. Since each of them can beperformed in polynomial time, the overall running time is

O∗(1.8878n1 · 1.8539n2) = O∗(1.8878n).

If we choose d∗ �= 12, then the above upper bound is no longer guaranteed. It isclear that this algorithm only needs polynomial space. ��

5 Conclusions

We presented two exact algorithms for the Hamiltonian Cycle problem. Canwe speed up these algorithms by making use of the triangle-freeness of the preim-age graph? Another (more) interesting open problem is whether we can solve theTraveling Salesman problem for claw-free graphs in O∗(αn) time for someconstant α < 2. This requires some new ideas as our current approach thattakes the closure of a graph and then makes a transformation to the domain oftriangle-free graphs does not suffice. Can we find an O∗(αn) time algorithm thatsolves the Hamiltonian Cycle problem for some constant α < 2 for the classof bipartite graphs, or equivalently (cf. [15]) for the class of split graphs, or asuperclass of split graphs such as the class of P5-free graphs? As the Hamilto-

nian Cycle problem is already NP-complete for chordal bipartite graphs [15],this question is interesting for that class as well. We can also try to design fastexact algorithms for superclasses of claw-free graphs such as K1,4-free graphs.

Page 63: Graph-Theoretic Concepts in Computer Science

Fast Exact Algorithms for Hamiltonicity in Claw-Free Graphs 53

References

1. Bax, E.T.: Inclusion and exclusion algorithm for the Hamiltonian path problem.Information Processing Letters 47, 203–207 (1993)

2. Bjorklund, A., Husfeldt, T., Kaski, P., Koivisto, M.: The travelling salesmanproblem in bounded degree graphs. In: Aceto, L., Damgard, I., Goldberg, L.A.,Halldorsson, M.M., Ingolfsdottir, A., Walukiewicz, I. (eds.) ICALP 2008, Part I.LNCS, vol. 5125, pp. 198–209. Springer, Heidelberg (2008)

3. Broersma, H.J., Paulusma, D.: Computing sharp 2-factors in claw-free graphs. In:Ochmanski, E., Tyszkiewicz, J. (eds.) MFCS 2008. LNCS, vol. 5162, pp. 193–204.Springer, Heidelberg (2008)

4. Diestel, R.: Graph Theory, 2nd edn. Graduate Texts in Mathematics, vol. 173.Springer, Heidelberg (2000)

5. Eppstein, D.: The traveling salesman problem for cubic graphs. Journal of GraphAlgorithms and Applications 11, 61–81 (2007)

6. Faudree, R., Flandrin, E., Ryjacek, Z.: Claw-free graphs—a survey. Discrete Math-ematics 164, 87–147 (1997)

7. Garey, M.R., Johnson, D.S.: Computers and Intractability. W.H. Freeman and Co.,New York (1979)

8. Gebauer, H.: On the number of hamilton cycles in bounded degree graphs. In: 4thWorkshop on Analytic and Combinatorics (ANALCO 2008), SIAM, Philadelphia(2008)

9. Harary, F.: Graph Theory. Addison-Wesley, Reading (1969)10. Harary, F., Nash-Williams, C.S.J.A.: On eulerian and hamiltonian graphs and line

graphs. Canadian Mathematical Bulletin 8, 701–709 (1965)11. Held, M., Karp, R.M.: A dynamic programming approach to sequencing problems.

Journal of SIAM 10, 196–210 (1962)12. Iwama, K., Nakashima, T.: An improved exact algorithm for cubic graph TSP. In:

Lin, G. (ed.) COCOON 2007. LNCS, vol. 4598, pp. 108–117. Springer, Heidelberg(2007)

13. Karp, R.M.: Dynamic programming meets the principle of inclusion and exclusion.Operations Research Letters 1, 49–51 (1982)

14. Li, M., Corneil, D.G., Mendelsohn, E.: Pancyclicity and NP-completeness in planargraphs. Discrete Applied Mathematics 98, 219–225 (2000)

15. Muller, H.: Hamiltonian circuits in chordal bipartite graphs. Discrete Mathemat-ics 156, 291–298 (1996)

16. Roussopoulos, N.D.: A max {m,n} algorithm for determining the graph H from itsline graph G. Information Processing Letters 2, 108–112 (1973)

17. Ryjacek, Z.: On a closure concept in claw-free graphs. Journal of CombinatorialTheory, series B 70, 217–224 (1997)

18. Thomassen, C., Toft, B.: Non-separating induced cycles in graphs. Journal of Com-binatorial Theory, Series B 31, 199–224 (1981)

19. Woeginger, G.J.: Open problems around exact algorithms. Discrete Applied Math-ematics 156, 397–405 (2008)

Page 64: Graph-Theoretic Concepts in Computer Science

Maximum Series-Parallel Subgraph

Gruia Calinescu1,�, Cristina G. Fernandes2,��, and Hemanshu Kaul3

1 Department of Computer Science, Illinois Institute of Technology, Chicago, IL60616, USA

[email protected] Department of Computer Science, University of Sao Paulo, Rua do Matao, 1010,

05508-090 Sao Paulo, [email protected]

3 Department of Applied Mathematics, Illinois Institute of Technology, Chicago, IL60616, [email protected]

Abstract. Consider the NP-hard problem of, given a simple graph G, tofind a series-parallel subgraph of G with the maximum number of edges.The algorithm that, given a connected graph G, outputs a spanning treeof G, is a 1

2-approximation. Indeed, if n is the number of vertices in G,

any spanning tree in G has n−1 edges and any series-parallel graph on nvertices has at most 2n−3 edges. We present a 7

12-approximation for this

problem and results showing the limits of our approach.

1 Introduction

The Maximum Series-Parallel Subgraph (MSP) problem is: given a simplegraph G, find a series-parallel subgraph of G with the maximum number ofedges. This problem is known to be NP-hard [3].

The algorithm that, given a connected graph G, outputs a spanning treeof G, is a 1/2 -approximation. Indeed, if n is the number of vertices in G, anyspanning tree in G has n−1 edges and any series-parallel graph on n verticeshas at most 2n−3 edges. We present a 7/12 -approximation for this problem.

We apply a method, previously used for the Maximum Planar Subgraph prob-lem [4], of producing a subgraph whose blocks (maximal 2-connected compo-nents) have a very simple structure. The way to produce such a subgraph alsohas similarities to some approximation algorithms for the Minimum Steiner Treeproblem [1,6].

A novelty of this work is that we allow blocks to have unbounded size. Indeed,using only blocks of bounded size does not lead to an improvement (as we showlater). This is a main difference to the works on Maximum Planar Subgraphand Minimum Steiner Tree [1,4,6]. A second difference, when compared to the

� Research supported in part by NSF grant CCF-0515088, and performed in part whileon sabbatical at University of Wisconsin Milwaukee.

�� Research supported in part by CNPq 312347/2006-5, 485671/2007-7, and486124/2007-0.

C. Paul and M. Habib (Eds.): WG 2009, LNCS 5911, pp. 54–65, 2010.c© Springer-Verlag Berlin Heidelberg 2010

Page 65: Graph-Theoretic Concepts in Computer Science

Maximum Series-Parallel Subgraph 55

Maximum Planar Subgraph algorithms, is that, to assure a good performance,our algorithm has to sometimes throw away or shrink previously selected blocks.We show ahead a family of examples that indicates that such an approach isnecessary.

We call spruces the very simple series-parallel graphs that we admit as non-bridge blocks in the subgraph we produce. (We define spruces in the next subsec-tion; a bridge consists of two adjacent vertices.) We prove that a subgraph whosenon-bridge blocks are spruces, and with maximum number of edges among suchsubgraphs, achieves a ratio of 2/3, and this ratio is tight. Unfortunately, com-puting such a subgraph is NP-hard, as we also show. So our algorithm in factcomputes only a large such subgraph. The ratio our algorithm achieves is 7/12,which happens to be the average between 1/2 and 2/3. This is a coincidencethough, because our analysis compares directly the algorithm’s output to anoptimal solution.

In a related work, Cai [2] considered the variant of the problem where oneis given a complete weighted graph, and wants to find a maximal series-parallelgraph of minimum weight. He presented a 1.655-approximation for this variantwhen the input graph is a set of points in the plane with their distances asweights.

1.1 Preliminaries

Two edges of a multigraph are parallel if they have the same endpoints, and theyare series edges if there is some vertex of degree two incident to both of them. Amultigraph is series-parallel if it arises from a forest by repeated replacing edgesby parallel or series edges [7].

All of our graphs are undirected and simple, unless otherwise specified. Fromthe definition above, one can see that a maximal series-parallel graph can beconstructed by the following procedure. Start with two adjacent vertices s and t,and then repeat the following: add one new vertex and make it adjacent to twoexisting adjacent vertices. (Such graphs are also called 2-trees in the literature,and series-parallel graphs are also known as partial 2-trees.)

Based on the construction above, a normalized tree decomposition of a max-imal series-parallel graph is built as follows (see Fig. 1 for an example). Startwith one node with bag {s, t}, the root of our tree decomposition. We maintainthe invariant that, for any edge of the series-parallel graph, there is exactly onenode in the tree decomposition whose bag consists of the endpoints of the edge.Whenever a vertex z is added to the series-parallel graph, and made adjacent toexisting adjacent vertices x and y, add to the tree decomposition three nodes:one with bag {x, y, z}, child of the node with bag {x, y}, and two “twin” chil-dren of this new node, with bags {x, z} and {y, z}. In this tree decomposition,all even-level nodes have bags of size two, all odd-level nodes have bags of sizethree, and no leaf is in an odd level. For a normalized tree decomposition Tof a maximal series-parallel graph H with |V (H)| = n, there are exactly n−2odd-level nodes in T .

Page 66: Graph-Theoretic Concepts in Computer Science

56 G. Calinescu, C.G. Fernandes, and H. Kaul

(a) (b)

s t

a

b

c

d

e

f

g

h

st

sat

sb

sbt

sa at bt

sca sda sea aft

sc sd se afca da ea ft

cga cha

cg chga ha

Fig. 1. (a) A maximal series-parallel graph, obtained by starting with the two adjacentvertices s and t, and then adding in order vertices a, b, c, d, e, f, g, h. (b) Its normalizedtree decomposition.

��������

��������

����������������

��������

������

������������

����

����

��

��������

��������

����

��������

����

����

����

����

��������

��������

��������

����������������

��������������������

��������

��������

����������������

����

��������

����

����

��������

������������������

(b)(a) u

v

wz

Fig. 2. (a) A graph with several spruces. (b) A connected spruce structure.

A spruce is a graph that has exactly two base vertices and at least one tipvertex, in which every tip vertex is adjacent to exactly the two base vertices.If the two base vertices are adjacent, the spruce is complete; otherwise it isincomplete. The gain of a spruce S is its cyclomatic number, and it is denotedgain(S); this is the number of tips for complete spruces, and one less than thenumber of tips for incomplete spruces.

Fig. 2(a) depicts in solid lines a complete spruce with base vertices z and w,and six tip vertices including u and v. Another spruce contained in the samegraph has base vertices u and v, and four tips including z and w; this secondspruce is incomplete.

A spruce cactus is a graph such that each of its blocks is a spruce. A sprucestructure is a graph each of whose blocks is a spruce or a bridge edge. See anexample in Fig. 2(b).

Fact 1. Spruce cactuses/structures are series-parallel graphs.

We can view a spruce cactus as a collection of spruces — those giving the blocksof the spruce cactus. A spruce cactus is well-behaved if it is a collection of sprucesthat do not share tips. We define the gain of a spruce cactus to be its cyclomaticnumber.

Page 67: Graph-Theoretic Concepts in Computer Science

Maximum Series-Parallel Subgraph 57

Fact 2. The gain of a spruce cactus equals the sum of the gains of its spruces.

Before we proceed with the algorithm, we first elaborate on the need of sprucesof unbounded size. First, if the input graph is a complete spruce with n−2 tips(and 2n−3 edges), any approach which uses blocks of size bounded by, say, k,results in an output with gain at most k−2 and a total of n + k− 3 edges. Withn large and k fixed, this is only a 1/2 -approximation.

Our algorithm discards and shrinks selected spruces. Why one has to do thisbecomes clear from the following example, depicted in Fig. 3(a). The optimumhas n vertices and 2n−3 edges. It contains a spruce with base vertices x and yand circa

√n tips. For each of its tips v, there are two complete spruces, one

with base vertices x and v, and the other with base vertices v and y, each withcirca

√n/2 tips. If an algorithm mistakenly (or greedily) selects the spruce with

base vertices x and y, then it cannot add any more spruces and it ends up withcirca n+

√n edges — asymptotically not better than a 1/2 -approximation.

����

��������

����������������

����

��������

��������

. .. .. ..

.

.

. .. .. ..

.

.

(a) (b)(b)

x y

√n tips

√n

2tips

Fig. 3. (a) A graph where a naive greedy strategy that does not discard previouslyselected spruces fails to achieve a ratio better than 1/2. (b) The only two types ofdegenerate spruces.

For the weighted version of our problem, the algorithm that returns a max-imum weight spanning tree is a 1/2-approximation. This follows from Lemma3, which is also used in the analysis of our algorithm. Precisely, for any sub-graph H ′ of an edge-weighted graph H , let w(H ′) denote the sum of w(e) forall e in E(H ′). The proof of the next lemma follows closely that of Lemma 17in [5].

Lemma 3. Let F be a maximum weight forest in weighted simple series-parallelgraph H. Then w(H) ≤ 2 w(F ), with the inequality being strict if w(H) > 0.

Proof. We use the greedy algorithm to construct F , first sorting the edges of Hinto non-increasing order by weight. Let Eh be the set of the first h edges inthis ordering, 1 ≤ h ≤ m, where m = |E(H)|. By wh we denote the weight ofthe hth edge in this ordering and we put wm+1 = 0. Starting with F = ∅, thegreedy spanning tree algorithm scans the edges in the given order and adds anedge to F as long as it does not create any cycles.

Page 68: Graph-Theoretic Concepts in Computer Science

58 G. Calinescu, C.G. Fernandes, and H. Kaul

Let F be the set of edges chosen by the greedy algorithm and let Fh = Eh∩F .Then, by rearranging the terms,

w(F ) =m∑

h=1

|Fh|(wh − wh+1), and w(H) =m∑

h=1

|Eh|(wh − wh+1).

It is therefore enough to show that |Eh| < 2 |Fh| for 1 ≤ h ≤ m. If this holds, ofcourse w(H) ≤ 2 w(F ), and if w1 > 0, the inequality is strict.

Choose an h such that 1 ≤ h ≤ m. Let p1, p2, . . . , pk be the number of vertices inthe non-trivial components of Fh. Of course, |Fh| =

∑kz=1(pz−1). Also note that

k ≥ 1, as Fh has at least one edge. Any edge of Eh must have its two endpoints inthe same component of Fh. (Otherwise, the edge could have been selected by thegreedy algorithm, merging two components of Fh.) Obviously this component isnon-trivial. We associate each edge of Eh with the (non-trivial) component of Fh

which contains both of its endpoints. The edges of Eh associated with a compo-nent of Fh are a subset of the edges of the graph induced in H by the verticesof this component. Thus, the number of edges associated with the zth non-trivialcomponent is at most 2pz−3, because this graph is series-parallel . But then, ask ≥ 1, we have that |Eh| ≤

∑kz=1(2pz−3) <

∑kz=1 2(pz−1) = 2 |Fh|.

2 A Local Improvement Algorithm

We may assume the input graph G is connected. Our local improvement algo-rithm, when running on G, keeps a set Q of spruces in G that form a well-behavedspruce cactus. We abuse notation and sometimes think of Q as the spruce cactusit forms.

The algorithm uses a slightly modified notion of gain. (One could also get anapproximation ratio higher than 1/2 by only using gain in the algorithm, but weget a higher ratio.) For a spruce S, the adjusted gain of S is denoted by gain(S),and is defined as gain(S) = gain(S) if S is complete, and gain(S) = gain(S)−1if S is incomplete. We call a spruce degenerate if its adjusted gain is non-positive.See Fig. 3(b).

For each component C of Q, the algorithm keeps a weighted tree TC whosevertex set is V (C) and edge set is as follows. For each spruce S in C with basevertices x and y, and tips v1, v2, . . . , vk, there is an edge xy in TC and edges xvi

for i = 1, . . . , k. The weight of the edges is given as follows: w(xy) = gain(S), andw(xvi) = 1 for all i. Note that TC is indeed a tree. For any two vertices x and yof C, let indexQ(x, y) be an edge in TC of minimum weight in the path in TC

from x to y. If x and y are in different components of Q, then let indexQ(x, y)be undefined and consider its weight to be zero.

Let v1, v2, . . . , vk be all vertices isolated in Q that are adjacent in G toboth x and y. If k ≥ 1, let SQ(x, y) be the spruce with base vertices x andy, tips v1, v2, . . . , vk, and the edge xy if it exists in G. Otherwise let SQ(x, y) beundefined.

Page 69: Graph-Theoretic Concepts in Computer Science

Maximum Series-Parallel Subgraph 59

��

����

���� ����������

��������

��

����������

����

��������

��������

����

����������

����

��������

����

����

����������������

��

��

����

���� ����������

��������

��

����������

����

��������

��������

����

����������

����

��������

����

����

����

����

��������

����

��������

����

��

��

��

��������

��������

����

����

����

��������

��������

��������

��������

��������

���� �

���

��������

����

��

����������������

��

����

������������

����

����

������������

����

��������

��������

������������

������

��������

��������

����

����

����������������

����

��

��

��������

����

��������

��������

��

����

��������

��������

��������

��������

�������� �

���

����

��������

������

������������

��

����

����������������

����

����

����������

����

��������

������������

����������

����

��������

����

��������

��������

����

��������

��������

��

��

����

����������������

����

����

����������

����

��������

��������

������������

����������

����

��������

����

����

������������������������

��

��

����

������������

����

����

������������

����

��������

������������

������

��������

��������

����

����

����

��������

��������

����

����

����

����

(a)

(b)

(c)

x

xx

x

x = x′

y

y

y

y

y

x′

y′

y′

2

2

2

2

22

2

TC

TC

Fig. 4. Examples of local improvement, with SQ(x, y) given by the dashed lines in eachcase. (a) For such x and y, line 4 of the algorithm is executed resulting in Q as shownin the right. (b) For such x and y, line 7 of the algorithm is executed resulting in Qas shown in the right. The weighted tree TC before the improvement is in the middle,with weights 1 except for those written in the figure. (c) For such x and y, line 7 andline 13 of the algorithm are executed resulting in Q as shown in the right.

The algorithm is shown in pseudocode later. We exemplify some of its cases inFig. 4. Initially Q = ∅. The algorithm proceeds in iterations, each doing a localimprovement. In each iteration, Q is updated as follows. If there are two vertices xand y of G for which SQ(x, y) is defined and gain(SQ(x, y)) > w(indexQ(x, y)),then obtain a new Q′ as follows, else go to the final phase. If indexQ(x, y) isundefined, then let Q′ be obtained from Q by adding SQ(x, y), and start a newiteration with Q′ in the place of Q. Otherwise, let x′ and y′ be the endpointsof indexQ(x, y), and C be the component of Q containing x, x′, y, and y′. Let S′

be the spruce in Q containing x′ and y′. Note that such spruce exists by theconstruction of TC . If x′ and y′ are the base vertices of S′, then remove S′ from Qand add SQ(x, y) to obtain Q′. Otherwise, by the construction of TC , between x′

and y′ one is a base vertex of S′, and the other is a tip of S′. Exchange x′ and y′

if needed so that x′ is a base vertex of S′. Remove from S′ the two edges incidentto y′. If the resulting S′ is degenerate or is a single edge, then remove S′ from Q.Moreover, add SQ(x, y) to obtain Q′, and start a new iteration with Q′ in theplace of Q.

Observe that, in this iterative part of the algorithm, we maintain the invariantthat Q is a set of non-degenerate spruces that form a spruce cactus. Indeed, thisfollows by induction. It is enough to note that gain(SQ(x, y)) > 0, and x and yare in different components, either from the start, or after we removed part orall of the spruce S′ from Q.

Page 70: Graph-Theoretic Concepts in Computer Science

60 G. Calinescu, C.G. Fernandes, and H. Kaul

The final phase consists of the following. Let Q now be the set of non-degenerate spruces produced by the iterative phase. Obtain a spanning con-nected subgraph of G from Q by adding bridges and let it be the output of thealgorithm.Construct-Spruce-Structure (G)1 Q ← ∅2 while there are x and y such that SQ(x, y) is defined

and gain(SQ(x, y)) > w(indexQ(x, y)) do3 if indexQ(x, y) is undefined4 then Q ← Q ∪ {SQ(x, y)}5 else let x′ and y′ be the endpoints of indexQ(x, y)6 let S′ be the spruce in Q containing x′ and y′

7 Q ← Q \ {S′} ∪ {SQ(x, y)}8 if x′ or y′ is a tip of S′

9 then let z be one between x′ and y′ that is a tip of S′

10 let {e, f} be the two edges of S′ incident to z11 S ← S′ − {e, f}12 if S is not degenerate neither a single edge13 then Q ← Q ∪ {S}14 add bridges to Q to obtain a connected spanning subgraph of G15 return Q

2.1 Running Time Analysis

The main result of this section is the very technical Lemma 4 below, whichshows that each iteration makes some “progress”. Unfortunately, the definitionof “progress” is not straightforward, for the following reason.

A natural measure of progress would be the gain of Q (that is, its cyclomaticnumber). If gain(Q) increased in every iteration, then it would have been easyto conclude that the algorithm runs a polynomial number of iterations. Howeverthis is not the case, and a more careful analysis is required. Let us give someintuition in this paragraph. One can check that, in most of the cases, the gainof Q increases. Also, it never decreases and, in the iterations in which the gainof Q is maintained, the number of components increases — more components arehelpful since more, or bigger, spruces become eligible to improve the current Q.

Define Φ(Q) = 3 gain(Q) + c(Q), where c(Q) is the number of components ofQ when Q is seen as a spanning subgraph of G.

Lemma 4. Every iteration of the algorithm increases the parameter Φ.

From this lemma, whose proof we omit, we conclude that the number of iterationsis polynomially bounded, because Φ(Q) is a non-negative integer and gain(Q) ≤(2n−3)− (n−1) = n−2, which means Φ(Q) is bounded by 3(n−2) + n = 4n−6.

Also, each iteration can be easily implemented in polynomial time, as thereare only O(n2) pairs x, y for which SQ(x, y) must be computed and, if possible,used in updating Q.

Page 71: Graph-Theoretic Concepts in Computer Science

Maximum Series-Parallel Subgraph 61

2.2 Approximation Ratio Analysis

Let m be the number of edges in the graph Q returned by the algorithm. Then

m = n− 1 +∑

S∈Q gain(S).

Let A be an optimal solution for G and q be such that A has 2n− 3− q edges.Thus, the algorithm achieves a ratio that is a constant greater than 1/2 if

(i)∑

S∈Q gain(S) is at least a fraction of n, or(ii) q is at least a fraction of n.

The analysis aims to prove that (i) or (ii) holds. Precisely, it will be shown that

6∑

S∈Q gain(S) + 3q ≥ n− 2. (1)

From this, it is easy to derive the 7/12 ratio:

m = n−1 +∑

S∈Q gain(S) ≥ n−1 + 16 (n− 2− 3q) ≥ 7

12 (2n− 3− q).

The proof of Inequality (1) is not straightforward. We start by giving anoverview. First we will derive a set M of spruces from A and prove that

∑S∈M gain(S) + 3q ≥ n− 2.

This is done in Lemma 5, later. Then, to achieve Inequality (1), it remains toprove that

6∑

S∈Q gain(S) ≥ ∑S∈M gain(S). (2)

Consider Q to be the set of spruces when the algorithm finishes the iterations,and before the final phase (of adding bridges). Let t be the number of componentsof Q, and n′ be the number of vertices in spruces of Q. Inequality (2) is aconsequence of the following two inequalities:

4∑

S∈Q gain(S) ≥ ∑S∈M gain(S)− (n′ − t),

which is given by Lemma 6, below, and∑

S∈Q gain(S) ≥ 12 (n′ − t),

which is given by Lemma 7.In what follows, we present the description of the set M of spruces, and

proceed to Lemmas 5, 6, and 7.Let A+ be a maximal series-parallel graph containing A. Call the edges of A+

not in A of missing edges. As A+ is maximal, it can be obtained by the incremen-tal procedure described in the preliminaries. For each edge xy of A+ for whichthis procedure added at least one new vertex adjacent to x and y, consider aspruce S+

xy in A+ that has x and y as base vertices, and as tips all the vertices ad-jacent to x and y that were added in the procedure. As an example, in Fig. 1(a),spruce S+

as has a and s as base vertices, and tips c, d, e. Let Sxy be a maximalspruce of A contained in S+

xy, if such a spruce exists. Let M = {M1, M2, . . . , Mk}be the set of all such spruces Sxy. First, note that the spruces in M do not sharetips. Also,

Page 72: Graph-Theoretic Concepts in Computer Science

62 G. Calinescu, C.G. Fernandes, and H. Kaul

Lemma 5.∑

S∈M gain(S) + 3q ≥ n− 2.

Proof. Observe that, as all S+xy are complete, the sum of gain(S+

xy) for all xand y (for which S+

xy is defined) equals the cyclomatic number of A+, which is2n − 3 − (n−1) = n − 2. Let us first argue that

∑S∈M gain(S) ≥ n − 2 − 2q.

Indeed each missing edge e decreases the sum of gain(S+xy) by at most two,

because the edge e might appear in two spruces S+xy (once as xy and once as an

edge incident to a tip of S+xy). Note also that a spruce S+

xy for which Sxy is nota spruce corresponds to a term in the sum of gain(S+

xy) that will become zeroor negative after these discounts, so it does not hurt to drop it from the sum.Finally, the sum

∑S∈M gain(S) is equal to the sum

∑S∈M gain(S) minus the

number of incomplete spruces in M , which is bounded above by q. Therefore,the lemma holds.We proceed to Lemma 6.

Lemma 6. 4∑

S∈Q gain(S) ≥∑S∈M gain(S)− (n′ − t).

Proof. For i = 1, 2, . . . , k, let Ui be the set of tips of Mi that are in somespruce of Q. Let Si be obtained from Mi after the removal of its tip verticesin Ui. Note that Si might not be a spruce (it might be empty or a single edge).If Si is a spruce, then gain(Si) = gain(Mi)− |Ui|. To simplify, set gain(Si) = 0if Si is not a spruce.

The proof of this lemma has two steps. The first one consists of the followingsimple observation. As

∑i |Ui| ≤ n′, we have that

S∈M

gain(S) =∑

i

gain(Mi) ≤ n′ +∑

i

gain(Si), (3)

because the spruces Mi do not share tips.Let x and y be the base vertices of a spruce Mi from M . If x and y are in

different components of Q, then Si has to be a degenerate spruce or it is not aspruce (otherwise the algorithm would have included it in Q).

For each component C of Q, consider the following weighted simple graphH = HC on its set of vertices. For two vertices x and y in C that are thebase vertices of a spruce Si, the edge xy is present in H and it has weightw(xy) = gain(Si). Observe that H is a simple series-parallel graph. (It is asubgraph of A+.)

Now, for the second step, let FC be such a maximum weight forest in H . Recallthat the algorithm constructs a weighted tree TC on the same set of vertices;we treat the edges of TC as distinct from the edges of FC though both sets ofedges have weight w. For each two vertices x and y with xy in FC , there is aspruce Si such that w(xy) = gain(Si). Now, the spruce SQ(x, y) was consideredby the algorithm. Since Q is the set of spruces just before the final phase ofthe algorithm, SQ(x, y) was not added to Q and therefore gain(SQ(x, y)) ≤w(indexQ(x, y)). Note that gain(SQ(x, y)) ≥ gain(Si) as all the tips of Si, beingisolated vertices in Q, are also in SQ(x, y). Thus, putting all this together, wehave that w(xy) = gain(Si) ≤ gain(SQ(x, y)) ≤ w(indexQ(x, y)), for every x

Page 73: Graph-Theoretic Concepts in Computer Science

Maximum Series-Parallel Subgraph 63

and y such that xy ∈ FC . But then, in the multigraph whose vertex set is Cand the edge set is the disjoint union of E(FC) and E(TC), the tree TC is amaximum weight tree [8]. Also, as FC is a forest in this multigraph, we havethat w(FC) ≤ w(TC).

Note that, for any spruce S in Q, the total weight of the edges of TC obtainedfrom S is 2 gain(S), which holds both if S is complete or not. Let C be thecollection of connected components of Q. Also, for C in C, let QC be the (non-empty) set of spruces in C. By summing up for all spruces in Q, we obtainthat

2∑

C∈Cgain(QC) =

C∈Cw(TC) ≥

C∈Cw(FC) ≥ 1

2

C∈Cw(HC) +

12

t,

where the last inequality comes from Lemma 3 and the fact that all weights areintegers. Thus

2∑

S∈Q

gain(S) = 2∑

C∈Cgain(QC) ≥ 1

2

i

gain(Si) +12

t.

and this, together with (3), implies the lemma.Now we proceed to Lemma 7.

Lemma 7.∑

S∈Q gain(S) ≥ 12 (n′ − t).

Proof. As in the previous proof, C is the collection of connected componentsof Q, and QC is the (non-empty) set of spruces in C, for C in C. Let n(C) bethe number of vertices in C.

It is enough to prove that gain(QC) ≥ (n(C)−1)/2 for all C in C. So, considera C in C, and recall that Q does not have degenerate spruces. Let us prove byinduction on the number of spruces in QC that gain(QC) ≥ (n(C)−1)/2.

If QC has only one spruce S, then if S is complete, n(S) = gain(S)+2, andthus gain(S) = n(S)−2 ≥ (n(S)−1)/2 because n(S) ≥ 3. If S is incomplete,n(S) = gain(S)+3, and thus gain(S) = n(S)−3 ≥ (n(S)−1)/2 because, as S isnot degenerate, n(S) ≥ 5.

Now suppose that QC has more than one spruce, and let S be a spruce in QC

with at most one vertex in common with the others spruces in QC . (There isalways one such spruce because QC is a spruce cactus.) Let C′ be the connectedsubgraph of Q corresponding to the union of the spruces in QC′ = QC \ {S}.By induction, gain(QC′) ≥ (n(C′)−1)/2. If S is complete, n(C) = n(C′) +gain(S) + 1, and gain(QC) = gain(QC′) + gain(S) ≥ (n(C′)−1)/2 + gain(S) =(n(C) − gain(S) − 2)/2 + gain(S) = (n(C) + gain(S) − 2)/2 ≥ (n(C)−1)/2,because gain(S) ≥ 1. If S is incomplete, n(C) = n(C′) + gain(S) + 2, andgain(QC) = gain(QC′)+gain(S) ≥ (n(C′)−1)/2+gain(S) = (n(C)−gain(S)−3)/2 + gain(S) = (n(C) + gain(S) − 3)/2 ≥ (n(C)−1)/2, because gain(S) ≥ 2,as S is non-degenerate.Having finished this proof, based on the discussion at the beginning of the sub-section, we obtain the main result of the paper:

Page 74: Graph-Theoretic Concepts in Computer Science

64 G. Calinescu, C.G. Fernandes, and H. Kaul

Theorem 1. There is a polynomial-time 712 -approximation for Maximum

Series-Parallel Subgraph.

As an aside, observe that if we allowed the algorithm to include in Q the de-generate spruce which is a 4-cycle, then Lemma 7 would not hold anymore. Yeta weaker version of it would, with 1/3 instead of 1/2, and this would also leadto an approximation ratio greater than 1/2. We introduced the adjusted gainconcept specifically to forbid 4-cycles, so that Lemma 7 holds with 1/2.

The analysis is tight. We will describe a family of graphs that proves this.Follow the description looking at Fig. 5. There is a graph Gk in this familyfor each even positive integer k. The graph Gk is the union of two edge-disjointseries-parallel graphs H1 and H2. The first one, H1, is a path of length 8+k, witha triangle on top of each of its edges (for a total of 7+k triangles and 3(7+k)edges). We call this path the defining path of H1. In Fig. 5, the bottom edgesform the defining path of H1. The first 7 triangles on top of this path (shown bythe darker edges) play a different role than the remaining k triangles. Call topthe vertex in each of these triangles that is not on the defining path, and roundthe tops of the last k triangles plus the first and fourth top vertices. See the whitecircle vertices in Fig. 5. The final k vertices of the defining path are alternatelynamed square and triangular vertices. The second and fifth top vertices are alsosquare vertices, and the third and sixth are also triangular vertices. See Fig. 5.We will use these marks to describe the second graph.

The second graph, H2, consists of three big spruces on the marked vertices ofH1, with a pair of new extra vertices per tip t, each of them adjacent to t andto one of the spruce base vertices. Each spruce is on one of the types of markedvertices in H1. Let us now describe the first of the three big spruces, the one onthe round vertices of H1. This spruce has as base vertices the two first roundvertices in H1, and has as tips each of the other round vertices in H1, for a totalof k tips. In Fig. 5, this spruce is shown by the dotted edges, plus the “round”triangle with straight edges. For this triangle, we show also the two extra newvertices — the black small circle vertices, incident to the dashed edges.

The second big spruce is on the square vertices of H1. Its base vertices arethe two square top vertices, and its tips are the other k/2 square vertices of H1.The third big spruce is defined similarly on the triangular vertices of H1. This

t

Fig. 5. Part of the graph G4: the graph H1 (the bottom path and the triangles on topof it), the first big spruce in H2 (the subgraph induced by the white round vertices),and two extra vertices (the black small circle vertices)

Page 75: Graph-Theoretic Concepts in Computer Science

Maximum Series-Parallel Subgraph 65

completes the description of H2, which, summarizing, consists of these three bigspruces, plus the extra new vertices adjacent to the endpoints of the edges ofthese spruces incident to their tips. (In Fig. 5, we show only two of the extravertices, the black small circle vertices.)

As we said, Gk consists of these two graphs H1 and H2. Note that bothof them are indeed series-parallel. Thus, the number of edges in H2, which is(2k+1) + 2(k+1) + 8k = 12k+3, is a lower bound on the size of a maximumseries-parallel subgraph of Gk. Moreover, one can verify that our algorithm inthe iterative phase can produce as Q the graph H1, and output a graph with|E(H1)| + 4k = 3(7+k) + 4k = 7k+21 edges. In this case, the ratio achieved isno more than (7k+21)/(12k+3), which approaches 7/12 as k gets large.

References

1. Berman, P., Ramaiyer, V.: Improved approximations for the Steiner tree problem.Journal of Algorithms 17, 381–408 (1994)

2. Cai, L.: On spanning 2-trees in a graph. Discrete Applied Mathematics 74(3), 203–216 (1997)

3. Cai, L., Maffray, F.: On the spanning k-tree problem. Discrete Applied Mathemat-ics 44, 139–156 (1993)

4. Calinescu, G., Fernandes, C.G., Finkler, U., Karloff, H.: A better approximationalgorithm for finding planar subgraphs. Journal of Algorithms 27(2), 269–302 (1998)

5. Calinescu, G., Fernandes, C.G., Karloff, H., Zelikovski, A.: A new approximationalgorithm for finding heavy planar subgraphs. Algorithmica 36(2), 179–205 (2003)

6. Robins, G., Zelikovsky, A.: Improved steiner tree approximation in graphs. In: Pro-ceedings of the Tenth ACM-SIAM Symposium on Discrete Algorithms (SODA), pp.770–779 (2000)

7. Schrijver, A.: Combinatorial Optimization, vol. A. Springer, Heidelberg (2003),http://homepages.cwi.nl/~lex/files/dict.ps

8. Tarjan, R.E.: Data Structures and Networks Algorithms. Society for Industrial andApplied Mathematics (1983)

Page 76: Graph-Theoretic Concepts in Computer Science

Low-Port Tree Representations�

Shiri Chechik and David Peleg

Department of Computer Science and Applied Mathematics,The Weizmann Institute of Science, Rehovot, 76100 Israel

{shiri.chechik,david.peleg}@weizmann.ac.il

Abstract. Consider an n-node undirected graph G(V, E) with a pre-assigned port numbering for the outgoing edges of each node. The portnumbers assigned to a node u of degree deg(u) are {0, 1, . . . , deg(u)−1}.In certain contexts it is necessary to maintain a directed spanning tree ofG, in which case each node needs to remember the port number leadingto its parent. Hence the cost of a spanning tree T is the total numberof bits the nodes need to store in order to remember T . This paperaddresses the question of asymptotically bounding the cost of the optimaltree, as a function of the graph size. A tight upper bound of O(n) isestablished on this cost, thus improving on the best previously knownbound of O(n log log n) [6] and proving the conjecture raised therein. Thisis achieved by presenting a polynomial time algorithm for constructinga spanning tree T of cost O(n) for a given general graph G with anarbitrary port labeling.

1 Introduction

Many distributed applications make use of pre-defined network representationsfor guaranteeing efficient performance. These representations are often designedto be as compact as possible (cf. [16]) in terms of their memory requirements.Two notable examples are compact routing schemes [1,3,4,7,17,18,19,20], whichcommonly rely on sparse network representations such as partitions, covers anddecompositions, and informative labeling schemes for a variety of applications,e.g., [5,6,8,9,10,11,12,14,15].

An important special case of a pre-defined network representation is thatof a spanning tree. A number of well-known algorithms for basic distributedoperations, such as broadcast, convergecast and graph exploration (cf. [2,13,16]),are based on maintaining a spanning tree for the network and using it for efficientcommunication.

The problem of compact port-based representations for spanning trees wasintroduced in [6], which focused on the problem of providing, during a pre-processing stage, a compact local encoding of a spanning tree for a given graph.In particular, it raised the question of the existence of encodings in which theaverage number of bits stored at each node is constant.

� Supported by a grant from the Israel Science Foundation.

C. Paul and M. Habib (Eds.): WG 2009, LNCS 5911, pp. 66–76, 2010.c© Springer-Verlag Berlin Heidelberg 2010

Page 77: Graph-Theoretic Concepts in Computer Science

Low-Port Tree Representations 67

More precisely, the following problem was considered in [6]. Consider an n-node undirected graph G(V, E). Each node u has a pre-assigned port number foreach of its outgoing edges, with the port number of the edge connecting it to theneighbor v denoted Port(u, v). Denoting the degree of the node u by deg(u), theport numbers assigned to u’s ports are {0, . . . , deg(u)−1}, or more formally, theport number Port(u, v) is in {0, . . . , deg(u)−1}, where Port(u, v1) �= Port(u, v2)for every two distinct neighbors v1 and v2 of u. The port numbers are notnecessarily symmetric, i.e., it could be that Port(u, v) �= Port(v, u). The networknodes are required to maintain a directed spanning tree of G, with each noderequired to remember the port number leading to its parent. For a port numberp, denote by ω(p) the number of bits required to encode p using the standardbinary representation for integers. Formally,

ω(p) ={

1, if p = 0 ,�log p�+ 1, if p ≥ 1 .

The cost of a tree T is the total number of bits the nodes need to remember,denoted Cost(T, G). Formally,

Cost(T, G) =∑

v∈V, v �=r(T )

ω(Port(v, parent(v, T ))) ,

where r(T ) is the root of the tree T and parent(v, T ) is the parent of v in thetree T . Define Cost(G) to be min{Cost(T, G)}, where the minimum is takenover all spanning trees T of G. The question of constructing a spanning tree Tminimizing Cost(T, G) for a given graph G, hence also determining Cost(G),was shown in [6] to enjoy a polynomial time algorithm.

In this paper, we are interested in bounding the asymptotic behavior ofCost(G) as a function of the graph size. Define Cost(n) to be max{Cost(G)},where the maximum is taken over all n-node graphs G. An upper bound ofO(n log log n) on Cost(n) was shown in [6], by presenting a polynomial time al-gorithm constructing a spanning tree T of cost O(n log log n) for a given n-nodegraph G. It was conjectured in [6] that the actual bound is Cost(n) = Θ(n).In fact, a tight upper bound of O(n) is proved therein for the special cases ofcomplete graphs with arbitrary labeling and of arbitrary graphs with symmetricport labeling. In what follows, we confirm the above conjecture for arbitrarygraphs and arbitrary assignments of port numbers, by establishing a tight upperbound of O(n) on Cost(n). This is achieved by presenting a polynomial timealgorithm for constructing a spanning tree T of cost O(n) for a given generalgraph G with an arbitrary port labeling.

2 Construction of a Low Port Tree with Cost O(n)

In this section we present an algorithm for constructing a spanning tree withcost O(n) for a given graph G(V, E).

Page 78: Graph-Theoretic Concepts in Computer Science

68 S. Chechik and D. Peleg

2.1 Escape-Paths

We start by defining some basic notions. For a subtree T of G, we say that theedge (u, w) is an exit edge of T if u ∈ V (T ) and w /∈ V (T ), and the node u is anexit node of T if it has an exit edge of T . A tree T rooted at r(T ) is well-orientedif r(T ) is an exit node of T .

For a directed subtree T of G rooted at r(T ), a path P = (v1, . . . , vk) is saidto be a escape-path of T if

1. v1 = r(T ),2. v1, . . . , vk ∈ V (T ),3. (vi, vi+1) ∈ E for every 1 ≤ i ≤ k − 1,4. vk is an exit node (i.e., it has a neighbor z /∈ V (T )).

Note that the edges of the escape-path P need not be in T .Define the following order relation on paths in G. Given a path P1 = (v1, . . . , vk)and a path P2 = (z1, . . . , zr), we say that the path P2 is lighter than P1 if eitherr < k or r = k and Port(zr−1, zr) ≤ Port(vk−1, vk). Notice that this lightnessrelation is transitive. For a subtree T of G, a path P is said to be a lightestescape-path of T if it is an escape-path of T and no other escape-path of T islighter than P .

2.2 Outline of the Algorithm

The algorithm consists of two phases, a preprocessing phase and a tree construc-tion phase. Our approach in the construction process of the spanning tree isbased on starting with individual nodes and merging them gradually by takinga small well-oriented tree T and hanging it on another subtree T by adding anexit edge from r(T ) to T . Whenever this process succeeds, it leads to a low costspanning tree. The complications arise once the process encounters some smallsubtree T that is not well-oriented, i.e., whose root has no exit edge. In this case,the algorithm tries to re-orient the subtree T by finding a lightest escape-pathof T and reversing the relevant edges in that path.

The construction process proceeds in iterations, where in each iteration i thealgorithm chooses a subtree Ti and applies this process on it. For the sake of aclearer description of the algorithm and its analysis, let us keep a record of thismerging process by remembering, for each iteration i, the basic small subtreeTi from which we started and the escape-path from the original root r(Ti) tothe selected exit node (which acts as the new root of Ti after the reversal). Thepreprocessing stage deals with selecting such escape-paths.

The preprocessing phase. Preprocessing consists of two stages. In the first,Stage S1, the algorithm chooses for each Ti a lightest escape-path Pi in a naiveway. By the analysis given in [6], these paths yields a tree of cost O(n log log n).In the second stage of the preprocessing phase, Stage S2, the algorithm buildscheaper paths that lead to the desired cost of O(n).

Page 79: Graph-Theoretic Concepts in Computer Science

Low-Port Tree Representations 69

Stage S1 of the preprocessing phase consists of n−1 iterations. The algorithmmaintains a forest F , namely, a collection of (vertex disjoint) subtrees whoseunion spans V . Initially, the forest F contains n subtrees, each consisting of asingle vertex. In each iteration i, the algorithm chooses the smallest subtree Ti

in the collection and merges it with another subtree in the collection. At the endof this stage, the forest F consists of a single tree spanning the entire graph.In addition, the algorithm also keeps record of the trees T1, . . . , Tn−1 chosenduring the n− 1 iterations. Note that these trees are not necessarily disjoint; itis possible that V (Ti) ⊂ V (Tj) for some i < j, although partial overlaps maynot occur.

Let us now describe in detail the process of transforming and merging thesubtree Ti, in iteration i of Stage S1. The process consists of two main steps. Inthe first step, the algorithm identifies a lightest escape-path Pi of Ti, ending atan exit node vk. (If the root r(Ti) itself is an exit node, then Pi consists of thesingle node v1 = r(Ti).) The algorithm then transforms Ti into a well-orientedtree T ′i on the same set of vertices. (If r(Ti) is an exit node then no changeis needed, i.e., T ′i = Ti and r(T ′i ) = r(Ti).) In the second step, the algorithmlooks at the set of exit edges of r(T ′i ), selects the exit edge (r(T ′i ), z) of minimumPort(r(T ′i ), z), sets Outi ← z, and lets T ∈ F be the subtree containing z. Thealgorithm then merges the subtrees T ′i and T into a subtree T by adding theedge (r(T ′i ), z), removes Ti and T from F and adds the merged tree T instead.For convenience, the formal description of the above process is broken into twoprocedures (presented in Figure 1): Procedure Transform, performing the firststep, and Procedure Merge, performing the second.

Procedure Transform(G, Ti)

1. T ′i ← Ti

2. Find a lightest escape-path of Ti, Pi = (v1, . . . , vk).3. For every 1 ≤ r ≤ k − 1, add the edge (vr, vr+1) of Pi to T ′

i .In turn, for 2 ≤ r ≤ k, remove from T ′

i the (unique) outgoing edge of vr inT ′

i , (vr, wr).4. Return the transformed tree and the escape-path, (T ′

i ,Pi).

Procedure Merge(G, Ti, vk, T ′i , F )

1. Outi ← node z outside T ′i with edge to vk of minimal Port(vk, z).

2. Let T ∈ F be the tree in F that contains Outi.3. T ← (V (T ′

i ) ∪ V (T ), E(T ′i ) ∪ E(T )).

4. Connect vk to Outi in T .5. Remove Ti and T from F and add the merged T instead.6. Return (Outi, F ).

Fig. 1. The procedure for merging the tree Ti with the tree T

Page 80: Graph-Theoretic Concepts in Computer Science

70 S. Chechik and D. Peleg

The transformation process, performed by Procedure Transform, operates asfollows. Let Pi = (v1, v2, . . . , vk) be a lightest escape-path of Ti. Set T ′i ← Ti.For every 1 ≤ j ≤ k − 1, add the edge (vj , vj+1) of Pi to T ′i . In turn, for2 ≤ j ≤ k, remove from T ′i the (unique) outgoing edge of vj in T ′i , (vj , wj).Figure 2 illustrates this transformation process.

1

v3 v3

v4 4v v4=r(T’)

2

r(T)=v

v

P(T)

(a) (b) (c)

2

r(T)=v

v

P(T)1

Fig. 2. (a) The tree T . (b) The lightest escape-path P = (v1, v2, v3, v4) of T (dashed).The node v4 has an exit edge (not shown in the figure). (c) The tree T ′, with v4 as itsroot. T ′ is obtained from T by erasing the edges that connected v2, v3 and v4 to theirparents in T , and replacing them by the edges of P .

In the second stage of the preprocessing phase, Stage S2, the algorithm exam-ines the chosen trees Ti and their escape-paths Pi in reverse order, from Tn−1 toT1, and tries to find shortcut paths P∗i using the nodes in the previously selectedshortcut paths P∗j for j > i.

Loosely speaking, when considering a tree Ti, the algorithm treats all nodesin the tree Ti that participate in some shortcut path P∗j for some j > i asnodes outside the tree Ti. It then tries to use these new outer nodes in findinga shortcut path P∗i of lower cost than the escape-path Pi. The definition of theshortcut path is similar to that of the escape-path, with a small modification:instead of the requirement that the last node in the path has a neighbor outsideof V (Ti), we require that the last mode has an edge to a node that participatesin P∗j for some j > i. The lightest shortcut path is the analogue of the lightestescape-path, i.e., a path P∗ is said to be a lightest shortcut-path of T if it is ashortcut-path of T and no other shortcut-path of T is lighter than P∗. If thealgorithm finds a shortcut-path lighter than the original escape-path Pi, then itreplaces the escape-path Pi with the lightest shortcut-path P∗i .

Hence iteration i of Stage S2 of the preprocessing phase proceeds as follows.Consider the subtree Ti for 1 ≤ i ≤ n− 1. The algorithm examines all shortcut-paths (v1, . . . , vk) of the tree Ti such that vk has a neighbor z that belongs tosome shortcut path P∗j for j > i. If the algorithm finds a shortcut-path lighterthan Pi then it sets P∗i to be the lightest such path (v1, . . . , vk) and Outi to thenode z that belongs to some shortcut path P∗j for j > i with minimal Port(vk, z).

The preprocessing phase is described formally in Figure 3. After the prepro-cessing phase, the algorithm keeps a set of subtrees T1, . . . , Tn−1, a set of shortcutpaths P∗1 , . . . ,P∗n−1 and a set of out nodes Out1, . . . , Outn−1.

Page 81: Graph-Theoretic Concepts in Computer Science

Low-Port Tree Representations 71

Procedure Find Paths(G)

1. F ← {({v}, ∅) | v ∈ V }2. For i = 1, . . . , n − 1 do: /* Stage S1 */

(a) Let Ti be the smallest-size tree in F .(b) Invoke (T ′

i ,Pi) ← Transform(G, Ti).(c) Invoke (Outi, F ) ← Merge(G, Ti, vk, T ′

i , F ).3. S ← ∅4. For i = n − 1, . . . , 1 do: /* Stage S2 */

(a) Consider Pi = (v1, . . . , vk).(b) If there exists a shortcut-path P∗

i (using the nodes in S) lighter thanPi then do:

i. Set P∗i to be the lightest shortcut path (z1, . . . , zr) of Ti using the

nodes in S.ii. Set Outi to be the node z in S with an edge (zr, z) of minimal

Port(zr, z).(c) Else, set P∗

i ← Pi.(d) S ← S ∪ V (P∗

i ).5. Return (T1, . . . , Tn−1,P∗

1 , . . . ,P∗n−1, Out1, . . . , Outn−1)

Fig. 3. The procedure for finding the transformation paths for all subtrees

Procedure Tree Cons(G, T1, . . . , Tn−1, P∗1 , . . . , P∗

n−1, Out1, . . . , Outn−1)

1. T ← (V, ∅)2. For i = 1, . . . , n − 1 do:

(a) Consider P∗i = (v1, . . . , vk).

(b) For every 1 ≤ j ≤ k − 1, add the edge (vj , vj+1) to T .In turn, for 2 ≤ j ≤ k, remove from T the (unique) outgoing edge ofvj in T , (vj , wj).

(c) Add to T an edge from vk to Outi.3. Return T .

Fig. 4. The procedure for constructing a tree with total cost O(n)

Main(G)

1. Invoke (T1, . . . , Tn−1,P∗1 , . . . ,P∗

n−1, Out1, . . . , Outn−1) ← Find Paths(G).2. Invoke T ← Tree Cons(G, T1, . . . , Tn−1,P∗

1 , . . . ,P∗n−1, Out1, . . . , Outn−1).

Fig. 5. Constructing a spanning tree with cost O(n)

Page 82: Graph-Theoretic Concepts in Computer Science

72 S. Chechik and D. Peleg

The tree construction phase. The tree construction phase consists of n− 1iterations. The algorithm maintains a subgraph T which is first initialized tobe T ← (V, ∅). In each iteration i, the algorithm does the following. Let P∗i =(v1, . . . , vk). For every 1 ≤ j ≤ k − 1, the algorithm adds the edge (vj , vj+1) toT . In turn, for 2 ≤ j ≤ k, it removes from T the (unique) outgoing edge of vj inT , (vj , wj). It then adds to T an edge from vk to Outi. In the end, it returns T .

The tree construction phase is presented formally in Figure 4. The main al-gorithm is given in Figure 5.

3 Analysis

Let T be the final tree returned by the algorithm. Denote by S the set of all edgesadded to T at some iteration in procedure Tree Cons. Notice that E(T ) ⊆ S,where E(T ) is the set of edges in the final tree T . It could be that E(T ) �= S,as some of the edges in S might be removed in later iterations. We show thatthe total cost of all edges in S, denoted by Cost(S), is O(n), which implies thatCost(T , G) = O(n). For the analysis, we partition the edges that were added toS into two subsets, Eout and Eesc, and bound separately the total cost of edgesin each subset by O(n), thus the total cost of all edges in S is also O(n).

For a subtree Tr with P∗r = (v1, . . . , vk), all edges (vi, vi+1) for 1 ≤ i ≤ k − 1belong to the subset Eesc and are referred to as escape-edges. The edge from thenode vk to the node Outr is called an out-edge and it belongs to the subset Eout.

Consider an edge (x, y), and let c = Port(x, y). Notice that there are exactlyc neighbors w of x that are “cheaper” than y, i.e., such that Port(x, w) <Port(x, y). For the sake of the analysis, we employ the following charging ruleon escape-edges. If the algorithm selects the escape-edge (x, y) to the constructedtree T at some iteration of Procedure Tree Cons, then each such cheaper nodew incurs a charge of 1 upon adding (x, y) to T .

For each node w, we are interested in identifying the subtrees Ti that cause wto incur a charge. Formally, we say that Ti is a charging subtree of w if w incursa charge upon adding the shortcut path P∗i = (v1, . . . , vk), namely, there existssome 1 ≤ j ≤ k − 1 such that the escape-edge (vj , vj+1) is more expensive than(vj , w), or in other words, Port(vj , vj+1) > Port(vj , w). Denote by M(w) the setof charging subtrees of w. In the analysis we prove that the algorithm guaranteesthat every node w has at most one charging subtree, namely, |M(w)| ≤ 1.

For each node w ∈ V , denote by C(w) the charge count of w, namely, thenumber of escape-edges for which w incurred a charge. Formally,

C(w) = #{v | Port(v, u) > Port(v, w) and (v, u) ∈ Eesc}.

We now show that the shortcut-paths chosen by the algorithm are disjoint.

Lemma 1. The paths P∗i for 1 ≤ i ≤ n− 1 are disjoint.

Proof: The proof is straightforward from the construction of P∗i . Consider someTi and Tj where 1 ≤ j < i ≤ n − 1. Assume, towards contradiction, that the

Page 83: Graph-Theoretic Concepts in Computer Science

Low-Port Tree Representations 73

paths P∗i and P∗j intersect, i.e., there exists a node v such that v ∈ P∗i andv ∈ P∗j . Letting P∗j = (z1, . . . , zr, v, . . .), notice that the path P = (z1, . . . , zr) isshorter than P∗j . Moreover, after iteration i of step 4 of Procedure Find Paths,the node v was added to S. Hence when looking for the lightest shortcut pathfor the tree Tj in iteration j of step 4 of Procedure Find Paths, the algorithmshould have chosen P as P∗j ; contradiction.

The following two lemmas establish that the resulting subgraph T is a tree.

Lemma 2. After iteration i of step 2 of Procedure Tree Cons, all cycles in Tcontain an edge (z, w) such that z ∈ P∗r for some r > i.

Proof: By induction on i. For i = 1, after the first iteration of ProcedureTree Cons T contains only one edge and the claim is trivial. Assume the claimholds for every j < i, and consider iteration i of step 2 of Procedure Tree Cons.By the inductive hypothesis, in the beginning of iteration i all cycles in T containa node z such that z ∈ P∗r for some r ≥ i.

Consider P∗i = (v1, . . . , vk) and consider a cycle C that contains an edge(z, w) such that z ∈ P∗i . Note that during iteration i of step 2(b) of ProcedureTree Cons, the outgoing edge (z, w) is removed, and therefore the subgraph T nolonger contains the cycle C. In addition, for all edges (vj , vj+1) that are addedto T in iteration i of step 2 of Procedure Tree Cons, the outgoing edge of vj+1

is removed, so clearly no cycle is created. The only exception is for the edgefrom vk to Outi. If Outi /∈ Ti, then again no cycle is closed. If Outi ∈ Ti then itmust be that Outi ∈ P∗r for some r > i. It follows that the claim also holds foriteration i.

Corollary 1. The final tree T does not contain cycles.

Lemma 3. The number of edges in T in the end of procedure Tree Cons is n−1.

Proof: In step 2(b) of Procedure Tree Cons, the number of edges that are addedto T is equal to the number of edges that are removed from T . In step 2(c) ofProcedure Tree Cons, one edge is added to T . Therefore, one edge is added to Tin each iteration of procedure Tree Cons. As the procedure has n− 1 iterationsoverall, the number of edges in T in the end of procedure Tree Cons is n−1.

Corollary 1 and Lemma 3 directly yield the following.

Lemma 4. The subgraph T is a tree.

We now show that each node z has at most one charging subtree.

Lemma 5. The charging trees of every z ∈ V satisfy |M(z)| ≤ 1.

Proof: Consider a node z ∈ V . Assume, towards contradiction, that bothTr1 , Tr2 ∈ M(z), and without loss of generality assume that r1 > r2. LetP∗r1

= (v1, . . . , vk1) and P∗r2= (z1, . . . , zk2). As Tr1 , Tr2 ∈ M(z), it must be

that z has an edge to both vi and zj , and moreover, Port(vi, z) < Port(vi, vi+1)

Page 84: Graph-Theoretic Concepts in Computer Science

74 S. Chechik and D. Peleg

and Port(zj , z) < Port(zj , zj+1) for some 1 ≤ i ≤ k1 − 1 and 1 ≤ j ≤ k2 − 1.Notice that the path P = (z1, . . . , zj , z) is lighter than the path P∗r2

and alsoz has an edge to vi ∈ P∗r1

. Moreover, after iteration r1 in step 4 of ProcedureFind Paths, the node vi was added to S. When looking for a shortcut for the treeTr2 in iteration r2 in step 4 of Procedure Find Paths, the algorithm was supposedto choose P (or some other path lighter than P ) as P∗r2

; contradiction.

We now turn to the cost analysis of the resulting tree T .

Lemma 6. The charging count of every z ∈ V satisfies 0 ≤ C(z) ≤ 3.

Proof: Consider some node z ∈ V . By Lemma 5, |M(z)| ≤ 1. This means thatz incurs a charge only on one subtree. It remains to show that when z incursa charge on some subtree Ti, that charge is at most 3. Assume Ti ∈ M(z). LetPi = (v1, . . . , vk) be the lightest escape-path generated by procedure Transformin the transformation process of Ti. Since Pi is a shortest path from v1 to vk inG(Ti), we have that z has at most three neighbors in Pi, otherwise the procedurecould have used z to get a shorter path between v1 and vk (this is due to the factthat if z is adjacent to nodes vl1 , . . . , vlt on Pi, then (v1, . . . , vl1 , z, vlt , . . . , vk)is an alternate path between v1 and vk, and if t ≥ 4 then this alternate pathis necessarily shorter than the original.). When updating Pi to a lighter pathP∗i = (z1, . . . , zr), again there can be at most three nodes among z1, . . . , zr thathave an edge to z. Thus C(z) ≤ 3.

For the analysis, we partition the overall cost of S into

Cost(S) = Cout + Cesc ,

whereCout =

(x,y)∈Eout

ω(Port(x, y))

andCesc =

(x,y)∈Eesc

ω(Port(x, y)) .

Lemma 7. Consider some subtree Ti for 1 ≤ i ≤ n − 1. Let P∗i = (v1, . . . , vk)and z = Outi. Then Port(vk, z) < |Ti|.Proof: The proof is straightforward from the definition of Outi. By definition,Outi is a node z outside Ti (or a node in Ti that participate in some shortcut pathP∗j for some j > i) with minimal Port(vk, z). So in the worst case, Port(vk, z) =|Ti| − 1.

Lemma 8. Cout = O(n).

Proof: For each subtree Ti, the algorithm adds at most one edge to Eout, andby Lemma 7 the cost of this edge is at most �log |Ti|�+ 1. There are n− 1 suchsubtrees Ti. In each iteration in step 2 of Procedure Find Paths, the algorithm

Page 85: Graph-Theoretic Concepts in Computer Science

Low-Port Tree Representations 75

chooses the smallest subtree in the forest F and merges it with another subtree.As initially F contains n subtrees of size 1, there are at least n/2 iterations withsubtrees of size 1, and at least n/4 subsequent iterations with subtrees of size atmost 2, and so on. It follows that the total cost is

Cout ≤log n∑

i=1

n

2i· (i + 1) = O(n) .

Lemma 9. Cesc = O(n).

Proof: Notice that exactly Port(x, y) nodes incur a charge for each edge e =(x, y) ∈ Eesc, and therefore

(x,y)∈Eesc

Port(x, y) =∑

v∈V

C(v) ≤ 3n ,

where the last inequality follows by Lemma 6. It follows that

Cesc =∑

(x,y)∈EescPort(x,y)=0

1+∑

(x,y)∈EescPort(x,y)>0

(�log Port(x, y)�+1)≤n+∑

(x,y)∈Eesc

Port(x, y)

≤ 4n = O(n).

Finally, Lemmas 8 and 9 yield the desired bound.

Lemma 10. Cost(T , G) = O(n).

References

1. Abraham, I., Gavoille, C., Malkhi, D., Nisan, N., Thorup, M.: Compact name-independent routing with minimum stretch. In: Proc. 16th ACM Symp. on ParallelAlgorithms & Architectures (SPAA), pp. 20–24 (2004)

2. Attiya, H., Welch, J.: Distributed Computing: Fundamentals, Simulations and Ad-vanced Topics. McGraw-Hill, New York (1998)

3. Awerbuch, B., Bar-Noy, A., Linial, N., Peleg, D.: Compact distributed data struc-tures for adaptive network routing. In: Proc. 21st ACM Symp. on Theory of Com-puting, pp. 230–240 (1989)

4. Awerbuch, B., Peleg, D.: Routing with polynomial communication-space trade-off.SIAM J. on Discrete Math. 5, 151–162 (1992)

5. Cohen, R., Fraigniaud, P., Ilcinkas, D., Korman, A., Peleg, D.: Label-guided graphexploration by a finite automaton. In: Caires, L., Italiano, G.F., Monteiro, L.,Palamidessi, C., Yung, M. (eds.) ICALP 2005. LNCS, vol. 3580, pp. 335–346.Springer, Heidelberg (2005)

6. Cohen, R., Fraigniaud, P., Ilcinkas, D., Korman, A., Peleg, D.: Labeling Schemesfor Tree Representation. In: Pal, A., Kshemkalyani, A.D., Kumar, R., Gupta, A.(eds.) IWDC 2005. LNCS, vol. 3741, pp. 13–24. Springer, Heidelberg (2005)

7. Fraigniaud, P., Gavoille, C.: Routing in trees. In: Orejas, F., Spirakis, P.G., vanLeeuwen, J. (eds.) ICALP 2001. LNCS, vol. 2076, pp. 757–772. Springer, Heidelberg(2001)

Page 86: Graph-Theoretic Concepts in Computer Science

76 S. Chechik and D. Peleg

8. Gavoille, C., Peleg, D., Perennes, S., Raz, R.: Distance labeling in graphs. In: Proc.12th ACM Symp. on Discrete Algorithms, pp. 210–219 (2001)

9. Kannan, S., Naor, M., Rudich, S.: Implicit Representation of Graphs. SIAM J. onDescrete Math. 5, 596–603 (1992)

10. Katz, M., Katz, N.A., Korman, A., Peleg, D.: Labeling Schemes for Flow andConnectivity. SIAM J. Computing 34, 23–40 (2004)

11. Korman, A., Kutten, S., Peleg, D.: Proof Labeling Schemes. In: Proc. 24th ACMSymp. on Principles of Distributed Computing, PODC (2005)

12. Korman, A., Peleg, D., Rodeh, Y.: Labeling Schemes for Dynamic Tree Networks.Theory of Computing Systems (Special Issue of STACS 2002) 37, 49–75 (2004)

13. Lynch, N.: Distributed Algorithms. Morgan Kaufmann, San Francisco (1995)14. Peleg, D.: Proximity-preserving labeling schemes and their applications. In: Wid-

mayer, P., Neyer, G., Eidenbenz, S. (eds.) WG 1999. LNCS, vol. 1665, pp. 30–41.Springer, Heidelberg (1999)

15. Peleg, D.: Informative labeling schemes for graphs. In: Nielsen, M., Rovan, B. (eds.)MFCS 2000. LNCS, vol. 1893, pp. 579–588. Springer, Heidelberg (2000)

16. Peleg, D.: Distributed Computing: A Locality-Sensitive Approach. SIAM, Philadel-phia (2000)

17. Peleg, D., Upfal, E.: A tradeoff between size and efficiency for routing tables. J.ACM 36, 510–530 (1989)

18. Santoro, N., Khatib, R.: Labelling and implicit routing in networks. The ComputerJournal 28, 5–8 (1985)

19. Thorup, M., Zwick, U.: Compact routing schemes. In: Proc. 13th ACM Symp. onParallel Algorithms & Architectures (SPAA), pp. 1–10 (2001)

20. van Leeuwen, J., Tan, R.B.: Routing with compact routing tables. In: Rozenberg,G., Salomaa, A. (eds.) The Book of L, pp. 259–273. Springer, Heidelberg (1986)

Page 87: Graph-Theoretic Concepts in Computer Science

Fully Dynamic Representations of IntervalGraphs

Christophe Crespelle

LIP6, CNRS - Universite Paris [email protected]

Abstract. We present a fully dynamic algorithm that maintains threedifferent representations of an interval graph: a minimal interval modelof the graph, the PQ-tree of its maximal cliques, and its modular decom-position. After each vertex or edge modification (insertion or deletion),the algorithm determines whether the new graph is an interval graph inO(n) time, and, in the positive, updates the three representations withinthe same complexity.

1 Introduction

In this paper, we are interested in the dynamic recognition and representationproblem for the class of interval graphs. For a family F of graphs, this problemis to maintain a characteristic representation of dynamically changing graphs aslong as the modified graph belongs to F [3,4,6,8,15,16]. The input of the problemis a graph G ∈ F with its representation and a modification which is one of thefollowing: inserting or deleting a vertex (along with the edges incident to it),inserting or deleting an edge. After any modification, the algorithm determineswhether the new graph belongs to F and, in the positive, updates the chosenrepresentation.

Related works. The seminal paper for the recognition of interval graphs [1]solved the problem in linear time by introducing a data structure called PQ-tree.The algorithm of [1] is not dynamic: even though the consecutiveness constraintsof each vertex are added one by one, the maximal cliques of the graph need to becomputed in advance. The algorithm of [11] also considers the vertices arrivingone by one and updates the PQ-tree. But in order to achieve a linear complexity,the ordering on the vertices is not arbitrary and must be precomputed statically.On the opposite, the algorithm of [7] is truly incremental on vertices. In the worstcase, the cost of a vertex insertion may be up to Θ(n). But unfortunately, asmentioned by the author, the data structure he uses does not allow to treatvertex deletion, while our algorithm is able to do so, within the same worst casetime complexity. For edge modifications, [9] designed a fully dynamic algorithmthat runs in O(n log n) time per operation. Here, we lower this complexity toO(n).

C. Paul and M. Habib (Eds.): WG 2009, LNCS 5911, pp. 77–87, 2010.c© Springer-Verlag Berlin Heidelberg 2010

Page 88: Graph-Theoretic Concepts in Computer Science

78 C. Crespelle

Our results. Our algorithm treats the insertion of a vertex in an intervalgraph in a truly dynamic manner and is the first one also treating the deletionof a vertex; both operations being handled in O(n) time. We also lower thecomplexity of the best dynamic algorithm for edges [9] from O(n log n) to O(n)per operation, insertion or deletion. In addition, we do not only deal with therecognition problem but also maintain, within the same complexity, three usefulrepresentations of the graph: a minimal interval model, the PQ-tree and themodular decomposition.

Beside our algorithmic results, we give new insight into the structure of inter-val graphs by showing strong connections between the PQ-tree and the modulardecomposition of an interval graph. It should also be noted that Theorem 3gives a characterisation of the neighbourhood of a vertex in an interval graph.Complete proofs of all results presented here can be found in [2].

2 Preliminaries

Every graph considered here will be finite, undirected, loopless and simple.Throughout the paper, V denotes the vertex set of graph G and E its edgeset; we write G = (V, E). n stands for |V | and an edge between x and y is de-noted indifferently xy or yx. The neighbourhood of a vertex x ∈ V is denotedN(x) and its non-neighbourhood N(x). K(G) is the set of maximal cliques of G.A vertex x is simplicial in G iff its neighbourhood is a clique. A subset S � Vof vertices is uniform wrt. vertex x ∈ V \ S if S ⊆ N(x) (S is full) or S ⊆ N(x)(S is hollow). If S is not hollow, S is linked, and mixed if S is neither hollow norfull. When there is no confusion, we omit to mention the vertex x referred to.For a rooted tree T and a node u of T , we denote parent(u) for the parent of u inT , C(u) for its set of children, Anc(u) for the ancestors of u in T (u ∈ Anc(u)),and Tu for the subtree of T rooted at u. We sometimes identify the tree and itsset of nodes by denoting u ∈ T . For a linear ordering σ, we denote min(σ) andmax(σ) for respectively the first and last element of σ.

Interval graphs. An interval model of a graph G is a set I of intervals ofthe real line along with a mapping from V to I such that two vertices of Gare adjacent iff their corresponding intervals intersect. Interval graphs are thegraphs that admit such a model. In all the models considered in the following,intervals will be closed and will have integer bounds (the class remains the sameunder this restriction). Associating with each vertex the two integer bounds ofits corresponding interval yields an efficient data structure providing adjacencytesting in constant time. Interval graphs are well known to be chordal, thatis, they do not contain any induced cycle of length ≥ 4. One of their nicestcharacterisations is the following.

Theorem 1. [5] A graph G is an interval graph iff its maximal cliques can belinearly ordered such that, for every vertex x of G, the maximal cliques containingx occur consecutively.

Page 89: Graph-Theoretic Concepts in Computer Science

Fully Dynamic Representations of Interval Graphs 79

Such an ordering of the maximal cliques is called a consecutive ordering of G (orK(G)). Numbering the maximal cliques with their rank in a consecutive orderingσ and assigning to each vertex x of G the interval of σ consisting of the cliquescontaining x results in a model of G. The minimal models are precisely thosethat can be obtained this way.

It is shown in [1] that all the consecutive orderings of the maximal cliques ofa graph G can be represented by an O(|K(G)|)-space structure called PQ-tree.The PQ-tree of G, denoted T c, is a rooted tree whose leaves are the maximalcliques of G. Its internal nodes are labeled P (degenerate nodes) or Q (primenodes). Any Q-node q is assigned two linear orderings, denoted σq and σq, onthe set of its children, σq being the reverse order of σq. A solidification of aPQ-tree T , is an assignation, to each node u of T , of a linear ordering on itschildren: any linear ordering if u is a P -node, σu or σu if u is a Q-node. Thefrontier of a solidification s is the prefix order of the leaves of T resulting froma depth first search where the children of a given node u ∈ T are explored inthe order defined by s. A result of [1] states that the frontier is a one to onemapping from the set of solidifications of T c onto the set of consecutive orderingsof G.

Modular decomposition. The reader which is not familiar with the basicnotions of modular decomposition theory such as module, strong module, maxi-mal strong module (whose set is denotedMSM(G)) and prime graph may referto [13].

For a module M of G, we define the quotient graph G/M = G[(V \M)∪{a}],where a ∈ M is called the representative vertex of M . Similarly, for a family Pof pairwise disjoint modules, we define the quotient graph G/P by choosing arepresentative vertex for each module in P .

The modular decomposition tree of G is denoted T m, its leaves are the verticesof G and a node p ∈ T m represents the strong module of G, denoted V (p),which is the set of leaves of T m

p . The children of a node p of T m are the maximalstrong modules of G[V (p)]. To each node p of T m, we associate its quotient graphGp = G[V (p)]/MSM(G[V (p)]). From the well-known modular decompositiontheorem, the quotient Gp is either a stable set, then p is labeled parallel, ora clique, then p is labeled series, or a prime graph, then p is labeled prime.The parallel and series nodes are also called degenerate nodes. We will need thefollowing lemma.

Lemma 1. Let G and H be interval graphs, and x a vertex of G. Gx←H is aninterval graph iff: (i) x is simplicial; or (ii) H is a clique.

3 Three Representations of Interval Graphs

Minimal interval models. of an interval graph G consist of a consecutiveordering σ of G stored as a list. Each cell contains its position in the list andeach vertex of G is assigned two pointers (possibly the same) toward the cellsrepresenting the first and the last (wrt. σ) maximal clique of G containing x.

Page 90: Graph-Theoretic Concepts in Computer Science

80 C. Crespelle

The size of such a structure is O(n + |K(G)|) = O(n) as |K(G)| ≤ n− 1 for anyinterval graph.

The PQ-representation. is essentially the same structure as the MPQ-treeintroduced in [10]. In the classic PQ-tree, the maximal clique corresponding to aleave of T c is stored by the list of its vertices, which results in an O(n+m) spacestructure, while the number of nodes in the PQ-tree is only O(n). In the PQ-representation, the vertices of G are stored in the internal nodes of T c (thanksto the pointers defined below) instead of being stored in its leaves. Let u be anode of T c, we denote KT c(u) for the maximal cliques of G corresponding tothe leaves of T c

u. For a subset S ⊆ V of vertices, we denote K(S) for the set ofmaximal cliques of G containing S; and for a singleton we denote K(x) insteadof K({x}). For a vertex x ∈ V , we denote ex for the least common ancestor ofthe leaves of T c corresponding to the maximal cliques of G containing x.

Lemma 2. [11] For any vertex x of an interval graph G, exactly one of the twofollowing conditions holds: (i) K(x) = KT c(ex), or (ii) ex is a prime node and

∃(u1, u2) ∈ (C(ex))2 \ {(min(σex), max(σex ))}, u1 <σexu2 and K(x) =⋃

u1≤v≤u2KT c(v).

When (ii) is satisfied, we denote e1x and e2

x for the children u1 and u2 of ex. ThePQ-representation of an interval graph G, denoted PQ(G), is made of T c andthe set of vertices of G, where each vertex x stores a primary pointer toward ex,and two secondary pointers toward resp. e1

x and e2x when x satisfies (ii). These

pointers encode which maximal cliques of G (i.e. the leaves of T c) contain x.Since the number of nodes in T c is O(n) and since each vertex of G stores atmost three pointers, it follows that the total size of the PQ-representation isO(n).

Notation 1. (cf. Fig 1) Let ρ be the root of T c. For each node u of T c, wedefine the following sets:Xu = {y ∈ V | ey = u and y has no secondary pointers}Yu = {y ∈ V | ey = u and y has secondary pointers toward the children of u}u∗ = {y ∈ V | ey ∈ T c

u}Δu =

{{y ∈ Yu | e1y ≤σu

u ≤σue2

y} if u �= ρ (where u = parent(u))∅ if u = ρ

Bu =⋃

v∈Anc(u) Xv ∪Δv

Note that, by definition, if u is degenerate then Yu = ∅, and if parent(u) isdegenerate then Δu = ∅. Bu is the set of vertices that belong to all the maximalcliques corresponding to the leaves of T c

u, and u∗ is the set of vertices that areinvolved only in those cliques. The maximal clique of G corresponding to a leaff ∈ T c is precisely Bf .

The MD-representation. of an arbitrary graph G, denoted MD(G), is itsmodular decomposition tree T m along with the quotient graphs Gp of its primenodes p and a mapping from the vertices of Gp onto C(p). In the case where G

Page 91: Graph-Theoretic Concepts in Computer Science

Fully Dynamic Representations of Interval Graphs 81

12

34

e f g h

iS// j

P

2 43

1

S

k l

//

c d

S

a b

//

S

m

a b

c d

e f

g h i

j

m

k l

cda b e f i

gh j

lm

ku1 u2

v2

v1

MD-representation minimal interval modelPQ-representation

Fig. 1. Three representations of an interval graph. In the PQ-representation, the degen-erate nodes are represented by circles and the prime nodes by rectangles. The primarypointers are black, while the secondary pointers are grey. The primary pointers of thevertices that have secondary pointers are not represented. We have u∗

1 = {a, b, c, d},Xu1 = {c, d}, Xu2 = {k, l}, Yu2 = {g, h, i}, Bv2 = {f, g, h, k, l,m} and Δv1 = {i}.

is an interval graph, the quotient graphs are stored as minimal interval models.As the model of a prime node p takes O(|C(p)|) space, it yields an O(n) spacerepresentation of G.

3.1 Linear-Time Equivalence of PQ-Representation andMD-Representation

The equivalence is based on the fact that the PQ-representation of an intervalgraph is quite well structured regarding its strong modules.

Theorem 2. Let G be an interval graph. M is a non-trivial strong module of Giff |M | > 1 and there exists some node u ∈ T c satisfying one of the two followingconditions:1. M = u∗ or M = u∗ \Xu; or2. u is prime and ∃u1, u2 ∈ C(u), M = {y ∈ Yu | e1

y = u1 and e2y = u2}.

Theorem 2 justifies that the MD-representation can be obtained from the PQ-representation as follows. Hereinafter, we refer to this process as the PQ-MD-transformation. In a bottom-up manner, for each node u of T c, we computeT m(G[u∗]). For an internal node u, whose set of children is {u1, . . . , uk}, wehave to consider three different cases:

1. If Xu = ∅ and u is a degenerate node, the root u of T m(G[u∗]) is a parallelnode whose children are the roots of the trees T m(G[u∗1]), . . . , T m(G[u∗k]).

2. If Xu = ∅ and u is a prime node, the root u of T m(G[u∗]) is a prime node.The interval model of Gu is made with the list Z of children of u ordered byσu. The set of simplicial vertices of Gu is the set S = {v ∈ C(u) | v∗ �= ∅}. Forany v ∈ S, the root of T m(G[v∗]) is made a child of u and its correspondingvertex in Gu has two pointers toward the cell of v in Z. The non-simplicial

Page 92: Graph-Theoretic Concepts in Computer Science

82 C. Crespelle

vertices of Gu are the classes y of vertices y ∈ Yu having the same secondarypointers. The child v of u corresponding to y is a series node (or a leaf if|y| = 1) whose children are the vertices of y. The pointers of v toward Z arethe same as the pointers of any y ∈ y.

3. If Xu �= ∅, we first ignore the vertices of Xu and build T m(G[u∗ \Xu]) likedescribed above. Then, we introduce a new series node whose children arethe leaves representing vertices of Xu and the root of T m(G[u∗ \Xu]).

Processing the leaves of T c takes O(n) time. For a degenerate node u, treatment 1takes O(|C(u)|) time. In the processing of a prime node, the difficult operationis to find the equivalence classes y in Yu. To that purpose, we can bucket sortthe vertices y ∈ Yu with the rank of e1

y in Z as primary key, and the rank of e2y

as secondary key. As we sort |Yu| elements having values between 1 and |C(u)|,this takes O(|Yu| + |C(u)|) time. It follows that the processing time of a primenode is O(|Yu|+ |C(u)|). Finally, treatment 3 takes O(|Xu|) time. Thus, the totalcomputation time of T m(G) is O(

∑u∈T c |Xu| +

∑u∈T c |Yu| +

∑u∈T c |C(u)|) =

O(n).For lack of space, we do not detail the converse operation that gives the PQ-

representation from the MD-representation. It leans on a bottom-up search ofT m, similar to the one of T c, which also runs in O(n) time.

4 The Dynamic Algorithm

Since our three representations are O(n) time equivalent, and since we want toget an O(n) time algorithm, we can focus on maintaining only one of them andget the others within the same complexity. We chose to concentrate on showinghow to maintain the MD-representation. However, when they are more conve-nient, we will also use the other representations and the equivalence betweenthem.

Since edge modifications can be handled by one vertex deletion followed byone vertex insertion, we will not specifically consider them.

For lack of space, we do not present the deletion algorithm but only giveits general idea. When the parent u ∈ T m of the vertex x to be deleted isdegenerate, we simply remove the leaf corresponding to x and make some localcleaning of the tree, exactly as in [3]. When u is prime, we use the algorithm of[12] that computes the PQ-tree from an interval model, and we use the PQ-MD-transformation to get the updated MD-representation. We now concentrate onvertex insertion.

4.1 Focus on the Key Node

[3] showed that, for an arbitrary graph, the modifications of T m under vertexinsertion are located in the subtree of T m rooted at the insertion node wm,defined further. Here, we introduce the key node w that plays the same role inT c and we show that, in order to determine whether G + x is an interval graph,we can restrict our attention to G[w∗] + x.

Page 93: Graph-Theoretic Concepts in Computer Science

Fully Dynamic Representations of Interval Graphs 83

From now on, x will be a vertex to be inserted in an interval graph G, andwe denote G′ for G + x. We will say that a node u ∈ T m (resp. T c) is uniform,mixed, full, hollow or linked (see definitions p. 78) referring to the set V (u) (resp.u∗). A node u ∈ T c is saturated iff u∗ and Bu are full.

Definition 1. [3] A node u ∈ T m is proper iff either u is uniform wrt. x, or uis a mixed node with a (unique) mixed child f such that V (f)∪ {x} is a moduleof G′[V (u)∪{x}]. The insertion node, denoted wm, is the least common ancestorof the non-proper nodes of T m.Node wm is said to be cut iff wm has no mixed child and either wm is primeand has a child f such that V (f) ∪ {x} is a module of G′[V (wm) ∪ {x}], or wm

is degenerate.

In the following, we do not consider the trivial case where V is uniform. More-over, from now on, we only consider the case where wm is not cut and theneighbourhood of V (wm) is a clique: the other cases are easy to deal with. Weadopt the following definition.

Definition 2. The key node w is the node of T c such that V (wm) = w∗ orV (wm) = w∗ \Xw.

Note that in Condition 2 of Theorem 2, the neighbourhood of M is not a clique.Thus, in the present case, V (wm) satisfies Condition 1 of Theorem 2, whichensures the existence of node w. It is straightforward to see that V (wm) ∪ {x}is a module of G+x, and since w∗ is a module of G and V (wm) ⊆ w∗, it followsthat w∗ ∪ {x} is a module of G + x. Furthermore, since the neighbourhood ofV (wm) in G is a clique, the neighbourhood of w∗ ∪ {x} in G + x is a clique.Then, the lemma below follows from Lemma 1.

Lemma 3. G + x is an interval graph iff G[w∗] + x is an interval graph.

4.2 Dynamic Characterisation of Interval Graphs

In this section, we characterise the insertions of a vertex x in an interval graphG that result in an interval graph. We start with the definitions and notationswe use in our characterisation.

Definition 3. Let u be a prime node of T c and v ∈ C(u). v satisfies the left(resp. right) property iff ∀y ∈ Yu ∩N(x), e2

y ≥ v (resp. e1y ≤ v).

Notation 2. If the saturated children of u form an interval of σu, we denoteIu for this interval and lu (resp. ru), if it exists, for the child of u immediatelypreceding (resp. following) Iu.

Lemmas 4 to 7 give some necessary conditions for G+x to be an interval graph,and Theorem 3 states that they are also sufficient. We omitted the proofs of theLemmas since they are too technical to be sketched within the space limitation.As a general hint, we can say that their statement widely lean on the fact that

Page 94: Graph-Theoretic Concepts in Computer Science

84 C. Crespelle

deleting x in all the cliques of a consecutive ordering σ′ of G′ and removing theobtained cliques that are not maximal in G results in a consecutive ordering ofG. Roughly speaking, this implies that, in σ′, the maximal cliques of the newgraph G′ appear in an order that somehow respects the constraints previouslyimposed by the nodes of T c.

Lemma 4. If G + x is an interval graph, any node u ∈ T cw \ {w} has at most

one mixed child, and w has at most two mixed children. Furthermore, for allu ∈ T c

w, if Bu is not full, then u has at most one linked child.

The other necessary conditions for G′ to be an interval graph apply only toprime nodes of T c

w.

Lemma 5. If G + x is an interval graph, for all prime nodes u ∈ T cw, the set

of saturated children of u is an interval Iu of σu. And if Iu �= ∅, then any nodev1 ∈ C(u) \ (Iu ∪ {lu, ru}) is hollow.

Lemma 6. If G + x is an interval graph, any prime node u �= w of T cw satisfies

one of the following conditions:1. Bu is full and Iu �= ∅; and, up to reversing σu, max(σu) ∈ Iu and lu satisfies

the left property.2. Bu is full and Iu = ∅, or Bu is not full; and, up to reversing σu, max(σu)

satisfies the left property and the nodes of C(u) \ {max(σu)} are hollow.

Lemma 7. If G + x is an interval graph and if w is a prime node, it satisfiesone of the following conditions:1. Bw is full and Iw �= ∅; and lw and rw satisfy respectively the left and right

property.2. Bw is full and Iw = ∅; and, one of the two following conditions holds:

(a) there exist two consecutive elements l and r in σw, with l <σw r, thatsatisfy respectively the left and right property, and the nodes of C(w) \{l, r} are hollow, and Δl ∩Δr ⊆ N(x); or

(b) up to reversing σw, max(σw) satisfies the left property and the nodes ofC(w) \ {max(σw)} are hollow.

3. Bw is not full; and, up to reversing σw, max(σw) satisfies the left propertyand the nodes of C(w) \ {max(σw)} are hollow.

Theorem 3. G+x is an interval graph iff the conditions of Lemmas 4 to 7 aresatisfied.

Sketch of proof. If the conditions of Lemmas 4 to 7 are satisfied, we can builda consecutive ordering of G[w∗] + x. To that purpose, we first build, for everyfull node u, a consecutive ordering of G[u∗] + x. Then, inductively, in a bottomup traversal of T c

w, we build, for every mixed node u ∈ T cw \ {w}, a consecutive

ordering of G[u∗] + x st. the last maximal clique contains x. There are severalcases to be considered. We cannot discuss each of them but we detail, as an ex-ample, the case where u satisfies Cond. 1 of Lemma 6 and lu is mixed and Blu is

Page 95: Graph-Theoretic Concepts in Computer Science

Fully Dynamic Representations of Interval Graphs 85

full. In this case we obtain a consecutive ordering σ′ of G[u∗] + x by appending,in the order defined by σu, the consecutive orderings of G[v∗] of nodes v <σu lu,the consecutive ordering of G[l∗u] + x built previously in the induction, and theconsecutive orderings of G[v∗]+x of nodes v >σu lu. Moreover, for any v ∈ C(u),we add the vertices of Δv ∪Xu to the cliques of G[v∗] (or G[v∗] + x if v ≥σu lu).Since we use a consecutive ordering of G[l∗u]+x whose last clique contains x, thecliques of σ′ containing x form an interval. Once we get the consecutive orderingsrelated to the mixed children of w, as w satisfies the conditions of Lemma 7, alast induction step allow us to obtain, in a similar way, a consecutive orderingof G[w∗] + x. �

4.3 Overview of the Algorithm and Complexity

The first step of our algorithm collects some information about T m and T c, andfinds the key node w. The second step checks whether T c

w satisfies the conditionsof Lemmas 4 to 7, that is whether G + x is an interval graph. In the positive,the third step updates MD(G) by building MD(G′).

Marking step. We first determine for each node of T m whether it is full, mixedor hollow by a well-known bottom-up marking process of the tree (see [14]), inO(n) time. Then, we find the insertion node wm by following a path from theroot to w, while the visited node u is proper, we visit its unique mixed child(see [3]); the first non-proper node found is wm. As we mentionned, the caseswhere wm is cut or where the neighbourhood of V (wm) is not a clique are easyto deal with. We now describe the algorithm in the opposite case. Thanks to thecorrespondence between T c and T m, we find the key node w and determine foreach node of T c whether it is full, mixed or hollow. Finally, a simple top-downsearch of T c allows us to determine for each node u whether Bu is full, mixedor hollow. The first step runs in O(n) time.

Testing step. The conditions of Lemma 4 can be tested in O(|C(u)|) time bya simple search of C(u). The difficulty of checking the conditions of Lemma 5 isto decide whether the saturated children of u form an interval. To that purpose,we determine the set S = {v ∈ C(u) | Δv ⊆ N(x)}. We first bucket sort thevertices of y ∈ Yu∩N (x) by increasing e1

y. As 1 ≤ e1y ≤ |C(u)|, it takes O(|C(u)|)

time. Examining the vertices of Yu ∩N(x) in this order, we are able to maintaina partition of the children v of u such that Δv contains none of the verticesy ∈ Yu ∩ N(x) examined so far; each set of this partition being an interval ofC(u). At the end of the routine, we obtain a partition of S. Then, checkingthe conditions of Lemma 5 becomes easy. It can be done in O(|C(u)| + |Yu|)time. For a child v of a prime node u, it is easy to check whether v satisfiesthe left or right property by scanning Yu. It follows that the only difficulty inchecking the conditions of Lemmas 6 and 7 is to check Cond. 2a of Lemma 7. Letw1 = minσw{e2

y | y ∈ Yw ∩N(x)}. The children of w satisfying the left propertyare exactly the nodes v ≤σw w1. In the same way, we find the children of wsatisfying the right property. Then, the couples (f, l) st. f and l resp. satisfy the

Page 96: Graph-Theoretic Concepts in Computer Science

86 C. Crespelle

left and right property define an interval of σw. The same technique as the oneused to check the conditions of Lemma 5 determines the couples (f, l) such thatΔf ∩Δl ⊆ N(x). Hence, Cond. 2a of Lemma 7 can be tested in O(|C(w)|+ |Yw |)time. Finally, since all the conditions can be tested for a node u in O(|C(u)|+|Yu|)time, we can determine whether G + x is an interval graph in O(n) time.

Insertion step. If G + x is not an interval graph, then the algorithm stops.Otherwise, the MD-representation is updated. Since V (wm) ∪ {x} is a strongmodule of G′ = G + x (cf. [3]), we can obtain MD(G′) by replacing node wm ofMD(G) with the root of MD(G[V (wm)]+x). In order to get MD(G[V (wm)]+x)we first compute an interval model of G[w∗]+x. In the proof of Theorem 3, it isshown how to build a consecutive ordering of G[w∗]+x by a bottom-up traversalof T c

w. At each step, we concatenate the orderings computed for the children ofthe current node u, and we assign pointers to the vertices of Xu ∪ Yu; this takesO(|C(u)|+ |Xu|+ |Yu|) time. Thus, the whole processing of T c

w takes O(n) time.Once we get an interval model of G[w∗] + x we can easily extract a model ofG[V (wm)] + x, and thanks to the algorithm of [12] that computes the PQ-treefrom an interval model, we get PQ(G[V (wm)] + x) in O(n) time. The PQ-MD-transformation (see p.81) provides us with MD(G[V (wm)]+x) within the samecomplexity. Thus, the total computation time of MD(G′) is O(n).

Acknowledgements

The author thanks Christophe Paul for useful discussions on the subject.

References

1. Booth, K.S., Lueker, G.S.: Testing for the consecutive ones property, intervalgraphs, and graph planarity using PQ-tree algorithms. J. Comput. Syst. Sci. 13(3),335–379 (1976)

2. Crespelle, C.: Dynamic representations of interval graphs (manuscript) (2009),http://www-npa.lip6.fr/~crespell/publications/DynInt_long.pdf

3. Crespelle, C., Paul, C.: Fully dynamic algorithm for recognition and modular de-composition of permutation graphs. Algorithmica,http://www.springerlink.com/content/u6x0054g3h348810/;Ext. abs. in WG 2005

4. Crespelle, C., Paul, C.: Fully dynamic recognition algorithm and certificate fordirected cographs. Discrete Applied Mathematics 154(12), 1722–1741 (2006); Ext.abs. in WG 2004

5. Gilmore, P.C., Hoffman, A.J.: A characterization of comparability graphs and ofinterval graphs. Canad. J. Math. 16, 539–548 (1964)

6. Hell, P., Shamir, R., Sharan, R.: A fully dynamic algorithm for recognizing andrepresenting proper interval graphs. SIAM J. Comput. 31(1), 289–305 (2002)

7. Hsu, W.-L.: On-line recognition of interval graphs in O(m+nlogn) time. In: Com-binatorics and Computer Science, pp. 27–38 (1996)

8. Ibarra, L.: Fully dynamic algorithms for chordal graphs. In: SODA, pp. 923–924(1999)

Page 97: Graph-Theoretic Concepts in Computer Science

Fully Dynamic Representations of Interval Graphs 87

9. Ibarra, L.: A fully dynamic algorithm for recognizing interval graphs using theclique-separator graph. Tech. Report DCS-263-IR, Dept. of Computer Science,University of Victoria (2001)

10. Korte, N., Mohring, R.H.: Transitive orientation of graphs with side constraints.In: Nagl, M. (ed.) WG 1995. LNCS, vol. 1017, pp. 143–160. Springer, Heidelberg(1995)

11. Korte, N., Mohring, R.H.: An incremental linear-time algorithm for recognizinginterval graphs. SIAM J. Comput. 18, 68–81 (1989)

12. McConnell, R.M., de Montgolfier, F.: Algebraic operations on PQ trees and mod-ular decomposition trees. In: Kratsch, D. (ed.) WG 2005. LNCS, vol. 3787, pp.421–432. Springer, Heidelberg (2005)

13. Mohring, R.H., Radermacher, F.J.: Substitution decomposition for discrete struc-tures and connections with combinatorial optimization. Annals of Discrete Math-ematics 19, 257–356 (1984)

14. Muller, J.H., Spinrad, J.P.: Incremental modular decomposition algorithm.JACM 36(1), 1–19 (1989)

15. Nikolopoulos, S.D., Palios, L., Papadopoulos, C.: A fully dynamic algorithm for therecognition of p4-sparse graphs. In: Fomin, F.V. (ed.) WG 2006. LNCS, vol. 4271,pp. 256–268. Springer, Heidelberg (2006)

16. Tedder, M., Corneil, D.G.: An optimal, edges-only fully dynamic algorithm fordistance-hereditary graphs. In: Thomas, W., Weil, P. (eds.) STACS 2007. LNCS,vol. 4393, pp. 344–355. Springer, Heidelberg (2007)

Page 98: Graph-Theoretic Concepts in Computer Science

The Parameterized Complexity of SomeMinimum Label Problems

Michael R. Fellows1, Jiong Guo2, and Iyad A. Kanj3

1 The University of Newcastle, Callaghan, NSW 2308, [email protected]

2 Institut fur Informatik, Friedrich-Schiller-Universitat Jena, Ernst-Abbe-Platz 2,D-07743 Jena, [email protected]

3 School of Computing, DePaul University, 243 S. Wabash Avenue, Chicago, IL60604, USA

[email protected]

Abstract. We study the parameterized complexity of several minimumlabel graph problems, in which we are given an undirected graph whoseedges are labeled, and a property Π , and we are asked to find a subsetof edges satisfying property Π that uses the minimum number of labels.These problems have a lot of applications in networking. We show thatall the problems under consideration are W[2]-hard when parameterizedby the number of used labels, and that they remain W[2]-hard evenon graphs whose pathwidth is bounded above by a small constant. Onthe positive side, we prove that most of these problems are FPT whenparameterized by the solution size, that is, the size of the sought edge set.For example, we show that computing a maximum matching or an edgedominating set that uses the minimum number of labels, is FPT whenparameterized by the solution size. Proving that some of these problemsare FPT is nontrivial, and requires interesting and elegant algorithmicmethods that we develop in this paper.

1 Introduction

In this paper we consider several minimum label graph problems that are definedas follows:

Input: A graph G = (V, E) whose edges are associated with labels orcolors specified by a function C : E → C, where C denotes the set oflabels (also referred to as colors in this paper), a graph property Π , andan integer d.Output: A set E′ ⊆ E such that the subgraph of G consisting of theset of edges in E′ satisfies Π , and the number of labels/colors used bythe edges in E′ is at most d.

Minimum label problems have been extensively studied in the last few years.These problems are motivated by applications from telecommunication networks,

C. Paul and M. Habib (Eds.): WG 2009, LNCS 5911, pp. 88–99, 2010.c© Springer-Verlag Berlin Heidelberg 2010

Page 99: Graph-Theoretic Concepts in Computer Science

The Parameterized Complexity of Some Minimum Label Problems 89

electrical networks, and multi-modal transportation networks. For example, incommunication networks, there are different types of communication media, suchas optic fiber, cable, microwave, and telephone line. A communication node maycommunicate with different nodes by choosing different types of communicationmedia. Given a set of communication network nodes, the problem of findinga connected communication network using as few types of communication me-dia (i.e., labels/colors) as possible is exactly the Minimum Label Spanning

Tree problem, in which the property Π is the property of being a spanningtree of G (see [5,13] for more details). Among the minimum label problemsthat have been extensively studied, we mention the Minimum Label Span-

ning Tree problem [1,2,3,5,8,10,13,14,17,18,19], the Minimum Label Path

problem [2,4,8,16,20] (where Π is the property of being a path between twodesignated vertices), the Minimum Label Cut problem [9,20] (where Π is theproperty of being a cut between two designated vertices), and the Minimum

Label Perfect Matching problem [11] (where Π is the property of being aperfect matching).

The previous work on minimum label problems mainly dealt with determiningthe classical complexity of these problems and studying their approximabilty.Some of the previous work, however, dealt with developing exact algorithms forthese problems. For example, Broersma et al. [2] devised two exact algorithms forthe Minimum Label Path and Minimum Label Cut problems with runningtimeO(n ·min{|C|d(s,t), 2|C|}) and O(n2 · |C|!), respectively, where C denotes the setof labels (colors), and d(s, t) denotes the distance between the two designatedvertices s and t.

In the current paper we study the parameterized complexity of several mini-mum label graph problems, with respect to two natural parameters: the numberof used labels d, and the size of the solution |E′|. The problems under con-sideration are: Minimum Label Spanning Tree (MLST), Minimum Label

Hamiltonian Cycle (MLHC) (where Π is the property of being a Hamiltoniancycle), Minimum Label Cut (MLC), Minimum Label Edge Domination

Set (MLEDS) (where Π is the property of being an edge dominating set, thatis, every edges in E \ E′ shares at least one endpoint with some edge in E′),Minimum Label Perfect Matching (MLPM), Minimum Label Maximum

Matching (MLMM) (where Π is the property of being a maximum matchingof G), and Minimum Label Path (MLP).

From some of the NP-hardness reductions for the above problems, we can de-rive parameterized intractability results with respect to the parameter d; forexample, the NP-hardness reduction for Minimum Label Spanning Tree

shows that this problem is W[2]-hard [10]. In this paper, we strengthen these in-tractability results by showing that, even on graphs whose pathwidth is at mosta small constant, when parameterized by the number of used labels d, theseproblems remain W[2]-hard. These results are interesting, as very few naturalparameterized problems are known to be (parameterized) intractable on graphswith bounded pathwidth. When parameterized by the solution size |E′|, we show

Page 100: Graph-Theoretic Concepts in Computer Science

90 M.R. Fellows, J. Guo, and I.A. Kanj

that, with the only exceptions of Minimum Label Path and Minimum Label

Cut, which are W[1]-hard, all other problems are fixed-parameter tractable (ongeneral graphs). Showing that some of these problems are FPT is non-trivial,and requires elegant algorithmic methods that we develop in this paper.

All the hardness results will be presented in Section 2, while Section 3 containsall the fixed-parameter tractability results.

For the background and terminologies on graphs, we refer the reader toWest [15], and for that on parameterized complexity, we refer the reader toDowney and Fellows’ book [7].

2 Parameterized Hardness Results

First, we show that even on graphs whose pathwidth is at most a small constant,all the considered minimum label problems are W[2]-hard, when parameterizedby the number of used labels d. These results are very interesting since there arefew problems that are known to be W-hard on graphs of bounded pathwidth.

Theorem 2.1. Parameterized by the number of used labels d:

– Minimum Label Edge Dominating Set and Minimum Label Maximum

Matching are W[2]-hard on trees of pathwidth at most 1;– Minimum Label Spanning Tree and Minimum Label Path are W[2]-

hard on graphs with pathwidth at most 2;– Minimum Label Cut and Minimum Label Perfect Matching are

W[2]-hard on graphs with pathwidth at most 3; and,– Minimum Label Hamiltonian Cycle is W[2]-hard on graphs with path-

width at most 5.

Proof. All the corresponding FPT-reductions are from the W[2]-hard Hitting

Set (HS) problem, defined as follows. Given a ground set S, a collection L ofsubsets of S, and a nonnegative integer k, decide if there exists a subset S′

of S of cardinality at most k, such that every subset in L has a non-emptyintersection with S′. We only give one FPT-reduction showing that Minimum

Label Spanning Tree (MLST) is W[2]-hard. The reductions for the otherproblems are similar.

For a given instance of HS, we construct a graph G where, for each subset cin L, there is a star consisting of a root vertex and |c| leaves. The edges in thisstar are labeled with the elements of c. Then, we connect the leaves of this star bya path whose edges have the same label x, where x /∈ S. Finally, we connect allroot vertices by a path whose edges have the same label x. Clearly, the resultinggraph has pathwidth 2. Observe that every size-d solution of the HS-instancecorresponds to a solution of the resulting MLST-instance using d+1 labels, andvice versa. This gives the W[2]-hardness of MLST.

By reductions from Multicolored Clique, we can show the followingtheorem:

Page 101: Graph-Theoretic Concepts in Computer Science

The Parameterized Complexity of Some Minimum Label Problems 91

Theorem 2.2. Parameterized by the solution size |E′|:– Minimum Label Cut is W[1]-hard on graphs with pathwidth at most 4, and– Minimum Label Path is W[1]-hard on graphs with pathwidth at most 2.

3 Fixed-Parameter Tractability Results

Parameterized by the solution size, Minimum Label Spanning Tree, Mini-

mum Label Perfect Matching, and Minimum Label Hamiltonian Cycle

are all fixed-parameter tractable, since the instance size is bounded by a functionof the parameter. However, it requires much more effort to show that Minimum

Label Maximum Matching (MLMM) and Minimum Label Edge Domi-

nating Set (MLEDS) are fixed-parameter tractable with respect to the sameparameter. We note that we are mainly concerned with establishing the fixed-parameter tractability of MLMM and MLEDS. Consequently, the running timeof the parameterized algorithms developed in this paper is not very practical,and can definitely be improved much further.

3.1 Minimum Label Maximum Matching (MLMM)

Let (G, k) be an instance of MLMM, where k is the size of a maximum matchingin G. We denote by e(G) and n(G) the number of edges and vertices, respectively,in G. Let M be a maximal matching in G, I = V (G) \ V (M), and note that Iis an independent set in G. We denote by G[M ] the subgraph of G induced bythe endpoints of the edges in M .

The algorithm is a search-tree based algorithm: it starts by growing a setof partial solutions, i.e., matchings, into an optimal solution, i.e., a maximummatching that uses the minimum number of colors. To do so, the algorithmbranches on some vertices and edges in G to decide whether they belong to anoptimal solution or not. Since the branching will consider all possibilities, wewill maintain the invariant that at least one partial solution, among all partialsolutions we keep, can be extended to an optimal solution. The algorithm canbe split into three stages, each trying to simplify the resulting instance furtherby possibly performing more branchings.

Stage 1 Let Mopt be an optimal solution that we are trying to compute. Forevery edge e in G[M ] we branch as follows.

– e in Mopt: in this case we include e, decrement k by 1, and remove e and itsendpoints from the graph. We also record that the color C(e) is used in theoptimal solution.

– e is not in Mopt: in this case we simply remove e, that is, we set G := G− e.

For every remaining vertex v in G[M ] we branch as follows.

– v in Mopt: in this case we keep v in the graph.– v is not in Mopt: in this case we remove v by setting G := G− v.

Page 102: Graph-Theoretic Concepts in Computer Science

92 M.R. Fellows, J. Guo, and I.A. Kanj

Let S be the set of remaining vertices in G[M ], and note that since all theedges in G[M ] have been removed during the branching, S is an independentset. Moreover, assuming that our partial solution (branching) is valid (i.e., leadsto an optimal solution), every vertex in S must be an endpoint of an edge inthe optimal solution Mopt. Without loss of generality, and since the parameter kcan only decrease during the branching, we will denote the resulting parameterby k; this will simplify the notation in the remaining discussion. Assuming thatour branching is valid, we have the following observation.

Observation 3.1. The following are true:

(a) |S| = k, and hence,(b) for every u ∈ I, deg(u) ≤ k.

Let B = (S, I) be the resulting bipartite graph from G after the branching. Theremaining task amounts to computing a matching with the minimum number ofcolors that matches S into I—and hence has size k, under the constraint thatsome of the colors have been used.

Analysis of the number of partial solutions enumerated in Stage 1Since |M | ≤ k, the number of vertices in G[M ] is at most 2k, and the numberof edges in G[M ] is at most

(2k2

)= k(2k − 1).

The branching in Stage 1 can be implemented as follows. For each i = 0, . . . , k,we choose a matching of size i from the edges in G[M ] to be included in Mopt.For each of the remaining at most (2k− 2i) vertices in G[M ], we branch on it asindicated above, thus creating at most 22k−2i partial solutions. Therefore, thenumber of partial solutions enumerated in Stage 1 is bounded above by:

k∑

i=0

(k(2k − 1)

i

)22k−2i = 4k

k∑

i=0

(k(2k − 1)

i

)1/4i (1)

≤ 4k

(k(2k − 1)

k

) k∑

i=0

1/4i (2)

≤ 4k · (e(2k − 1))k ·O(1) (3)≤ 4k · (2ek)k ·O(1) = O((8ek)k).

Inequality (2) is justified by the fact that the coefficient(k(2k−1)

k

)is the largest

coefficient in the summation. Inequality (3) uses the fact that(nk

) ≤ (en/k)k,where e is the base of the natural logarithm (for instance, see [6]). It follows thatthe number of partial solutions enumerated in Stage 1 is O((8ek)k).

Stage 2 Given the bipartite graph B = (S, I) and the parameter k, we try inthis stage to simplify the instance further by performing more branching. Wesay that a matching is monochromatic if all its edges have the same color. IfM ′ is a monochromatic matching, we denote by C(M ′) the color of the edgesin M ′.

Page 103: Graph-Theoretic Concepts in Computer Science

The Parameterized Complexity of Some Minimum Label Problems 93

We would like to partition S into groups such that all the vertices in the samegroup are matched in Mopt by a monochromatic matching of a distinct color.For this purpose we try all possible partitions of S. For a fixed partition of Sinto � groups S1, . . . , S�, we work under the assumption that the vertices in eachgroup are matched by a monochromatic matching in Mopt of a distinct color(with respect to the colors of the other groups). Clearly, there exists at least onepartition of S for which this working hypothesis is true, namely the one inducedby the color classes in Mopt.

Let S1, . . . , S� be a fixed partition of S into � nonempty groups, where 1 ≤� ≤ k is an integer. It is possible that a group Si uses the color of an edgethat was added to a partial solution in Stage 1. Therefore, for each (possiblyempty) subset Cused of the set of colors of the edges added in Stage 1, we tryall one-to-one mappings from Cused to {S1, . . . , S�}. Fix such a mapping. Thensome groups in {S1, . . . , S�} have been assigned colors, and hence the colors ofthe monochromatic matchings sought for these groups are fixed. Clearly, sincewe are trying all possible assignments of the used colors to the groups, there willbe an assignment that corresponds to that of Mopt, and we are safe.

Let Si, i ∈ {1, . . . , �}, be a group. If Si has a preassigned color, let ci be thiscolor and define Mi = {Mi |Mi is a monochromatic matching that matches Si

into I and C(Mi) = ci}. Otherwise, the color of Si is undetermined yet, and inthis case define Mi = {Mi |Mi is a monochromatic matching that matches Si

into I}.Let h(k) be a function of k to be determined later, and let Si, i ∈ {1, . . . , �},

be a group. We perform more branching to simplify the instance as follows.If |Mi| ≤ h(k), we branch on every matching in Mi as the matching that

matches Si in Mopt. For each branch corresponding to a matching Mi inMi, weadd the edges in Mi to the potential solution, decrement k by |Si|, remove thevertices in V (Mi) from the graph, and remove every edge whose color is C(Mi)from the graph (such an edge can no longer be used). Since we are trying allpossible matchings Mi in Mi, we are safe.

If the total number of colors used by the matchings in Mi is at most h(k),we branch by trying all possible colors appearing in Mi to determine the colorused in Mopt to match Si (this color has to be one of the colors inMi). For eachsuch color c, we remove all the edges in Mi whose colors are different from c.Again, since we are branching on all possible colors in Mi, we are safe.

If all the edges of the matchings inMi have the same color, and if there existsa vertex v in Si with at most h(k) edges incident on it in the matchings inMi,we branch on which edge in a matching in Mi matches v in Mopt. For eachbranch corresponding to an edge ev, we add ev to the potential solution, removethe endpoints of ev from the graph, and decrement k by 1. We can now assumethe following.

Assumption 3.2. For each i ∈ {1, . . . , �}:(i) |Mi| > h(k).(ii) Either the number of colors appearing in Mi is more than h(k), or it is

exactly 1.

Page 104: Graph-Theoretic Concepts in Computer Science

94 M.R. Fellows, J. Guo, and I.A. Kanj

(iii) If Mi has exactly one color appearing in it, then every vertex in Si hasmore than h(k) edges that are incident on it in the matchings in Mi.

In the next stage we show how, given the above assumption, we can easily com-pute a solution to the resulting instance.

Analysis of the number of partial solutions enumerated in Stage 2Let cused be the number of colors used in Stage 1. The number of partitionsof S into � groups is at most �|S| ≤ �k. For each partition of S into � groups,where � ≥ cused, we map the colors used in a one-to-one fashion to a subset ofthe � groups. There are at most �!/(� − cused)! ≤ �! such mappings. Therefore,the total number of partitions of S in which some of the � groups (exactlycused many groups among them) have been assigned the used colors is at most∑k

�=1 �k�! ≤ kk+1k!.Now for each Si, i ∈ {1, . . . , �}, we compute at most h(k) + 1 monochromatic

matchings Mi ∈ Mi. To do so, we iterate over each color c, and compute atmost h(k) + 1 monochromatic matchings of color c. For a fixed color c, weconsider the subgraph of B consisting only of the edges incident on Si whosecolor is c. Note that each matching in this subgraph that matches Si into I isa maximum matching. It was shown in [12] how, after computing a maximummatching in a bipartite graph, every other maximum matching can be computedin linear time in the number of vertices of the subgraph, per matching. Therefore,computing at most h(k) + 1 monochromatic matchings of color c that match Si

into I can be done in time O(e(G)√

n(G) + n(G)h(k)). As a matter of fact,since whenever we fix a color c for a group Si we only look at the edges ofcolor c incident on the vertices in Si, and since we totally compute at mosth(k) + 1 matchings incident on the vertices in Si, computing at most h(k) + 1monochromatic matchings (regardless of the color) incident on the vertices of Si

can be done in time O(e(G)√

n(G)+n(G)h(k)). Since there are at most k groups,computing the sets Mi, i = 1, . . . , �, can be done in time O(ke(G)

√n(G) +

kh(k)n(G)).To make the graph B satisfy the statements in Assumption 3.2, we do the

following. After computing the setMi for each group Si as indicated above, wecheck if |Mi| ≤ h(k). If it is, we branch on every monochromatic matching inMi. For each such matching Mi, we remove the endpoints of the edges in Mi,and hence the group Si from the graph, and decrease the parameter by |Si|.Since we are branching on every monochromatic matching in Mi, we are safe.Since there are at most h(k) matchings in Mi, and at most k groups Si, thetotal number of enumerations is at most h(k)k.

Now we can assume that the cardinality of each set Mi is at least h(k) + 1.If there is a set Mi such that the total number of colors appearing in it is

at most h(k), then we branch by trying every color in Mi as the color used tomatch Si in Mopt. For each such color c, we remove all the edges incident on Si

whose color is different from c, and we remove every edge whose color is c butis not incident on a vertex in Si. The total number of enumerations is again atmost h(k)k.

Page 105: Graph-Theoretic Concepts in Computer Science

The Parameterized Complexity of Some Minimum Label Problems 95

Finally, if we have a set Mi such that all the matchings in this set have thesame color c, then for every vertex v (if any) in Si whose degree in Mi is atmost h(k), we branch on which edge inMi is used to match v in Mopt. For eachedge in Mi incident on v, we remove the endpoints of the edge from the graphand decrement k by 1. Since we are trying all possible edges incident on such avertex v, we are safe. The total number of enumerations in this case is at mosth(k)k (there are at most k vertices in S).

We can now assume that B satisfies the statements in Assumption 3.2. Thetotal number of enumerations incurred to make B satisfy the statements inAssumption 3.2 is at most h(k)k · h(k)k · h(k)k = h(k)3k.

It follows that the number of partial solutions enumerated in Stage 2 isbounded above by the number of partitions of S, multiplied by the numberof enumerations to make B satisfy the statements in Assumption 3.2. From theabove discussion, it follows that the number of partial solutions enumerated inStage 2 is O(kk+1k! + h(k)3k).

Stage 3 Given an instance B = (S, I) and a parameter k such that S is par-titioned into S1, . . . , S�, where each set Mi associated with Si, for i = 1, . . . , �,satisfies the statements of Assumption 3.2, the following theorem asserts that,in time O(k3), we can compute a matching M ′ that matches S into I, and suchthat the set of edges in M ′ incident on Si is a monochromatic matching whoseedges are edges from the matchings inMi. The proof is omitted for lack of space.

Theorem 3.1. Let h(k) ≥ k2+k. Assuming that eachMi, i = 1, . . . , �, satisfiesAssumption 3.2, then in time O(k3) we can compute a matching M ′ that matchesS into I, such that the set of edges in M ′ incident on Si, for i = 1, . . . , �, is amonochromatic matching whose edges are edges from the matchings in Mi.

Analysis of the running time of Stage 3By Theorem 3.1, computing the matching M ′ takes O(k3) time.

Putting all together. The correctness of the algorithm follows from the factthat it is enumerating all possible branchings. For each possible branching, eitherwe reject the instance, or we end up computing a maximum matching that usesa certain number of colors. The maximum matching we output at the end isthe maximum matching with the minimum number of colors. The running timeof the algorithm is bounded by the number of partial solutions enumerated,multiplied by the running time spent along each enumeration (path in the searchtree). The number of partial solutions we enumerate is the product of thoseenumerated in Stage 1 (O((8ek)k)) and Stage 2 (O(kk+1k! + h(k)3k)), which isO((8e)k ·k7k) after choosing h(k) = k2+k. Along each path in the search tree weend up processing the graph G, which takes linear time in its number of verticesand edges, computing a maximum matching in G, which takes O(e(G)

√n(G)),

and computing the setsMi in Stage 2, which takes O(ke(G)√

n(G) + k3n(G)).Therefore, the running time of the algorithm is O((8e)k · k7k+3e(G)

√n(G)).

Theorem 3.2. Minimum Label Maximum Matcing is FPT when parame-terized by the size of the maximum matching in the graph.

Page 106: Graph-Theoretic Concepts in Computer Science

96 M.R. Fellows, J. Guo, and I.A. Kanj

3.2 Minimum Label Edge Dominating Set (MLEDS)

The ideas used by the algorithm are similar in flavor to those used for theMLMM problem. Therefore, we will omit some details to avoid repetition. Westart with the following easy observation.

Observation 3.3. Let M be a matching in G, and let Q be an edge dominatingset of G. Then |Q| ≥ |M |/2.

Let (G, k) be an instance of MLEDS. Let M be a maximal matching in G,I = V (G) \ V (M), and note that I is an independent set in G. If |M | > 2k,then by Observation 3.3, G does not have an edge dominating set of size at mostk, and we can reject the instance (G, k). Therefore, we may assume henceforththat |M | ≤ 2k.

Similar to what we did for the MLMM problem, we will branch on the edgesand vertices in M to determine which ones contribute to a solution Qopt, whichis an edge dominating set of G of size at most k that uses the minimum numberof colors (if such a solution exists).

For an edge e ∈ G[M ], we branch on e as follows. If e is decided to be in Qopt,we set G = G − e, decrement k by 1, mark all the edges incident on e in thegraph as dominated, and label both endpoints of e with the label “INused” toindicate that they are in Qopt, and are endpoints of some edge that is alreadydecided to be in Qopt. (We will use the label “IN” later to indicate that thevertex is decided to be in Qopt but has no incident edge that was decided to bein Qopt yet.) We also indicate that the color of e has been used by storing it ina set of colors Cused. On the other hand, if e is decided not be in Qopt, we setG = G− e.

For a vertex v ∈ G[M ] whose status has not been determined yet by the abovebranching (i.e., v does not have the label INused), we branch on v as follows. Ifv is decided to be an endpoint of an edge in Qopt, we label v as IN , and markevery edge incident on v as dominated. If v is decided not be an endpoint of anedge in Qopt, we label it as OUT .

Note that since I is an independent set in G, every edge in G must be domi-nated by an edge in Qopt with at least one endpoint in G[M ]. In particular, thisis true for every edge in G[M ]. Therefore, after branching on the edges and ver-tices in G[M ], we need to check that, for every edge e ∈ G[M ] that was decidednot to be in Qopt and subsequently removed from G, at least one of its endpointshas label IN or INused. If this is not the case, then the partial solution that wehave enumerated is not valid, and we reject it.

Noting that after the above branching all the edges of G[M ] were removedfrom G, we end up with a bipartite graph B = (S, I), where S consists of thevertices in G[M ]. Every vertex in S has one of the following labels: (1) INused

indicating that the vertex is an endpoint of a known edge which was determinedto be in Qopt, (2) IN indicating that the vertex is the endpoint of some edge inQopt but this edge has not been determined yet, and (3) OUT indicating thatthe vertex is not an endpoint of an edge in Qopt. The edges in B have one of twopossible types: (1) dominated, those are the edges with at least one endpoint

Page 107: Graph-Theoretic Concepts in Computer Science

The Parameterized Complexity of Some Minimum Label Problems 97

of label INused or IN , and (2) not dominated, and those are the edges whoseendpoint in S is of label OUT .

Since we are trying all possible branches for the edges and vertices in G[M ],we are safe. The number of partial solutions enumerated by the branching canbe upper bounded in a similar fashion to that in Stage 1 of the algorithm forMLMM. The only difference here is that the number of edges in the maximalmatching M is at most 2k, and hence, the number of vertices in G[M ] is at most4k, and consequently the number of edges in G[M ] is at most 2k(4k− 1). Usinga similar analysis to that in Stage 1 of MLMM, we obtain that the number ofpartial solutions enumerated by the above branching is at most (128ek)k.

Now given the instance B = (S, I), and the parameter k (without loss ofgenerality), we will branch further to simplify the instance. First, observe thatsince the number of edges in Qopt is at most k, the number of vertices in Sthat are labeled with INused or IN is at most 2k (otherwise, we reject theenumeration).

Observation 3.4. For every vertex w in I, the number of edges incident on wwhose endpoint in S is labeled with INused or IN is at most 2k.

Note that, for every edge e = {u, v} where u ∈ S has label OUT , e needs to bedominated by an edge incident on v; therefore, the vertex v must be an endpointof some edge in Qopt. Since the number of edges in Qopt is at most k, and B isbipartite, there can be at most k vertices in I that are neighbors of vertices inS of label OUT ; let Iin be the set of such vertices. Since (by Observation 3.4)every vertex in I has at most 2k edges incident on it whose endpoint in S islabeled INused or IN , we can branch on every such edge incident on a vertexin Iin to determine if the edge is in Qopt or not. For each such edge, if theedge is decided to be in Qopt, we include the edge in the solution, label bothits endpoints INused, we remove the edge, decrement k by 1, and update Cused

appropriately; if the edge is decided not be in Qopt, we simply remove it. Afterthis branching, we check that for every vertex in Iin at least one of the edgesincident on it was decided to be in Qopt; otherwise, we reject the branch. Thenumber of partial solutions generated by this branching is at most (2k)k.

After branching on the edges incident on the vertices in Iin and removingthem, the vertices in Iin and the vertices in S of label OUT can be removed.Every remaining vertex in S is either of label INused or IN .

Since a vertex in S of label INused is an endpoint of an edge already in Qopt,every edge incident on a vertex in INused is dominated. Therefore, if for everyvertex of label IN in S we determine one of its incident edges to be in Qopt, weobtain an edge dominating set of B. On the other hand, our branching stipulatesthat from every vertex in S of label IN we must determine at least one edgeincident on it to be in Qopt. Therefore, our problem reduces to picking for everyvertex of label IN in S exactly one edge incident on it, so that the total numberof colors used is minimized. To do so, we first remove the vertices of label INused

from S, since no edge incident on any of them needs to be considered. At thispoint S should have at most k vertices; otherwise, we can reject. Then for everycolor c in Cused, and for every vertex v of label IN in S, if there is an edge of

Page 108: Graph-Theoretic Concepts in Computer Science

98 M.R. Fellows, J. Guo, and I.A. Kanj

color c incident on v, we include e in the solution, decrement k, and remove thevertex from B. (Note that edges whose color is in Cused are gained for free.)

After this step, every vertex in S is of label IN , and there is no edge incidenton any vertex in S whose color appears in Cused. To compute a set of edges ofminimum colors, such that for every vertex in S exactly one edge in this set isincident on it, we try each partition of S into � groups, � ∈ {1, . . . , k}, such thatall vertices in the same group are incident on edges of the same color in Qopt

(as we did in Stage 2 of the MLMM problem). For each such partition and eachgroup in this partition, we find a color c such that every vertex in this group isincident on an edge of color c. If such a choice is not possible for some group,then we reject the partition.

At the end, we end up with an edge dominating set for G. We output the edgedominating set of G of size at most k that uses the minimum number of colors,over all partial solutions generated from all branches.

Since S has at most k vertices at this stage, the total number of partitions ofS is at most kk+1.

It follows that the total number of partial solutions enumerated by the al-gorithm is O((128ek)k · (2k)k · kk+1) = O((256e)kk3k+1). For each such partialsolution we need to process the graph G during the branching, which takes timeO(n(G) + e(G)). Therefore, the running time of the algorithm isO((256e)kk3k+1(n(G) + e(G))).

Theorem 3.3. Minimum Label Edge Dominating Set is FPT when pa-rameterized by the size of the edge dominating set.

4 Concluding Remarks

In this paper, we considered some minimum label graph problems. We showedthat, when parameterized by the number of used labels, most of these problemsare intractable, even on graphs of bounded pathwidth.

On the other hand, we showed that most of these problems become parame-terized tractable when parameterized by the solution size.

We note that, recently, there has been a lot of interest in studying structuredgraph problems, such as problems on colored graphs, due to their applications invarious fields such as networking and computational biology. (The convex recol-oring problem is such an example in computational biology.) While these prob-lems are practically very important, they are often computationally hard due tothe structural requirement on the solution sought. Therefore, it is both naturaland interesting to study whether these problems remain intractable with respectto different parameters, such as the number of colors, the pathwidth/treewidthof the graph, the solution size, or even with respect to more restrictive param-eters, such as the vertex cover or the max leaf number. This paper follows thisline of research.

Finally, it is interesting to study the parameterized complexity of other min-imum label graph problems that have practical applications. A good candidatewould be the Minimum Label Feedback Arc Set problem on directed graphs.

Page 109: Graph-Theoretic Concepts in Computer Science

The Parameterized Complexity of Some Minimum Label Problems 99

References

1. Broersma, H., Li, X.: Spanning trees with many or few colors in edge-coloredgraphs. Discussiones Mathematicae Graph Theory 17(2), 259–269 (1997)

2. Broersma, H., Li, X., Woeginger, G., Zhang, S.: Paths and cycles in colored graphs.Australasian Journal on Combinatorics 31, 299–311 (2005)

3. Bruggemann, T., Monnot, J., Woeginger, G.: Local search for the minimum la-bel spanning tree problem with bounded color classes. Operations Research Let-ters 31(3), 195–201 (2003)

4. Carr, R., Doddi, S., Konjevod, G., Marathe, M.: On the red-blue set cover problem.In: Proc. 11th ACM-SIAM SODA, pp. 345–353 (2000)

5. Chang, R., Leu, S.: The minimum labeling spanning trees. IPL 63(5), 277–282(1997)

6. Cormen, T., Leiserson, C., Rivest, R., Stein, C.: Introduction to Algorithms, 2ndedn. McGraw-Hill Book Company, Boston (2001)

7. Downey, R.G., Fellows, M.R.: Parameterized complexity. Monographs in ComputerScience. Springer, New York (1999)

8. Hassin, R., Monnot, J., Segev, D.: Approximation algorithms and hardness resultsfor labeled connectivity problems. Journal of Combinatorial Optimization 14(4),437–453 (2007)

9. Jha, S., Sheyner, O., Wing, J.: Two formal analyses of attack graphs. In: Proc.15th IEEE Computer Security Foundations Workshop, pp. 49–63 (2002)

10. Krumke, S., Wirth, H.: On the minimum label spanning tree problem. IPL 66(2),81–85 (1998)

11. Monnot, J.: The labeled perfect matching in bipartite graphs. IPL 96(3), 81–88(2005)

12. Uno, T.: Algorithms for enumerating all perfect, maximum and maximal matchingsin bipartite graphs. In: Leong, H.-V., Jain, S., Imai, H. (eds.) ISAAC 1997. LNCS,vol. 1350, pp. 92–101. Springer, Heidelberg (1997)

13. Voss, S., Cerulli, R., Fink, A., Gentili, M.: Applications of the pilot method to hardmodifications of the minimum spanning tree problem. In: Proc. 18th MINI EUROConference on VNS (2005)

14. Wan, Y., Chen, G., Xu, Y.: A note on the minimum label spanning tree. IPL 84(2),99–101 (2002)

15. West, D.: Introduction to graph theory. Prentice Hall Inc., Upper Saddle River(1996)

16. Wirth, H.: Multicriteria Approximation of Network Design and Network UpgradeProblems. PhD thesis, Department of Computer Science, Universitat Wurzburg,Germany (2005)

17. Xiong, Y.: The Minimum Labeling Spanning Tree Problem and Some Variants.PhD thesis, Graduate School of the University of Maryland, USA (2005)

18. Xiong, Y., Golden, B., Wasil, E.: A one-parameter genetic algorithm for the min-imum labeling spanning tree problem. IEEE Transactions on Evolutionary Com-putation 9(1), 55–60 (2005)

19. Xiong, Y., Golden, B., Wasil, E.: Worst case behavior of the MVCA heuristic forthe minimum labeling spanning tree problem. Operations Research Letters 33(1),77–80 (2005)

20. Zhang, P., Tang, L., Zhao, W., Cai, J., Li, A.: Approximation and hardness resultsfor label cut and related problems (manuscript) (2007)

Page 110: Graph-Theoretic Concepts in Computer Science

Exact and Parameterized Algorithms forMax Internal Spanning Tree

Henning Fernau1, Serge Gaspers2, and Daniel Raible1

1 Univ. Trier, FB 4—Abteilung Informatik, D-54286 Trier, Germany{fernau,raible}@uni-trier.de

2 LIRMM – Univ. of Montpellier 2, CNRS, 34392 Montpellier, [email protected]

Abstract. We consider the NP-hard problem of finding a spanningtree with a maximum number of internal vertices. This problem is ageneralization of the famous Hamiltonian Path problem. Our dynamic-programming algorithms for general and degree-bounded graphs haverunning times of the form O∗(cn) (c ≤ 3). The main result, however, isa branching algorithm for graphs with maximum degree three. It onlyneeds polynomial space and has a running time of O(1.8669n) whenanalyzed with respect to the number of vertices. We also show that itsrunning time is 2.1364knO(1) when the goal is to find a spanning treewith at least k internal vertices. Both running time bounds are obtainedvia a Measure & Conquer analysis, the latter one being a novel use ofthis kind of analysis for parameterized algorithms.

1 Introduction

Motivation. In this paper we investigate the following problem:

Max Internal Spanning Tree (MIST)

Given: A graph G = (V, E) with n vertices and m edges.Task: Find a spanning tree of G with a maximum number of internalvertices.

MIST is a generalization of the well-studied Hamiltonian Path problem: finda path in a graph such that every vertex is visited exactly once. Clearly, such apath, if it exists, is also a spanning tree, namely one with a maximum numberof internal vertices. Whereas the running time barrier of 2n has not been bro-ken for general graphs, there are faster algorithms for cubic graphs (using onlypolynomial space). It is natural to ask if for the generalization, MIST, this canalso be obtained.

A second issue is to find an algorithm for MIST with a running time ofthe form O∗(cn). 1 The naıve approach gives only an upper bound of O∗(2m). A

� Supported by a PPP grant between DAAD (Germany) and NFR (Norway).1 f(n) = O∗(g(n)) if f(n) ≤ p(n) · g(n) for some polynomial p(n).

C. Paul and M. Habib (Eds.): WG 2009, LNCS 5911, pp. 100–111, 2010.c© Springer-Verlag Berlin Heidelberg 2010

Page 111: Graph-Theoretic Concepts in Computer Science

Exact and Parameterized Algorithms for Max Internal Spanning Tree 101

possible application could be the following scenario. Consider cities which shouldbe connected with water pipes. The possible connections between them can berepresented by a graph G. It suffices to compute a spanning tree T for G. InT we may have high degree vertices that have to be implemented by branchingpipes which cause turbulences and therefore pressure may drop. To minimize thenumber of branching pipes one can equivalently compute a spanning tree withthe smallest number of leaves, leading to MIST. Vertices representing branchingpipes should not be of arbitrarily high degree, motivating us to investigate MIST

on degree-restricted graphs.

Previous Work. It is well-known that the more restricted problem, Hamilto-

nian Path, can be solved within O(n22n) steps and exponential space. This re-sult has been independently obtained by Bellman [1], and Held and Karp [6]. TheTraveling Salesman problem (TSP) is very closely related to Hamiltonian

Path. Basically, the same algorithm solves this problem, but there has not beenany improvement on the running time since 1962. The space requirements have,however, been improved and now there areO∗(2n) algorithms needing only poly-nomial space. In 1977, Kohn et al. [9] gave an algorithm based on generating func-tions with a running time ofO(2nn3) and space requirements ofO(n2) and in 1982Karp [8] came up with an algorithm which improved storage requirements toO(n)and preserved this run time by an inclusion-exclusion approach.

Eppstein [4] studied TSP on cubic graphs. He could achieve a running time ofO(1.260n) using polynomial space. Iwama and Nakashima [7] could improve thistoO(1.251n). Bjorklund et al. [2] considered TSP with respect to degree-boundedgraphs. Their algorithm is a variant of the classical 2n-algorithm and the spacerequirements are therefore exponential. Nevertheless, they showed that for agraph with maximum degree d there is a O∗((2− εd)n)-algorithm. In particularfor d = 4 there is a O(1.8557n)- and for d = 5 a O(1.9320n)-algorithm.

MIST was also studied with respect to parameterized complexity. The (stan-dard) parameterized version of the problem is parameterized by k, and askswhether G has a spanning tree with at least k internal vertices. Prieto andSloper [11] proved a O(k3)-vertex kernel for the problem showing FPT -mem-bership. In [12] the kernel size has been improved to O(k2) and in [5] to 3k.Parameterized algorithms for MIST have been studied in [3,5,12]. Prieto andSloper [12] gave the first FPT algorithm, with running time 24k log k ·nO(1). Thisresult was improved by Cohen et al. [3] who solve a more general directed versionof the problem in time 49.4k · nO(1). The current fastest algorithm has runningtime 8k · nO(1) [5].

Salamon [14] studied the problem considering approximation. He could achievea 7

4 -approximation. A 2(Δ− 2)-approximation for the node-weighted version is aby-product. Cubic and claw-free graphs were considered by Salamon and Wiener [13]introducing algorithms with approximation ratios 6

5 and 32 , respectively.

Our Results. This paper gives two algorithms:

(a) A dynamic-programming algorithm solving MIST in time O∗(3n). We ex-tend this algorithm and show that for any degree-bounded graph a running

Page 112: Graph-Theoretic Concepts in Computer Science

102 H. Fernau, S. Gaspers, and D. Raible

time of O∗((3−ε)n) with ε > 0 can be achieved. To our knowledge this is thefirst algorithm for MIST with a running time bound of the form O∗(cn).2

(b) A polynomial-space branching algorithm solving the maximum degree 3 casein time O(1.8669n). We also analyze the same algorithm from a parame-terized point of view, achieving a running time of 2.1364knO(1) to find aspanning tree with at least k internal vertices (if possible). The latter anal-ysis is novel in a sense that we use a potential function analysis—Measure& Conquer—in a way that, to our knowledge, is much less restrictive thanany previous analysis for parameterized algorithms that were based on thepotential function method.

Notions and Definitions. We consider only simple undirected graphs G =(V, E). The neighborhood of a vertex v ∈ V in G is NG(v) := {u | {u, v} ∈ E}and its degree is dG(v) := |NG(v)|. The closed neighborhood of v is NG[v] :=NG(v) ∪ {v} and for a set V ′ ⊆ V we let NG(V ′) :=

(⋃u∈V ′ NG(u)

) \ V ′. Weomit the subscripts of NG(·), dG(·), and NG[·] when the graph is clear from thecontext. A subcubic graph has maximum degree at most three. For a (partial)spanning tree T ⊆ E let I(T ) be the set of its internal (non-leaf) vertices andL(T ) the set of its leaves. An i-vertex u is a vertex with dT (u) = i with respect tosome spanning tree T , where dH(u) := {{u, v} | {u, v} ∈ H} for any H ⊆ E. Thetree-degree of some u ∈ V (T ) is dT (u). We also speak of the T -degree dT (v) whenwe refer to a specific spanning tree. A Hamiltonian path is a sequence of pairwisedistinct vertices v1, . . . , vn from V such that {vi, vi+1} ∈ E for 1 ≤ i ≤ n− 1.

The Problem on General Graphs. By means of Dynamic Programmingand the help of an upper bound on the number of connected vertex-subsets ofdegree bounded graph (shown by [2]) we show the next statement.

Lemma 1. MIST can be solved in time O∗(3n) and for graphs with maximumdegree Δ, MIST can be solved in time O∗(3(1−εΔ)n) with εΔ > 0.

2 Subcubic Maximum Internal Spanning Tree

2.1 Observations

Let tTi denote the number of vertices u such that dT (u) = i for a spanning treeT . Then the following proposition can be proved by induction on nT := |V (T )|.Proposition 1. In any spanning tree T , 2 +

∑i≥3(i− 2) · tTi = tT1 .

Due to Proposition 1, MIST on subcubic graphs boils down to finding a spanningtree T such that tT2 is maximum. Every internal vertex of higher degree wouldalso introduce additional leaves.2 Before the camera-ready version of this paper was prepared, Nederlof [10] came up

with a polynomial-space O∗(2n) algorithm for MIST on general graphs, answeringa question in a preliminary version of this paper.

Page 113: Graph-Theoretic Concepts in Computer Science

Exact and Parameterized Algorithms for Max Internal Spanning Tree 103

Lemma 2. [11] An optimal solution To to Max Internal Spanning Tree isa Hamiltonian path or the leaves of To are independent.

The proof of Lemma 2 shows that if To is not a Hamiltonian path and there aretwo adjacent leaves, then the number of internal vertices can be increased. Inthe rest of the paper we assume that To is not a Hamiltonian path due to thenext lemma which uses the O(1.251n) algorithm for Hamiltonian Cycle onsubcubic graphs [7] as a subroutine.

Lemma 3. Hamiltonian Path can be solved in time O(1.251n) on subcubicgraphs.

Lemma 4. Let T be a spanning tree and u, v ∈ V (T ) two adjacent vertices withdT (u) = dT (v) = 3 such that {u, v} is not a bridge. Then there is a spanningtree T ′ ⊃ (T \ {{u, v}}) with |I(T ′)| ≥ |I(T )| and dT ′(u) = dT ′(v) = 2.

Proof. By removing {u, v}, T is separated into two parts T1 and T2. The verticesu and v become 2-vertices. As {u, v} is not a bridge, there is another edgee ∈ E \E(T ) connecting T1 and T2. By adding e we lose at most two 2-vertices.Then let T ′ := (T \ {{u, v}}) ∪ {e} and it follows that |I(T ′)| ≥ |I(T )|. �

2.2 Reduction Rules

Let E′ ⊆ E. Then, ∂E′ := {{u, v} ∈ E\E′ | u ∈ V (E′)} are the edges outside E′

that have a common end point with an edge in E′ and ∂V E′ := V (∂E′)∩V (E′)are the vertices that have at least one incident edge in E′ and another incidentedge not in E′. During the algorithm we will maintain an acyclic subset of edgesF which will be part of the final solution. The following invariant will alwaysbe true: G[F ] consists of a tree T and a set P of pending tree edges (pt-edges).Here a pt-edge {u, v} ∈ F is an edge with one end point u of degree 1 and theother end point v �∈ V (T ). G[T ∪ P ] will always consist of 1 + |P | components.Next we present several reduction rules. The order in which they are applied iscrucial: Before a rule is applied the preceding ones were carried out exhaustively.

Cycle: Delete any edge e ∈ E such that E(T ) ∪ {e} has a cycle.Bridge: If there is a bridge e ∈ ∂E(T ), then add e to F .Deg1: Let u ∈ V \ V (F ) with d(u) = 1. Then add its incident edge to F .Pending: If a a vertex v is incident to dG(v)− 1 pt-edges, then remove them.ConsDeg2: If there are edges {v, w}, {w, z} ∈ E \ E(T ) such that dG(w) =

dG(z) = 2, then delete {v, w}, {w, z} from G and add the edge {v, z} to G.Deg2: If there is an edge {u, v} ∈ ∂E(T ) such that u ∈ V (T ) and dG(u) = 2,

then add {u, v} to F .Attach: If there are edges {u, v}, {v, z} ∈ ∂E(T ) such that u, z ∈ V (T ),

dT (u) = 2, 1 ≤ dT (z) ≤ 2, then delete {u, v}. See Fig. 1(a)Attach2: If there is a vertex u ∈ ∂V E(T ) with dT (u) = 2 and {u, v} ∈ E\E(T )

such that v is incident to a pt-edge, then delete {u, v}.Special: If there are two edges {u, v}, {v, w} ∈ E\F with dT (u) ≥ 1, dG(v) = 2,

and w is incident to a pt-edge, then add {u, v} to F . See Fig. 1(b).

Page 114: Graph-Theoretic Concepts in Computer Science

104 H. Fernau, S. Gaspers, and D. Raible

u

v

xz

(a)

u v w

(b)

Fig. 1. Light edges may be not present. Double edges (dotted or solid, resp.) refer toedges which are either T -edges or not, resp. Edges attached to oblongs are pt-edges.

We mention that ConsDeg2 can create double edges. In this case simply deleteone of them which is not in F (at most one can be part of F ).

Lemma 5. The reduction rules stated above are sound.

Proof. Let To ⊃ F be a spanning tree of G with a maximum number of internalvertices. The correctness of the first five reduction rules is easily verified.

Deg2. Since the preceding reduction rules do not apply, we have dG(v) = 3 andthere is one incident edge, say {v, z}, z �= u, that is not pending. Assumeu is a leaf in To. Define another spanning tree T ′o ⊃ F by setting T ′o =(To ∪ {{u, v}}) \ {v, z}. Since |I(To)| ≤ |I(T ′o)|, T ′o is also optimal.

Attach. If {u, v} ∈ E(To) then {v, z} �∈ E(To) due to the acyclicity of To and asT is connected. Then by exchanging {u, v} and {v, z} we obtain a solutionT ′o with at least as many 2-vertices.

Attach2. Suppose {u, v} ∈ E(To). Let {v, p} be the pt-edge and {v, z} thethird edge incident to v (that must exist and is not pending, since Pendingdid not apply). Since Bridge did not apply, {u, v} is not a bridge. Firstly,suppose {v, z} ∈ E(To). Due to Lemma 4, there is also an optimal solutionT ′o ⊃ F with {u, v} /∈ E(T ′o). Secondly, assume {v, z} /∈ E(To). Then T ′ =(To \ {{u, v}}) ∪ {{v, z}} is also optimal as u has become a 2-vertex.

Special. Suppose {u, v} �∈ E(To). Then {v, w}, {w, z} ∈ E(To) where {w, z} isthe third edge incident to w. Let T ′o := (To \ {{v, w}}) ∪ {{u, v}}. In T ′o, wis a 2-vertex and hence T ′ is also optimal. �

2.3 The Algorithm

The algorithm we describe here is recursive. It constructs a set F of edges whichare selected to be in every spanning tree considered in the current recursive step.The algorithm chooses edges and considers all relevant choices for adding themto F or removing them from G. It selects these edges based on priorities chosento optimize the running time analysis. Moreover, the set F of edges will alwaysbe the union of a tree T and a set of edges P that are not incident to the treeand have one end point of degree 1 in G (pt-edges). We do not explicitly write inthe algorithm that edges move from P to T whenever an edge is added to F thatis incident to both an edge of T and an edge of P . To maintain the connectivityof T , the algorithm explores edges in the set ∂E(T ) to grow T .

If |V | > 2 every spanning tree T must have a vertex v with dT (v) ≥ 2.Thus initially the algorithm creates an instance for every vertex v and every

Page 115: Graph-Theoretic Concepts in Computer Science

Exact and Parameterized Algorithms for Max Internal Spanning Tree 105

possibility that dT (v) ≥ 2. Due to the degree constraint there are no more than4n instances. After this initial phase, the algorithm proceeds as follows.

1. Carry out each reduction rule exhaustively in the given order.2. If ∂E(T ) = ∅ and V �= V (T ), then G is not connected and does not admit a

spanning tree. Ignore this branch.3. If ∂E(T ) = ∅ and V = V (T ), then return T .4. Select {a, b} ∈ ∂E(T ) with a ∈ V (T ) according to the following priorities (if

such an edge exists):a) there is an edge {b, c} ∈ ∂E(T ),b) dG(b) = 2,c) b is incident to a pt-edge, ord) dT (a) = 1.Recursively solve the two instances where {a, b} is added to F or removedfrom G respectively, and return the spanning tree with most internal vertices.

5. Otherwise, select {a, b} ∈ ∂E(T ) with a ∈ V (T ). Let c, x be the other twoneighbors of b. Recursively solve three instances where(i) {a, b} is removed from G,(ii) {a, b} and {b, c} are added to F and {b, x} is removed from G, and(iii) {a, b} and {b, x} are added to F and {b, c} is removed from G.Return the spanning tree with most internal vertices.

By a Measure & Conquer analysis taking into account the degrees of the vertices,their number of incident edges that are in F , and to some extent the degrees oftheir neighbors, we obtain the following result.

Theorem 1. MIST can be solved in time O(1.8669n) on subcubic graphs.

Let us provide the measure we use in the analysis. Let D2 := {v ∈ V | dG(v) =2, dF (v) = 0}, D�

3 := {v ∈ V | dG(v) = 3, dF (v) = �} and D2∗3 := {v ∈ D2

3 |NG(v) \NF (v) = {u} and dG(u) = 2}. Then the measure we use is

μ(G) = ω2 · |D2|+ ω13 · |D1

3|+ ω23 · |D2

3 \D2∗3 |+ |D0

3 |+ ω2∗3 · |D2∗

3 |

with the weights ω2 = 0.3193, ω13 = 0.6234, ω2

3 = 0.3094 and ω2∗3 = 0.4144.The

proof of the theorem uses the following result.

Lemma 6. None of the reduction rules increase μ for the given weights.

Let Δ03 := Δ0∗

3 := 1 − ω13 , Δ1

3 := ω13 − ω2

3 , Δ1∗3 := ω1

3 − ω2∗3 , Δ2

3 := ω23 , Δ2∗

3 :=ω2∗

3 and Δ2 = 1 − ω2. We define Δi3 := min{Δi

3, Δi∗3 } for 1 ≤ i ≤ 2, Δ�

m =min0≤j≤�{Δj

3}, and Δ�m = min0≤j≤�{Δj

3}.Proof. (of Theorem 1) As the algorithm deletes edges or moves edges from E \Fto F , cases 1–3 do not contribute to the exponential function in the runningtime of the algorithm. It remains to analyze cases 4 and 5, which we do now.Note that after applying the reduction rules exhaustively, we have that for allv ∈ ∂V E(T ), dG(v) = 3 (Deg2) and for all u ∈ V , dP (u) ≤ 1 (Pending).

Page 116: Graph-Theoretic Concepts in Computer Science

106 H. Fernau, S. Gaspers, and D. Raible

4.(a) Obviously, {a, b}, {b, c} ∈ E \ E(T ), and there is a vertex d such that{c, d} ∈ E(T ); see Figure 2(a). We have dT (a) = dT (c) = 1 due to thereduction rule Attach. We consider three cases.

dG(b) = 2. When {a, b} is added to F , Cycle deletes {b, c}. We get anamount of ω2 and ω1

3 as b drops out of D2 and c out of D13 (Deg2).

Also a will be removed from D13 and added to D2

3 which amounts to areduction of at least Δ1

3. When {a, b} is deleted, {b, c} is added to E(T )(Bridge). By a symmetric argument we get a reduction of ω2 +ω1

3 + Δ13

as well. In total this yields a (ω2 + ω13 + Δ1

3, ω2 + ω13 + Δ1

3)-branch.dG(b) = 3 and there is one pt-edge incident to b. Adding {a, b} to F de-

creases the measure by Δ13 (from a) and 2ω1

3 (deleting {b, c}, then Deg2on c). By Deleting {a, b} we decrease μ by 2ω1

3 and by Δ13 (from c). This

amounts to a (2ω13 + Δ1

3, 2ω13 + Δ1

3)-branch.dG(b) = 3 and no pt-edge is incident to b. Let {b, z} be the third edge

incident to b. In the first branch the measure drops by at least ω13 +

Δ13 from c and a (Deg2), 1 from b (Deg2). In the second branch we

get ω13 + Δ2. Observe that we also get an amount of at least Δ1

m fromq ∈ NT (a) \ {b} if dG(q) = 3. If dG(q) = 2 we get ω2. It results a(ω1

3 + Δ13 + 1, ω1

3 + Δ2 + min{ω2, Δ1m})-branch.

Note that from this point on, for all u, v ∈ V (T ) there is no z ∈ V \V (T )with {u, z}, {z, v} ∈ E.

4.(b) As the previous case does not apply, the other neighbor c of b has dT (c) =0, and dG(c) ≥ 2 (Pending), see Figure 2(b). Additionally, observe thatdG(c) = 3 due to ConsDeg2 and that dP (c) = 0 due to Special. Weconsider two subcases.

dT (a) = 1. When we add {a, b} to F , then {b, c} is also added due to Deg2.The reduction is at least Δ1

3 from a, ω2 from b and Δ03 from c. When

{a, b} is deleted, {b, c} becomes a pt-edge. There is {a, z} ∈ E \ E(T )with z �= b, which is subject to a Deg2 reduction rule. We get at leastω1

3 from a, ω2 from b, Δ03 from c and min{ω2, Δ

1m} from z. This is a

(Δ13 + Δ0

3 + ω2, ω13 + Δ0

3 + ω2 + min{ω2, Δ1m})-branch.

dT (a) = 2. Similarly, we obtain a (Δ2∗3 + ω2 + Δ0

3, Δ2∗3 + ω2 + Δ0

3)-branch.4.(c) In this case, dG(b) = 3 and there is one pt-edge attached to b, see Fig-

ure 2(c). Note that dT (a) = 2 can be ruled out due to Attach2. Thus,dT (a) = 1. Let z �= b be such that {a, z} ∈ E \E(T ). Due to the priorities,dG(z) = 3. We distinguish between the cases where c, the other neighborof b, is incident to a pt-edge or not.

dP (c) = 0. First suppose dG(c) = 3. Adding {a, b} to F allows a reductionof 2Δ1

3 (due to case 4.(b) we can exclude Δ1∗3 ). Deleting {a, b} implies

that we get a reduction from a and b of 2ω13 (Deg2 and Pending). As

{a, z} is added to F we reduce μ(G) by at least Δ13 as the state of z

changes. Now due to Pending and Deg1 we include {b, c} and get Δ03

from c. We have at least a (2Δ13, 2ω1

3 + Δ13 + Δ0

3)-branch.If dG(c) = 2 we consider the two cases for z also. These are dP (z) =1 and dP (z) = 0. The first entails (ω1

3 + Δ1∗3 , 2ω1

3 + Δ13 + ω2 + Δ2

m).

Page 117: Graph-Theoretic Concepts in Computer Science

Exact and Parameterized Algorithms for Max Internal Spanning Tree 107

Note that when we add {a, b} we trigger Attach2. The second is a(Δ1

3 + Δ1∗3 , 2ω1

3 + Δ03 + ω2 + Δ2

m)-branch.dP (c) = 1. Let d �= b be the other neighbor of c that does not have degree

1. When {a, b} is added to F , {b, c} is deleted by Attach2 and {c, d}becomes a pt-edge (Pending and Deg1). The changes on a incur ameasure decrease of Δ1∗

3 and those on b, c a measure decrease of 2ω13 .

When {a, b} is deleted, {a, z} is added to F (Deg2) and {c, d} becomesa pt-edge by two applications of the Pending and Deg1 rules. Thus,the decrease of the measure is at least 3ω1

3 in this branch. In total, wehave a (Δ1∗

3 + 2ω13, 3ω1

3)-branch here.4.(d) Now, dG(b) = 3, b is not incident to a pt-edge, and dT (a) = 1. See

Figure 2(c). There is also some {a, z} ∈ E \ E(T ) such that z �= b. Notethat dT (z) = 0, dG(z) = 3 and dP (z) = 0. Otherwise either Cycle orcases 4.(b) or 4.(c) would have been triggered. From the addition of {a, b}to F we get Δ1

3+Δ03 and from its deletion ω1

3 (from a via Deg2), Δ2 (fromb) and at least Δ0

3 from z and thus, a (Δ13 + Δ0

3, ω13 + Δ2 + Δ0

3)-branch.5. See Figure 2(d). The algorithm branches in the following way: 1) Delete{a, b}, 2) add {a, b}, {b, c}, and delete {b, x}, 3) add {a, b}, {b, x} anddelete {b, c}. Due to Deg2, we can disregard the case when b is a leaf.Due to Lemma 4 we also disregard the case when b is a 3-vertex. Thus bybranching in this manner we find at least one optimal solution.The reduction in the first branch is at least ω2

3 +Δ2. We get an additionalamount of ω2 if d(x) = 2 or d(c) = 2 from ConsDeg2. In the secondwe have to consider also the vertices c and x. There are exactly threesituations for h ∈ {c, x} α) dG(h) = 2, β) dG(h) = 3, dP (h) = 0 and γ)dG(h) = 3, dP (h) = 1. We will only analyze branch 2) as 3) is symmetric.We first get a reduction of ω2

3 + 1 from a and b. We reduce μ due todeleting {b, x} by: α) ω2 + Δ2

m, β) Δ2, γ) ω13 + Δ2

m. Next we examine theamount by which μ will be decreased by adding {b, c} to F . We distinguishbetween the cases α, β and γ: α) ω2 + Δ2

m, β) Δ03, γ) Δ1

3.For h ∈ {c, x} and W ∈ {α, β, γ} let 1h

W be the indicator function whichis set to one if we have situation W at vertex h. Otherwise it is zero. Nowthe branching tuple can be stated the following way :(ω2

3 + Δ2 + (1xα + 1c

α) · ω2,ω2

3 + 1 + 1xα · (ω2 + Δ2

m) + 1xβ ·Δ2 + 1x

γ · (ω13 + Δ2

m) + 1cα · (ω2 + Δ2

m) + 1cβ ·

Δ03 + 1c

γ · Δ13),

ω23 + 1 + 1c

α · (ω2 + Δ2m) + 1c

β ·Δ2 + 1cγ · (ω1

3 + Δ2m) + 1x

α · (ω2 + Δ2m) + 1x

β ·Δ0

3 + 1xγ · Δ1

3)The amount of (1x

α + 1cα) · ω2 comes from possible applications of Cons-

Deg2.

Observe that every instance created by branching is smaller than the originalinstance in terms of μ. Together with Lemma 6 we see that every step of thealgorithm only decreases μ. Now if we evaluate the upper bound for every givenbranching tuple for the given weights we can conclude that MIST can be solvedin time O∗(1.8669n) on subcubic graphs. �

Page 118: Graph-Theoretic Concepts in Computer Science

108 H. Fernau, S. Gaspers, and D. Raible

ca

b

z

(a)

ca

b

z

(b)

ca

b

z

(c)

ca

b

xy

(d)

Fig. 2. Light edges may be not present. Double edges (dotted or solid, resp.) refer toedges which are either T -edges or not, resp. Edges attached to oblongs are pt-edges.

Let us now turn to a parameterized analysis of the algorithm. For generalgraphs, the smallest known kernel has size 3k. This can be easily improved to2k for subcubic graphs.

Lemma 7. MIST on subcubic graphs has a 2k-kernel.

Applying the algorithm of Theorem 1 on this kernel for subcubic graphs wouldlead to a running time of 3.4854knO(1). However, we can achieve a faster pa-rameterized running time by applying a Measure & Conquer analysis which iscustomized to the parameter k. We would like to put forward that our use of thetechnique of Measure & Conquer for a parameterized algorithm analysis goes be-yond previous work as our measure is not restricted to differ from the parameterk by just a constant. We first demonstrate our idea with a simple analysis.

Theorem 2. Deciding whether a subcubic graph has a spanning tree with atleast k internal vertices can be done in time 2.7321knO(1).

Proof. Consider the algorithm described earlier, with the only modification thatthe parameter k is adjusted whenever necessary (for example, when two pt-edges incident to the same vertex are removed), and that the algorithm stopsand answers Yes whenever T has at least k internal vertices. Note that the as-sumption that G has no Hamiltonian path can still be made due to the 2k-kernel of Lemma 7: the running time of the Hamiltonian path algorithm is1.2512knO(1) = 1.5651knO(1). The running time analysis of our algorithm re-lies on the following measure: κ := κ(G, F, k) := k − ω · |X | − |Y |where X := {v ∈ V | dG(v) = 3, dT (v) = 2}, Y := {v ∈ V | dG(v) = dT (v) ≥ 2}and ω = 0.45346. Let U := V \ (X ∪ Y ). Note that a vertex which has alreadybeen decided to be internal, but that still has an incident edge in E \ T , con-tributes a weight of 1 − ω to the measure. Or equivalently, such a vertex hasbeen only counted by ω. None of the reduction and branching rules increases κand we have that 0 ≤ κ ≤ k at any time of the execution of the algorithm. By asimple case analysis and evaluating the branching factors, the proof follows. �This analysis can be improved by also measuring vertices of degree 2 and verticesincident to pt-edges differently.

Theorem 3. Deciding whether a subcubic graph has a spanning tree with atleast k internal vertices can be done in time 2.1364knO(1).

Page 119: Graph-Theoretic Concepts in Computer Science

Exact and Parameterized Algorithms for Max Internal Spanning Tree 109

Table 1. Analysis of the branching for the running time of Theorem 3

add delete branching tupleCase 4.(a), dG(b) = 2

a b c

a : U → Xsymmetric (1 + ω1 − ω2, 1 + ω1 − ω2)b : Z → U

c : U → Y

Case 4.(a), dG(b) = 3, b is incident to a pt-edge

a b c

a : U → Xsymmetric (2 + ω1 − ω3, 2 + ω1 − ω3)b : W → Y

c : U → Y

Case 4.(a), dG(b) = 3, b is not incident to a pt-edge

a b c

a : U → X a : U → Y(2 + ω1, 1 + ω2)b : U → Y b : U → Z

c : U → Y

Case 4.(b), dT (a) = 1

a b c

a : U → X a : U → Y(1 + ω1 − ω2, 1 + ω3 − ω2)b : Z → Y b : Z → U

c : U → W

Case 4.(b), dT (a) = 2

a b c

a : X → Y a : X → Y(2 − ω1 − ω2, 1 − ω1 − ω2 + ω3)b : Z → Y b : Z → U

c : U → W

Case 4.(c)

a b c

a : U → X a : U → Y(2ω1 − ω3, 2)b : W → X b : W → Y

c : U → W

Case 4.(d)

a b c

a : U → X a : U → Y(ω1, 1 + ω2)b : U → Z

Case 5, dG(x) = dG(c) = 3 and there is q ∈ (X ∩ (N(x) ∪ N(c)), w.l.o.g. q ∈ N(c)

a b c

x a : X → Y a : X → Y(2 − ω1, 3 − 2ω1, 1 − ω1 + ω2)b : U → Y b : U → Z

(2nd branch)q : X → Y

Case 5, dG(x) = dG(c) = 3

a b c

x a : X → Y a : X → Y(1 − ω1 + ω2, 2 − ω1 + ω2, 2 − ω1 + ω2)b : U → Y b : U → Z

c/x : U → ZThere are 3 branches; 2 of them (add) are symmetric.

Case 5, dG(x) = 2 or dG(c) = 2 and

a b c

x a : X → Y a : X → Y(2 − ω1, 2 − ω1, 2 − ω1)b : U → Y b : U → Z

When {a, b} is deleted, ConsDeg2 additionally decreases k by 1and removes a vertex of Z.

Page 120: Graph-Theoretic Concepts in Computer Science

110 H. Fernau, S. Gaspers, and D. Raible

We consider a more detailed measure:κ := κ(G, F, k) := k − ω1 · |X | − |Y | − ω2|Z| − ω3|W |, where

– X := {v ∈ V | dG(v) = 3, dT (v) = 2} is the set of vertices of degree 3 thatare incident to exactly 2 edges of T ,

– Y := {v ∈ V | dG(v) = dT (v) ≥ 2} is the set of vertices of degree at least 2that are incident to only edges of T ,

– W := {v ∈ V \ (X ∪ Y ) | dG(v) ≥ 2, ∃u ∈ N(v) st. dG(u) = dF (u) = 1} isthe set of vertices of degree at least 2 that have an incident pt-edge, and

– Z := {v ∈ V \W | dG(v) = 2, N [v] ∩ (X ∪ Y ) = ∅} is the set of degree 2vertices that do not have a vertex of X ∪ Y in their closed neighborhood,and are not incident to a pt-edge.

We immediately set ω1 := 0.5485, ω2 := 0.4189 and ω3 := 0.7712. Let U :=V \ (X ∪ Y ∪ Z ∪W ). We first have to show that the algorithm can be stoppedwhenever the measure drops to 0 or less.

Lemma 8. Let G = (V, E) be a connected graph, k be an integer and F ⊆ E bea set of edges that can be partitioned into a tree T and a set of pending edges P .If none of the reduction rules applies to this instance and κ(G, F, k) ≤ 0, thenG has a spanning tree T ∗ ⊇ F with at least k internal nodes.

We also show that reducing an instance does not increase its measure.

Lemma 9. Let (G′, F ′, k′) be an instance resulting from the application of areduction rule to an instance (G, F, k). Then, κ(G′, F ′, k′) ≤ κ(G, F, k).

Proof. (of Theorem 3) Table 1 outlines how vertices a, b, and their neighborsmove between U , X , Y , Z, and W in the branches where an edge is added toF or deleted from G in the different cases of the algorithm. For each case, theworst branching tuple is given.

The tight branching numbers are found for cases 4.(b) with dT (a) = 2, 4.(c),4.(d), and 5. with all of b’s neighbors having degree 3. The respective branchingnumbers are (2 − ω1 − ω2, 1 − ω1 − ω2 + ω3), (2ω1 − ω3, 2), (ω1, 1 + ω2), and(1− ω1 + ω2, 2− ω1 + ω2, 2− ω1 + ω2). They all equal 2.1364. �

3 Conclusion and Future Research

We have shown that Max Internal Spanning Tree can be solved in timeO∗(3n). In a preliminary version of this paper we asked if MIST can be solvedin time O∗(2n) and also expressed our interest in polynomial space algorithmsfor MIST. These questions have been settled very recently by Nederlof [10] byproviding a O∗(2n) polynomial-space algorithm for MIST which is based on theprinciple of Inclusion-Exclusion and on a new concept called “branching walks”.

This paper focuses on algorithms for MIST that work for the degree-boundedcase, in particular, for subcubic graphs. The main novelty is a Measure & Con-quer approach to analyze our algorithm from a parameterized perspective (pa-rameterizing by the solution size). We are not aware of many examples where

Page 121: Graph-Theoretic Concepts in Computer Science

Exact and Parameterized Algorithms for Max Internal Spanning Tree 111

this was successfully done without cashing the obtained gain at an early stage,see [15]. More examples in this direction would be interesting to see.

A related problem is the generalization to directed graphs: Find a directedtree, which consist of directed paths form the root to the leaves with as fewleaves as possible. Which results can be carried over to the directed case?

Acknowledgment. We would like to thank Alexey A. Stepanov for useful dis-cussions in the initial phase of this paper.

References

1. Bellman, R.: Dynamic programming treatment of the Travelling Salesman Prob-lem. J. Assoc. Comput. Mach. 9, 61–63 (1962)

2. Bjorklund, A., Husfeldt, T., Kaski, P., Koivisto, M.: The travelling salesmanproblem in bounded degree graphs. In: Aceto, L., Damgard, I., Goldberg, L.A.,Halldorsson, M.M., Ingolfsdottir, A., Walukiewicz, I. (eds.) ICALP 2008, Part I.LNCS, vol. 5125, pp. 198–209. Springer, Heidelberg (2008)

3. Cohen, N., Fomin, F.V., Gutin, G., Kim, E.J., Saurabh, S., Yeo, A.: Algorithm forfinding k-Vertex Out-trees and its application to k-Internal Out-branching prob-lem. In: COCOON 2009. Springer, Heidelberg (2008) (to appear)

4. Eppstein, D.: The Traveling Salesman problem for cubic graphs. J. Graph Algo-rithms Appl. 11(1), 61–81 (2007)

5. Fomin, F.V., Gaspers, S., Saurabh, S., Thomasse, S.: A linear vertex kernel forMaximum Internal Spanning Tree. ArXiv Report CoRR abs/0907.3473 (2009)

6. Held, M., Karp, R.M.: A dynamic programming approach to sequencing problems.J. Soc. Indust. Appl. Math. 10, 196–210 (1962)

7. Iwama, K., Nakashima, T.: An improved exact algorithm for cubic graph TSP. In:Lin, G. (ed.) COCOON 2007. LNCS, vol. 4598, pp. 108–117. Springer, Heidelberg(2007)

8. Karp, R.M.: Dynamic programming meets the principle of inclusion-exclusion. Inf.Process. Lett. 1(2), 49–51 (1982)

9. Kohn, S., Gottlieb, A., Kohn, M.: A generating function approach to the TravelingSalesman Problem. In: Proceedings of the 1977 ACM Annual Conference (ACM1977), pp. 294–300. Association for Computing Machinery (1977)

10. Nederlof, J.: Fast polynomial-space algorithms using Mobius inversion: Improvingon Steiner Tree and related problems. In: Albers, S., et al. (eds.) ICALP 2009, PartI. LNCS, vol. 5555, pp. 713–725. Springer, Heidelberg (2009)

11. Prieto, E., Sloper, C.: Either/or: Using vertex cover structure in designing FPT-algorithms—the case of k-internal spanning tree. In: Dehne, F., Sack, J.-R., Smid,M. (eds.) WADS 2003. LNCS, vol. 2748, pp. 474–483. Springer, Heidelberg (2003)

12. Prieto, E., Sloper, C.: Reducing to independent set structure – the case of k-internalspanning tree. Nord. J. Comput. 12(3), 308–318 (2005)

13. Salamon, G., Wiener, G.: On finding spanning trees with few leaves. Inf. Process.Lett. 105(5), 164–169 (2008)

14. Salamon, G.: Approximation algorithms for the maximum internal spanning treeproblem. In: Kucera, L., Kucera, A. (eds.) MFCS 2007. LNCS, vol. 4708, pp. 90–102. Springer, Heidelberg (2007)

15. Wahlstrom, M.: Algorithms, Measures and Upper Bounds for Satisfiability andRelated Problems. PhD thesis, Linkopings universitet, Sweden (2007)

Page 122: Graph-Theoretic Concepts in Computer Science

An Exact Algorithm for Minimum DistortionEmbedding�

Fedor V. Fomin, Daniel Lokshtanov, and Saket Saurabh

Department of Informatics, University of Bergen, N-5020 Bergen, Norway{fedor.fomin,daniello,saket.saurabh}@ii.uib.no

Abstract. Let G be an unweighted graph on n vertices. We show that an embed-ding of the shortest path metric of G into the line with minimum distortion canbe found in time 5n+o(n). This is the first algorithm breaking the trivial n!-barrier.

1 Introduction

Given an undirected graph G with the vertex set V(G) and the edge set E(G), the graphmetric of G is M(G) = (V(G),DG), where the distance function DG is the shortest pathdistance between u and v for every pair of vertices u, v ∈ V(G). Given a graph metric Mand another metric space M′ with distance functions D and D′, a mapping f : M → M′is called an embedding of M into M′. The mapping f has contraction c f and expansione f if for every pair of points p, q in M,

D(p, q) ≤ D′( f (p), f (q)) · c f ,

andD(p, q) · e f ≥ D′( f (p), f (q))

respectively. We say that f is non-contracting if c f is at most 1. A non-contractingmapping f has distortion d if e f is at most d.

In this paper we provide an exact algorithm for the following fundamental problem:For a given graph G, find a minimum distortion embedding of the graph metric of Ginto the line. In this case the metric space M′ is R1 and D′ is the Euclidean distance. Asimple algorithm is to try all possible permutations of the vertex set. Each permutationcorresponds to an embedding where the distance between two consecutive vertices onthe line is equal to the shortest path distance between them. The running time thisalgorithm is O(n!n) and to the best of our knowledge, no faster exact algorithm for anykind of embedding problem was known prior to our work.

The problem of finding an embedding with low distortion between metric spaces is afundamental mathematical problem [8,10] that has been studied intensively. Embeddinga graph metric into a simple low-dimensional metric space like the real line has provedto be a useful algorithmic tool in various fields. A long list of applications given in [7]includes approximation algorithms for graph and network problems, such as sparsestcut, minimum bandwidth, low-diameter decomposition and optimal group Steiner trees,

� Partially supported by the Research Council of Norway.

C. Paul and M. Habib (Eds.): WG 2009, LNCS 5911, pp. 112–121, 2010.c© Springer-Verlag Berlin Heidelberg 2010

Page 123: Graph-Theoretic Concepts in Computer Science

An Exact Algorithm for Minimum Distortion Embedding 113

and on-line algorithms for metrical task systems and file migration problems. The al-gorithmic issues of metric embeddings has recently begun to develop [1,2,3,9]. Forexample, Badoiu et al. [1] describe approximation algorithms and hardness results forembedding general metrics into the line. In particular they show that the minimum dis-tortion for a line embedding is hard to approximate up to a factor polynomial in n,even for weighted trees where the ratio of maximum/minimum weights is bounded bya polynomial in n. For the case of unweighted graphs, it was shown by Badoiu et al. [2]that there is a constant a > 1, such that it is NP-hard to compute an a-approximationof the minimum distortion of an embedding into the line. Badoiu et al. also providedan exact algorithm for computing an embedding with distortion at most d in time nO(d).For d = Ω(n) the running time of such an algorithm is nO(n). Fellows et al. [6] studiedthe parameterized complexity of metric embeddings and proved that embedding intothe line and more generally, into trees with bounded vertex degrees, is fixed parametertractable when parameterized by the distortion. For embedding a graph metric into theline the running time of the algorithm described in [6] is O(nd4(2d + 1)2d), which alsodoes not break the barrier of n! when d = Θ(n).

It is worth to mention the resemblance between the problem of embedding into theline and the BandwidthMinimization problem. In the BandwidthMinimization problemthe objective is for a given graph G to find a bijective mapping f : V(G) → {1, . . . , n},for which the bandwidth, that is b = max(u,v)∈E(G) | f (u) − f (v)|, is minimized. Observethat the only difference between the two problems is that in the BandwidthMinimizationproblem we demand 1 ≤ | f (p)− f (q)| for every pair of vertices while the non-contractionconstraint in our embedding problem is D(p, q) ≤ | f (p) − f (q)|.

The Bandwidth Minimization problem is one of the test-bed problems in the areaof moderately exponential time algorithms and has been studied intensively. Trying allpossible permutations of the vertex set yields a simple O(n!n) time algorithm while theknown algorithms for the problem with running time O(cn) are far from straightforward.The O(n!)-barrier was broken by Feige and Kilian [5] who gave an algorithm with run-ning time O(10nnO(1)). This result was subsequently improved by Cygan and Pilipczuk[4] down to O(5nnO(1)).

Despite the similarities between low distortion embedding into the line and band-width, the non-contraction constraint makes the algorithmic complexity of the twoproblems significantly different. A striking example is that the parameterized versionof the Bandwidth Minimization problem is one of the hardest problems in Parame-terized Complexity, while low distortion embedding into the line is fixed parametertractable [6]. Thus, it is not surprising that a direct transmission of the ideas for theBandwidth Minimization problem to low distortion embeddings does not work. Never-theless, our approach is still based on the approaches from [4,5], especially the initialand final parts of our algorithm. However, to handle non-contraction need a non-trivialadditional link connecting these parts.

2 Preliminaries

Let G be an undirected graph with vertex set V(G) and edge set E(G). We denote thenumber of vertices by n. For u and v ∈ V(G), DG(u, v) is the shortest path distance

Page 124: Graph-Theoretic Concepts in Computer Science

114 F.V. Fomin, D. Lokshtanov, and S. Saurabh

between u and v in G. For a subset V ′ ⊆ V(G), by G[V ′] we mean the subgraph of Ginduced by V ′. An integer interval is a set {x, x + 1, . . . , y − 1, y} of integers appearingconsecutively. An embedding of a graph G into the line is a function f : V(G) →R. The distortion of an embedding f is maxu,v∈V(G)

| f (u)− f (v)|DG (u,v) . An embedding is called

non-contracting if | f (u) − f (v)| ≥ DG(u, v) for every pair u, v of vertices. If f is non-contracting we say that a vertex u pushes vertex v if DG(u, v) = | f (u) − f (v)|. For anembedding f , let v1, v2, . . . , vn be an ordering of the vertices such that f (v1) < f (v2) <· · · < f (vn). We say that f is pushing if vi pushes vi+1, for each 1 ≤ i ≤ n − 1.

A partial embedding of G into the line is a function f ′ : V ′ → R for some subsetV ′ of V . For a partial embedding f ′ with domain V ′, let v′1, v′2, . . . , v

′n′ be an ordering

of V ′ such that f ′(v′1) < f ′(v′2) < · · · < f (v′n′ ). We say that f ′ is pushing if v′i pushesv′i+1, for each 1 ≤ i ≤ n′ − 1. The distortion of a pushing partial embedding f ′ ismaxuv∈E(G[V ′ ]) | f ′(u) − f ′(v)|.

3 Exact Algorithm for Distortion

In this section we give an exact algorithm for the following problem.

Given an input graph G with the vertex set V(G) and the edge set E(G), find amapping f : V(G)→ R+ such that for all u, v ∈ V(G), | f (u) − f (v)| ≥ DG(u, v)and the function

dist(G) = maxu,v∈V(G)

| f (u) − f (v)|DG(u, v)

is minimized.

In order to reduce the search space we apply a simple lemma proved in [6] on minimumdistortion embedding of graphs into the line.

Lemma 1 ([6])

– If G can be embedded into the line with distortion d, then there is a pushing embed-ding of G into the line with distortion d. Furthermore, every pushing embedding ofG into the line is non-contracting.

– Let f be a pushing embedding of a connected graph G into the line with distortionat most d. Then D(vi−1, vi) ≤ d for every 1 ≤ i ≤ n.

Lemma 1 implies that it is sufficient to look for an optimal pushing embedding. Noticethat a pushing embedding with f (v1) = 0 maps every vertex to an integer coordinate.Therefore we can without loss of generality restrict ourselves to functions f : V(G) →{0, . . . , dn}. We also assume that our input graph G is connected, because otherwisesome pair of vertices have infinite distance between them and hence there is no non-contracting embedding of G into the line.

We now present an algorithm that decides whether there is an embedding of distor-tion at most d for the input graph G. It is well known that any graph G with n verticescan be embedded into the line with distortion at most 2n−1 [2]. Thus, if we want to findthe minimum d such that there is an embedding of G into the line with distortion at most

Page 125: Graph-Theoretic Concepts in Computer Science

An Exact Algorithm for Minimum Distortion Embedding 115

d it is sufficient to try all values between 1 and 2n − 1 for d. Next we describe the threemain components of our algorithm and show how to combine them in order to obtainan algorithm running in time 5n+o(n) and using 2n+o(n) space. The first and third part ofour algorithm go along the lines of the known algorithms for Bandwidth [5,4]. Whilethese two parts are sufficient to compute bandwidth, in order to solve our problem weneed an intermediate divide and conquer step to bridge the first and last part.

3.1 Fixing an Assignment into Buckets

The algorithm loops over all possible distributions of the vertices into “buckets” onthe integer line. The remaining two steps of the algorithm deal with finding an optimalembedding that agrees with the distribution made in the first step. Formally, we arelooking for a pushing embedding f : V(G) → {0, . . . , dn}. A bucket assignment is afunction h : V(G) → {0, . . . , n} and an embedding f : V(G) → {0, . . . , dn} of G agreeswith h if for every vertex v of G we have h(v) = f (v)

d+1 . For i ≥ 0, the i-th bucket of h (orthe i-th bucket for short) is Bi = {(d + 1)i, . . . , (d + 1)(i + 1) − 1} and the content of thei-th bucket is Vi = {v : h(v) = i}.

The outer loop of the algorithm goes over a set of bucket assignments such that ifthere is a pushing embedding f : V(G) → {0, . . . , dn} with distortion at most d thensome h we have looped over agrees with f . We guess a vertex v such that h(v) = 0and fix a spanning tree T of G with rT as root. Once h(p) has been determined for theparent p of a node u in T , we loop over all possible values of h(u). If h is to agree withsome pushing embedding f : V(G) → {0, . . . , dn} with distortion at most d we havethat h(u) = h(p) − 1, h(u) = h(p) or h(u) = h(p) + 1 and that h(u) ≥ 0. Since we haveat most 3 possibilities for the placement of each vertex the outer loop needs only to goover at most n · 3n different bucket assignments h.

3.2 Dealing with Many Buckets

In this section and Section 3.3, we provide an algorithm which given an initial bucketassignment h, decides whether there is a pushing embedding f of the input graph intothe line with distortion at most d that agrees with h.

Our algorithm Exact-Dist solves a slight modification of the problem. Input to thisproblem is a graph G, an integer d, a bucket assignment h, an interval J = {x, x +1, . . . , y} of integers and a function g : V ′ → {0, . . . , dn} for some subset V ′ of V(G).Let BJ =

⋃j∈J B j and VJ =

⋃j∈J V j. The algorithm determines whether there is a

partial pushing embedding f : VJ → BJ with distortion at most d such that f agreeswith h and f (v) = g(v) for all vertices in V ′ ∩VJ . To solve the original problem we makea call to Exact-Dist(G, d, h, J, g) where J = {0, . . . , n} and the domain V ′ of g is empty.Before commencing with the algorithm, we perform a “sanity check”. That is, given hcheck whether it is even remotely feasible that f can exist. We verify that h satisfies thefollowing properties.

– For every i, |Vi| ≤ d + 1.– Similarly, for every edge uv, |h(u) − h(v)| ≤ 1.

Page 126: Graph-Theoretic Concepts in Computer Science

116 F.V. Fomin, D. Lokshtanov, and S. Saurabh

Exact-Dist(G, d, h, J, g)(Here d is the distortion, h is the fixed bucket assignment, J = {x, . . . , y} is the set ofindices of buckets and g is a partial embedding of some of the vertices in the graph.)

1. If the size of |J| > nlog2 n

then find a bucket Vj of the kind described in Lemma 2else go to Step 3.

2. Enumerate all possible pushing partial embeddings gj : Vj → B j of distortion atmost d. For every such gj:

– Assign g′(v) = gj(v) if v ∈ Vj and g′(v) = g(v) if v is in the domain ofg. Let J1 = {x, . . . , j − 1, j} and J2 = { j, j + 1, . . . y}. Recursively solve thesubproblems Exact-Dist(G, d, h, J1, g′) and Exact-Dist(G, d, h, J2, g′). Return“YES” if both recursive calls return “YES”.

3. In this case solve the problem using Lemma 5 of Section 3.3.

Fig. 1. Description of the Algorithm

Indeed, if some of these cases do not hold, there is no embedding f with distortion d thatagrees with h and we can immediately answer “NO”. At all later stages of the algorithmwe assume that h satisfies these properties. An outline of the algorithm without thesepreliminary steps is given in Figure 1. In Section 3.3 we will give an algorithm whichimplements Step 3 in time 2n · nO(b) time, where b = |J| is the number of bucketsconsidered.

The idea behind the algorithm is as follows. When the number of buckets |J| is large,our algorithm follows a divide-and-conquer approach and if the number of buckets is“small”, that is roughly n/ log2 n, we do dynamic programming. To deal with the largenumber of buckets we look for a “small balanced separator” to branch on. The first stepof algorithm Exact-Dist is based on the following lemma.

Lemma 2. Let h be a bucket assignment and let J = x, x + 1, . . . , y be an integer in-terval such that n

log2 n< |J|. Then there exists j ∈ I = { 3x+y

4 + 1, . . . , x+3y4 } such that

|V j| ≤ 2 log2 n.

Proof. The proof follows from an averaging principle. For the sake of contradiction, letus assume that for every j ∈ I, |V j| > 2 log2 n. Then the total number of elements in thebuckets V j with j ∈ I is at least

j∈I|V j| > 2 log2 n · |J|

2> 2 log2 n · n

2 log2 n= n.

But the sets V j are disjoint, and thus the sum does not exceed |V(G)| = n, which is acontradiction. � If |J| is at least n/ log2 n, the algorithm picks a bucket B j and branches on all possi-ble ways to lay out V j in B j. After this the problem breaks up into two independentsubproblems (G, d, h, J1, g′) and (G, d, h, J2, g′), see Figure 1. We argue that the twosubproblems are indeed independent. Let f be a pushing partial embedding of VJ intoBJ with distortion at most d such that f agrees with h and coincides with g. This means

Page 127: Graph-Theoretic Concepts in Computer Science

An Exact Algorithm for Minimum Distortion Embedding 117

that f restricted to V j is a pushing partial embedding of V j into B j. We choose g j tocoincide with f on V j and define g′(v) = g j(v) if v ∈ V j and g′(v) = g(v) if v is in the do-main of g, just as in step 2 of algorithm Exact-Dist. If J = {x, . . . , y} then J1 = {x, . . . , j}and J2 = { j, . . . , y}. Now f restricted to J1 is a pushing partial embedding from VJ1 toBJ1 while f restricted to J2 is a pushing partial embedding from VJ2 to BJ2 .

In the other direction, let f1 and f2 be pushing partial embeddings from VJ1 toBJ1 andfrom VJ2 to BJ2 respectively, agreeing with h and coinciding with g′. Since J = J1 ∪ J2

and J1 ∩ J2 = { j} we can choose f to be the partial embedding from VJ to BJ thatcoincides with both f1 and f2. Since both f1 and f2 are pushing partial embeddings, sois f . Since every edge with both endpoints in VJ has both endpoints either in VJ1 or inVJ2 and both f1 and f2 have distortion at most d, so does f .

Let T (n, b) be the time required by algorithm Exact-Dist on a n-vertex graph G with|J| = b. Let T ∗(n) be the time required by algorithm Exact-Dist on a n-vertex graph Gand with |J| < n/ log2 n. An analysis of step 1 and 2 of algorithm Exact-Dist yields thefollowing recurrence.

T (n, b) =

⎧⎪⎪⎨⎪⎪⎩

(d+1

2 log2 n

)(2 log2 n)! · 2T

(n, 3b

4

)if b > n′

log2 n

T ∗(n) otherwise.

Thus, since b ≤ n we have T (n, b) ≤ 2O(log n

n/ log2 n) · T ∗(n) = 2o(n) · T ∗(n). In Section 3.3

we show how to implement the last step of algorithm Exact-Dist to run in time 2nnO(b)

which is at most 2n · 2o(n) since b ≤ n/ log2 n. This yields a 2n+o(n) runtime bound foralgorithm Exact-Dist and a 6n+o(n) bound for deciding whether G can be embedded intothe line with distortion at most d. In Section 3.4 we will show that the running time ofour algorithm in fact is bounded by 5n+o(n).

3.3 Dealing with Few Buckets

In this section we give an algorithm which given an initial bucket assignment h, a partialassignment g, and an integer interval J = {x, . . . , y} with |J| = b < n/ log2 n decideswhether there is a pushing partial embedding f : VJ → BJ with distortion at most d,agreeing with h and coinciding with partial assignment g. Our algorithm runs in timeand space 2nnO(b).

The number of slots in J, that is positions in the line to where vertices can be mapped,is at most b · (d + 1). Thus there could be many slots with no vertex mapped to them.We start our algorithm by guessing for every j ∈ J the leftmost non-empty slot in eachbucket B j and a vertex from V j to be placed there. Naturally, if the layout of a bucketB j with j ∈ J has already been determined by g our guesses must be consistent withthis. For every j ∈ J, let t j denote the vertex guessed to be placed leftmost in bucket j.Also let l j denote the position guessed for t j. After having made the guess we modifythe problem at hand—we now look for a pushing partial embedding f : VJ → BJ withdistortion at most d, agreeing with h, coinciding with g such that for every bucket B j

with j ∈ J, the leftmost vertex mapped to B j is t j, which is mapped to l j. The numberof possible guesses is bounded by (d + 1)bnb.

Page 128: Graph-Theoretic Concepts in Computer Science

118 F.V. Fomin, D. Lokshtanov, and S. Saurabh

We choose the ordering π1, π2, . . . , π|BJ | of the entries of BJ such that for every i < jwe have that πi mod (d + 1) ≤ π j mod (d + 1) and such that if πi mod (d + 1) =π j mod (d + 1) then πi

d+1 ≤ π j

d+1 . For example, if J = 3, 4, 5 and d = 4, then

π1, . . . , π15 = 15, 20, 25, 16, 21, 26, 17, 22, 27, 18, 23, 28, 19, 24, 29.

We call the ordering π1, . . . , π|BJ | the bucket order of B j. Next we define the notion of astate.

Definition 1 A state ζ is a quadruple (P,Q,R, p), where P ⊆ VJ, Q ⊆ P is a set ofvertices containing at most one vertex from each V j such that if V j∩P � ∅ then V j∩Q �∅ and t j ∈ P, R ⊆ BJ, is a set of integers containing at most one integer from each bucketB j and p ≤ |J| is a non-negative integer.

Let us observe that the number of states is at most 2n×n|J|×(d+1)|J|×|B j|. If Q∩V j � ∅,then define q j to be the vertex in Q ∩ V j. If R ∩ B j � ∅ let r j be the integer in R ∩ B j.Next we define what it means for a state to be feasible:

Definition 2 A state is called feasible if there exists a partial embedding f assigningthe vertices of P to the first p positions in the bucket order such that the followingcondition hold:

1. For any edge uv with u ∈ P and v ∈ P, | f (u) − f (v)| ≤ d, f agrees with h andcoincides with g.

2. If V j ∩ P � ∅, then f (t j) = l j and f (q j) = r j. There is no vertex v ∈ V j ∩ P such thatf (v) < l j or f (v) > r j.

3. For any bucket V j with j ∈ J, if x, y ∈ V j, f (x) < f (y) and no vertex is mapped byf to the interval { f (x) + 1, f (y) − 1}, then f (y) − f (x) = DG(x, y);

4. If j ∈ J and j is not the largest element of J, V j ⊆ P and V j+1 ∩ P � ∅, thenf (l j+1) − f (r j) = DG(l j+1, r j).

The idea is to go through the slots in J one by one in the bucket order and for eachof them determine which vertex (if any) gets mapped by f to this slot. The number pdenotes the position in the bucket order that we have reached. The set P correspondsto the set of vertices that have already been placed. For every j ∈ J, t j and q j denotethe vertices placed leftmost and rightmost in B j respectively. Also l j and r j denotes theposition of t j and q j in B j. Now we define the notion of a state succeeding another state.

Definition 3 Let ζ1 = (P1,Q1,R1, p) and ζ2 = (P2,Q2,R2, p + 1) be two states. We saythat ζ2 succeeds ζ1 if the following holds.

– Either P2 = P1, or P2 = P1 ∪ {v}.– If P1 = P2, then Q1 = Q2 and R1 = R2.– If P2 = P1 ∪ {v} and v ∈ V j, then j = πp+1

d+1 and1. If v ∈ t j, then l j = πp+1. If g(v) is defined then g(v) = πp+1.2. Q2 = (Q1 \ {q j}) ∪ {v} and R2 = (R1 \ {r j}) ∪ {πp+1}.3. If V j ∩ P1 � ∅ then πp+1 − r j = DG(v, q j).4. If j is not the largest element of J then l j+1 − πp+1 ≥ D(v, t j+1).

Page 129: Graph-Theoretic Concepts in Computer Science

An Exact Algorithm for Minimum Distortion Embedding 119

5. If j ∈ J and j is not the largest element of J, V j ⊆ P2 and V j+1 ∩ P2 � ∅ thenf (l j+1) − f (v) = DG(l j+1, v).

6. If j is not the smallest element of J then N(v) ∩ V j−1 ∩ P2 = ∅.We now proceed to prove an observation that will be helpful for the correctness proof.

Lemma 3. Let ζ1 = (P1,Q1,R1, p) be a feasible state and ζ2 = (P2,Q2,R2, p + 1) be astate that succeeds ζ1. Then ζ2 is feasible.

Proof. Since ζ1 = (P1,Q1,R1, p) is feasible there is a partial embedding f satisfyingpoints 1 − 4 in Definition 2. If P1 = P2 then f satisfies the points 1 − 4 for ζ2 as well. IfP2 � P1 then P2 \P1 contains a single vertex v. Let f ′ be a partial embedding assigningthe vertices of P2 to the first p + 1 positions in the bucket order such that f ′ and fcoincide and f ′(v) = πp+1. By point 1 of the definition of succession f ′ agrees with hand coincides with g. Since v has no neighbour in P1 ∩V j−1 it follows that for any edgeuw with u ∈ P2 and w ∈ P2, | f (u) − f (w)| ≤ d. Also, f ′ satisfies point 2 of definition2 because πp+1 is the rightmost position in P2 ∩ B j. Furthermore f ′ satisfies point 3 ofDefinition 2 by point 3 of Definition 3. Finally f ′ satisfies point 4 of Definition 2 bypoint 5 of Definition 3. � Now we are ready to prove the main lemma of the section which allows us to obtain thedesired result.

Lemma 4. There is a pushing partial embedding f : VJ → BJ with distortion atmost d such that f agrees with h, coincides with g and such that for every j ∈ J,f (t j) = l j and no other vertex in V j is mapped before t j by f if and only if there existssequence of states ζ1, ζ1, . . . , ζ|BJ | such that (a) ζ1 = (∅, ∅, ∅, 0); (b) ζi+1 succeeds ζi forall i ∈ {1, . . . , |BJ | − 1}; and (c) ζ|BJ | = (VJ, X, Y, |BJ|).Proof. Let f : VJ → BJ be a pushing partial embedding with distortion at most d suchthat f agrees with h, coincides with g and such that for every j ∈ J, f (t j) = l j and noother vertex in V j is mapped before t j by f . With the help of f we define the sequenceof feasible states as follows. For every p ≤ |BJ |, P is the set of vertices f maps toπ0, . . . , πp, Q is the set of vertices in P such that for every j such that P ∩ V j � ∅, Qcontains exactly one vertex q j, f maps all vertices in P ∩ V j to the left of q j. Finally Ris the set of positions that f maps the vertices of Q. The construction of the sequence ofstates implies that ζ1 = (∅, ∅, ∅, 0), ζi+1 succeeds ζi for all i ∈ {1, . . . , |BJ | − 1} and thatζ|BJ | = (VJ, X, Y, |BJ |).

For the reverse direction suppose that we have sequence of feasible states ζ1, ζ1, . . . ,ζ|BJ | such that ζ1 = (∅, ∅, ∅, 0); (b) ζi+1 succeeds ζi for all i ∈ {1, . . . , |BJ | − 1}; and (c)ζ|BJ | = (VJ, X, Y, |BJ|). Since ζ1 = (∅, ∅, ∅, 0) is feasible Lemma 3 implies that ζ|BJ | =(VJ, X, Y, |BJ|) is feasible as well. The definition of feasibility guarantees the existenceof the desired f , concluding the proof. � Finally, we ready to proceed with the lemma used for the analysis of Step 3.

Lemma 5. There is an algorithm that for given G, d, h, J, g and T decides whetherthere is a pushing partial embedding f : VJ → BJ with distortion at most d such thatf agrees with h, coincides with g and such that for every j ∈ J, f (t j) = l j and no othervertex in V j is mapped before t j by f in time and space 2n · nO(|J|).

Page 130: Graph-Theoretic Concepts in Computer Science

120 F.V. Fomin, D. Lokshtanov, and S. Saurabh

Proof. As we observed already, the number of states is at most 2n×n|J|×(d+1)|J|×|B j| ≤2n·nO(|J|). The algorithm decides the existence of f by applying Lemma 4. The algorithmstarts in the state (∅, ∅, ∅, 0) and does breadth first search on the graph where vertices arethe states and there is a directed edge from a state ζi to a state ζ j if ζ j succeeds ζi. We donot keep this graph explicitly and rather generate the vertices of this graph as and whenrequired in our breadth first search. Whenever we are at state ζ we can find all possiblesuccessor states in polynomial time. By Lemma 4 there is a required embedding f if andonly if there is a path from (∅, ∅, ∅, 0) to (VJ, X, Y, |BJ|). Our algorithm needs 2n · nO(|J|)space to keep track of the set of states visited by the breadth first search algorithm. Sincethe number of states is bounded by 2n · nO(|J|) and the number of successors of a state isat most d + 2 the number of vertices and edges in the state graph is upper bounded by2n · nO(|J|). Hence the algorithm takes 2n · nO(|J|) time and space. � Observe that applying Lemma 5 together with the analysis presented for AlgorithmExact-Dist over the previous section yields a running time bound of 6n+o(n). In fact, ouralgorithm runs in time 5n+o(n). The next section is devoted to proving this.

3.4 A Refined Analysis

In this section we prove that the total number of states ever produced by our algorithmis 5n+o(n). Since the running time of the algorithm is proportional to the number of stateswe generate up to a subexponential factor, this implies that algorithm Exact-Dist runsin time 5n+o(n). The proof of the following lemma is essentially an adaptation of therunning time analysis given in [4] and will appear in the full version of the paper.

Lemma 6. The algorithm described in the previous sections runs in time 5n+o(n).

We conclude with the following theorem.

Theorem 1. There is an algorithm that given a graph G on n vertices constructs anon-contracting embedding of the shortest path metric generated by G into the linewith minimum distortion in time 5n+o(n) and space 2n+o(n).

4 Concluding Remarks and Open Problems

In this paper we have provided the first single vertex exponential time algorithm forcomputing a minimum distortion embedding of a graph metric into the line. This resultgives rise to many challenging questions.

How fast is it possible to compute a minimum distortion embedding of a graph Ginto the metric of another graph H? Is there a 2O(|V(G)|) time algorithm for this problem,or can one show that this is impossible up to some complexity theoretic assumption?How does the problem behave if the host graph H is a tree? Even when H is a binarytree, this does not seem to be an easy problem. At a first glance it would seem that ouralgorithm should be directly extendable to find a minimum distortion embedding of agraph G into a given cycle C. However this does not look to be easy and we leave it asan open problem whether finding a minimum distortion embedding of a graph G into agiven cycle C can be done in 2O(|V(G)|) time.

Page 131: Graph-Theoretic Concepts in Computer Science

An Exact Algorithm for Minimum Distortion Embedding 121

We believe that the world of embeddings provides a lot of challenges to the areaof moderately exponential time algorithms and is worth to be explored. We hope thatour result will lead to further investigation of the combinatorially challenging field ofembeddings within the framework of moderately exponential time algorithms.

References

1. Badoiu, M., Chuzhoy, J., Indyk, P., Sidiropoulos, A.: Low-distortion embeddings of generalmetrics into the line. In: Proceedings of the 37th Annual ACM Symposium on Theory ofComputing (STOC), ACM, pp. 225–233 (2005)

2. Badoiu, M., Dhamdhere, K., Gupta, A., Rabinovich, Y., Racke, H., Ravi, R., Sidiropou-los, A.: Approximation algorithms for low-distortion embeddings into low-dimensionalspaces. In: Proceedings of the 16th Annual ACM-SIAM Symposium on Discrete Algorithms(SODA), pp. 119–128. SIAM, Philadelphia (2005)

3. Badoiu, M., Indyk, P., Sidiropoulos, A.: Approximation algorithms for embedding generalmetrics into trees. In: Proceedings of the 18th Annual ACM-SIAM Symposium on DiscreteAlgorithms (SODA), pp. 512–521. ACM, SIAM (2007)

4. Cygan, M., Pilipczuk, M.: Faster Exact Bandwidth. In: Broersma, H., Erlebach, T., Friedet-zky, T., Paulusma, D. (eds.) WG 2008. LNCS, vol. 5344, pp. 101–109. Springer, Heidelberg(2008)

5. Feige, U.: Coping with the NP-hardness of the graph bandwidth problem. In: Halldorsson,M.M. (ed.) SWAT 2000. LNCS, vol. 1851, pp. 10–19. Springer, Heidelberg (2000)

6. Fellows, M.R., Fomin, F.V., Lokshtanov, D., Losievskaja, E., Rosamond, F.A., Saurabh, S.:Distortion is Fixed Parameter Tractable. In: Albers, S., et al. (eds.) ICALP 2009. LNCS,vol. 5555, pp. 463–474. Springer, Heidelberg (2009)

7. Gupta, A., Newman, I., Rabinovich, Y., Sinclair, A.: Cuts, trees and l1-embeddings of graphs.Combinatorica 24, 233–269 (2004)

8. Indyk, P.: Algorithmic applications of low-distortion geometric embeddings. In: Proceedingsof the 42nd IEEE Symposium on Foundations of Computer Science (FOCS), pp. 10–33.IEEE, Los Alamitos (2001)

9. Kenyon, C., Rabani, Y., Sinclair, A.: Low distortion maps between point sets. In: Proceedingsof the 36th Annual ACM Symposium on Theory of Computing (STOC), pp. 272–280. ACMPress, New York (2004)

10. Linial, N.: Finite metric-spaces—combinatorics, geometry and algorithms. In: Proceedingsof the International Congress of Mathematicians, Beijing, vol. III, pp. 573–586. Higher Ed.Press (2002)

Page 132: Graph-Theoretic Concepts in Computer Science

Sub-coloring and Hypo-coloring Interval Graphs�

Rajiv Gandhi1, Bradford Greening Jr.1, Sriram Pemmaraju2,and Rajiv Raman3

1 Department of Computer Science, Rutgers University-Camden, Camden, NJ [email protected]

2 Department of Computer Science, University of Iowa, Iowa City, Iowa [email protected]

3 Max-Planck Institute for Informatik, Saarbrucken, [email protected]

Abstract. In this paper, we study the sub-coloring and hypo-coloringproblems on interval graphs. These problems have applications in jobscheduling and distributed computing and can be used as “subroutines”for other combinatorial optimization problems. In the sub-coloring prob-lem, given a graph G, we want to partition the vertices of G into minimumnumber of sub-color classes, where each sub-color class induces a unionof disjoint cliques in G. In the hypo-coloring problem, given a graph G,and integral weights on vertices, we want to find a partition of the ver-tices of G into sub-color classes such that the sum of the weights of theheaviest cliques in each sub-color class is minimized. We present a “for-bidden subgraph” characterization of graphs with sub-chromatic numberk and use this to derive a 3-approximation algorithm for sub-coloring in-terval graphs. For the hypo-coloring problem on interval graphs, we firstshow that it is NP-complete, and then via reduction to the max-coloringproblem, show how to obtain an O(log n)-approximation algorithm for it.

1 Introduction

Given a graph G = (V, E), a k-sub-coloring of G is a partition of V into sub-color classes V1, V2, . . . , Vk; a subset Vi ⊆ V is called a sub-color class if itinduces a union of disjoint cliques in G. Figure 1(a) shows a 2-sub-coloring of agraph, with the black vertices forming one sub-color class and the white verticesthe other. The smallest k for which a graph has a k-sub-coloring is called thesub-chromatic number of G, and is denoted χs(G). The sub-coloring problem[1,4,5,8,22] seeks to find a partition of vertices of G into the smallest number ofsub-color classes. Clearly, any proper coloring of G is also a sub-coloring, sinceany proper color class can be viewed as the disjoint union of size-1 cliques; hence,χs(G)≤ χ(G). Of course, the sub-chromatic number can be much smaller thanthe chromatic number (e.g., consider a large clique). Figure 1(b) shows a graph

� Part of this work was done when the first author was visiting the University of Iowa.Research partially supported by Rutgers University Research Council Grant and byNSF award CCF-0830569.

C. Paul and M. Habib (Eds.): WG 2009, LNCS 5911, pp. 122–132, 2010.c© Springer-Verlag Berlin Heidelberg 2010

Page 133: Graph-Theoretic Concepts in Computer Science

Sub-coloring and Hypo-coloring Interval Graphs 123

1 92

8 5

511

7

(a) (b)

0 1

00 01 10 11

b c

f gd e

Fig. 1. (a) shows a 2-sub-coloring of a graph whose chromatic number is 3. If the num-bers next to the vertices are taken to be vertex-weights then the white-black coloringis a hypo-coloring of cost 17 + 11 = 28. (b) shows a graph whose chromatic numberand sub-chromatic number are both 3. This is an example of BC(3), a binary cliqueof order 3. The binary string vertex-labels are useful in defining the family of binarycliques (see Section 2).

G with χ(G) = χs(G) = 3. To see that χs(G) ≥ 3, observe that each of the 2-paths induced by {b, d, e} and {c, f, g} require 2 sub-color classes. Furthermore,if the subgraph induced by {b, c, d, e, f, g} is colored using 2 sub-colors, thenvertex a cannot be added to either of the sub-color classes because each of thesub-color classes will contain at least one vertex from {b, d, e} and at least onevertex from {c, f, g}. We call the graph shown in Figure 1(b) a binary cliqueof order 3, denoted BC(3). Later (in Section 2) we define the family, BC(k),k ≥ 1, of order k binary cliques and show that the presence of an induced binaryclique is an obstacle to having a small sub-chromatic number, in the sense thatχs(BC(k)) ≥ k.

Given a graph G = (V, E), and a vertex weight function w : V → N, the hypo-coloring problem [6] seeks to find a partition of the vertices of G into sub-colorclasses such that the sum of the weights of the heaviest cliques in each sub-colorclass is minimized. In other words, if V1, V2, . . . , Vk are the sub-color classes ofa hypo-coloring solution, then the cost of the solution is

∑ki=1 maxK⊆Vi w(K),

where each K is a clique in the sub-color class Vi and w(K) is the sum of theweights of vertices in K. Figure 1(a) shows a hypo-coloring of a vertex-weightedgraph with cost 17 + 11 = 28.

Our Contribution. This paper studies the approximability of sub-coloring andhypo-coloring on interval graphs. On the positive side, we present (in Section 2)a 3-approximation algorithm for sub-coloring interval graphs. This is the firstconstant-factor approximation algorithm for the problem. We also present anO(log n)-approximation algorithm for the hypo-coloring problem, via reductionto the max-coloring problem [20]. In fact, we get an O(log n)-approximation forhypo-coloring on a variety of graph classes including perfect graphs, unit diskgraphs, circle graphs, etc., all of which admit constant-factor approximationalgorithms for the max-coloring problem [19]. On the negative side, we show (inSection 3) that hypo-coloring on interval graphs is NP-complete.

It is worth noting here that the complexity status of sub-coloring on inter-val graphs is unknown. Results due to Broersma et al. [5] imply that there is annO(log n)-time algorithm for the sub-coloring problem on interval graphs. The ex-istence of a subexponential time algorithm for the problem makes it unlikely that

Page 134: Graph-Theoretic Concepts in Computer Science

124 R. Gandhi et al.

sub-coloring on interval graphs is NP-complete. Given this, it is worth furtherexploring the possibility that the problem has a polynomial-time algorithm.

1.1 Applications

The sub-coloring and hypo-coloring problems have a variety of applications to jobscheduling, distributed computing, and combinatorial optimization. We sketchsome of these applications next.

Combinatorial Optimization: The sub-coloring problem can be used as a sub-routine in solving some combinatorial optimization problems on graphs, wheresolving the problem on a clique is easier than solving the problem on generalgraphs. This approach has been used for example in approximation algorithmsfor the maximum feasible subsystem problem(MFS)1. In [7], Elbassioni et al.study the MFS problem where the marix A is a consecutive-ones matrix, and xis restricted to be non-negative. They give an algorithm for solving the problemon a clique, and then use this result in conjunction with a sub-coloring to obtainapproximation algorithms for this problem.

Job Scheduling: The hypo-coloring problem arises in the problem of batchscheduling jobs in conflict. In a batch scheduling environment with conflicts,we are given jobs J = {J1, · · · , Jn} with processing times pj , and a conflictgraph with vertices as the jobs, and an edge representing conflict, where jobsthat are in conflict can not be scheduled simultaneously. A schedule that min-imizes the makespan of the schedule (with an arbitrarily large number of ma-chines) has been studied as the max-coloring problem [20]. When the conflictgraph is an interval graph, the problem reduces to the max-coloring problemon interval graphs. Now suppose that in a batch we have one job with a largeprocessing time, and other jobs with very small processing times, then all themachines except for the machine processing this large job are idle until the batchcompletes. We can get an improved schedule if in each batch the jobs form aunion of disjoint cliques. Thus, each clique can be run on the same machinesequentially, while the next set of jobs is scheduled once this batch of jobs com-pletes. Such schedules can be seen as batch schedules with a kind of backfilling[21,15].

Distributed Computing: The sub-coloring problem on general graphs is also mo-tivated by the network decomposition problem in distributed computing [3,17].A vertex partition V1, V2, . . . , Vk of a graph G = (V, E) induces a cluster graphwith vertex set {1, 2, . . . , k} and edges {i, j} iff there is an edge in G betweensome u ∈ Vi and v ∈ Vj . The network decomposition problem seeks to find a ver-tex partition V1, V2, . . . , Vk of G such that each cluster G[Vi] has small diameterand the cluster graph has small chromatic number. For example, Awerbuch etal. [3] present a deterministic, distributed algorithm running in O(nε(n)) time for

1 The maximum feasible subsytem problem is the following. Given a system l ≤ Ax ≤b, which is infeasible, the goal is to find a solution vector x that satisfies the maximumnumber of inequalites.

Page 135: Graph-Theoretic Concepts in Computer Science

Sub-coloring and Hypo-coloring Interval Graphs 125

computing a (nε(n), nε(n))-network decomposition2 where ε(n) =√log log n/

√log n. Using this they obtain the first, deterministic, sublinear

distributed algorithms for several classical problems in distributed computing.If we restrict the diameter of each Vi to 1, i.e., a clique, then the networkdecomposition problem is equivalent to the sub-coloring problem since eachproper color class of the cluster graph is a disjoint union of cliques from theinput graph. Lately, this approach to designing fast distributed algorithms hasbecome very popular in wireless networks [12]. This motivates the study ofsub-coloring on geometric intersection graphs such as unit disk graphs (UDGs)or disk graphs. used to model wireless networks.

1.2 Related Work

The sub-chromatic number of a graph was introduced by Mynhardt and Broere[4,16], and studied as spot-coloring by Hartman [11]. Achlioptas [1] proved thatF -free coloring3 is NP-hard even when F is any graph with at least 3 vertices. Bysetting F = P3 we get that the sub-coloring problem on general graphs is NP-hard. Fiala et al. [8] showed that F -free coloring is NP-hard even for triangle-freeplanar graphs with maximum degree 4, while giving polynomial time algorithmsfor sub-coloring on cographs and graphs of bounded tree-width. Stacho [22] hasshown that sub-coloring on chordal graphs is NP-complete. Broersma et al. [5]study algorithmic and combinatorial aspects of sub-coloring on various classesof graphs. Specifically, they show that when G is chordal χs(G) is Θ(log n).They also show that for any constant r, there is a polynomial time algorithm tocompute a sub-coloring of interval graphs that have sub-coloring ≤ r. However,they do not consider the problem of obtaining an approximation algorithm forsub-coloring on general interval graphs.

Motivated by the problem of batch scheduling conflicting jobs, de Werra et al.[6] introduced the hypo-coloring problem. The authors give a polynomial timealgorithm for graphs with maximum degree 2, and for forests with boundedmaximum degree. They also show that the problem is NP-hard on bipartitegraphs and triangle-free planar graphs.

A problem that seems related to hypo-coloring is the max-coloring problem.Given a graph G = (V, E) and a weight function w : V → N the problem is to finda proper vertex coloring C1, C2, . . . , Ck of G that minimizes

∑ki=1 maxv∈Ci w(v).

Note that the special case of this problem in which w(v) = 1 for all v ∈ V issimply the problem of coloring graphs using fewest colors. Pemmaraju et al. [20]show that the max-coloring problem on interval graphs is NP-complete and givea 2-approximation algorithm. In Section 3 we study the relation between theoptimal solutions for max-coloring and hypo-coloring and provide a reduction

2 A (c(n), d(n))-network decomposition is one in which the cluster graph chromaticnumber is bounded above by c(n) and the diameter of each cluster is bounded aboutby d(n).

3 For a graph G = (V, E), an F -free coloring is a partition of the vertex set of G suchthat in each color class, the vertices do not have F as an induced subgraph.

Page 136: Graph-Theoretic Concepts in Computer Science

126 R. Gandhi et al.

from hypo-coloring to max-coloring that leads to an O(log n)-approximation tohypo-coloring.

2 A 3-Approximation for Sub-coloring Interval Graphs

This section presents an algorithm that takes as input an interval graph G =(V, E) and returns a partition into sub-color classes S1, S2, . . . , Sk, such thatk ≤ 3 · χs(G). We start by first establishing a lower bound on χs(G), for anygraph G. A complete binary tree of order k, k ≥ 1, denoted CBT (k), is a rootedtree with vertex set {0, 1}k−1 and edge set {{α, α0}, {α, α1} | α ∈ {0, 1}k−2}.The root of the tree is the vertex labeled ε, the empty string. A binary clique oforder k, denoted BC(k), is obtained from CBT (k) by adding edges {α, β} whereβ is a strict prefix of α. Figure 1(b) shows BC(3) along with the binary stringlabels for the vertices. The edges {a, d}, {a, e}, {a, f}, and {a, g} were added ingoing from CBT (3) to BC(3).

Lemma 1. If a graph G (not necessarily an interval graph) contains BC(k) asan induced subgraph, then χs(G) ≥ k.

Proof. (Sketch) The proof follows by induction on k. The base case can be easilyseen to hold. Assuming the inductive hypothesis for k′ ≤ k− 1, if BC(k) can besub-colored with k − 1 or fewer colors, this leads to a contradiction.

The 3-approximation algorithm that we will present next has two main phases.Suppose that G is the input interval graph and A is the set of intervals corre-sponding to this graph. In the first phase (partitioning phase), we partition theintervals in A into subsets S1, S2, . . . , Sk and show that G contains an inducedbinary clique of order k, implying via Lemma 1 that χs(G) is lower bounded bythe size of the partition. In the second phase (coloring phase) of the algorithmwe sub-color each Si using at most 3 colors, and using a different set of colorsfor each subclass. This yields a sub-coloring with 3k ≤ 3χs(G) colors.

2.1 Partitioning Phase

Our partitioning procedure takes as input a collection A of intervals. An intervalI in A is said to be internal if it completely contains (in the geometric sense) twodisjoint intervals I1 and I2. Any interval that is not internal is called external.The partitioning algorithm (shown in Figure 2) simply peels of “layers” of exter-nal intervals. Note that every non-empty collection of intervals has a non-emptysubset of external intervals.

Lemma 2. If Partition(A) returns S1, S2, . . . , Sk, then G, the interval graphcorresponding to A, contains an induced BC(k).

Proof. We will prove by induction that for any j, 1 ≤ j ≤ k, and any intervalI ∈ Sj , I is the root of a binary clique H of order j contained entirely within the

Page 137: Graph-Theoretic Concepts in Computer Science

Sub-coloring and Hypo-coloring Interval Graphs 127

Partition(A)

1 A0 ← A; k ← 02 while (Ak �= ∅) do3 k ← k + 14 Sk ← intervals that are external in Ak−1

5 Ak ← Ak−1 \ Sk

6 return S1, S2, . . . , Sk

Fig. 2. Partitioning algorithm that takes a set A of intervals as input and returns apartition S1, S2, . . . , Sk

intervals in Bj = S1∪S2∪· · ·∪Sj and furthermore all intervals in H are entirelycontained (in the geometric sense) in I. The base case (j = 1) is trivially true.Consider any interval I ∈ Sj . There are two disjoint intervals I1 and I2 in Sj−1

that are completely contained in I. Otherwise, I would have been a member ofSj−1. By the inductive hypothesis, I1 is the root of H1, a binary clique of orderj − 1 and I2 is the root of H2, a binary clique of order j − 1. Furthermore, allintervals in Hi, i = 1, 2 are contained in Ii. This implies that H1 and H2 aredisjoint and also that interval I has edges to all the intervals in H1 and in H2.The graph induced by I and the intervals in H1 and H2 is a binary clique oforder j, with root I, and with all intervals contained within I.

After partitioning A into subsets S1, S2, . . . , Sk, we “color” the intervals in eachsubset Si as follows. For the rest of this subsection let S denote an arbitrarySi. We start by choosing the left-most maximal clique in S; call this M1. LetI1 ∈M1 be the interval with the right-most right endpoint, and let N1 be the setof intervals not in M1 that are completely contained within I1. We then removeintervals in M1 ∪ N1 from S and if S = ∅, we repeat the process and computeM2 and N2 and so on. Once this process terminates, for some k ≥ 1, we havepartitioned S into subsets M1, M2, . . . , Mk and N1, N2, . . . , Nk. We then “color”all intervals in N1 ∪ N2 ∪ · · · ∪ Nk using color C2 and alternately “color” theintervals in M1, M2, . . . , Mk, using color C1 and C0. The pseudocode for thisalgorithm is given in Figure 3.

2.2 Analysis

Observe that after the 3Color algorithm finishes processing a subset S, eachinterval in S is assigned to exactly one of 3 subsets, C0, C1, or C2. We now showthat each Cj , j = 0, 1, 2, is a union of disjoint cliques. This suffices to prove thatC0, C1, C2 is a valid 3-sub-coloring of S.

Lemma 3. C2 is a union of disjoint cliques.

Proof. Let Nx and Ny be any two particular but arbitrary cliques in C2. Withoutloss of generality, let x < y. Note that Nx is the set of intervals in C2 which arecompletely contained in interval Ix and Ny is the set of intervals in C2 which are

Page 138: Graph-Theoretic Concepts in Computer Science

128 R. Gandhi et al.

3Color(S)

1 k ← 02 C0 ← C1 ← C2 ← ∅3 while (S �= ∅) do4 k ← k + 15 Mk ← leftmost maximal clique6 Ik ← interval in Mk with the rightmost right endpoint7 Nk ← intervals not in Mk that are completely contained in Ik

8 S ← S \ (Mk ∪ Nk)9 if k is even then10 C0 ← C0 ∪ Mk

11 else12 C1 ← C1 ∪ Mk

13 C2 ← C2 ∪ Nk

14 return C0, C1, C2

Fig. 3. Sub-Coloring algorithm that takes a subset S of intervals produced by thepartition algorithm and computes a 3-sub-coloring of S

completely contained in interval Iy . If Ix and Iy do not overlap, then clearly thereare no overlaps between intervals in Nx and intervals in Ny. However, if Ix andIy do overlap, then it must be that y = x+1. Now assume for contradiction thatinterval J ∈ Nx overlaps with interval K ∈ Ny. Since J is completely containedin Ix, and K overlaps J , clearly K also overlaps Ix. This means that K belongsto My (the leftmost maximal clique after all intervals in Mx are removed), andhence cannot belong to Ny, a contradiction. ��Lemma 4. C1 (C0, respectively) is a union of disjoint cliques.

Proof. Let Mx and My be any two particular but arbitrary cliques in C1 (C0,respectively) and assume for contradiction that there are intervals in Mx whichoverlap intervals in My. Without loss of generality assume that x < y. LetJ ∈ Mx be an interval which overlaps with an interval K ∈ My. Recall thatIx ∈Mx is the interval having rightmost right endpoint in Mx, therefore Ix alsooverlaps K. This implies that Mx and My are consecutive maximal cliques, thatis, My = Mx+1 and thus the algorithm would not have assigned both Mx andMy to C1, (C0, respectively) a contradiction. ��Lemmas 3 and 4 lead to the following corollary.

Corollary 1. The algorithm 3Color(S) computes a 3-sub-coloring of S.

This corollary, along with Lemmas 1 and 2 leads to the following result.

Theorem 1. There is a 3-approximation algorithm for the sub-coloring problemon interval graphs.

We note that the sub-coloring obtained also yields a 6-approximation algorithmfor partitioning an interval graph into the fewest number of proper interval

Page 139: Graph-Theoretic Concepts in Computer Science

Sub-coloring and Hypo-coloring Interval Graphs 129

graphs4 Gardi [9] posed this as an open problem. The proof follows by notingthat the sub-chromatic number of proper interval graphs is 2.

Theorem 2. There is a 6-approximation algorithm for partitioning an intervalgraph into fewest number of proper interval graphs.

3 Hypo-coloring of Interval Graphs

In this section, we show that the hypo-coloring problem is NP-complete, andgive an O(log n)-approximation algorithm via a reduction to the max-coloringproblem.

3.1 NP-Completeness

The NP-completeness of hypo-coloring on interval graphs is shown by using areduction from Coloring Circular-Arc Graphs [10]. Our proof is heavilyinfluenced by the NP-completeness proof of minimum sum coloring on intervalgraphs by D. Marx [13] and the proof of NP-completeness of max-coloring oninterval graphs by Pemmaraju et al. [20].Coloring Circular-Arc Graphs

INPUT: A circular-arc graph G = (V, E), and a number k ∈ N.QUESTION: Does G have a coloring of cost at most k?

We may assume that a circular arc representation of G is given to us sincerecognition and construction of a circular arc representation can be done inpolynomial time [14]. Also as done in [13,20], we can assume that there exists apoint on the circle contained in exactly k arcs. In the following proof, we view thehypo-coloring problem as a decision problem in which we are given an additionalinput, a positive integer W , and asked if the given instance has a hypo-coloringof cost at most W .

Theorem 3. Hypo-coloring interval graphs is NP-Complete.

Proof. Given a circular-arc graph G and parameter k, let r be a ray from the cen-ter of the circle that passes through k arcs of G. We construct an interval graphH from G by splitting the arcs intersecting r. More formally, let I = {I1, · · · , Ik}be the arcs intersecting r. We replace each arc Ii ∈ I by two arcs I ′i and I ′′i ,that start and end respectively at r. This gives us an interval graph and we canassume that the intervals I ′ = {I ′i | i = 1, 2, . . . , k} form the leftmost intervals,and the intervals I ′′ = {I ′′i | i = 1, 2, . . . , k} form the rightmost intervals. Weset the left end-points of the intervals I ′i such that l(I ′i) < l(I ′j) whenever i < jand we set r(I ′′i ) < r(I ′′j ) whenever i < j. Here l(I) and r(I) respectively de-note the left and right end-points of an interval I. Further, we add two sets ofintervals L = {L1, · · · , Lk} and R = {R1, · · · , Rk}, such that r(Li) = l(I ′i) and4 An interval graph is proper if there is an interval representation of G such that no

interval properly contains another.

Page 140: Graph-Theoretic Concepts in Computer Science

130 R. Gandhi et al.

l(Ri) = r(I ′′i ) for all i = 1, · · · , k. The weights of the intervals are defined asfollows. We let w(Li) = w(Ri) = 1 + i · ε, for ε = 1

k+1 ), w(I) = 1, ∀I ∈ L ∪ R.This gives us the interval graph H . Note that scaling the weights by a factor ofk + 1 will guarantee that all vertex-weights in H are integral.

If to each interval in H , we assign a color c if it’s corresponding inteval inG is assigned a color c, then I ′i and I ′′i are assigned the same color for eachi = 1, · · · , k, allowing us to assign the same colors to Li and Ri as I ′i and I ′′i , weobtain a hypo-coloring of cost C = k + k(k + 1)ε/2.

On the other hand, suppose there is a hypo-coloring of cost C or less. Wefirst show that such a coloring must in fact be a proper coloring of H . To seethis, consider just the subgraph of H induced by the intervals in L∪ I ′. A hypo-coloring of this subgraph with cost at most C must itself be proper because anyhypo-color class in this hypocoloring with a clique of size larger than 1 will forceus to place one of the intervals in L ∪ I ′ in a new color class, incurring a costof at least C + 1. Further, in such a proper coloring, if Li is not placed in thesame color class as Ri for each i = 1, · · · , k, the coloring has cost at least C + ε.Hence, a hypo-coloring of cost C or less must be proper, and place Li and Ri inthe same color class, for each i, which is only possible if I ′i and I ′′i are placed inthe same color class for each i = 1, · · · , k, and this yields a proper coloring ofthe circular-arc graph G. ��

3.2 An O(log n)-approximation for Hypo-coloring

In this section we show that an optimal solution to the max-coloring problemon any graph G is an O(log n)-approximation to the hypo-coloring problem withinput G. Since there is a 2-approximation algorithm for max-coloring on intervalgraphs [20] this implies that there is an O(log n)-approximate solution for hypo-coloring interval graphs.

Theorem 4. Given any graph G, an optimal max-coloring of G is an O(log n)-approximation for hypo-coloring of G.

Proof. Let OPTH be an optimal hypo-coloring solution. We will prove theclaim by showing that there is a feasible maxcoloring solution whose cost isO(log n)OPTH . Let S1, S2, . . . , Sk be the k color classes in OPTH and let thecliques in Si be given by S1

i , S2i , . . . , Spi

i . Let mi be the maximum number ofvertices in any clique in Si. In other words, mi = max1≤j≤pi |Sj

i |. Consider themax-coloring solution in which there are color classes C1

i , C2i , . . . , Cmi

i for eachSi in OPTH . For 1 ≤ x ≤ mi, the color class Cx

i is formed by including the xth

heaviest vertices from each of the cliques in Si. Since the cliques are disjoint,so are the xth heaviest vertices from each of the cliques. Consider the heaviestvertex v ∈ Cx

i and let v belong to clique Syi . Since v is the xth heaviest ver-

tex in Syi there must be x − 1 vertices in Sy

i of weight at least w(v) that areplaced in C1

i , C2i , . . . , Cx−1

i . Hence, w(Cxi ) ≤ Wi

x , where Wi is the weight of theheaviest clique in Si. Thus C1

i , C2i , . . . , Cmi

i is a feasible maxcoloring solution forinput Si with cost ≤ Wi + Wi

2 + . . . + Wi

mi= WiHmi ≤ Wi(ln mi + 1). Thus the

Page 141: Graph-Theoretic Concepts in Computer Science

Sub-coloring and Hypo-coloring Interval Graphs 131

total cost of our maxcoloring solution for G becomes ≤ ∑ki=1 Wi(ln mi + 1) ≤

∑ki=1 Wi(ln m+1) = O(log m)

∑ki=1 Wi = O(log m)OPTH where m is the num-

ber of vertices in the largest clique among all batches S1, S2, . . . , Sk. Since m ≤ n,we have obtained a solution to maxcoloring of cost O(log n)OPTH . ��The above analysis can be shown to be tight. Owing to lack of space, the detailsare in the full version.

References

1. Achlioptas, D.: The complexity of g-free colorability. Discrete Math, 21–30 (1997)2. Albertson, M.O., Jamison, R.E., Hedetnieme, S.T., Locke, S.C.: The subchromatic

number of a graph. Discrete Math. 74, 33–49 (1989)3. Awerbuch, B., Goldberg, A.V., Luby, M., Plotkin, S.A.: Network decomposition

and locality in distributed computation. In: Proceedings of the 30th Annual Sym-posium on Foundations of Computer Science (FOCS), pp. 364–369 (1989)

4. Broere, I., Mynhardt, C.M.: Generalized colorings of outerplanar and planargraphs. In: Proceedings of the 10th International Workshop on Graph-TheoreticConcepts in Computer Science (WG), pp. 151–161 (1984)

5. Broersma, H., Fomin, F.V., Nesetril, J., Woeginger, G.J.: More about subcolorings.Computing 69, 187–203 (2002)

6. deWerra, D., Demange, M., Monnot, J., Paschos, V.T.: A hypocoloring model forbatch scheduling. Discrete Applied Mathematics 146, 3–25 (2005)

7. Elbassioni, K.M., Raman, R., Ray, S., Sitters, R.: On the approximability of themaximum feasible subsystem problem with 0/1-coefficients. In: Proceedings ofthe 20th ACM-SIAM Symposium on Discrete algorithms (SODA), pp. 1210–1219(2009)

8. Fiala, J., Jansen, K., Le, V.B., Seidel, E.: Graph subcoloring:complexity and algo-rithms. SIAM Journal on Discrete Mathematics 16, 635–650 (2003)

9. Gardi, F.: On partitioning interval and circular-arc graphs into proper interval sub-graphs with applications. In: Latin American Theoretical Informatics Symposium(LATIN), pp. 129–140 (2004)

10. Garey, M.R., Johnson, D.S., Miller, G.L., Papadimitriou, C.H.: The complexityof coloring circular arcs and chords. SIAM J. Algebraic and Discrete Methods 1,216–227 (1980)

11. Hartman, C.: Extremal Problems in Graph Theory (1997)12. Fabian, K., Thomas, M., Roger, W.: On the locality of bounded growth. In: Pro-

ceedings of the 24th Annual ACM symposium on Principles of Distributed Com-puting (PODC), pp. 60–68. ACM, New York (2005)

13. Marx, D.: A short proof of the NP-completeness of minimum sum interval coloring.Operations Research Letters 33(4), 382–384 (2005)

14. McConnell, R.M.: Linear-time recognition of circular-arc graphs. Algorith-mica 37(2), 93–147 (2003)

15. Mu’alem, A.W., Feitelson, D.G.: Utilization, predictability, workloads, and userruntime estimates in scheduling the ibm sp2 with backfilling. IEEE Trans. Paralleland Distributed Syst. 12(6), 529–543 (2001)

16. Mynhardt, C.M., Broere, I.: Generalized colorings of graphs. In: Proceedings of the11th International Workshop on Graph-Theoretic Concepts in Computer Science(WG), pp. 583–594 (1985)

Page 142: Graph-Theoretic Concepts in Computer Science

132 R. Gandhi et al.

17. Panconesi, A., Srinivasan, A.: On the complexity of distributed network decompo-sition. J. Algorithms 20(2), 356–374 (1996)

18. Pemmaraju, S.V., Pirwani, I.A.: Good quality virtual realization of unit ballgraphs. In: Arge, L., Hoffmann, M., Welzl, E. (eds.) ESA 2007. LNCS, vol. 4698,pp. 311–322. Springer, Heidelberg (2007)

19. Pemmaraju, S.V., Raman, R.: Approximation algorithms for the max-coloringproblem. In: Caires, L., Italiano, G.F., Monteiro, L., Palamidessi, C., Yung, M.(eds.) ICALP 2005. LNCS, vol. 3580, pp. 1064–1075. Springer, Heidelberg (2005)

20. Pemmaraju, S.V., Raman, R., Varadarajan, K.: Buffer minimization using max-coloring. In: Proceedings of the 15th ACM-SIAM Symposium on Discrete Algo-rithms (SODA), pp. 562–571 (2004)

21. Shmueli, E., Feitelson, D.G.: Backfilling with look ahead to optimize the packingof parallel jobs. J. Parallel and Distributed Computing 65(9), 1090–1107 (1995)

22. Stacho, J.: Complexity of Generalized Colourings of Chordal Graphs (2008)

Page 143: Graph-Theoretic Concepts in Computer Science

Parameterized Complexity of GeneralizedDomination Problems

Petr A. Golovach1, Jan Kratochvıl2, and Ondrej Suchy2,�

1 Department of Informatics, University of Bergen,5020 Bergen, [email protected]

2 Department of Applied Mathematicsand

Institute for Theoretical Computer Science (ITI)��,Charles University, Prague, Czech Republic

{honza,suchy}@kam.mff.cuni.cz

Abstract. Given two sets σ, ρ of nonnegative integers, a set S of verticesof a graph G is (σ, ρ)-dominating if |S∩N(v)| ∈ σ for every vertex v ∈ S,and |S ∩ N(v)| ∈ ρ for every v /∈ S. This concept, introduced by Tellein 1990’s, generalizes and unifies several variants of graph dominationstudied separately before. We study the parameterized complexity of(σ, ρ)-domination in this general setting. Among other results we showthat existence of a (σ, ρ)-dominating set of size k (and at most k) areW[1]-complete problems (when parameterized by k) for any pair of finitesets σ and ρ. We further present results on dual parametrization by n−k,and results on certain infinite sets (in particular for σ, ρ being the setsof even and odd integers).

1 Introduction

1.1 (σ, ρ)-Domination

Let σ, ρ be a pair of nonempty sets of nonnegative integers. A set S of verticesof a graph G is called (σ, ρ)-dominating if for every vertex v ∈ S, |S∩N(v)| ∈ σ,and for every v /∈ S, |S ∩N(v)| ∈ ρ. The concept of (σ, ρ)-domination was intro-duced by J.A. Telle [18,19] (and further elaborated on in [13,20]) as a unifyinggeneralization of many previously studied variants of the notion of dominatingsets. See Table 1 for some examples.

It is well known that the optimization problems such as Maximum Inde-

pendent Set, Minimum Dominating Set, etc. are NP-hard. In many casesof the generalized domination already the existence of a (σ, ρ)-dominating set

� Work partially supported by the ERASMUS program, by the DFG, projectNI 369/4 (PIAF), while visiting Friedrich-Schiller-Universitat Jena, Germany (Octo-ber 2008–March 2009) and by grant 201/05/H014 of the Czech Science Foundation.

�� Supported by the Ministry of Education of the Czech Republic as project1M0021620808.

C. Paul and M. Habib (Eds.): WG 2009, LNCS 5911, pp. 133–142, 2010.c© Springer-Verlag Berlin Heidelberg 2010

Page 144: Graph-Theoretic Concepts in Computer Science

134 P.A. Golovach, J. Kratochvıl, and O. Suchy

Table 1. Overview of the special cases of (σ, ρ)-domination and their parameterizedcomplexity (when parameterized by the size of the set). (Here N and N0 denote thesets of positive and nonnegative integers, respectively.)

σ ρ Problem name Parameterized ComplexityN0 N Dominating Set W[2]-completeN N Total Dominating Set W[2]-hardN0 {1} Efficient Dominating Set W[1]-hard{0} N Indepependent Dominating Set W[2]-complete{0} N0 Independent set W[1]-complete{0} {1} (1-)Perfect Code(Indep. Eff. Dom. Set) W[1]-complete{r} N0 Induced r-Regular subgraph W[1]-hard{0} {0, 1} Strong Stable Set Unknown{1} {1} Total Perfect Dominating Set Unknown

becomes NP-hard (e.g., when both σ and ρ are finite and nonempty, and 0 �∈ ρ[18]). Hence attention was paid to special graph classes, e.g. interval graphs ([15]shows polynomial-time solvability for any pair of finite σ, ρ), chordal graphs ([11]shows a P/NP-c dichotomy classification) or degenerate graphs [12].

Since the establishment of the Parameterized Complexity Theory by Downeyand Fellows [7], domination-type problems have been among the first ones inten-sively studied in the framework of this theory. (We assume the reader is familiarwith the concept of FPT and W[t] classes, otherwise we refer to [7,10] and [17] asexcellent textbooks.) It is well known that Independent Set is W[1]-complete[6] and Dominating Set is W[2]-complete [5,7] (when parameterized by the sizeof the set). A number of domination-type problems are considered in [2], where itis shown (among other results) that Total Dominating Set is W[2]-hard andthat Efficient Dominating Set is W[1]-hard. Independent Dominating

Set is W[2]-complete [5], while Efficient Independent Dominating Set

(also called Perfect Code) is W[1]-complete ([6] shows W[1]-hardness and [3]shows W[1]-membership). More results on parameterized complexity of problemsfrom coding theory can be found in [9]. The complexity of finding an r-regularinduced subgraph in a graph is studied in [16].

Parity constraints have been considered in [9]. A subset of a color class ofa bipartite graph is called odd (even) if every vertex from the other class hasan odd (even, respectively) number of neighbors in the set. Downey et al. showthat deciding the existence of an odd set of size k, an odd set of size at mostk, and an even set of size k are W[1]-hard problems; somewhat surprisingly, thecomplexity of Even Set of Size at Most k remains open.

All these individual results concern special (σ, ρ)-dominating sets, and thuscall for a unifying approach. Our paper attempts to be a starting one by givinggeneral results for large classes of pairs σ, ρ. The second goal of our paper isto study (many of) the above problems from the dual parametrization point ofview (looking for a set of size at least n− k, where k is the parameter), both forthe domination-type and parity-type problems.

Page 145: Graph-Theoretic Concepts in Computer Science

Parameterized Complexity of Generalized Domination Problems 135

1.2 Notation and Overview of Our Results

We consider the following (σ, ρ)-domination problem

(σ, ρ)-Dominating Set of Size at most kInput: A graph G.Parameter: k.Question: Is there a (σ, ρ)-dominating set in G of size at most k?

and its variants (σ, ρ)-Dominating Set of Size k, (σ, ρ)-Dominating Set

of Size at least n − k, and (σ, ρ)-Dominating Set of Size n − k, whosemeaning should be clear. All these problems ar parameterized by k, and in thelatter two, n denotes the number of vertices of the input graph. The first of ourmain results determines the parameterized complexity for finite sets σ and ρ.

Theorem 1. Let σ and ρ be nonempty finite sets of nonnegative integers, 0 /∈ ρ.Then both (σ, ρ)-Dominating Set of Size k and (σ, ρ)-Dominating Set of

Size at most k are W[1]-complete problems.

The hardness part is proved in Subsection 2.1, and the W[1]-membership isproved in Subsection 2.2 in a stronger form when σ is only required to be recur-sive but not necessarily finite.

We further study the dually parameterized problems and show in an evenmore general way that these problems become tractable. In Section 3 we provethe following theorem (here and throughout the paper, X = N0 \X for a set Xof integers).

Theorem 2. Let σ and ρ be sets of nonnegative integers such that either σ or σis finite, and similarly either ρ or ρ is finite. Then the (σ, ρ)-Dominating Set

of Size at least n− k problem is in FPT.

We show that a similar result cannot be expected for arbitrary recursive sets σand ρ. Even for the parity case (when we denote EVEN = {0, 2, 4, 6, . . .} andODD = {1, 3, 5, . . .}) we can prove W[1]-hardness.

Theorem 3. Let σ, ρ ∈ {EVEN,ODD}. Then both (σ, ρ)-Dominating Set

of Size n− k and (σ, ρ)-Dominating Set of Size at least n− k are W[1]-hard problems.

As a tool for the previous result we consider the following parity problems onbipartite graphs. Suppose that G is a bipartite graph and R, B is a bipartitionof its set of vertices (vertices of R are called red and vertices of B are blue). Anonempty set S ⊆ R is called even if for every vertex v ∈ B, |N(v)∩S| ∈ EVEN,and it is called odd if for every vertex v ∈ B, |N(v) ∩ S| ∈ ODD. The followingproblem

Even Set of Size at least r − kInput: A bipartite graph G = (R, B, E) and r = |R|.Parameter: k.Question: Is there an even set in R of size at least r − k?

Page 146: Graph-Theoretic Concepts in Computer Science

136 P.A. Golovach, J. Kratochvıl, and O. Suchy

and its variants Even Set of Size r − k, Odd Set of Size at least r − k,and Odd Set of Size r − k are the dually parameterized versions of bipartiteparity problems studied in [9]. We prove in Section 4 that all four of them areW[1]-hard.

In the last section we present observations on FPT results for sparse graphs.

2 Complexity of the (σ, ρ)-Dominating Set of Size at

most k Problems - Proof of Theorem 1

2.1 W[1]-Hardness

We are going to reduce a special variant of the Satisfiability problem (theproof of W[1]-hardness of this problem is omitted here).

At most α-Satisfiability

Instance: A Boolean formula φ in conjunctive normal form, without negatedvariables.Parameter: k.Question: Does φ allow a satisfying truth assignment of weight at most k (i.e.,at most k variables have value true) such that each clause of φ contains at mostα variables which evaluate to true?

Suppose that σ and ρ are nonempty finite sets of nonnegative integers, 0 /∈ ρ. Letus denote pmin = min σ, pmax = maxσ, qmin = min ρ and qmax = max ρ. Furtherwe set t = max{i ∈ N0 : i /∈ ρ, i + 1 ∈ ρ} (since 0 /∈ ρ, t is correctly defined),and α = qmax − t ≥ 1. We are going to reduce At most α-Satisfiability.Due the space restrictions we give here only a sketch of the reduction. Completedescription will appear in the journal version of the paper.

We first construct several auxiliary gadgets. These gadgets “enforce” on agiven vertex the property of “not belonging to any (σ, ρ)-dominating set”, andat the same time guarantee that this vertex has a given number of neighbors inany (σ, ρ)-dominating set in the gadget. To describe the properties formally, wewill consider rooted graphs and introduce the following notion. Let G be a rootedgraph with a set of root vertices X . We call a set S ⊆ V (G) a (σ, ρ)-dominatingset for G if |N(v) ∩ S| ∈ σ for every v ∈ S \ X , and |N(v) ∩ S| ∈ ρ for everyv /∈ S, v /∈ X (i.e., the conditions from the definition of (σ, ρ)-domination arerequired for all vertices except the roots).

The first gadget is a graph F (s) (s is a positive integer) with s independentroots x1, . . . , xs of degree one, all adjacent to the same vertex, say a1, whichhas the following property: Every (σ, ρ)-dominating set S for F (s) contains a1,contains none of the roots, and all such sets have the same size f = f(σ, ρ).

The second gadget is a graph F ′(s) (s is a positive integer) with s independentroots y1, . . . , ys of degree one, all adjacent to the same vertex, say x. It has thefollowing property: Every (σ, ρ)-dominating set S for F ′(s) contains none ofthe roots, neither it contains their common neighbor x, and all such sets havethe same size f ′ = f ′(σ, ρ).

Page 147: Graph-Theoretic Concepts in Computer Science

Parameterized Complexity of Generalized Domination Problems 137

A selection gadget R(l) (l is a positive integer) is a graph rooted in a cliqueX containing l vertices, and it satisfies the following property: Every (σ, ρ)-dominating set S for R(l) contains exactly one root vertex, and all such setshave the same size r = r(σ, ρ). Moreover, for every root vertex x ∈ X , thereexists a (σ, ρ)-dominating set S in R(l) which contains x (note that here werequire that even the root vertices are dominated in a proper way).

Now we describe the reduction. Let φ be a formula as an input of the At most

α-Satisfiability problem. Let x1, . . . , xn be its variables, and let C1, . . . , Cm

be the clauses.We take k copies of the graph R(n+1) denoted by R1, . . . , Rk, with the roots

of Ri being denoted by xi,j . For each clause Cs, a vertex Cs is added and joinedby edges to all vertices xi,j , i = 1, . . . , k such that the variable xj occurs in theclause Gs. Now we distinguish two cases:

t = 0. In this case a copy of F ′(m) is introduced, and the m roots of thisgadget are identified with vertices C1, . . . , Cm. In this case we set k′ = kr + f ′.

t > 0. We construct t copies of F (m), and the roots of each copy are identifiedwith C1, . . . , Cm. In this case we set k′ = kr + tf .

The resulting graph is called G. The proof of W[1]-hardness is then concludedby the following lemma (whose proof is omitted).

Lemma 1. The formula φ allows a satisfying truth assignment of weight atmost k such that each clause of φ contains at most α variables with value true ifand only if G has a (σ, ρ)-dominating set of size at most k′. Moreover, in sucha case the size of any (σ, ρ)-dominating set is exactly k′.

2.2 W[1]-Membership

Here we prove a slightly stronger claim.

Theorem 4. Let σ be recursive, and suppose that ρ is finite. Then the (σ, ρ)-Dominating Set of Size at most k and (σ, ρ)-Dominating Set of Size kproblems are in W[1].

To show the membership of the problems in W[1], we use the characterizationof W[1] by Nondeterministic Random Access Machines as proposed in [10].

A nondeterministic random access machine (NRAM) model is based on thestandard deterministic random access machine (RAM) model. A single nonde-terministic instruction ”GUESS” is added, whose semantics is: Guess a naturalnumber less than or equal to the number stored in the accumulator and store it inthe accumulator. Acceptance of an input by an NRAM is defined as usually fornondeterministic machines. The steps of computation of an NRAM that executea GUESS instruction are called nondeterministic steps.

Definition 1. An NRAM program P is tail-nondeterministic k-restricted ifthere are computable functions f and g and a polynomial p such that on ev-ery run with input (x, k) ∈ Σ∗ × N the program P

Page 148: Graph-Theoretic Concepts in Computer Science

138 P.A. Golovach, J. Kratochvıl, and O. Suchy

– performs at most f(k) · p(n) steps;– uses at most the first f(k) · p(n) registers;– contains numbers ≤ f(k) · p(n) in any register at any time;

and all nondeterministic steps are among the last g(k) steps of the computation.Here n = |x|.The following characterization is crucial for our proof:

Theorem 5 ([10]). A parameterized problem P is in W[1] if and only if thereis a tail-nondeterministic k-restricted NRAM program deciding P .

Now we introduce our program SigmaRho that takes a graph G and a positiveinteger k as an input and there is an accepting computation of SigmaRho onG and k if and only if there is a (σ, ρ)-dominating set of size exactly k in G.We present it in a higher level language that can be easily translated to theNRAM instructions. It is straightforward to show that this program is tail-nondeterministic k-restricted, the formal proof will appear in journal version ofthe paper and we omit it here. Recall that qmax = max ρ. Here

(Vr

)denotes the

set {R ⊆ V | |R| = r}.

Program SigmaRho(G = (V,E), k)for r := 1 to qmax + 1 do forall R ∈ (

Vr

)do1

B(R) := |⋂

u∈R

NG(u)| = |{v | v ∈ V,∀u ∈ R : uv ∈ E}|;

Guess k distinct vertices v1, . . . , vk, denote S = {v1, . . . , vk};2

for i := 1 to k do if |{vj | vivj ∈ E}| /∈ σ then REJECT;3

for r := qmax + 1 downto 1 do4

D(r) :=∑

R∈(Sr)

(B(R) − |⋂

u∈R

NG(u) ∩ S|) =

=∑

R∈(Sr)

|{v | v ∈ V \ S,∀u ∈ R : uv ∈ E}|;

C(r) := D(r) −qmax∑

t=r+1

((t

r

)

· C(t)

)

;

if r /∈ ρ and C(r) �= 0 then REJECT;

if 0 /∈ ρ and∑

r∈ρC(r) �= n− k then REJECT; else ACCEPT;5

Lemma 2. Let G be a graph and k ∈ N. There is an accepting computationof SigmaRho on G and k if and only if there is a (σ, ρ)-dominating set of size(exactly) k in G.

Page 149: Graph-Theoretic Concepts in Computer Science

Parameterized Complexity of Generalized Domination Problems 139

Proof. We will show that the program SigmaRho accepts the input if and only ifthe set S guessed in step 2 is a (σ, ρ)-dominating set of size k for the input graphG. It is easy to see that the members of the set S must satisfy the σ-conditiondue to step 3. Now observe that the number D(r) computed in step 4 denotesthe number of pairs (R, v) such that R is a subset of S of size r and v is a vertexnot in S that has all vertices from R as neighbors (the first term counts all suchvertices v in V and the second term subtracts such vertices v that are in S).Hence this D(r) represents the number of vertices outside S which have at leastr neighbors in S with multiplicities, in particular a vertex with t neighbors inS is counted

(tr

)times. Since in the first run of the cycle 4 with r = qmax + 1

we check that there is no vertex outside S with more than qmax neighbors in S,C(r) represents the number of vertices outside S which have exactly r neighborsin S. It is now clear that if r /∈ ρ and there is a vertex outside S with r neighborsin S (i.e., C(r) > 0), then S cannot form a (σ, ρ)-dominating set. In the laststep 5 we sum up the number of vertices outside S that satisfy the ρ-conditionand thus S (which satisfies all the conditions checked by the previous steps) is(σ, ρ)-dominating if and only if this sum is equal to the total number of verticesoutside S, i.e., n− k, or 0 ∈ ρ.

Proof (Proof of Theorem 4). First observe that (σ, ρ)-Dominating Set of Size

at most k can be easily reduced to (k calls of) (σ, ρ)-Dominating Set of Size

k. Hence it is enough to prove the membership for the second problem. But thatis a direct consequence of Theorem 5 together with Lemma 2 and ProgramSigmaRho being tail-nondeterministic k-restricted.

3 Complexity of the (σ, ρ)-Dominating Set of Size at

least n − k Problems

Theorem 2. Let σ and ρ be sets of nonnegative integers such that either σ or σis finite, and similarly either ρ or ρ is finite. Then the (σ, ρ)-Dominating Set

of Size at least n− k problem is in FPT.

Proof. We present an algorithm that is based on the bounded search tree tech-nique. At the beginning the algorithm includes all vertices into the set S andthen tries recursively excluding some of the vertices to make S (σ, ρ)-dominating.Once a vertex is excluded, it is never included in the set again (in the same branchof the algorithm). Obviously at most k vertices can be excluded from S to fulfillthe size constraint.

We call a vertex v satisfied (with respect to the current set S) if it has theright number of neighbors in S (i.e., v ∈ S and |N(v) ∩ S| ∈ σ or v /∈ S and|N(v) ∩ S| ∈ ρ), otherwise we call it unsatisfied. Let pmax denote maxσ if σ isfinite and max σ if σ is finite. Similarly let qmax denote max ρ or max ρ. (It isassumed here that max ∅ = 0.) Finally let b denote max{pmax, qmax}. We call avertex v big if deg(v) > b + k and small otherwise.

The main idea of the algorithm is that there is at most one way to make anunsatisfied big vertex satisfied (to exclude it from S) and if this does not work,

Page 150: Graph-Theoretic Concepts in Computer Science

140 P.A. Golovach, J. Kratochvıl, and O. Suchy

there is no (σ, ρ)-dominating set at all. On the other hand to satisfy a smallvertex, we must either exclude it or one of its first b neighbors that were in S.

Procedure Exclude(S)if there is no unsatisfied vertex then Return(S);Exit;if |S| = n− k then Halt;let v be an unsatisfied vertex;if v is big then

if v ∈ S and ρ is infinite then Exclude(S \ v);else Halt;

elseif v ∈ S then Exclude(S \ v);let {u1, . . . , ur} = S ∩N(v) be the set of included neighbors of v;if r = 0 then Halt;for i := 1 to min{b+ 1, r} do Exclude(S \ {ui}).

The algorithm consists of a single call Exclude(V ) and returns the set Sreturned by the procedure or NO if no set was returned.

4 Complexity for the Case σ, ρ ∈ {EVEN, ODD}As a counterpart to the results of [9] we first show that all four parity problemsfor Red/Blue bipartite graphs are hard under the dual parametrization.

Theorem 6. The Even Set of Size r − k, Even Set of Size at least

r−k, Odd Set of Size r−k, and Odd Set of Size at least r−k problemsare all W[1]-hard.

Proof. It was proved in [9] thatOdd Set of Size at most kInput: A bipartite graph G = (R, B, E).Parameter: k.Question: Is there an odd set in R of size at most k?is W[1]-hard. It should be noted that W[1]-hardness was stated for the exactvariant of the problem (i.e. for the question: Is there an odd set in R of size k?),but for our variant of the question, the proof of [9] works the same. We showthat the problem remains W[1]-hard if all blue vertices have odd degrees (andalso if all of them have even degrees). Then we deduce the claims by consideringthe set R \ S for a would-be odd set S ⊂ R.

The main result of this section is the hardness of the (EVEN—ODD)-domination problems under the dual parametrization.

Theorem 3. Let σ, ρ ∈ {EVEN,ODD}. Then the (σ, ρ)-Dominating Set of

Size n− k and (σ, ρ)-Dominating Set of Size at least n− k problems areW[1]-hard.

Page 151: Graph-Theoretic Concepts in Computer Science

Parameterized Complexity of Generalized Domination Problems 141

Proof. We prove this theorem for the (σ, ρ)-Dominating Set of Size at least

n−k problem. The proof for the (σ, ρ)-Dominating Set of Size n−k is done bysimilar arguments. Also we give here only the proof for the case σ = ρ = EVEN.The proofs for the other three cases use the similar ideas and are omitted here.We use the following lemma:

Lemma 3. The Even Set of Size at least r−k problem remains W[1]-hardif all red vertices have even degrees.

Proof. We reduce the Even Set of Size at least r− k problem by replacingeach blue vertex by two vertices with the same neighborhoods. Trivially S ⊆ Ris an even set in the obtained graph if and only if it is an even set in the originalgraph.

If all red vertices have even degrees then S ⊆ R is an even set if and only ifS∪B is an (EVEN,EVEN)-dominating set. It follows immediately that G hasan even set of size at least r − k if and only if G has a (σ, ρ)-dominating set ofsize at least n− k for σ = ρ = EVEN.

5 Complexity of the (σ, ρ)-Dominating Set of Size (at

most) k Problem for Sparse Graphs

It is well known that many problems which are difficult for general graphs canbe solved efficiently for sparse graphs. Very general results of such kind wereestablished in [4]. Let v be a vertex of a graph G. For a positive integer r, denoteby Nr[v] the closed r-neighborhood of v i.e. the set of vertices of G at distanceat most r from v. Let G be a class of graphs. Suppose that there is a family ofgraphs {Hr} such that for each graph G ∈ G and for any v ∈ V (G),

G[Nr(v)] excludes Hr as a minor for r ≥ 1. It is said that the graph classG is locally minor excluding. It can be noted that e.g. planar graphs, graphs ofbounded genus, H-minor-free graphs are locally minor excluding graph classes.It was proved in [4] that if G is a locally minor excluding class of graphs, thendeciding first-order properties (i.e. properties which can be expressed in thefirst-order logic) is FPT on G. The next claim follows immediately from thisresult.

Theorem 7. Let σ and ρ be sets of nonnegative integers such that either σ or σis finite, and similarly either ρ or ρ is finite. Then the (σ, ρ)-Dominating Set

of Size (at most) k problem is FPT on locally minor excluding graph classes.

It is known that some domination problems are FPT for a more general classof degenerate graphs (see e.g. [1,14]). These results can be easily generalized for(σ, ρ)-domination problems for some special sets σ and ρ. It is an interestingopen problem whether the results of Theorem 7 can be extended to degenerategraphs.

Page 152: Graph-Theoretic Concepts in Computer Science

142 P.A. Golovach, J. Kratochvıl, and O. Suchy

References

1. Alon, N., Gutner, S.: Linear time algorithms for finding a dominating set of fixedsize in degenerated graphs. In: Lin, G. (ed.) COCOON 2007. LNCS, vol. 4598, pp.394–405. Springer, Heidelberg (2007)

2. Bodlaender, H.L., Kratsch, D.: A note on fixed parameter intractability of somedomination-related problems. Private communication (1994)

3. Cesati, M.: Perfect code is W [1]-complete. Inf. Process. Lett. 81, 163–168 (2002)4. Dawar, A., Grohe, M., Kreutzer, S.: Locally excluding a minor. In: LICS 2007, pp.

270–279. IEEE Computer Society Press, Los Alamitos (2007)5. Downey, R.G., Fellows, M.R.: Fixed-parameter tractability and completeness. Con-

gressus Numerantium, 161–178 (1992)6. Downey, R.G., Fellows, M.R.: Fixed-parameter tractability and completeness. II.

On completeness for W[1]. Theoret. Comput. Sci. 141, 109–131 (1995)7. Downey, R.G., Fellows, M.R.: Parameterized Complexity. Springer, Heidelberg

(1998)8. Downey, R.G., Fellows, M.R.: Threshold dominating sets and an improved charac-

terization of W [2]. Theoret. Comput. Sci. 209, 123–140 (1998)9. Downey, R.G., Fellows, M.R., Vardy, A., Whittle, G.: The parametrized complexity

of some fundamental problems in coding theory. SIAM J. Comput. 29 (electronic),545–570 (1999)

10. Flum, J., Grohe, M.: Parameterized Complexity Theory. Springer, Heidelberg(2006)

11. Golovach, P.A., Kratochvıl, J.: Computational complexity of generalized domina-tion: A complete dichotomy for chordal graphs. In: Brandstadt, A., Kratsch, D.,Muller, H. (eds.) WG 2007. LNCS, vol. 4769, pp. 1–11. Springer, Heidelberg (2007)

12. Golovach, P.A., Kratochvıl, J.: Generalized domination in degenerate graphs: acomplete dichotomy of computational complexity. In: Agrawal, M., Du, D.-Z.,Duan, Z., Li, A. (eds.) TAMC 2008. LNCS, vol. 4978, pp. 182–191. Springer, Hei-delberg (2008)

13. Heggernes, P., Telle, J.A.: Partitioning graphs into generalized dominating sets.Nordic J. Comput. 5, 128–142 (1998)

14. Kloks, T., Cai, L.: Parameterized tractability of some (efficient) Y - dominationvariants for planar graphs and t-degenerate graphs. In: Proceedings of the Inter-national Computer Symposium (ICS 2000), Taiwan (2000)

15. Kratochvıl, J., Manuel, P.D., Miller, M.: Generalized domination in chordal graphs.Nordic J. Comput. 2, 41–50 (1995)

16. Moser, H., Thilikos, D.M.: Parameterized complexity of finding regular inducedsubgraphs. In: Broersma, H., Dantchev, S.S., Johnson, M., Szeider, S. (eds.) ACiD2006. Texts in Algorithmics, vol. 7, pp. 107–118. King’s College, London (2006)

17. Niedermeier, R.: Invitation to Fixed Parameter Algorithms. Oxford UniversityPress, USA (2006)

18. Telle, J.A.: Complexity of domination-type problems in graphs. Nordic J. Com-put. 1, 157–171 (1994)

19. Telle, J.A.: Vertex partitioning problems: characterization, complexity and algo-rithms on partial k-trees. PhD thesis. Department of Computer Science, Universityof Oregon, Eugene (1994)

20. Telle, J.A., Proskurowski, A.: Algorithms for vertex partitioning problems on par-tial k-trees. SIAM J. Discrete Math. 10, 529–550 (1997)

Page 153: Graph-Theoretic Concepts in Computer Science

Connected Feedback Vertex Set in PlanarGraphs

Alexander Grigoriev1 and Rene Sitters2

1 Department of Quantitative Economics, Maastricht University, The [email protected]

2 Department of Econometrics and Operations Research, VU University, Amsterdam,The Netherlands

[email protected]

Abstract. We study the problem of finding a minimum tree spanningthe faces of a given planar graph. We show that a constant factor ap-proximation follows from the unconnected version if the minimum degreeis 3. Moreover, we present a polynomial time approximation scheme forboth the connected and unconnected version.

1 Introduction

Given a planar graph, what is the smallest subgraph connecting all the faces?The simplicity and naturalness of this question is the main motivation for thestudy in this paper. Bodlaender et al. [5] call this the face cover tree problem andto the best of our knowledge they were the first to study it. They show that theproblem can be solved efficiently for edge-weighted graphs of bounded treewidth.In this paper we consider unweighted planar graphs with the minimum degreeat least three. This is a natural restriction since allowing vertices of degree twomakes its complexity polynomially equivalent to the problem with polynomiallybounded edge weights.

Interestingly, the problem does not depend on the embedding since any treehitting all faces will, in fact, hit all cycles of the graph.

Lemma 1. Let G be a connected planar graph and T ⊆ G be a tree such that,for a given embedding of G, every face has at least one vertex in T . Then, everycycle of G has a vertex in T .

Proof. Every cycle separates the embedded graph in an inner and outer part.Each of the two parts contains at least one face. Therefore, the cycle and thetree must have at least one vertex in common. ��The problem of finding the smallest set of vertices hitting all cycles is well-studied and known as the feedback vertex set problem. A natural variant forplanar graphs is the problem of hitting all faces with a minimum number of ver-tices. By Lemma 1, the connected versions of these two problems are equivalentand independent of the embedding. This is the problem we study here and callit the connected feedback vertex set problem.

C. Paul and M. Habib (Eds.): WG 2009, LNCS 5911, pp. 143–153, 2010.c© Springer-Verlag Berlin Heidelberg 2010

Page 154: Graph-Theoretic Concepts in Computer Science

144 A. Grigoriev and R. Sitters

Planar Feedback Vertex Set (Planar FVS): Given an unweighted planargraph, find the smallest set S of vertices such that every cycle of the graph hasat least one vertex in S.Face Hitting Set (FHS): Given an unweighted planar graph with an embed-ding, find the smallest set S of vertices such that every face of the graph has atleast one vertex in S.Connected Planar Feedback Vertex Set (Connected Planar FVS): Givenan unweighted planar graph, find the smallest tree T such that every cycle (orequivalently, every face in an embedding) of the graph has a vertex in T .

1.1 Related Results

The feedback vertex set problem is extensively studied. It is APX-hard in generalgraphs and can be approximated efficiently within a factor 2; see Becker andGeiger [4] and Bafna et al [1]. For planar graphs the problem is NP-hard [12]and a PTAS was given by Demaine and Hajiaghayi [8]. Goemans and Williamsonapply the primal-dual method to obtain a (9/4)-approximation [13], which waslater reduced to 2 by Chudak et al [7].

Regarding the connectivity constraint, two obvious related problems, are theproblem of spanning all vertices and the problem of spanning all the edges of thegraph. The latter is known as connected vertex cover and was introduced in 1977by Garey and Johnson [11], who showed it to be NP-hard even when restrictedto planar graphs with maximum degree 4. The 2-approximation algorithm forvertex cover in general graphs by Savage [14] transfers directly to the connectedproblem. Recently, Escoffier et al. [10] have shown that connected vertex coveradmits a PTAS for planar graphs. A PTAS for connected dominating set inplanar graphs was given in [8] as well.

1.2 Our Results

We give an overview on structural properties, complexity and approximabil-ity results for the connected feedback vertex set problem in planar graphs. Weshow that if the minimum vertex degree is three, then the ratio between theconnected and unconnected problem is bounded by a constant. This provides apolynomial time constant approximation algorithm for connected planar FVS.Another interesting consequence of this structural result is that the diameterof a 3-polytope is in the order of the smallest set of vertices hitting all facets.Further, we show that FHS and connected planar FVS are strongly NP-hardand give polynomial time approximation schemes for both problems. Along thetext we pose several interesting open questions.

2 Structural Results

2.1 Insightful Observations

We start with some simple lemmas to get an insight in the relation betweenFVS and FHS and the dependence on the embedding. Then we give the main

Page 155: Graph-Theoretic Concepts in Computer Science

Connected Feedback Vertex Set in Planar Graphs 145

result of this section on the relation between connected and unconnected FVS

in planar graphs. We end with a small discussion on the application to diametersof polytopes.

Lemma 2. For any planar graph G and embedding ΓG with at least two faceswe have FHS(ΓG) ≤ FVS(G). Otherwise, FHS(ΓG) = 1 and FVS(G) = 0.

Lemma 3. For any planar graph G with faces F we have FVS(G) ≤ |F | − 1and this bound is tight.

The proofs of Lemmas 2 and 3 are not complicated and we leave those for areader.

Lemma 4. For any planar graph G and embedding ΓG we have FVS(G) ≤2FHS(ΓG) − 1 and this bound is tight for 0, 1 or 2-connected graphs. If G is3-connected then FVS(G) ≤ 2FHS(ΓG)− 2.

Proof. Let S1 be a minimum FHS in ΓG. Now consider the graph H containingall uncovered cycles and let FH be its faces. Each face f in H must contain apoint from S1 in its interior. Hence, |S1| ≥ |FH |. Let S2 be a minimum FVS inH . Then by Lemma 3 |S2| ≤ |FH | − 1 ≤ |S1| − 1. Note that S1 ∪ S2 is a FVS inG. Hence, FVS(G) ≤ |S1|+ |S2| ≤ 2|S1| − 1 = 2FHS(ΓG)− 1. ��For 3-connected graphs the embedding is unique and so is the minimum valueof FHS. In general the optimal value differs by at most a factor two for differentembeddings and this bound is tight; see Figure 1(A).

Lemma 5. Let Γ1, Γ2 be two embeddings of planar graph G. Then FHS(Γ1) ≤2FHS(Γ2)− 1.

Proof. If G contains only one face (i.e., it is a forest), then FHS(Γ1)=FHS(Γ2)=1. In the other case Lemma 2 says FHS(Γ1) ≤ FVS(G). By Lemma 4 we haveFVS(G) ≤ 2FHS(Γ2)− 1. Combining these inequalities the lemma follows. ��

(A) (B)

Fig. 1. (A) Tight example for the dependence on the embedding. If all k trianglesare directed inwards, the optimal FHS has size k + 1. If all are directed outwards theoptimal value is 2k + 1. (B) In an infinite honeycomb graph the ratio between FHS

and the connected FVS is 3.

Page 156: Graph-Theoretic Concepts in Computer Science

146 A. Grigoriev and R. Sitters

2.2 FVS and FHS in Planar Graphs with Minimum Degree 3

The minimum FHS may be arbitrarily much smaller than the connected FVS

if we allow vertices of degree 2. However, restricting to a minimum degree of3 ensures a constantly bounded ratio between the connected and unconnectedproblem.

Theorem 1. Let G be a connected planar graph with minimum degree 3 andlet Opt

C be the optimal value for connected planar FVS. Further, let Opt bethe optimal value for FHS, for some given embedding of G. Then, Opt

C = 0 ifOpt = 1 and Opt

C ≤ 11Opt− 14 otherwise.

Proof. The case Opt = 1 is trivial. Now assume Opt ≥ 2. The outline of theproof is as follows. Given a planar graph G = (V, E) plus embedding, let S bea face hitting set and T be a minimum Steiner tree on S. We will constructcurves in the embedding that go from edges in T to vertices in S such that notwo curves intersect. On one hand, the number of curves will be Ω(|T |). On theother hand, we will see that non-intersection of curves implies that their numberis O(|S|). Combined we get |T | = O(|S|).

To simplify the construction of curves we define a graph G′ that follows fromG after contractions of edges. We can partition T in a collection P of at most2|S| − 2 paths such that any two paths may only have an endpoint in common.By minimality of T , any path is a shortest path between its endpoints. We leaveany path Pi ∈ P of length 1, 2 or 3 unchanged, where the length is the numberof edges. If the length Pi is two, we denote its inner vertex by qi. If the length isthree we denote one of its inner vertices by qi. Any path Pi of length at least fouris reduced to length exactly four by contracting all points that are at distanceat least two from the two endpoints of Pi in a single point qi. Let the resulting(multi) graph be G′ = (V ′, E′). The following properties are easy to verify. Ashort justification is given below.

(i) All points q1, q2, . . . , are different.(ii) If length(Pi) ≤ 3 then degree(qi) ≥ length(Pi).(iii) If length(Pi) ≥ 4 then degree(qi) ≥ length(Pi)− 1.(iv) Solution S is a FVS for G′ as well.(v) For any v ∈ V ′, degree(v) ≥ 3.

Explanation: (i) Paths only share endpoints and these are not contracted, i.e.,no edge was contracted to any of those points. (ii) Obvious. (iii) Every pointon Pi has at least one edge not in Pi. (iv) A contraction creates no extra faces.Vertices in S are not contracted. (v) The contraction of two adjacent points withdegrees d1, d2 ≥ 3 results in a point with degree d1 + d2 − 2 ≥ 4.

Claim. There are no multiple edges in G′.

Proof. Since G is a simple graph, a multiple edge can only appear if at leastone of the two endpoints is a contracted point. More precisely, either (i) thereare edges (u1, v) and (u2, v) in E such that u1 and u2 are contracted in a single

Page 157: Graph-Theoretic Concepts in Computer Science

Connected Feedback Vertex Set in Planar Graphs 147

points qi, or (ii) there are edges (u1, v1) and (u2, v2) in E such that u1 and u2

are contracted in qi and v1 and v2 are contracted in qj .In case (i), the point v cannot be on the part of Pi between u1 and u2 since

then all three points would be contracted in qi. Therefore, the edges (u1, v) and(u2, v) plus the part of Pi between u1 and u2 form a simple cycle C in G. ByLemma 1, C must have a vertex from T and this can only be v. But then, wecan strictly reduce the length of the T as follows. Remove from T the path fromu1 to u2. Assume, w.l.o.g., that u1 and v are in the same component. Now addedge (u2, v) and remove the remaining redundant path to u1. The argument for(ii) is similar. The edges edges (u1, v1), (u2, v2) plus the part of Pi between u1

and u2 and the part of Pj between v1 and v2 form a simple cycle in G and musttherefore contain a point from T . But there is no such point on these parts bydefinition. ��

Note that a face in G′ may have more than one vertex from S. For each facef we fix one vertex s(f) ∈ S. Now, consider a point qi and let Ni be the setof neighboring edges whose endpoints are not in S. For each i with |Ni| ≥ 2we do the following. Consider two edges from Ni that are consecutive in theembedding, i.e., they appear consecutively among edges from Ni when we walkaround qi. Let f be a face that touches qi between these edges. We draw a curveinside f from qi to s(f). Call this a face-curve. We do this for all |Ni| pairs ofconsecutive edges of qi. If, on the other hand, |Ni| = 0 or |Ni| = 1 we add acurve from qi to each neighbor that is an element from S. Call these edge curves.Finally, for each path Pi of length one in G we define the point in the plane onthe middle of edge Pi as ri and draw one curve from ri to s(f), where f is aface adjacent to ri. These curves are also called face-curves. Note that for eachpath Pi ∈ P , we either defined a vertex qi in G′ or defined a point ri in theembedding of G′.

We define the bipartite (multi-)graph H = (Π ∪ Σ,A) as follows. Let Π ={π1, . . . , π|P|} and Σ = {σ1, . . . , σ|S|}. For each curve defined in the processabove there is an edge in H , i.e., for each curve from qi or ri to sj there is anedge (πi, σj).

Claim. The graph H is planar and degree(πi) ≥ length(Pi)− 1 for each Pi ∈ P .

Proof. The first follows directly from the following observations. All points qi

and ri are different and none coincides with points from S. Each curve eitherlies inside a single face or corresponds to a single edge. All curves inside a facehave a common endpoint.

If length(Pi) = 1 then degree(πi) = 1. If length(Pi) ∈ {2, 3} then degree(qi) ≥3. Now, either |Ni| ≥ 2 in which case we added |Ni| face-curves, or |Ni| ≤ 1 inwhich case we added degree(qi) − |Ni| ≥ 3 − 1 = 2 edge-curves. Now assumelength(Pi) ≥ 4. Note that in that case no neighbor of qi can be a vertex s ∈ S,since in that case we can reduce the length of T ⊆ G by adding edge (qi, s)and removing the path in T from qi to one of the two endpoints of Pi. Hence,|Ni| ≥ degree(qi) ≥ length(Pi)− 1. ��

Page 158: Graph-Theoretic Concepts in Computer Science

148 A. Grigoriev and R. Sitters

We will show that H has few edges. Consider the embedding of H defined nat-urally by the curves in the embedding of G′. In general, H may have faces oflength two and may be disconnected. To facilitate the analysis we add edges toH until it is connected. Note that we can always do this without creating newfaces of length two. Denote the new graph by H ′. We prove through Claim 2.2that H ′ does not have many edges by showing that it has no faces of length two.In the proof we use the next general statement on planar graphs.

Claim. Let G = (V, E) be a simple planar graph with |V | ≥ 3 and s, w ∈ V suchthat degree(v) ≥ 3 for all v ∈ V \ {s, w} and degree(w) ≥ 1. Then, there is atleast one face that does not contain s on its boundary.

Proof. Remove s from G and consider a component C containing some v ∈V \ {s, w}. Since |V | ≥ 3 this component exists. If w ∈ C then its degree is atleast one. Any other vertex has degree at least two. The sum of the degrees inC is then at least 2n′ − 1, with n′ the number of vertices in C. But then C isnot a forest and must therefore have a cycle. Since s is not on the cycle there isa face not connected to s. ��

Claim. There are no faces of length two in H ′.

Proof. Suppose there is a face f of length two in H ′. Since H ′ is connected, therecannot be a point σj ∈ Σ inside f since it has to be connected to at least oneof the two points of f , in which case f has length larger than two. Given thatf has no points from Σ in its interior, the two curves in G′ that correspond tothe two edges of f do not enclose a point from S. We will show that this leadsto a contradiction.

For each ri we defined exactly one curve. So the two curves do not startfrom a point ri. For each qi we either defined edge-curves (at most one to eachneighbor) or defined face-curves. Therefore the two curves must both be face-curves. Assume they go from qi to sj . Let J ⊆ G′ be the graph induced by allvertices enclosed by the two curves and including qi and sj . We know that sj

is the only vertex from S in J and, by construction, there is at least one edge(qi, w) ∈ Ni in J . Since w /∈ S we have w = sj and J has at least three vertices:qi, w and sj . Further, any vertex v /∈ {qi, sj} in J has degree at least 3 in J . ByClaim 2.2, graph J ⊆ G′ has no multiple edges. Now, it follows from Claim 2.2that there must be a face of J that is not connected to sj. A contradiction. ��

The proof of Theorem 1 now easily follows from an upper and lower bound onthe number of edges |A| in H . By Claim 2.2 we have

|A| =∑

πi∈Π

degree(πi) ≥∑

Pi∈P(length(Pi)− 1) = |T | − |P|. (1)

Since we assumed |S| ≥ 2, the number of vertices in H is |Π |+ |Σ| ≥ 1 + 2 = 3.Let n, m, f be, respectively, the number of vertices, the number of edges, andthe number of faces in H ′. Each face in H ′ is bounded by at least three edges so

Page 159: Graph-Theoretic Concepts in Computer Science

Connected Feedback Vertex Set in Planar Graphs 149

2m ≥ 3f . Since H ′ is connected we know from Euler’s formula that n+f = m+2.Hence, 2m ≥ 3f = 3m + 6− 3n implying m ≤ 3n− 6. We obtain,

|A| ≤ m ≤ 3n− 6 = 3(|Π |+ |Σ|)− 6.

Combined with (1) we get that

|T | − |P| ≤ |A| ≤ 3(|Π |+ |Σ|)− 6 = 3(|P|+ |S|)− 6. (2)

In the definition of P we remarked that |P| ≤ 2|S| − 2. This combined with (2)gives

|T | ≤ 4|P|+ 3|S| − 6 ≤ 4(2|S| − 2) + 3|S| − 6 = 11|S| − 14.

If S is an optimal solution for the unconnected problem, then

OptC ≤ |T | ≤ 11|S| − 14 = 11Opt− 14. ��

Question 1. What is the right ratio for Theorem 1? We conjecture it is 3. SeeFigure 1(B).

2.3 Diameter of Polytopes

The 1-skeleton of a 3d-polytope is a 3-connected planar graph and vice versa. Weproved that the smallest tree spanning all facets is in the order of the numberof points hitting all facets. An easy corollary is that the diameter is not muchlarger. The famous Hirsch conjecture states that the diameter of any d-polytopeis at most n− d, with n the number of facets. It is known to be true for d = 3.Note that the face hitting set may be much smaller than the number of faces.We believe the next easy corollary is of its own interest.

Corollary 1. The diameter of a 3-dimensional polytope P is O(FHS(P)).

Proof. Let s1, s2 be vertices of the polytope P and S a smallest set covering allthe facets. If si /∈ S we add a hyperplane that just cuts off si. The new polytopeP ′ has at most two extra facets and we can cover all facets by at most |S| + 2vertices. These vertices are spanned by tree of size at most 11(|S| + 2) − 14 =11|S| + 4. Clearly, the tree in P ′ induces a tree in P of at most the same sizeand which connects s1 and s2. ��

A similar statement for higher dimensions should depend on the dimension d. Forexample, the facets of a d-dimensional cube are covered by two opposite verticeswhile the diameter is d. Hence, the diameter of a d-cube P is d/2·FHS(P), whereFHS is the minimum facet hitting set. Barnette [3] proved that the diameter ofa d-polytope is O(2d(n− d)). Can we replace the n by the minimum FHS?

Question 2. Is there a function f(d) such that for any d-dimensional polytopeP , the diameter is bounded by f(d)FHS(P)?

Page 160: Graph-Theoretic Concepts in Computer Science

150 A. Grigoriev and R. Sitters

3 Complexity and Approximation

3.1 NP-Hardness of FHS and Connected FVS

Bodlaender et al. [5] show that connected FVS with maximum degree 4 is NP-hard even if every edge has either unit length or an input dependent length K.They reduce from the connected vertex cover problem in planar graphs. Gareyand Johnson[11] show that the latter problem is already NP-hard if the maximumdegree is 4. To prove NP-hardness for unit lengths we modify the original prooffrom [11]. NP-hardness of FHS follows easily from the reduction we use for theconnected version.

Theorem 2. FHS is NP-hard in planar graphs with maximum degree 6 andconnected FVS is NP-hard in planar graphs with maximum degree 9.

Proof. We concentrate on the proof for the connected FVS problem and we leavethe proof for FHS to the extended journal version of this paper. We reduce fromthe vertex cover problem in planar graphs with maximum degree 3, which isknown to be NP-hard [11]. Given a planar graph G = (V, E) with maximumdegree 3, we fix some embedding. Let F be the set of faces. We replace eachedge by a graph on 10 vertices as in Figure 2. Call this a bridge. Let the size of aface be the length of a closed walk along the edges of the face. In each face f ofsize k we add two rings: an outside ring on 5k vertices and an inside ring on 15kvertices. Connections between the rings and bridges are illustrated in Figure 2.To enhance the counting we do this for the outer face as well. (Not shown in thefigure.) The newly constructed graph G′ has maximum vertex degree 9. We claimthat G has a vertex cover of size s if and only if G′ has a connected feedbackvertex set of size s + 12|E|+ |F |. We omit this technical proof and present it inthe full length journal version of this paper. ��

G’ G

Fig. 2. The reduction. Construction for the outer face is not shown. The encircledvertices indicate a vertex cover in G and a connected feedback vertex set in G′.

3.2 Approximation Schemes for FHS and Connected FVS

First, we consider the connected FVS. We assume that the minimum vertexdegree in the graph is at least 3. The polynomial time approximation scheme

Page 161: Graph-Theoretic Concepts in Computer Science

Connected Feedback Vertex Set in Planar Graphs 151

is a Baker’s type algorithm; see Baker [2]. First, we define levels of the planarembedding following the recursive procedure: define level 1 of the embeddingas the set of vertices incident to the exterior face of the embedding; assume weconstructed level j, then level j + 1 is defined as the set of vertices incident tothe exterior face of the embedding after removal of the first j levels.

Given a desired approximation precision ε > 0, let k = 2(log n)/ε�. Let Tbe a minimum tree hitting all faces in G and let OPT = |V (T )| − 1. For any0 ≤ j ≤ k− 1 define set Vj as the union of levels i such that i ≡ j mod k. Sincesets Vj , 0 ≤ j ≤ k−1, define a partition of V (G) into k subsets, there is a subsetV� containing at most OPT/k vertices from T . Denote q = |V� ∩ V (T )|. Noticethat we do not know in advance values and q. So, the algorithm enumeratesall possibilities for those values and chooses the values providing the shortesttree hitting all faces. As 1 ≤ ≤ k and 1 ≤ q ≤ OPT/k, this enumeration addsa factor O(n) in the running time. From now, we assume that the algorithmpicked correct values and q.

Consider k + 1 consecutive levels with the first and the last levels from V�.We call a subgraph induced by such set of levels a slice. Clearly, any slice isa (k + 1)-outerplanar graph. By Bodlaender et al [5], the minimum FHS in k-outerplanar graphs can be found in time O(n3 + 29.5539k). Thus, by definitionof k, we can solve the problem on any slice in polynomial time. Using the samealgorithm as in [5], we can solve in polynomial time even more general problem:given a slice and an arbitrary number 1 ≤ r ≤ n, we have to find a minimumforest of at most r components that hits all faces of the slice. We omit the proofof this simple adjustment.

Notice that T can be seen as a collection of at most q +1 trees such that eachof these trees is located in exactly one slice. Given the minimum forests for eachslice and each number of components, by straightforward dynamic program wefind the minimum forest hitting all faces of G with at most q + 1 components,each located in exactly one slice. Let T ′ be such forest. Notice, E(T ′) ≤ OPT .

Now, we have a forest T ′ of at most q +1 components that hits all faces in G.Moreover, this forest is shorter than tree T . The only question remains: how toconnect the components of T ′ at small cost? For any two components S and S′ ofT ′, let distance d(S, S′) be defined as the length of the shortest path connectingS and S′. On this metric, take a minimum spanning tree M . If (S, S′) ∈ E(M),we connect S and S′ with the corresponding shortest path. In this way we obtaina connected graph that hits all faces. Hence, we can find a tree of length at mostOPT +

∑(S,S′)∈E(M) d(S, S′).

Lemma 6.∑

(S,S′)∈E(M) d(S, S′) ≤ εOPT .

Proof. As T ′ has at most q+1 components, M contains at most q edges. Assumethere is an edge (S, S′) in M of length greater than εOPT/q. Since OPT ≥ qk ≥2 logn/ε, we have that d(S, S′) > 2 logn. Consider the corresponding shortestpath between S and S′. Take a vertex v in the middle of this path. Let the setof faces of G which are not incident to v be referred as F . Consider the distancefrom v to f ∈ F by mean the length of the shortest path from v to the furthest

Page 162: Graph-Theoretic Concepts in Computer Science

152 A. Grigoriev and R. Sitters

vertex incident to f . By choice of v and the assumption that d(S, S′) > 2 log n,the distance from v to any face from F is greater than log n. Therefore, thesubgraph of G induced by all vertices on distance at most 1 + log n from v isa tree. Since minimum degree in G is at least 3, the number of vertices in suchtree is more than n. A contradiction.

Now, we summarize the main results of this section in the following theorem andcorollary.

Theorem 3. Given a planar graph G of minimum degree 3 and ε > 0, thealgorithm above constructs in polynomial time a tree hitting all faces of G withlength at most (1 + ε)OPT .

Applying literally the same modifications to the Baker’s algorithm as in Epp-stein [9] and Bodlaender and Grigoriev [6] we derive the following corollary.

Corollary 2. The connected feedback vertex set face hitting set problem ongraphs embeddable on a surface of bounded genus and having minimum vertexdegree 3 admits a polynomial time approximation scheme.

Without the connectivity constraint the problem becomes much easier. A PTASfor FHS follows directly from the discussion above and we leave the proof to thereader.

Theorem 4. The face hitting set problem on graphs embeddable on a surface ofbounded genus admits a polynomial time approximation scheme.

References

1. Bafna, V., Berman, P., Fujito, T.: A 2-Approximation Algorithm for the UndirectedFeedback Vertex Set Problem. SIAM J. Discrete Math. 12, 289–297 (1999)

2. Baker, B.: Approximation algorithms for NP-complete problems on planar graphs.JACM 41, 153–180 (1994)

3. Barnette, D.: An upper bound for the diameter of a polytope. Discr. Math. 10,9–13 (1974)

4. Becker, A., Geiger, D.: Optimization of Pearl’s method of conditioning and greedy-like approximation algorithms for the vertex feedback set problem. Artificial Intel-ligence 83, 167–188 (1996)

5. Bodlaender, H.L., Feremans, C., Grigoriev, A., Penninkx, E., Sitters, R., Wolle, T.:On the minimum corridor connection and other generalized geometric problems.In: Erlebach, T., Kaklamanis, C. (eds.) WAOA 2006. LNCS, vol. 4368, pp. 69–82.Springer, Heidelberg (2007)

6. Bodlaender, H.L., Grigoriev, A.: Algorithms for graphs embeddable with few cross-ings per edge. Algorithmica 49, 1–11 (2007)

7. Chudak, F.A., Goemans, M.X., Hochbaum, D.S., Williamson, D.P.: A primal-dualinterpretation of two 2-approximation algorithms for the feedback vertex set prob-lem in undirected graphs. Oper. Res. Lett. 22, 111–118 (1998)

8. Demaine, E.D., Hajiaghayi, M.: The bidimensionality theory and its algorithmicapplications. The Computer Journal 51, 292–302 (2008)

Page 163: Graph-Theoretic Concepts in Computer Science

Connected Feedback Vertex Set in Planar Graphs 153

9. Eppstein, D.: Diameter and treewidth in minor-closed graph families. Algorith-mica 27, 275–291 (2000)

10. Escoffier, B., Gourves, L., Monnot, J.: Complexity and approximation results forthe connected vertex cover problem. In: Brandstadt, A., Kratsch, D., Muller, H.(eds.) WG 2007. LNCS, vol. 4769, pp. 202–213. Springer, Heidelberg (2007)

11. Garey, M.R., Johnson, D.S.: The rectilinear Steiner tree problem is NP-complete.SIAM J. Appl. Math. 32, 826–834 (1977)

12. Garey, M.R., Johnson, D.S.: Computers and Intractability: A Guide to the Theoryof NP-Completeness. Freeman, New York (1979)

13. Goemans, M.X., Williamson, D.P.: Primal-Dual Approximation Algorithms forFeedback Problems in Planar Graphs. Combinatorica 17, 1–23 (1997)

14. Savage, C.D.: Depth-first search and the vertex cover problem. Inf. Process.Lett. 14, 233–235 (1982)

Page 164: Graph-Theoretic Concepts in Computer Science

Logical Locality EntailsFrugal Distributed Computation over Graphs

(Extended Abstract)

Stephane Grumbach and Zhilin Wu

INRIA – LIAMA,Chinese Academy of Sciences, PO Box 2728, Beijing 100080, PR China

[email protected], [email protected]

Abstract. First-order logic is known to have limited expressive powerover finite structures. It enjoys in particular the locality property, whichstates that first-order formulae cannot have a global view of a structure.This limitation ensures their low sequential computational complexity.We show that the locality impacts as well on their distributed computa-tional complexity. We use first-order formulae to describe the propertiesof finite connected graphs, which are the topology of communication net-works, on which the first-order formulae are also evaluated. We show thatover bounded degree networks and planar networks, first-order proper-ties can be frugally evaluated, that is, with only a bounded number ofmessages, of size logarithmic in the number of nodes, sent over eachlink. Moreover, we show that the result carries over for the extension offirst-order logic with unary counting.

1 Introduction

Logical formalisms have been widely used in many areas of computer science toprovide high levels of abstraction, thus offering user-friendliness while increas-ing the ability to verify properties. In the field of databases, first-order logicconstitutes the basis of relational query languages, which allow to write queriesin a declarative manner, independently of the physical implementation. In thispaper, we propose to use logical formalisms to express properties of the topologyof communication networks, that can be verified in a distributed fashion overthe networks themselves.

We focus on first-order logic over graphs. First-order logic has been shown tohave limited expressive power over finite structures. In particular, it enjoys thelocality property, which states that first-order formulae are local [Gai82], in thesense that local areas of the graphs are sufficient to evaluate them.

First-order properties have been shown to be computable with very low com-plexity in both sequential and parallel models of computation. It was shown thatfirst-order properties can be evaluated in linear time over classes of bounded de-gree graphs [See95] and over classes of locally tree-decomposable graphs1 [FG01].1 Locally tree-decomposable graphs generalize bounded degree graphs, planar graphs,

and graphs of bounded genus.

C. Paul and M. Habib (Eds.): WG 2009, LNCS 5911, pp. 154–165, 2010.c© Springer-Verlag Berlin Heidelberg 2010

Page 165: Graph-Theoretic Concepts in Computer Science

Logical Locality Entails Frugal Distributed Computation over Graphs 155

These results follow from the locality of the logic. It was also shown that theycan be evaluated in constant time over Boolean circuits with unbounded fan-in(AC0) [Imm89]. These bounds lead us to be optimistic on the complexity of thedistributed evaluation of first-order properties.

We consider communication networks based on the message passing model[AW04], where nodes exchange messages with their neighbors. The properties tobe evaluated concern the graph which forms the topology of the network, andwhose knowledge is distributed over the nodes, which are only aware of their1-hop neighbors. We thus focus on connected graphs.

In distributed computing, the ability to solve problems locally has attracteda strong interest since the seminal paper of Linial [Lin92]. The ability to solveglobal problems in distributed systems, while performing as much as possiblelocal computations, is of great interest to ensure scalability. Moreover relying asmuch as possible on local information improves fault-tolerance. Finally, restrict-ing the computation to local areas allows to optimize time and communicationcomplexity.

Naor and Stockmeyer [NS95] showed that there were non-trivial locally check-able labelings that are locally computable, while on the other hand some lower-bounds have been exhibited, thus resulting in non-local computability results[KMW04, KMW06].

Different notions of local computation have been considered. The most widelyaccepted restricts the time of the computation to be constant, that is indepen-dent of the size of the network [NS95], while allowing messages of size O(log n),where n is the size of the network. This condition is rather stringent. Naor andStockmeyer [NS95] show their result for a restricted class of graphs (eg boundedodd degree). Godard et al. used graph relabeling systems as the distributed com-putational model, defined local computations as graph relabeling systems withlocally-generated local relabeling rules, and characterized the classes of graphsthat are locally computable [GMM04].

Our initial motivation is to understand the impact of the logical locality onthe distributed computation, and its relationship with local distributed compu-tation. It is easy to verify though that there are simple properties (expressiblein first-order logic) that cannot be computed locally. Consider for instance theproperty “There exist at least two distinct triangles”, which requires non-localcommunication to check the distinctness of the two triangles which may be faraway from each other. Nevertheless, first-order properties do admit simple dis-tributed computations.

We thus introduce frugal distributed computations. A distributed algorithmis frugal if during its computation only a bounded number of messages of sizeO(log n) are sent over each link. If we restrict our attention to bounded degreenetworks, this implies that each node is only receiving a bounded number ofmessages. Frugal computations resemble local computations over bounded degreenetworks, since the nodes are receiving only a bounded number of messages,although these messages can come from remote nodes through multi-hop paths.

Page 166: Graph-Theoretic Concepts in Computer Science

156 S. Grumbach and Z. Wu

We prove that first-order properties can be frugally evaluated over boundeddegree networks and planar networks (Theorem 2 and Theorem 4). The proofsare obtained by transforming the centralized linear time evaluation algorithms[See95, FG01] into distributed ones satisfying the restriction that only a boundednumber of messages are sent over each link. Moreover, we show that the resultscarry over to the extension of first-order logic with unary counting. While thetransformation of the centralized linear time algorithm is simple for first-orderproperties over bounded degree networks, it is quite intricate for first-order prop-erties over planar networks. The most intricate part is the distributed construc-tion of an ordered tree decomposition for some subgraphs of the planar network,inspired by the distributed algorithm to construct an ordered tree decompositionfor planar networks with bounded diameter in [GW09].

Intuitively, since in the centralized linear time computation each object isinvolved only a bounded number of times, in the distributed computation, abounded number of messages sent over each link could be sufficient to evalu-ate first-order properties. So it might seem trivial to design frugal distributedalgorithms for first-order properties over bounded degree networks and planarnetworks. Nevertheless, this is not the case, because in the centralized com-putation, after visiting one object, any other object can be visited, but inthe distributed computation, only the adjacent objects (nodes, links) can bevisited.

The paper is organized as follows. In the next section, we recall classical graphtheory concepts, as well as Gaifman’s locality theorem. In Section 3, we considerthe distributed evaluation of first-order properties over respectively boundeddegree and planar networks. Finally, in Section 4, we consider the distributedevaluation of first-order logic with unary counting.

2 Graphs, First-Order Logic and Locality

In this paper, our interest is focused to a restricted class of structures, namelyfinite graphs. Let G = (V, E), be a finite graph. We use the following notations.If v ∈ V , then deg(v) denotes the degree of v. For two nodes u, v ∈ V , thedistance between u and v, denoted distG(u, v), is the length of the shortest pathbetween u and v. For k ∈ �, the k-neighborhood of a node v, denoted Nk(v), isdefined as {w ∈ V |distG(v, w) ≤ k}. If v = v1...vp is a collection of nodes in V ,then the k-neighborhood of v, denoted Nk(v), is defined by

⋃1≤i≤p Nk(vi). For

X ⊆ V , let 〈X〉G denote the subgraph induced by X .Let G = (V, E) be a connected graph, a tree decomposition of G is a rooted

labeled tree T = (T, F, r, B), where T is the set of vertices of the tree, F ⊆ T ×Tis the child-parent relation of the tree, r ∈ T is the root of the tree, and B is alabeling function from T to 2V , mapping vertices t of T to sets B(t) ⊆ V , calledbags, such that

1. For each edge (v, w) ∈ E, there is a t ∈ T , such that {v, w} ⊆ B(t).2. For each v ∈ V , B−1(v) = {t ∈ T |v ∈ B(t)} is connected in T .

Page 167: Graph-Theoretic Concepts in Computer Science

Logical Locality Entails Frugal Distributed Computation over Graphs 157

The width of T , width(T ), is defined as max{|B(t)| − 1|t ∈ T }. The tree-widthof G, denoted tw(G), is the minimum width over all tree decompositions of G.An ordered tree decomposition of width k of a graph G is a rooted labeled treeT = (T, F, r, L) such that:

– (T, F, r) is defined as above,– L assigns each vertex t ∈ T to a (k + 1)-tuple bt = (bt

1, · · · , btk+1) of vertices

of G (note that in the tuple bt, vertices of G may occur repeatedly),– If L′(t) := {bt

j|L(t) = (bt1, · · · , bt

k+1), 1 ≤ j ≤ k + 1}, then (T, F, r, L′) is atree decomposition.

The rank of an (ordered) tree decomposition is the rank of the rooted tree, i.e.the maximal number of children of its vertices.

We consider first-order logic (FO) over the signature E, where E is a binaryrelation symbol. The syntax and semantics of first-order formulae are definedas usual [EF99]. The quantifier rank of a formula ϕ is the maximal number ofnestings of existential and universal quantifiers in ϕ.

A graph property is a class of graphs closed under isomorphisms. Let ϕ be afirst-order sentence, the graph property defined by ϕ, denoted Pϕ, is the classof graphs satisfying ϕ.

The distance between nodes can be defined by first-order formulae dist(x, y) ≤k stating that the distance between x and y is no larger than k, and dist(x, y) > kis an abbreviation of ¬dist(x, y) ≤ k. In addition, let x = x1...xp be a list ofvariables, then dist(x, y) ≤ k is used to denote ∨

1≤i≤pdist(xi, y) ≤ k.

Let ϕ(y) be a first-order formula with free variables y, k ∈ �, and x be a list ofvariables not occurring in ϕ(y), then the formula bounding the quantifiers of ϕ(y)to the k-neighborhood of x, denoted (ϕ(y))(k) (x), can be defined easily in first-order logic by using formulae dist(x, y) ≤ k. For instance, if ϕ(y) := ∃zψ(y, z),then

(ϕ(y))(k) (x) := ∃z(dist(x, z) ≤ k ∧ (ψ(y, z))(k) (x)

).

We can now recall the notion of logical locality introduced by Gaifman[Gai82, EF99].

Theorem 1. [Gai82] Let ϕ be a first-order formula with free variables u1, ..., up,then ϕ can be written in Gaifman Normal Form, that is into a Boolean combi-nation of (i) sentences of the form:

∃x1...∃xs

⎝∧

1≤i<j≤s

d(xi, xj) > 2r ∧∧

i

ψ(r)(xi)

⎠ (1)

and (ii) formulae of the form ψ(t)(y), where y = y1...yq such that yi ∈ {u1, ..., up}for all 1 ≤ i ≤ q, r ≤ 7k−1, s ≤ p + k, t ≤ (7k − 1

)/2 (k is the quantifier rank

of ϕ)2.

2 The bound on r has been improved to 4k − 1 in [KL04].

Page 168: Graph-Theoretic Concepts in Computer Science

158 S. Grumbach and Z. Wu

Moreover, if ϕ is a sentence, then the Boolean combination contains only sen-tences of the form (1).

The locality of first-order logic is a powerful tool to demonstrate non-definabilityresults [Lib97]. It can be used in particular to prove that counting properties,such as the parity of the number of vertices, or recursive properties, such as theconnectivity of a graph, are not first-order.

3 Distributed Evaluation of FO

We consider a message passing model of distributed computation [AW04], basedon a communication network whose topology is given by a graph G = (V, E)of diameter Δ, where E denotes the set of bidirectional communication linksbetween nodes. From now on, we restrict our attention to finite connected graphs.

We assume that the distributed system is asynchronous and has no failure.The nodes have a unique identifier taken from 1, 2, · · · , n, where n is the numberof nodes. Each node has distinct local ports for distinct links incident to it. Thenodes have states, including final accepting or rejecting states.

For simplicity, we assume that there is only one query fired in the network bya requesting node. We also assume that a breadth-first-search (BFS) tree rootedon the requesting node has been pre-computed in the network3, such that eachnode stores locally the identifier of its parent in the BFS-tree, and the statesof the ports with respect to the BFS-tree, which are either “parent” or “child”,denoting the ports corresponding to the tree edges, or “horizon”, “upward”,“downward”, denoting the ports corresponding to the non-tree edges to somenode with the same, smaller, or larger depth in the BFS-tree. The computationterminates, when the requesting node reaches a final state.

Let C be a class of graphs. A distributed algorithm is said to be frugal over C ifthere is a k ∈ � such that for any network G ∈ C of n nodes and any requestingnode in G, the distributed computation terminates, with only at most k messagesof size O(log n) sent over each link. If we restrict our attention to bounded degreenetworks, frugal distributed algorithms imply that each node only receives abounded number of messages. Frugal computations resemble local computationsover bounded degree networks, since the nodes receive only a bounded number ofmessages, although these messages can come from remote nodes through multi-hop paths.

Let C be a class of graphs, and ϕ an FO sentence, we say that ϕ can bedistributively evaluated over C if there exists a distributed algorithm such thatfor any network G ∈ C and any requesting node in G, the computation of thedistributed algorithm on G terminates, with the requesting node in the acceptingstate if and only if G |= ϕ. Moreover, if there is a frugal distributed algorithmto do this, then we say that ϕ can be frugally evaluated over C.3 The pre-computation of the BFS tree can be done in O(Δ) distributed time and

with O(Δ) messages sent over each link [BDLP08].

Page 169: Graph-Theoretic Concepts in Computer Science

Logical Locality Entails Frugal Distributed Computation over Graphs 159

For centralized computations, it has been shown that Gaifman’s locality ofFO entails linear time evaluation of FO properties over classes of bounded de-gree graphs and classes of locally tree-decomposable graphs [See95, FG01]. Inthe following, we show that it is possible to design frugal distributed evalua-tion algorithms for FO properties over bounded degree and planar networks,by carefully transforming the centralized linear time evaluation algorithms intodistributed ones with computations on each node well balanced.

3.1 Bounded Degree Networks

We first consider the evaluation of FO properties over bounded degree networks.We assume that each node stores the degree bound k locally.

Theorem 2. FO properties can be frugally evaluated over bounded degree net-works.

Theorem 2 can be shown by using Hanf’s technique [FSV95], in a way similarto the proof of Seese’s seminal result [See95].

Let r ∈ �, G = (V, E), and v ∈ V , then the r-type of v in G is the isomorphismtype of

(〈Nr(v)〉G, v). Let r, m ∈ �, G1 and G2 be two graphs, then G1 and

G2 are said to be (r, m)-equivalent if and only if for every r-type τ , either G1

and G2 have the same number of vertices with r-type τ or else both have atleast m vertices with r-type τ . G1 and G2 are said to be k-equivalent, denotedG1 ≡k G2, if G1 and G2 satisfy the same FO sentences of quantifier rank atmost k. It has been shown that:

Theorem 3. [FSV95] Let k, d ∈ �. There exist r, m ∈ � such that r dependsonly on k, m depends on both k and d, and for any graphs G1 and G2 withmaximal degree no more than d, if G1 and G2 are (r, m)-equivalent, then G1 ≡k

G2.

Let us now sketch the proof of Theorem 2, which relies on a distributed algorithmconsisting of three phases. Suppose the requesting node requests the evaluationof some FO sentence with quantifier rank k. Let r, m be the natural numbersdepending on k, d specified in Theorem 3.

Phase I. The requesting node broadcasts messages along the BFS-tree to askeach node to collect the topology information in its r-neighborhood;

Phase II. Each node collects the topology information in its r-neighborhood;Phase III. The r-types of the nodes in the network are aggregated through

the BFS-tree to the requesting node up to the threshold m for each r-type.Finally the requesting node decides whether the network satisfies the FOsentence or not by using the information about the r-types.

It is easy to see that only a bounded number of messages are sent over each linkin Phase I and II. Since the total number of distinct r-types with degree boundd depends only upon r and d and each r-type is only counted up to a thresholdm, it turns out that over each link, only a bounded number of messages are sentin Phase III as well. So the above distributed evaluation algorithm is frugal overbounded degree networks.

Page 170: Graph-Theoretic Concepts in Computer Science

160 S. Grumbach and Z. Wu

3.2 Planar Networks

We now consider the distributed evaluation of FO properties over planar net-works.

A combinatorial embedding of a planar graph G = (V, E) is an assignmentof a cyclic ordering of the set of incident edges to each vertex v such that twoedges (u, v) and (v, w) are in the same face iff (v, w) is immediately before(v, u) in the cyclic ordering of v. Combinatorial embeddings, which encode theinformation about boundaries of the faces in usual embeddings of planar graphsinto the planes, are useful for computing on planar graphs. Given a combinatorialembedding, the boundaries of all the faces can be discovered by traversing theedges according to the above condition.

We assume in this subsection that a combinatorial embedding of the planarnetwork is distributively stored in the network, i.e. a cyclic ordering of the setof the incident links is stored in each node of the network.

Theorem 4. FO properties can be frugally evaluated over planar networks.

For the proof of Theorem 4, we first recall the centralized linear time algorithmto evaluate FO properties over planar graphs in [FG01]4.

Let G = (V, E) be a planar graph and ϕ be an FO sentence. From Theorem 1,we know that ϕ can be written into Boolean combinations of sentences of theform (1),

∃x1...∃xs

⎝∧

1≤i<j≤s

d(xi, xj) > 2r ∧∧

i

ψ(r)(xi)

⎠ .

It is sufficient to show that sentences of the form (1) are linear-time computableover G. The centralized algorithm to evaluate FO sentences of the form (1) overplanar graphs consists of the following four phases:

1. Select some v0 ∈ V , let H = {G[i, i + 2r]|i ≥ 0}, where G[i, j] = {v ∈ V |i ≤distG(v0, v) ≤ j};

2. For each H ∈ H, compute Kr(H), where Kr(H) := {v ∈ H |Nr(v) ⊆ H};3. For each H ∈ H, compute PH := {v ∈ Kr(H)|〈H〉G |= ψ(r)(v)};4. Let P := ∪HPH , determine whether there are s distinct nodes in P such

that their pairwise distance is greater than 2r.

In the computation of the 3rd and 4th phase above, an automata-theoreticaltechnique to evaluate Monadic-Second-Order (MSO) formulae in linear time overclasses of graphs with bounded tree-width [Cou90, FG06, FFG02] is used. In thefollowing, we recall this centralized evaluation algorithm.

MSO is obtained by adding set variables and set quantifiers into FO, suchas ∃Xϕ(X) (where X is a set variable). MSO has been widely studied in the

4 In fact, in [FG01], it was shown that FO is linear-time computable over classes oflocally tree-decomposable graphs.

Page 171: Graph-Theoretic Concepts in Computer Science

Logical Locality Entails Frugal Distributed Computation over Graphs 161

context of graphs for its expressive power. For instance, 3-colorability, transitiveclosure or connectivity can be defined in MSO [Cou08].

The centralized linear time evaluation of MSO formulae over classes of boundedtree-width graphs goes as follows. First an ordered tree decomposition T of thegiven graph is constructed. Then from the given MSO formula, a tree automatonA is obtained. Afterwards, T is transformed into a labeled tree T ′, finally A isrun over T ′ (maybe several times for formulae containing free variables) to get theevaluation result.

In the rest of this section, we design a frugal distributed algorithm to evaluateFO sentences over planar networks by adapting the above centralized algorithm.The main difficulty is to distribute the computation among the nodes such thatonly a bounded number of messages are sent over each link during the compu-tation.

Phase I. The requesting node broadcasts the FO sentence of the form (1) toall the nodes in the network through the BFS tree;

Phase II. For each v ∈ V , compute C(v) := {i ≥ 0|v ∈ G[i, i + 2r]};Phase III. For each v ∈ V , compute D(v) := {i ≥ 0|Nr(v) ⊆ G[i, i + 2r]};Phase IV. For each i ≥ 0, compute Pi := {v ∈ V |i ∈ D(v), 〈G[i, i + 2r]〉G |=

ψ(r)(v)};Phase V. Let P :=

⋃i Pi, determine whether there are s distinct nodes labeled

by P such that their pairwise distance is greater than 2r.

Phase I is trivial. Phase II is easy. In the following, we illustrate the computationof Phase III, IV, and V one by one.

We first introduce a lemma for the computation of Phase III.For W ⊆ V , let Ki(W ) := {v ∈ W |Ni(v) ⊆ W}. Let Di(v) := {j ≥ 0|v ∈

Ki(G[j, j + 2r])}.Lemma 1. For each v ∈ V and i > 0, Di(v) = C(v) ∩ ⋂

w:(v,w)∈E

Di−1(w).

With Lemma 1, D(v) = Dr(v) can be computed in an inductive way to finishPhase III: Each node v obtains the information Di−1(w) from all its neighborsw, and performs the in-node computation to compute Di(v).

Now we consider Phase IV.Because ψ(r)(x) is a local formula, ψ(r)(x) can be evaluated separately over

each connected component of G[i, i+2r] and the results are stored distributively.Let Ci be a connected component of G[i, i + 2r], and wi

1, · · · , wil be all the

nodes contained in Ci with distance i from the requesting node. Now we considerthe evaluation of ψ(r)(x) over Ci.

Let C′i be the graph obtained from Ci by including all ancestors of wi1, · · · , wi

l

in the BFS-tree, and C∗i be the graph obtained from C′i by contracting all theancestors of wi

1, · · · , wil into one vertex, i.e. C∗i has one more vertex, called the

virtual vertex, than Ci, and this vertex is connected to wi1, · · · , wi

l . It is easy tosee that C∗i is a planar graph with a BFS-tree rooted on v∗ and of depth at most2r + 1. So C∗i is a planar graph with bounded diameter.

Page 172: Graph-Theoretic Concepts in Computer Science

162 S. Grumbach and Z. Wu

An ordered tree decomposition for planar networks with bounded diametercan be distributively constructed with only a bounded number of messages sentover each link as follows [GW09]:

– Do a depth-first-search to decompose the network into blocks, i.e. bicon-nected components;

– Construct an ordered tree decomposition for each nontrivial block: Traverseevery face of the block according to the cyclic ordering at each node, trian-gulate all those faces, and connect the triangles into a tree decompositionby utilizing the pre-computed BFS tree;

– Finally the tree decompositions for the blocks are connected together into acomplete tree decomposition for the whole network.

By using the distributed algorithm for the tree decomposition of planar networkswith bounded diameter, we can construct distributively an ordered tree decom-position for C∗i , while having the virtual vertex in our mind, and get an orderedtree decomposition for Ci.

With the ordered tree decomposition for Ci, we can evaluate ψ(r)(x) over Ci

by using the automata-theoretical technique, and store the result distributivelyin the network (each node stores a Boolean value indicating whether it belongsto the result or not).

A distributed post-order traversal over the BFS tree can be done to find outthe connected components of all G[i, i + 2r]’s and construct the tree decomposi-tions for these connected components one by one.

Finally we consider Phase V.Label nodes in

⋃i Pi with P .

Then consider the evaluation of FO sentence ϕ′ over the vocabulary {E, P},

∃x1...∃xs

⎝∧

1≤i<j≤s

d(xi, xj) > 2r ∧∧

i

P (xi)

⎠ .

Starting from some node w1 with label P , mark the vertices in N2r(w1) as Q,then select some node w2 outside Q, and mark those nodes in N2r(w2) by Qagain, continue like this, until wl such that either l = s or all the nodes withlabel P have already been labeled by Q.

If l < s, then label the nodes in⋃

1≤i≤l

N4r(vi) as I. Each connected component

of 〈I〉G has diameter no more than 4lr < 4sr. We can construct distributivelya tree decomposition for each connected component of 〈I〉G, and connect thesetree decompositions together to get a complete tree-decomposition of 〈I〉G, thenevaluate the sentence ϕ′ by using this complete tree decomposition.

4 Beyond FO Properties

We have shown that FO properties can be frugally evaluated over respectivelybounded degree and planar networks. In this section, we extend these results toFO unary queries and some counting extension of FO.

Page 173: Graph-Theoretic Concepts in Computer Science

Logical Locality Entails Frugal Distributed Computation over Graphs 163

From Theorem 1, an FO formula ϕ(x) containing exactly one free variablex can be written into a Boolean combinations of sentences of the form (1) andlocal formulae ψ(t)(x). Then it is not hard to prove the following result.

Theorem 5. FO formulae ϕ(x) with exactly one free variable x can be frugallyevaluated over respectively bounded degree and planar networks, with the resultsdistributively stored on the nodes of the network.

Counting is one of the ability that is lacking to first-order logic, and has beenadded in commercial relational query languages (e.g. SQL). Its expressive powerhas been widely studied [GO92, GT95, Ott96] in the literature. Libkin [Lib97]proved that first-order logic with counting still enjoys Gaifman locality property.We prove that Theorem 2 and Theorem 4 carry over as well for first-order logicwith unary counting.

Let FO(#) be the extension of first-order logic with unary counting. FO(#)is a two-sorted logic, the first sort ranges over the set of nodes V , while thesecond sort ranges over the natural numbers �. The terms of the second sortare defined by: t := #x.ϕ(x) | t1 + t2 | t1× t2, where ϕ is a formula over the firstsort with one free variable x. Second sort terms of the form #x.ϕ(x) are calledbasic second sort terms.

The atoms of FO(#) extend standard FO atoms with the following two unarycounting atoms: t1 = t2 | t1 < t2, where t1, t2 are second sort terms. Let t be asecond sort term of FO(#), G = (V, E) be a graph, then the interpretation of tin G, denoted tG, is defined as follows:

– (#x.ϕ(x))G is the cardinality of {v ∈ V |G |= ϕ(v)};– (t1 + t2)

G is the sum of tG1 and tG2 ;– (t1 × t2)

G is the product of tG1 and tG2 .

The interpretation of FO(#) formulae is defined in a standard way.

Theorem 6. FO(#) properties can be frugally evaluated over respectivelybounded degree and planar networks.

The proof of the theorem relies on a normal form of FO(#) formulae.

5 Conclusion

We have shown that logical formulae used to express properties of graphs, whichconstitute the topology of communication networks, can be evaluated very effi-ciently over these networks. Their distributed computation, although not local,can be done frugally, that is with a bounded number of messages of logarith-mic size exchanged over each link, over respectively bounded degree and planarnetworks. The frugal computation, introduced in this paper, generalizes localcomputation and offers a large spectrum of applications. Moreover the resultscarry over to the extension of first-order logic with unary counting. The dis-tributed time used in the frugal evaluation of FO properties over bounded degreenetworks is O(Δ), while that over planar networks is O(n).

Page 174: Graph-Theoretic Concepts in Computer Science

164 S. Grumbach and Z. Wu

We assumed that a BFS tree is pre-computed and stored distributively inthe network. Evidently the BFS-tree varies when the requesting node is chosendifferently. Since a BFS-tree is a tree 2-spanner [CC95] of the network, we canactually assume that a tree 2-spanner, independent of the choice of the requestingnode, is distributively pre-computed and stored in the network, and we stillguarantee the frugality of the computation by adapting slightly the distributedevaluation algorithms in Section 3.

Beyond its interest for logical properties, the frugality of distributed algo-rithms, which ensures an extremely good scalability of their computation, raisesfundamental questions, such as deciding what can be frugally computed. Weleave as an open problem the question of deciding whether for instance a Hamil-tonian path can be computed frugally.

References

[AW04] Attiya, H., Welch, J.: Distributed Computing: Fundamentals, Simulationsand Advanced Topics. Wiley Interscience, Hoboken (2004)

[BDLP08] Boulinier, C., Datta, A.K., Larmore, L.L., Petit, F.: Space efficient andtime optimal distributed BFS tree construction. Inf. Process. Lett. 108(5),273–278 (2008)

[Bod93] Bodlaender, H.L.: A linear time algorithm for finding tree-decompositionsof small treewidth. In: ACM STOC (1993)

[CC95] Cai, L., Corneil, D.G.: Tree Spanners. SIAM J. Discret. Math. 8(3), 359–387 (1995)

[Cou90] Courcelle, B.: Graph rewriting: An algebraic and logic approach. In: Hand-book of Theoretical Computer Science, Volume B: Formal Models and Se-matics (B), pp. 193–242. Elsevier and MIT Press (1990)

[Cou08] Courcelle, B.: Graph algebras and monadic second-order logic. To be pub-lished by Cambridge University Press (2008) (in preparation)

[EF99] Ebbinghaus, H.D., Flum, J.: Finite model theory. Springer, Heidelberg(1999)

[FFG02] Flum, J., Frick, M., Grohe, M.: Query evaluation via tree-decompositions.J. ACM 49(6), 716–752 (2002)

[FG01] Frick, M., Grohe, M.: Deciding first-order properties of locally tree-decomposable structures. J. ACM 48(6), 1184–1206 (2001)

[FG06] Flum, J., Grohe, M.: Parameterized Complexity Theory. Springer, Heidel-berg (2006)

[FSV95] Fagin, R., Stockmeyer, L.J., Vardi, M.Y.: On a monadic NP vs monadicco-NP. Inf. Comput. 120(1), 78–92 (1995)

[Gai82] Gaifman, H.: On local and non-local properties. In: Proceedings of theHerbrand Symposium, Logic Colloquium 1981. North-Holland, Amsterdam(1982)

[GMM04] Godard, E., Metivier, Y., Muscholl, A.: Characterizations of classes ofgraphs recognizable by local computations. Theory Comput. Syst. 37(2),249–293 (2004)

[GO92] Gradel, E., Otto, M.: Inductive definability with counting on finite struc-tures. In: Computer Science Logic, CSL, pp. 231–247 (1992)

[GT95] Grumbach, S., Tollu, C.: On the expressive power of counting. Theor. Com-put. Sci. 149(1), 67–99 (1995)

Page 175: Graph-Theoretic Concepts in Computer Science

Logical Locality Entails Frugal Distributed Computation over Graphs 165

[GW09] Grumbach, S., Wu, Z.: On the distributed evaluation of MSO on graphs(2009) (manuscript)

[Imm89] Immerman, N.: Expressibility and parallel complexity. SIAM J. Com-put. 18(3), 625–638 (1989)

[KL04] Keisler, H.J., Lotfallah, W.B.: Shrinking games and local formulas. Ann.Pure Appl. Logic 128(1-3), 215–225 (2004)

[KMW04] Kuhn, F., Moscibroda, T., Wattenhofer, R.: What cannot be computedlocally. In: ACM PODC (2004)

[KMW06] Kuhn, F., Moscibroda, T., Wattenhofer, R.: The price of being near-sighted. In: Seventeenth ACM-SIAM SODA (2006)

[Lib97] Libkin, L.: On the forms of locality over finite models. In: LICS, pp. 204–215 (1997)

[Lin92] Linial, N.: Locality in distributed graph algorithms. SIAM J. Com-put. 21(1), 193–201 (1992)

[NS95] Naor, M., Stockmeyer, L.J.: What can be computed locally? SIAM J. Com-put. 24(6), 1259–1277 (1995)

[Ott96] Otto, M.: The expressive power of fixed-point logic with counting. J. Symb.Log. 61(1), 147–176 (1996)

[Pel00] Peleg, D.: Distributed computing: a locality-sensitive approach. Society forIndustrial and Applied Mathematics, Philadelphia (2000)

[See95] Seese, D.: Linear time computable problems and logical descriptions.Electr. Notes Theor. Comput. Sci. 2 (1995)

[TW68] Thatcher, J.W., Wright, J.B.: Generalized finite automata theory with anapplication to a decision problem of second-order logic. Math. SystemsTheory 2(1), 57–81 (1968)

Page 176: Graph-Theoretic Concepts in Computer Science

On Module-Composed Graphs

Frank Gurski� and Egon Wanke

Heinrich-Heine-University DusseldorfInstitute of Computer ScienceD-40225 Dusseldorf, Germany

{gurski-wg09,wanke-wg09}@acs.uni-duesseldorf.de

Abstract. In this paper we introduce module-composed graphs, i.e.graphs which can be defined by a sequence of one-vertex insertionsv1, . . . , vn, such that the neighbourhood of vertex vi, 2 ≤ i ≤ n, forms amodule of the graph defined by vertices v1, . . . , vi−1.

We show that module-composed graphs are HHDS-free and thus ho-mogeneously orderable, weakly chordal, and perfect. Every bipartitedistance hereditary graph and every trivially perfect graph is module-composed. We give an O(|V | · (|V | + |E|)) time algorithm to decidewhether a given graph G = (V, E) is module-composed and constructa corresponding module-sequence.

For the case of bipartite graphs, we show that the set of module-composed graphs is equivalent to the well known class of distancehereditary graphs, which implies linear time algorithms for their recog-nition and construction of a corresponding module-sequence using BFSand Lex-BFS.

Keywords: special graph classes, homogeneous sets, HHDS-free graphs,distance hereditary graphs, bipartite graphs.

1 Introduction

In this paper we analyze special graphs G = (V, E) which are defined by a bijectivemapping ϕ : V → {1, . . . , |V |}, such that the neighbourhood of vertex ϕ−1(i) ischaracterizedby special operations on the previously defined graphG[{ϕ−1(1), . . .,ϕ−1(i − 1)}]. For example a chordal graph is a graph, such that the neighbour-hood of vertex ϕ−1(i) is a clique in graph G[{ϕ−1(1), . . . , ϕ−1(i − 1)}]. Furtherwell known examples of such defined graph classes are trees, co-graphs, distancehereditary graphs, and k-trees, see [19] for a survey. The existence of such vertexorderings ϕ often has algorithmic applications, see [1,11].

We introduce the closely related new concept of module-composed graphs. Weallow to insert vertex ϕ−1(i) into some defined graph G[{ϕ−1(1), . . . , ϕ−1(i −1)}] if the neighbourhood of vertex ϕ−1(i) is a module in graph G[{ϕ−1(1), . . . ,ϕ−1(i− 1)}].� The work of the first author was supported by the German Research Association

(DFG) grant RO 1202/11-1.

C. Paul and M. Habib (Eds.): WG 2009, LNCS 5911, pp. 166–177, 2010.c© Springer-Verlag Berlin Heidelberg 2010

Page 177: Graph-Theoretic Concepts in Computer Science

On Module-Composed Graphs 167

Our results are as follows. We classify module-composed graphs in general andfor the case of bipartite graphs within the hierarchy of well known graph classes.We show that bipartite module-composed graphs are exactly bipartite distancehereditary graphs which implies a new characterization for bipartite distancehereditary graphs and linear time algorithms for the recognition and constructionof a corresponding module-sequence using fundamental search strategies such asLexicographic Breadth First Search (Lex-BFS) and Breadth First Search (BFS).For general module-composed graphs G = (V, E) we give an O(|V | · (|V |+ |E|))time recognition algorithm based on a modular decomposition of the given graph.

2 Preliminaries

For some positive integer k, let [k] = {1, . . . , k} be the set of all positive integersbetween 1 and k.

Let G = (V, E) be a graph. For U ⊆ V we define by G[U ] the subgraph of Ginduced by the vertices of U . By G− v we denote the subgraph G[V − {v}] of G.The edge complement graph of G is denoted by co-G. Further by 2G, we denotethe disjoint union of two copies of graph G. For a set of graphs F , we denote byF-free graphs the set of all graphs that do not contain a graph of F as an inducedsubgraph. In Table 1 we show some special graphs to which we refer during thepaper. A hole is a chordless cycle with at least five vertices. A k-sun is a chordalgraphG = (V, E) on 2k vertices for some k ≥ 3 whose vertex set can be partitionedinto V = U ∪W such that U = {u0, . . . , uk−1} and W = {w0, . . . , wk−1} is anindependent set. Additionally vertex ui is adjacent to vertex wj if and only if i = jor i = j +1 mod k. G is called a sun if it is a k-sun for some k ≥ 3. If graph G[U ]is a clique, then G is called a complete k-sun.

For some vertex v ∈ V we denote the neighbourhood of v by N(v) = {w ∈V | {v, w} ∈ E}. Vertex set M ⊆ V is called a module (homogeneous set) of G,if for all (v1, v2) ∈ M2: N(v1) −M = N(v2) −M , i.e. v1 and v2 have identical

Table 1. Special graphs

C5 hole house gem

domino co-(K3,3 − e) 3-sun co-2C4

Page 178: Graph-Theoretic Concepts in Computer Science

168 F. Gurski and E. Wanke

neighbourhoods outside M . Module M ⊆ V is called a trivial module, if |M | = 0,|M | = 1, or M = V .

3 Module-Composed Graphs

Definition 1. A graph G = (V, E) is module-composed, if there exists a linearordering ϕ : V → [|V |], such that for every 2 ≤ i ≤ |V | the neighbourhood ofvertex ϕ−1(i) in graph G[{ϕ−1(1), . . . , ϕ−1(i − 1)}] forms a module. For somemodule-composed graph G ordering ϕ is called a module-sequence for G.

In order to classify module-composed graphs within the hierarchy of well knowngraph classes and to prove the correctness of our recognition algorithm formodule-composed graphs we start with some basic but important properties.

Lemma 1. 1. Given a module-composed graph G, every induced subgraph ofG is module-composed.

2. Given two module-composed graphs G1, G2, the disjoint union G1 ∪ G2 ismodule-composed.

3. Given a module-composed graph G, the addition of a dominating vertex (ver-tex of maximum degree) leads a module-composed graph.

4. Given a module-composed graph G, the addition of a pendant vertex (vertexof degree one) leads a module-composed graph.

5. Graph G = (V, E) is a module-composed graph, if and only if there exists atleast one v ∈ V such that N(v) is a module in graph G − v and for everysuch vertex v graph G− v is a module-composed graph.

6. Every module-composed graph does not contain one of the following graphsas an induced subgraph (see Table 1): Cn, n ≥ 5 (i.e. holes), co-Cn, n ≥ 5(i.e. anti-holes), house, domino, co-(K3,3 − e), 3-sun, co-2C4.

Proof. 1. Let G = (V, E) be a module-composed graph. If M ⊆ V is a moduleof graph G then for every u ∈M , M −{u} is a module of graph G−u. Thuswe can remove an arbitrary subset V ′ ⊆ V and obtain a module-composedgraph G[V − V ′].

2. Given two module-composed graphs G1 = (V1, E1), G2 = (V2, E2) and twomodule-sequences ϕ1, ϕ2 for G1 and G2, respectively. It is easy to verify thatsequence

ϕ(v) ={

ϕ1(v) if v ∈ V1

ϕ2(v) + |V1| if v ∈ V2

is a module-sequence for the disjoint union of these two graphs.3. Given a module-composed graph G = (V, E), a module-sequence ϕ for G

and some vertex v �∈ V , we can extend ϕ by ϕ(v) = |V | + 1 and obtain amodule-sequence for G with dominating vertex v.

4. Similar to (3.)5. Let v be the last vertex in a module-sequence for G, then by definition N(v)

is a module in graph G− v. By (1.) for every v ∈ V induced subgraph G− vis a module-composed graph.

Page 179: Graph-Theoretic Concepts in Computer Science

On Module-Composed Graphs 169

Since G− v is a module-composed graph there is some module-sequence forgraph G− v and since N(v) is a module in graph G− v, we can extend thissequence by v for a module-sequence for G.

6. It is easy to verify that none of the given graphs G contains a vertex v suchthat N(v) is a module in graph G − v. Thus by part (5.) the given graphsare not module-composed.

The example of graph co-2C4 shows that not every co-graph is module-compo-sed. But the subclass of trivially perfect graphs is module-composed.

Lemma 2. Trivially perfect graphs are module-composed.

Proof. Every trivially perfect graph can be defined by an expression X using thedisjoint union of two trivially perfect graphs and the addition of a dominatingvertex. This implies by Lemma 1 (2.) and (3.) that we can construct a module-sequence for graph defined by X . Next we conclude results on super classes of module-composed graphs.

Lemma 3. Module-composed graphs are {house,hole,domino,sun}-free (HHDS-free).

Proof. By Lemma 1 (6.) the house, every hole, the domino, and the complete3-sun are not module-composed. By a result shown in [10] each sun contains acomplete sun as induced subgraph, which is obviously not module-composed. ByLemma 1 (1.) the result follows. Thus we conclude that module-composed graphs are perfect, homogeneouslyorderable, and weakly chordal. The example C4 shows that module-composedgraphs are not chordal in general.

4 Algorithms for Module-Composed Graphs

4.1 How to Find Module-Sequences

Next we give a polynomial time algorithm to recognize module-composed graphs.Within our algorithm we will use a modular decomposition of the input graph.

A graph G = (V, E) is called prime if every module M of G is trivial, i.e. if|M | = 0, |M | = 1, or M = V . The smallest non-trivial prime graph is the P4. Amodule M is maximal if there is no non-trivial module N such that M ⊆ N . Amodule is called strong if it does not overlap with any other module.

While the set of all modules of a graph G can be exponentially large, the setof strong modules is linear in the number of vertices. The inclusion order of theset of all strong modules defines a tree-structure which is denoted as modulardecomposition TG, see [17]. The root of TG represents the graph G and the leavesof TG correspond to the vertices of G. Every inner node, i.e. non-leaf node, w ofTG corresponds to an induced subgraph of G consisting of the leaves of TG insubtree with root w, which is called the representative graph of w and is denoted

Page 180: Graph-Theoretic Concepts in Computer Science

170 F. Gurski and E. Wanke

by G(w) = (VG(w), EG(w)). Vertex set VG(w) is a strong module of G. For someinner node v of TG, the quotient graph G[v] is obtained by substituting in G(v)every strong module, represented by some child of v in TG, by a single vertex.For some inner node v of TG, quotient graph G[v] is either a complete graph (vis denoted as join node), the edge complement of a complete graph (v is denotedas co-join node), or a prime graph (v is denoted as prime node).

Theorem 1. Given a graph G = (V, E), one can decide in time O(|V | · (|V |+|E|)) whether G is module-composed and in the case of a positive answer con-struct a module-sequence for G.

Proof. We show that graph G = (V, E) is module-composed, if and only if thealgorithm of Table 2 returns a module-sequence for G.

Table 2. Recognition algorithm for module-composed graphs

Input: Graph G = (V,E)Output: Module-sequence ϕ : V → [|V |] or the answer NO

(1) mod-com(G)(2) i = |V |;(3) if (G disconnected){(4) for every connected component H of G: mod-com(H);(5) combine the obtained sequences to one sequence (see Lemma 1 (2.)) }(6) else {(7) construct modular decomposition TG with root r;(8) if (r is join node) {(9) if (∃ child vl of r which is a leaf in TG) {(10) for every such child vl of r {ϕ(vl) = i−−; G = G− vl; }(11) mod-com(G);}(12) else if (∃ child r1 of r labeled by co-join and a child vl of r1 which(13) is a leaf in TG) {(14) for every such vertex vl {ϕ(vl) = i−−; G = G− vl; }(15) mod-com(G); }(16) }(17) else if (r is prime node) {(18) if (∃ child vl of r which is a leaf in TG and corresponds to a vertex(19) of degree 1 in quotient graph G[r]) {(20) for every such child vl of r {ϕ(vl) = i−−; G = G− vl; }(21) mod-com(G);}(22) else if (∃ child r1 of r labeled by co-join and corresponds to a vertex(23) of degree 1 in quotient graph G[r] and a child vl of r1 which is a(24) leaf in TG) {(25) for every such vertex vl {ϕ(vl) = i−−; G = G− vl; }(26) mod-com(G); }(27) }(28) else(29) return NO;(30) }

Page 181: Graph-Theoretic Concepts in Computer Science

On Module-Composed Graphs 171

Let G = (V, E) be some module-composed graph and TG be a modular de-composition for G. We can assume that G is connected, otherwise we considerevery connected component of G, which is module-composed by Lemma 1 (1.).By Lemma 1 (5.) graph G contains at least one vertex v such that N(v) is amodule in G − v. It remains to show that our algorithm finds such a vertexwithin the set of leaves of tree TG. Since G is connected the root r of TG is ajoin node or a prime node.

If r is a join node then every son of r which is a leaf of TG is a possible vertexv since its neighbourhood is G− v and thus a (trivial) module in G− v. Furtherif there is a child r1 of r labeled by co-join, then every child vl of r1 which is aleaf of TG is a possible vertex v since its neighbourhood in G− v is a module.

If r is a prime node then every son of r which is a leaf of TG and correspondsto a vertex of degree 1 in quotient graph G[r] is a possible vertex v since itsneighbourhood in G− v is a single vertex and thus a (trivial) module in G− v.Further if there is a child r1 of r labeled by co-join and corresponds to a vertexof degree 1 in quotient graph G[r], then every child vl of r1 which is a leaf ofTG is a possible vertex v since its neighbourhood in G− v is a single vertex andthus a (trivial) module in G− v.

A case distinction shows that no further situations for vertex v are possiblewhich guarantees that our algorithm finds some vertex v such that N(v) is amodule in G− v. Since by Lemma 1 (5.) graph G− v remains module-composedthe same argumentation holds in every iteration until our algorithm returns avertex ordering ϕ for the input graph. Ordering ϕ is a module-sequence for G,since we either remove vertices v whose neighbourhood is a module in G− v orcombine module-sequences by Lemma 1 (2.) for connected components withinour algorithm.

The reverse direction holds by definition.

The construction of the modular decomposition TG in Line (7) of our algo-rithm in Table 2 can be realized in time O(|V | + |E|) by [8,16] which impliesthat the total running time of the given algorithm is O(|V | · (|V |+ |E|)). It remains open whether there exists a linear time algorithm to recognize module-composed graphs. Within our given algorithm we compute in every iterationa new modular decomposition. Thus if we could find for some given modulardecomposition for some graph G, a modular decomposition for graph G − v intime less time than O(|V |+|E|), e.g. in time O(|V |), we could reduce the runningtime of our algorithm.

4.2 Easy Problems on Module-Composed Graphs

Since module-composed graphs are HHD-free, we conclude by the results shownin [14] the following theorem.

Theorem 2. For every module-composed graph which is given together with amodule-sequence the size of a largest independent set, the size of a largest clique,

Page 182: Graph-Theoretic Concepts in Computer Science

172 F. Gurski and E. Wanke

the chromatic number, and the minimum number of cliques covering the graphcan be computed in linear time.

A very usual approach when looking for solvable problems on special graphclasses is to consider their tree-width [3] or clique-width [7]. In the case of module-composed graphs both parameters are unbounded which is easy to show.

Remark 1. First, since every complete graph is module-composed, the set ofall module-composed graphs can not have bounded tree-width. Further, everygraph which can be constructed from a single vertex by a sequence of one vertexextentions by a dominating vertex or a pendant vertex is module-composed byLemma 1 (3.) and (4.). But the set of all such defined graphs has unboundedclique-width [19] and thus the set of all module-composed graphs can not havebounded clique-width.

5 Independent Module-Composed Graphs

Next we want to analyze module-composed graphs for a restricted case.

Definition 2. A graph G = (V, E) is independent module-composed, if thereexists a linear ordering ϕ : V → [|V |], such that for every 2 ≤ i ≤ |V | theneighbourhood of vertex ϕ−1(i) in graph G[{ϕ−1(1), . . . , ϕ−1(i − 1)}] forms amodule which is an independent set. For some independent module-composedgraph G ordering ϕ is called an independent module-sequence for G.

5.1 Characterizations for Independent Module-Composed Graphs

It is easy to see that independent module-composed graphs do not contain anyof the graphs of Table 1 as induced subgraph.

Lemma 4. Independent module-composed graphs are {house,hole,domino,gem}-free (HHDG-free).

HHDG-free are also known as distance hereditary graphs [13,2], which can bedefined by a so-called pruning sequence. A pruning sequence for a graph G =(V, E) with n vertices is a sequence of pairs (v1, l1), . . . , (vn, ln) where li is eithera single vertex graph, denoted by •, or from {v1, . . . , vi−1} × {leaf, true-twin,false-twin}. A graph is defined by a pruning sequence as follows. Let Gi, 1 ≤ i ≤n, be the graph defined by pruning sequence (v1, l1), . . . , (vi, li). Then graph Gi

is obtained from Gi−1 by inserting vertex vi and some edges defined as follows. Ifli = • then no edges are inserted. If li = (vj , leaf) then vertex vi will be connectedwith vertex vj . If li = (vj , false-twin) then vertex vi will be connected with allneighbors of vertex vj . If li = (vj , true-twin) then vertex vi will be connectedwith vertex vj and all neighbors of vertex vj .

Theorem 3 ([13,2]). Let G be some graph. The following conditions are equiv-alent.

Page 183: Graph-Theoretic Concepts in Computer Science

On Module-Composed Graphs 173

1. G is distance hereditary.2. G is HHDG-free.3. G can be generated by a pruning sequence.

Our next theorem shows that for the case of bipartite graphs, i.e. odd-cycle-freegraphs, the notion module-composed even is equivalent to the notion of distancehereditary.

Theorem 4. Let G be some graph. The following conditions are equivalent.

1. G is bipartite module-composed.2. G is independent module-composed.3. G is bipartite distance hereditary.4. G is domino, hole, and odd-cycle-free.5. G can be generated by a pruning sequence without true twins.

Proof. (3.) ⇔ (4.) ⇔ (5.) Well known results from [2].(1.) ⇒ (2.) In the case of bipartite graphs any neighbourhood is an independent

set and thus every module-sequence even is an independent module-sequence.(2.) ⇒ (4.) By Lemma 4 we know that independent module-composed are do-

mino and hole-free, and since C3 is not independent module-composed thesegraphs are even odd-cycle-free.

(5.) ⇒ (1.) By our first equivalence we know that G is bipartite. So we have toshow that G is module-composed. Let G be a graph defined by a pruningsequence (v1, l1), . . . , (vn, ln) without true twins. We now define a module-sequence ϕ : V → [|V |] for G. We start with ϕ(v1) = 1. Assume we havedefined a module-sequence ϕ : {v1, . . . , vi} → [i] for the first i vertices.A module-sequence for the first i + 1 vertices is obtained as follows. Wedistinguish the following three cases.– If li+1 = •, then ϕ is extended by ϕ(vi+1) = i + 1.– If li+1 = (vj , leaf), then ϕ is extended by ϕ(vi+1) = i + 1.– If li+1 = (vj , false-twin), then let x = ϕ−1(vj). For every vertex v ∈{v1, . . . , vi} with ϕ(v) > x we increase ϕ(v) by one and define ϕ(vi+1) =x + 1. That is vertex vi+1 ins inserted in our module-sequence immedi-ately after its false twin vj .

Notice that because of the movement of the false twins it may happen thatsome leaf vertices of Gi are no longer of degree one in graph Gi+1. But sincein Gi+1 the neighbourhood of such leaf vertices of Gi is a set of twin verticesof Gi+1, our transformation leads a feasible module-sequence.

In general, the class of module-composed graphs is incomparable with the classof distance hereditary graphs, since there are module-composed graphs which arenot distance hereditary, e.g. the gem, and there are distance hereditary graphwhich are not module-composed, e.g. the co-(K3,3 − e).

By Theorem 4 module-composed graphs can be regarded as a generalizationof bipartite distance hereditary graphs. For a generalization of arbitrary distancehereditary graphs by homogeneously orderable graphs we refer to the paper [4].

Page 184: Graph-Theoretic Concepts in Computer Science

174 F. Gurski and E. Wanke

5.2 How to Find Independent Module-Sequences

The problem to decide whether a given graph is bipartite distance hereditaryand to construct a corresponding pruning sequence can be done in linear time bythe well known characterization for bipartite graphs as 2-colorable graphs andexisting linear time recognition algorithms for distance hereditary graphs shownin [13,2,15]. By Theorem 4, this immediately implies a linear time algorithm forrecognizing independent module-composed graphs. A corresponding independentmodule-sequence can be constructed in linear time from a pruning sequence asshown in the proof of Theorem 4.

Next we discuss how to use well known fundamental search strategies Lex-icographic Breadth First Search (Lex-BFS) and Breadth First Search (BFS)for recognizing independent module-composed graphs, see [5] for a survey onLex-BFS.

First we show how to produce an independent module-sequence for some givenindependent module-composed graph.

Theorem 5. Given an independent module-composed graph G = (V, E), everyreverse Lex-BFS ordering constructs in time O(|V |+|E|) an independent module-sequence for G.

Proof. By Lemma 3 we know that independent module-composed graphs areHHDS-free, which allows us to apply the results on Lex-BFS orderings shown forHHD-free graphs shown in [14]. If ({v1, v2, v3, v4}, {{v1, v2}, {v2, v3}, {v3, v4}})induces a P4 in some graph G = (V, E) we denote v2 and v3 as midpoints ofthe P4. A vertex v in graph G is semi-simplicial, if v is no midpoint of anyinduced P4 in G. A vertex ordering ϕ : V → [|V |] is denoted as semi perfectelimination ordering if for every 1 ≤ i ≤ |V | vertex ϕ−1(i) is semi-simplicialin graph G[{ϕ−1(i), . . . , ϕ−1(n)}]. That is, for every semi perfect eliminationordering ϕ of some graph G, we know that every independent set N(ϕ−1(i)) inG[{ϕ−1(i + 1), . . . , ϕ−1(n)}] is even a module in G[{ϕ−1(i + 1), . . . , ϕ−1(n)}].

In [14] it is shown that for every HHD-free graph G = (V, E) every Lex-BFSordering ϕ : V → [|V |] is a semi perfect elimination ordering. Since for the caseof bipartite graphs every neigbourhood of some vertex is an independent set, ϕobviously is even a reverse independent module-sequence. Thus for every indepen-dent module-composed graph G every reverseLex-BFS ordering is an independentmodule-sequence for G, which can be found in time O(|V |+ |E|) [14]. Next we show how to decide whether a given graph is independent module-composed and if so, how to produce an independent module-sequence.

Theorem 6. Given a graph G = (V, E), one can decide using BFS in timeO(|V | + |E|) whether G is independent module-composed and in the case of apositive answer construct an independent module-sequence.

Proof. To decide whether a given graph G = (V, E) is bipartite distance here-ditary can be done by Corollary 5 shown in [2] using the fundamental searchstrategy of BFS which produces a classification of the vertices into levels, with

Page 185: Graph-Theoretic Concepts in Computer Science

On Module-Composed Graphs 175

respect to a start vertex u. Level i is the set of vertices with distance i to vertexu and is denoted by Ni(u).

Theorem 7 (Corollary 5 of [2]). Let G be a connected graph and let u be avertex of G. Then G is bipartite distance hereditary if and only if all levels Nk(u)are edgeless, and for every vertices v,w in Nk(u) and neighbours x and y of v inNk−1(u), we have N(x)∩Nk−2(u) = N(y)∩Nk−2(u), and further N(v)∩Nk−1(u)and N(w) ∩Nk−1(u) are either disjoint or one is contained in the other.

A BFS starting at a vertex u can compute the level sets Nk(u) in time O(|V |+|E|) and using these levels, the conditions of Corollary 5 of [2] can be verified inthe same time.

A BFS numbering ϕ : V → [|V |] of the vertices with respect to some vertex ucan be used to obtain an independent module-sequence ϕ1 as follows. We startwith ϕ1(v) = ϕ(v), ∀v ∈ V . For the first |N0(u)|+ |N1(u)| vertices we obviouslycan choose ϕ1(v) = ϕ(v). For the vertices of w ∈ Nk(u), k ≥ 2, we know thattheir neighbours in set Nk−1(u) are modules which can be ordered by a series ofinclusions N1 ⊆ N2 ⊆ . . . ⊆ N j . We rearrange the order of the vertices in Nk(u)with respect to ϕ1 such that for every such series of inclusions ϕ1(w1) < ϕ1(w2)if and only if Nk−1(u) ∩N(w1) ⊇ Nk−1(u) ∩N(w2). This leads an independentmodule-sequence for graph G if G is bipartite distance hereditary.

5.3 Easy Problems on Independent Module-Composed Graphs

In contrast to general module-composed graphs, independent module-composedgraphs have bounded clique-width, since distance hereditary graphs have

Table 3. Inclusions of special graph classes

HHDS−free

perfect

weakly chordal

HHD−free

HHDG−free=distance hereditary

trivially perfect

tree−width 1

interval

chordal

k tree−

difference

homogeneously orderable

homogeneous

module−composed

independent module−composed=bipartite distance hereditary

co−graphs

Page 186: Graph-Theoretic Concepts in Computer Science

176 F. Gurski and E. Wanke

clique-width at most 3 [12]. This implies that a lot of hard problems can besolved in polynomial time on independent module-composed graphs [6,9]. Fur-ther algorithms for hard problems on bipartite distance hereditary graphs canbe found in [20,18].

6 Graph class Inclusions

In Table 3 we summarize the relation of module-composed graphs and relatedgraph classes.

7 Conclusions

In this paper we introduced the new concept of module-composed graphs. Wehave classified module-composed graphs in general and for the case of bipartitegraphs within the hierarchy of well known graph classes. Independent module-composed graphs turn out to be a well known graph class and can be recognizedin linear time. For general module-composed graphs G = (V, E) we showed anO(|V | · (|V |+ |E|)) time recognition algorithm.

It remains open whether there are equivalent characterizations of module-composed graphs and a linear time recognition algorithm. In any case BFS andLex-BFS approaches failed to improve our given algorithm.

References

1. Arnborg, S., Proskurowski, A.: Linear time algorithms for NP-hard problems re-stricted to partial k-trees. Discrete Applied Mathematics 23, 11–24 (1989)

2. Bandelt, H.-J., Mulder, H.M.: Distance-hereditary graphs. Journal of Combinato-rial Theory, Series B 41, 182–208 (1986)

3. Bodlaender, H.L.: A partial k-arboretum of graphs with bounded treewidth. The-oretical Computer Science 209, 1–45 (1998)

4. Brandstadt, A., Dragan, F.F., Nicolai, F.: Homogeneously orderable graphs. The-oretical Computer Science 172, 209–232 (1997)

5. Corneil, D.G.: Lexicographic breadth first search - a survey. In: Hromkovic, J.,Nagl, M., Westfechtel, B. (eds.) WG 2004. LNCS, vol. 3353, pp. 1–19. Springer,Heidelberg (2004)

6. Courcelle, B., Makowsky, J.A., Rotics, U.: Linear time solvable optimization prob-lems on graphs of bounded clique-width. Theory of Computing Systems 33(2),125–150 (2000)

7. Courcelle, B., Olariu, S.: Upper bounds to the clique width of graphs. DiscreteApplied Mathematics 101, 77–114 (2000)

8. Cournier, A., Habib, M.: A new linear time algorithm for modular decomposition.In: Tison, S. (ed.) CAAP 1994. LNCS, vol. 787, pp. 68–84. Springer, Heidelberg(1994)

9. Espelage, W., Gurski, F., Wanke, E.: How to solve NP-hard graph problems onclique-width bounded graphs in polynomial time. In: Brandstadt, A., Le, V.B.(eds.) WG 2001. LNCS, vol. 2204, pp. 117–128. Springer, Heidelberg (2001)

Page 187: Graph-Theoretic Concepts in Computer Science

On Module-Composed Graphs 177

10. Farber, M.: Characterizations of strongly chordal graphs. Discrete Mathematics 43,173–189 (1983)

11. Gavril, F.: Algorithms for minimum coloring, maximum clique, minimum coveringby cliques, and maximum independent set of a chordal graph. SIAM Journal onComputing 1(2), 180–187 (1972)

12. Golumbic, M.C., Rotics, U.: On the clique-width of some perfect graph classes.International Journal of Foundations of Computer Science 11(3), 423–443 (2000)

13. Hammer, P.L., Maffray, F.: Completely separable graphs. Discrete Applied Math-ematics 27, 85–99 (1990)

14. Jamison, B., Olariu, S.: On the semi-perfect elimination. Advances in applied math-ematics 9, 364–376 (1988)

15. Lanlignel, J.-M., Raynaud, O., Thierry, E.: Pruning graphs with digital searchtrees. Application to distance hereditary graphs. In: Reichel, H., Tison, S. (eds.)STACS 2000. LNCS, vol. 1770, pp. 529–541. Springer, Heidelberg (2000)

16. McConnell, R.M., Spinrad, J.: Modular decomposition and transitive orientation.Discrete Mathematics 201(1-3), 189–241 (1999)

17. Mohring, R.H., Radermacher, F.J.: Substitution decomposition for discrete struc-tures and connections with combinatorial optimization. Annals of Discrete Math-ematics 19, 257–365 (1984)

18. Muller, H., Nicolai, F.: Polynomial time algorithms for hamiltonian problems onbipartite distance-hereditary graphs. Information Processing Letters 46(5), 225–230 (1993)

19. Rao, M.: Clique-width of graphs defined by one-vertex extensions. Discrete Math-ematics 308(24), 6157–6165 (2008)

20. Yeh, H.-G., Chang, G.J.: The path-partition problem in bipartite distance-hereditary graphs. Taiwanese Journal of Mathematics 2(3), 353–360 (1998)

Page 188: Graph-Theoretic Concepts in Computer Science

An Even Simpler Linear-Time Algorithmfor Verifying Minimum Spanning Trees

Torben Hagerup

Institut fur Informatik, Universitat Augsburg, 86135 Augsburg, [email protected]

Abstract. A new linear-time algorithm is presented for the tree-path-maxima problem of, given a tree T with real edge weights and a list ofpairs of distinct nodes in T , computing for each pair (u, v) on the list amaximum-weight edge on the path in T between u and v. Linear-time al-gorithms for the tree-path-maxima problem were known previously, butthe new algorithm may be considered significantly simpler than the ear-lier solutions. A linear-time algorithm for the tree-path-maxima problemimplies a linear-time algorithm for the MST-verification problem of de-termining whether a given spanning tree of a given undirected graph Gwith real edge weights is a minimum-weight spanning tree of G.

1 Introduction

A spanning tree of an undirected graph G with real edge weights is a minimumspanning tree (MST ) if its weight, i.e., the total weight of its edges, is minimalamong all weights of spanning trees of G. The MST-construction problem ofcomputing an MST of a given connected undirected graph with real edge weightsis a fundamental problem with numerous applications [1,10].

In a comparison-based model that allows constant-time binary comparisons ofedge weights but no other operations on weights, the best currently known upperbound on the complexity of the MST-construction problem was established byChazelle [5], who gave an algorithm that runs in O(mα(m, n)) time on inputgraphs with n vertices and m edges, where α is an inverse of the Ackermannfunction. Pettie and Ramachandran [17] described a provably optimal determin-istic algorithm based on table-lookup for small subproblems, but nothing betterthan O(mα(m, n)) is known about its running time. A randomized algorithmthat runs in O(n + m) time with high probability was found by Karger, Kleinand Tarjan [11]; another such algorithm was subsequently indicated by Pettieand Ramachandran [18]. Fredman and Willard [9] devised a deterministic algo-rithm with a running time of O(n+m) for the word-RAM model, which assumesthe weights to be integers on which a range of operations can be executed inconstant time. Extensive surveys of material related to the MST problem werecompiled by Graham and Hell [10] and by Mares [15].

A number of researchers have considered the following problem related toMST construction.

C. Paul and M. Habib (Eds.): WG 2009, LNCS 5911, pp. 178–189, 2010.c© Springer-Verlag Berlin Heidelberg 2010

Page 189: Graph-Theoretic Concepts in Computer Science

An Even Simpler Linear-Time Algorithm for Verifying MST 179

MST-verification problem: Given an undirected graph G with real edge weightsand a spanning tree T of G, decide whether T is an MST of G.

The MST-verification problem for a graph with n vertices and m edges ob-viously reduces in O(n + m) time to the MST-construction problem for thesame graph, but it might be easier (except, of course, in models of computa-tion for which even the MST-construction problem is known to be solvable inlinear time). Komlos [14] described how to solve the MST-verification problemfor a graph with n vertices and m edges with O(n + m) binary comparisons ofedge weights, but did not indicate an algorithm with an overall running timeof O(n + m). Dixon, Rauch and Tarjan [8] gave the first linear-time algorithmfor MST verification. It is based on decomposing an input tree into small mi-crotrees, many of which share the same tree shape, computing for each possiblemicrotree shape the decision tree implied by Komlos’ result, using the decisiontrees to process the actual microtrees, and solving the remaining slightly smalleroverall problem using an efficient but not linear-time algorithm of Tarjan [19].Subsequently King [13] proposed an implementation of Komlos’ algorithm thatreduces the overhead spent outside of weight comparisons to O(n + m). Ab-stractly speaking, a linear time bound is achieved by packing several elements ofa set into a single computer word and operating on all of them simultaneouslyat unit cost. Edge weights are only subjected to binary comparisons, however,as required by the comparison-based model. A linear-time algorithm that workson a pointer machine was proposed by Buchsbaum et al. [3].

Most of the algorithms for MST verification discussed above actually solvethe following problem.

Tree-path-maxima problem: Given a tree T with real edge weights and a list ofpairs of distinct nodes in T , determine for each pair (u, v) on the list a heaviestedge on the path in T between u and v.

A spanning tree T of an undirected graph G with real edge weights is anMST of G if and only if the weight of every nontree edge {u, v} in G is atleast as large as the maximum weight of an edge on the path in T between uand v. (To see this, observe that T can be constructed by Kruskal’s algorithmif the condition is satisfied and that a cheaper spanning tree can be obtainedvia an edge swap if not.) Therefore the MST-verification problem for a graphwith n vertices and m edges reduces, within O(n + m) time, to the tree-path-maxima problem for an n-node tree and a list of at most m node pairs. Thetree-path-maxima problem has additional applications, however, notably to therandomized construction of minimum spanning trees [7,11,12]. It can be viewedin a more abstract setting, where the computation of the maximum is replacedby a general semigroup operation. In this setting, the complexity of the problemis known to be Θ(mα(m, n)) [4,6,20]. In an online setting in which the querycorresponding to each pair (u, v) must be answered before the next pair be-comes known, the same bound applies even to the original tree-path-maximaproblem [16].

King [13] demonstrated that the tree-path-maxima problem reduces, againwithin linear time, to the special case of itself characterizedbelow. A full branching

Page 190: Graph-Theoretic Concepts in Computer Science

180 T. Hagerup

tree is a rooted tree in which all leaves are on the same level and all inner nodeshave at least 2 children.

Special tree-path-maxima problem: Given a full branching tree T with real edgeweights and a list of pairs (u, v) of nodes in T such that u is a proper ancestorof v, determine for each pair (u, v) on the list a heaviest edge on the path in Tbetween u and v.

King’s reduction replaces the original input tree T by a tree with at mosttwice as many nodes that reflects the structure of an execution of Boruvka’sMST-construction algorithm [2], applied to T , and it uses a data structure fordetermining the lowest common ancestor (LCA) of two nodes to replace eachoriginal node pair (u, v) by the two pairs (z, u) and (z, v), where z is the LCAof u and v (if z coincides with u or v, the corresponding pair is omitted).

This paper describes a new linear-time algorithm in the comparison-basedmodel for the special tree-path-maxima problem. Used with King’s reduction, ityields linear-time algorithms for the general tree-path-maxima problem and theMST-verification problem. Similarly as King’s algorithm, the new algorithm isan implementation of Komlos’ algorithm for full branching trees, and its running-time analysis depends crucially on a lemma provided by Komlos.

The algorithm of Dixon, Rauch and Tarjan [8] appears moderately compli-cated and not very suited for practical use. King’s algorithm [13] probably faresbetter on both accounts. However, it employs a nontrivial scheme for encod-ing edges, represents objects of several logically distinct types in single com-puter words, and distinguishes between big and small nodes, which causes theprocessing at a node to take one of at least four different forms. In contrast,the new algorithm uses no encoding of edges, represents only one very simpletype of object with a richer logical structure than an integer in single com-puter words, and processes all nodes in exactly the same uniform manner. Asan additional demonstration of the simplicity of the new algorithm, Section 5offers a complete working implementation of it in the programming language D(http://www.digitalmars.com/d). The code fits on three pages. It seems un-likely that any of the earlier algorithms has a comparably succinct description.

2 The ↓ Operation on Sets

The new algorithm is most conveniently formulated and proved correct with theaid of a set operation ↓, written infix and defined as follows: For all sets A andB of integers,

A ↓ B = {b ∈ B | ∃a ∈ A : a < b and there is no b′ ∈ B with a < b′ < b}.Informally, A ↓ B can be described as follows: Each a ∈ A picks the next largerb ∈ B, if any; A ↓ B is the set of bs picked. Several as may pick the same b,which is nonetheless included only once. Some as may pick no b at all. A numberof elementary properties of ↓ follow more or less directly from the definition. Letus agree to take inf ∅ = ∞ and sup ∅ = −∞ and employ the natural orderingconventions for the set of integers extended by ∞ and −∞.

Page 191: Graph-Theoretic Concepts in Computer Science

An Even Simpler Linear-Time Algorithm for Verifying MST 181

Lemma 1. For all finite sets A, B and C of integers, the following relationshold:

(a) A ↓ B ⊆ B.(b) |A ↓ B| ≤ |A|.(c) (A ∪B) ↓ C = (A ↓ C) ∪ (B ↓ C).(d) A ↓ (B ∪ C) ⊆ (A ↓ B) ∪ (A ↓ C).(e) If A ↓ B = ∅, then A ↓ C = A ↓ (C \B).(f) If A ↓ B ⊆ C ⊆ B, then A ↓ B = A ↓ C.(g) If sup(B ∩ C) < inf(B \ C), then A ↓ (B ∩ C) = (A ↓ B) ∩ C.(h) If A ⊆ B, then A ↓ C = A ↓ (B ↓ C).

Proof. Given sets A and B of integers and a b ∈ B, let us call an a ∈ A an(A, B)-witness of b if a < b and there is no b′ ∈ B with a < b′ < b. Thus A ↓ Bis the set of those elements of B that have an (A, B)-witness.

(a) Trivial.(b) No two distinct elements of B can have the same (A, B)-witness.(c) An (A ∪B, C)-witness of some c ∈ C is clearly an (A, C)-witness of c if it

belongs to A and a (B, C)-witness of c if it belongs to B. Thus (A ∪ B) ↓ C ⊆(A ↓ C)∪ (B ↓ C). On the other hand, every (A, C)- or (B, C)-witness of c is an(A ∪B, C)-witness of c, so (A ↓ C) ∪ (B ↓ C) ⊆ (A ∪B) ↓ C.

(d) An (A, B ∪ C)-witness of some x ∈ B ∪ C is an (A, B)-witness of x ifx ∈ B and an (A, C)-witness of x if x ∈ C.

(e) Assume that A ↓ B = ∅. Then A ↓ (B ∩ C) = ∅ and, by part (d),A ↓ C ⊆ A ↓ (C \B). Conversely, let c ∈ A ↓ (C \B) and let a be an (A, C \B)-witness of c. By definition, there is no c′ ∈ C \B with a < c′ < c. If there werea c′ ∈ C ∩ B with a < c′ < c, the smallest element of {b ∈ B | a < b} wouldbelong to A ↓ B, a contradiction. Therefore c ∈ A ↓ C.

(f) Assume that A ↓ B ⊆ C ⊆ B. Let b ∈ A ↓ B and let a be an (A, B)-witnessof b. Then the relation a < b′ < b does not hold for any b′ ∈ B. In particular, itdoes not hold for any b′ ∈ C. Since b ∈ C, it follows that b ∈ A ↓ C.

Conversely, let c ∈ A ↓ C and let a be an (A, C)-witness of c. Assume that c �∈A ↓ B. Then, since c ∈ C and hence c ∈ B, there is a b ∈ B with a < b < c. If bis chosen smallest with this property, then b ∈ A ↓ B and b �∈ C, a contradiction.

(g) Assume that sup(B ∩ C) < inf(B \ C). Let x ∈ A ↓ (B ∩ C) and let a bean (A, B ∩ C)-witness of x. Then there is no x′ ∈ B ∩ C with a < x′ < x. Sincex ∈ B ∩ C, there is no x′ ∈ B \ C with x′ < x either. Thus x ∈ (A ↓ B) ∩C.

Conversely, let x ∈ (A ↓ B) ∩ C and let a be an (A, B)-witness of x. Thena < x′ < x holds for no x′ ∈ B and, in particular, for no x′ ∈ B ∩ C. Sincex ∈ B ∩ C, x ∈ A ↓ (B ∩ C).

(h) Assume that A ⊆ B. Let c ∈ A ↓ C and let a be an (A, C)-witness of c.Since a ∈ B, c ∈ B ↓ C. Moreover, since B ↓ C ⊆ C, there is no c′ ∈ B ↓ C witha < c′ < c, so c ∈ A ↓ (B ↓ C).

Conversely, let c ∈ A ↓ (B ↓ C) and let a be an (A, B ↓ C)-witness of c, sothat a < c′ < c holds for no c′ ∈ B ↓ C. Assume that a < c′ < c holds for somec′ ∈ C and choose c′ smallest with this property. Then, since a ∈ B, c′ ∈ B ↓ C,a contradiction. Thus c ∈ A ↓ C.

Page 192: Graph-Theoretic Concepts in Computer Science

182 T. Hagerup

3 The High-Level Algorithm

Consider an input instance of the special tree-path-maxima problem consistingof an n-node tree T = (V, E) and a list (u1, v1), . . . , (um, vm) of m pairs of nodesin T such that for i = 1, . . . , m, ui is a proper ancestor of vi. Let r and h be theroot of T and its height, respectively. For all u ∈ V , let d(u) be the depth of uin T and, if u �= r, let w(u) be the weight of the edge between u and its parentin T .

Stepping through the list (u1, v1), . . . , (um, vm) once, the algorithm begins bystoring the set Lv = {i | 1 ≤ i ≤ m and vi = v} with each node v ∈ V . Intraversals of T , it subsequently computes h and, for each node u ∈ V , its depthd(u) and the set

Du = {d(ui) | ui is a proper ancestor of u and vi is a descendant of u},

which may be thought of, informally, as the set of depths of endpoints above uof query paths that contain u. According to the recursive formula

Du = {d(ui) | vi = u} ∪⋃

v is a child of u

(Dv \ {d(u)}),

the computation of Du for all u ∈ V can easily be carried out in a bottom-upfashion, as indicated by King [13] (who writes LCA(u) for what we call Du).

For each v ∈ V , denote by Pv(j), for j = 0, . . . , d(v), the ancestor of v in Tof depth j. Moreover, let

Mv = {j | 1 ≤ j ≤ d(v) and w(Pv(j)) > w(Pv(k)) for k = j + 1, . . . , d(v)}.

Informally, Mv is the set of depths of suffix maxima on the path in T from r tov, where a suffix maximum is a nonroot node u such that w(u) is strictly largerthan every weight of an edge that follows u on the path. Obviously, Mv is strictlydecreasing in the sense that if i, j ∈Mv and i < j, then w(Pv(i)) > w(Pv(j)).

It is easy to see that the correct answer to the query represented by a node pair(u, v) is Pv(j), where j is the single element of the set {d(u)} ↓ Mv. Thereforethe problem at hand essentially reduces to computing Mv for all v ∈ V . Sinceit is not known how to do this in linear time, instead we find Sv = Dv ↓Mv forall v ∈ V . By part (h) of Lemma 1 and the fact that d(u) ∈ Dv, {d(u)} ↓ Sv ={d(u)} ↓ (Dv ↓ Mv) = {d(u)} ↓ Mv, so that Sv serves just as well as Mv. Theremainder of the section explains how to determine Sv for all v ∈ V .

Let v be a nonroot node in T and let u be its parent. Then Mv can be obtainedfrom Mu by removing zero or more largest elements of Mu and adding the singleelement d(v). As a consequence, sup(Mu ∩Mv) < inf(Mu \Mv). Moreover, bypart (c) of Lemma 1, (Dv \Du) ↓Mu ⊆ {d(u)} ↓Mu = ∅. Using these relationsas well as parts of Lemma 1 (indicated above the relevant relation symbols), wefind

Page 193: Graph-Theoretic Concepts in Computer Science

An Even Simpler Linear-Time Algorithm for Verifying MST 183

Sv = Dv ↓Mv

(c)= ((Dv ∩Du) ↓Mv) ∪ ((Dv \Du) ↓Mv)

(c),(e)

⊆ (Du ↓Mv) ∪ ((Dv \Du) ↓ (Mv \Mu))(d)

⊆ (Du ↓ (Mu ∩Mv)) ∪ (Du ↓ (Mv \Mu)) ∪ ((Dv \Du) ↓ (Mv \Mu))(g),(a)

⊆ ((Du ↓Mu) ∩Mv) ∪ (Mv \Mu)

= (Su ∩Mv) ∪ {d(v)}(a)= {j ∈ Su | w(Pv(j)) > w(v)} ∪ {d(v)}

= {j ∈ Su | j ≤ sup{j′ ∈ Su | w(Pv(j′)) > w(v)}} ∪ {d(v)}.Let

R = {j ∈ Su | j ≤ sup{j′ ∈ Su | w(Pv(j′)) > w(v)}} and

R′ = {j ∈ Su | j ≤ sup{j′ ∈ Dv ↓ Su | w(Pv(j′)) > w(v)}}.

By what we proved above, Dv ↓Mv ⊆ R ∪ {d(v)} ⊆Mv. Therefore, by part (f)of Lemma 1, Dv ↓ Mv = Dv ↓ (R ∪ {d(v)}). Moreover, we have sup(Su ∩ R) =sup R < inf(Su \ R), so, by parts (g) and (a) of Lemma 1, Dv ↓ R ⊆ Dv ↓ Su

and R′ ⊆ R. Let j ∈ Dv ↓ R. By part (a) of Lemma 1, if j �∈ R′, we havej > sup{j′ ∈ Dv ↓ Su | w(Pv(j′)) > w(v)} ≥ sup{j′ ∈ Dv ↓ R | w(Pv(j′)) >w(v)} = sup(Dv ↓ R), a contradiction. We may conclude that Dv ↓ R ⊆ R′ and,by another application of part (f) of Lemma 1, that Dv ↓ R = Dv ↓ R′. Sinced(v) > sup(Dv ↓ R), this is easily seen to imply that Sv = Dv ↓ (R ∪ {d(v)}) =Dv ↓ (R′∪{d(v)}). The algorithm therefore proceeds to compute Sv for all v ∈ Vin a top-down traversal of T according to the recursive formula

Sv =

⎧⎨

∅ if v = r;Dv ↓ ({j ∈ Su | j ≤ sup{j′ ∈ Dv ↓ Su | w(Pv(j′)) > w(v)}} ∪ {d(v)}),

if v has parent u.

During the traversal, the ancestors of the node currently visited are kept inan array sorted by depth, so that it is easy to access Pv(j) for arbitrary j ∈{0, . . . , d(v)} during the visit of v.

The value sup{j′ ∈ Dv ↓ Su | w(Pv(j′)) > w(v)} is found with binary searchby initializing a set S to Dv ↓ Su and proceeding as follows: If S = ∅, return −∞(or 0, which has the same effect). Otherwise, as long as |S| > 1, compute themedian k of S, defined here to be the element in S of rank |S|/2 + 1� (i.e., tiesare broken in favor of the larger element), and replace S by {j ∈ S | j ≥ k} ifw(Pv(k)) > w(v) and by {j ∈ S | j < k} otherwise. Finally, if the single elementk of S satisfies w(Pv(k)) > w(v), return k—it is the largest element with thatproperty; otherwise return −∞.

Page 194: Graph-Theoretic Concepts in Computer Science

184 T. Hagerup

During the visit of a node v in the traversal, the algorithm also answers thequeries whose indices are stored in Lv: As discussed above, for each i ∈ Lv, itcomputes {d(ui)} ↓ Sv and outputs Pv(j), where j is the single element of theresulting set.

Outside of the binary searches, the algorithm carries out O(1) operations pernode and per query. Some of the operations manipulate entire sets. However, aswill be shown in the next section, each set operation required by the algorithm,including the evaluation of A ↓ B, can be executed in constant time. Since|Sv| ≤ |Dv| for all v ∈ V according to part (b) of Lemma 1, this yields a runningtime of O(n + m +

∑v∈V log(|Dv|+ 1)). Komlos [14] has shown that when T is

a full branching tree, as assumed here, then∑

v∈V log(|Dv| + 1) = O(n + m).Therefore the running time of the algorithm is O(n + m).

4 Realizing the Set Operations

The sets Lv, with v ∈ V , must support only the operations of initialization tothe empty set, insertion of an element and iteration over the entire set. Thereforethey can obviously be realized via, e.g., linked lists. Every other set manipulatedby the algorithm is a set of depths in T , i.e., it is a subset of {0, . . . , h}. Letus call such a set an h-set. Since T is a full branching tree, h ≤ log2n. It istherefore reasonable to assume that integers in the range 0, . . . , 2h+1 − 1 can bestored in single computer words in the usual 2’s-complement representation andoperated on in constant time by standard computer instructions, and we willmake this assumption. This allows us to represent an h-set A via the integer∑

i∈A 2i, which makes the implementation of most of the relevant set operationsa routine matter, as indicated in the table below. Let us number the bit positionsof nonnegative integers 0, 1, . . . , starting at the least significant bit position.

Set expression C equivalent Comment∅ 0 all bits cleared

A ∪B A|B bitwise or

A \B A&~B bitwise and and complement{j} 1<<j 2j , obtained by left shift of 1

{i ∈ A | i < j} A&(1<<j)-1 mask with bits 0, . . . , j − 1 set{i ∈ A | i ≥ j} A&~((1<<j)-1) mask with bits 0, . . . , j − 1 cleared

A ↓ B B&(~(A|B)^(A+(A|~B))) see below

To understand the last line of the table, let A and B be h-sets, consider the(arithmetic) addition of the integers representing the sets A and A∪B, where Bis the complement of B with respect to the universe {0, . . . , h}, and assume thatthe addition is carried out with the usual school method, i.e., from bit position0 to bit position h and with the use of carries. Let i ∈ {0, . . . , h}. If i ∈ A, thenboth operands of the addition have a 1 in bit position i, which turns position iinto a carry-generate position that sends a carry into position i+1 (if such a bitposition exists), independently of all other bits of the operands. Similarly, if i

Page 195: Graph-Theoretic Concepts in Computer Science

An Even Simpler Linear-Time Algorithm for Verifying MST 185

belongs to neither A nor B, position i is a carry-propagate position that passes acarry on to position i+1 (if it exists) if and only if it receives a carry from positioni− 1. The final case, i belongs to B but not to A, yields a carry-absorb positionthat never sends a carry to position i + 1. In summary, each element i of A“throws” a carry that runs through positions i + 1, i + 2, . . . until it is “caught”(if ever) by an element j > i of B (if j ∈ A, a new carry is simultaneouslythrown). It is now easy to see that A ↓ B is the set of those elements of B whosecorresponding bit positions receive a carry. It is possible to test whether this isthe case for position i by forming the exclusive or (C representation: ^) of thethree bits in position i of the two operands of the addition and of their sum. Inthe light of the simplifying relation A⊕ (A ∪B) = A ∪B, where ⊕ denotes thesymmetric set difference, this leads to the C expression given in the last line ofthe table.

The necessary C operations can be reduced to a core set consisting of bitwisecomplement, bitwise and or or and left shift of 1 by j ∈ {0, . . . , h} bit positions,since the remaining operations reduce to these with a constant-factor overheadvia de Morgan’s laws, etc. If even the core operations are not available at unitcost, they can be replaced by lookup in tables that can be precomputed in O(n)time.

The only operation that still needs to be explained is the computation of themedian of an h-set, for which we have to resort to the table-lookup method.

For all nonnegative integers n and k, denote by{

nk

}the set of all subsets

of size k of {0, . . . , n − 1}. Moreover, for arbitrary sets of sets A and B, letA×∪B = {a ∪ b | a ∈ A and b ∈ B}. In complete analogy with a well-knownrecursive formula for binomial coefficients, the formula

{n

k

}=

⎧⎪⎨

⎪⎩

∅, if n < k;{∅}, if n ≥ k = 0;({{n− 1}}×∪

{n−1k−1

})∪ {n−1

k

}, if n ≥ k ≥ 1

holds for all nonnegative integers n and k. It is easily translated into a recursivefunction subsets that, for n, k ∈ {0, . . . , h}, can compute

{nk

}(as a sequence of

integers, each of which represents an h-set) in O(∣∣{n

k

}∣∣) time.Given a set A of sets of integers and an integer k, let A + k denote the set

of those sets obtained from the sets in A by adding k to each of their elements.Then, for s ∈ {0, . . . , h}, the set median−1(s) of those h-sets whose median is sis

s⋃

k=0

[({h− s

k

}+ s + 1

)×∪ {{s}}×∪

({ s

k

}∪{

s

k + 1

})],

since an h-set belongs to median−1(s) if and only if it consists of s and, for somek ∈ {0, . . . , s}, k elements larger than s and either k or k + 1 elements smallerthan s. With the aid of the function subsets discussed above, this formula is easilytranslated to a function that, for each s ∈ {0, . . . , h}, can compute median−1(s) in

Page 196: Graph-Theoretic Concepts in Computer Science

186 T. Hagerup

O(|median−1(s)|) time. And with this function, finally, it is a trivial matter to fillin a table of size 2h+1 that maps each h-set to its median in O(2h) = O(n) time.

5 An Implementation in D

int[] tree_path_maxima(int root,int[] child,int[] sibling,double[] weight,int[] upper,int[] lower) {

// Returns an array of answers to the queries of an instance// (T,((u_1,v_1),...,(u_m,v_m))) of the special tree-path-maxima// problem. For some natural number n, T is a weighted full// branching tree on the node set {0,...,n-1}, represented// via the variables root, which indicates the root of T,// child[n], which maps each node u of T to its leftmost child// (in some arbitrary left-to-right order of T), or to -1 if u is// a leaf, sibling[n], which maps each node v of T to its right// sibling, or to -1 if v has no right sibling, and weight[n],// which maps each node v of T, except for the root of T, to the// weight of the edge between v and its parent. For i=1,...,m,// u_i and v_i are the i’th element of upper[m] and lower[m],// respectively, and the i’th element of the array returned is// a vertex v of T such that the edge between v and its parent// in T is a heaviest edge on the path in T between u_i and v_i.// The running time is O(n+m).

int height=0,n=child.length,m=upper.length;int[] depth=new int[n],D=new int[n],L=new int[n],

Lnext=new int[m],answer=new int[m],median,P;

void init(int u,int d) { // d = depth of udepth[u]=d;if (d>height) height=d; // height of T = maximum depthfor (int i=L[u];i>=0;i=Lnext[i]) D[u]|=1<<depth[upper[i]];for (int v=child[u];v>=0;v=sibling[v]) {init(v,d+1);D[u]|=D[v]&~(1<<d);

}}

int[] median_table(int h) {// Returns a table of size 2^(h+1) whose entry in position i, for// i=0,...,2^(h-1)-1, is the median of the set represented by i.int[] T=new int[(1<<h)+1],median=new int[1<<h+1];

Page 197: Graph-Theoretic Concepts in Computer Science

An Even Simpler Linear-Time Algorithm for Verifying MST 187

int subsets(int n,int k,int p) {// Stores the subsets of size k of {0,...,n-1} in T,// starting in position p, and returns p plus their number.if (n<k) return p;if (k==0) { T[p]=0; return p+1; }int q=subsets(n-1,k-1,p);for (int i=p;i<q;i++) T[i]|=1<<(n-1);return subsets(n-1,k,q);

}

for (int s=0;s<=h;s++)for (int k=0;k<=s;k++) {int p=subsets(h-s,k,0);int q=subsets(s,k,p);q=subsets(s,k+1,q);for (int i=0;i<p;i++) {int b=(1<<s+1)*T[i]+(1<<s); // fixed high bitsfor (int j=p;j<q;j++) median[b+T[j]]=s; // variable low bits

}}

return median;} // end median_table

int down(int A,int B) {// Returns A "downarrow" Breturn B&(~(A|B)^(A+(A|~B)));

}

void visit(int v,int S) { // S = S of parent

int binary_search(double w,int S) {// Returns max({j in S | weight[P[j]]>w} union {0})if (S==0) return 0;int j=median[S];while (S!=1<<j) { // while |S|>1S&=(weight[P[j]]>w)?~((1<<j)-1):(1<<j)-1;j=median[S];}return (weight[P[j]]>w)?j:0;

}

P[depth[v]]=v; // push current node on stackint k=binary_search(weight[v],down(D[v],S));

Page 198: Graph-Theoretic Concepts in Computer Science

188 T. Hagerup

S=down(D[v],S&(1<<(k+1)-1)|(1<<depth[v]));for (int i=L[v];i>=0;i=Lnext[i])answer[i]=P[median[down(1<<depth[upper[i]],S)]];

for (int z=child[v];z>=0;z=sibling[z]) visit(z,S);} // end visit

L[]=-1; Lnext[]=-1; // initialize all array elements to -1for (int i=0;i<m;i++) { // distribute queries to lower nodesLnext[i]=L[lower[i]];L[lower[i]]=i;

}D[]=0; // initialize all array elements to 0init(root,0);P=new int[height+1];median=median_table(height);visit(root,0);return answer;} // end tree_path_maxima

References

1. Ahuja, R.K., Magnanti, T.L., Orlin, J.R.: Network Flows: Theory, Algorithms, andApplications. Prentice-Hall, Upper Saddle River (1993)

2. Boruvka, O.: O jistem problemu minimalnım. Prace Mor. Prırodoved. Spol. vBrne 3, 37–58 (1926)

3. Buchsbaum, A.L., Georgiadis, L., Kaplan, H., Rogers, A., Tarjan, R.E., Westbrook,J.R.: Linear-time algorithms for dominators and other path-evaluation problems.SIAM J. Comput. 38, 1533–1573 (2008)

4. Chazelle, B.: Computing on a free tree via complexity-preserving mappings. Algo-rithmica 2, 337–361 (1987)

5. Chazelle, B.: A minimum spanning tree algorithm with inverse-Ackermann typecomplexity. J. Assoc. Comput. Mach. 47, 1028–1047 (2000)

6. Chazelle, B., Rosenberg, B.: The complexity of computing partial sums off-line.Internat. J. Comput. Geometry Appl. 1, 33–45 (1991)

7. Chiang, Y., Goodrich, M.T., Grove, E.F., Tamassia, R., Vengroff, D.E., Vitter, J.S.:External-memory graph algorithms. In: Proc. 6th Annual ACM-SIAM Symposiumon Discrete Algorithms (SODA), pp. 139–149 (1995)

8. Dixon, B., Rauch, M., Tarjan, R.E.: Verification and sensitivity analysis of mini-mum spanning trees in linear time. SIAM J. Comput. 21, 1184–1192 (1992)

9. Fredman, M.L., Willard, D.E.: Trans-dichotomous algorithms for minimum span-ning trees and shortest paths. J. Comput. System Sci. 48, 533–551 (1994)

10. Graham, R.L., Hell, P.: On the history of the minimum spanning tree problem.Annals Hist. Comput. 7, 43–57 (1985)

11. Karger, D.R., Klein, P.N., Tarjan, R.E.: A randomized linear-time algorithm tofind minimum spanning trees. J. Assoc. Comput. Mach. 42, 321–328 (1995)

Page 199: Graph-Theoretic Concepts in Computer Science

An Even Simpler Linear-Time Algorithm for Verifying MST 189

12. Katriel, I., Sanders, P., Traff, J.L.: A practical minimum spanning tree algorithmusing the cycle property. In: Di Battista, G., Zwick, U. (eds.) ESA 2003. LNCS,vol. 2832, pp. 679–690. Springer, Heidelberg (2003)

13. King, V.: A simpler minimum spanning tree verification algorithm. Algorith-mica 18, 263–270 (1997)

14. Komlos, J.: Linear verification for spanning trees. Combinatorica 5, 57–65 (1985)15. Mares, M.: The saga of minimum spanning trees. Comput. Sci. Rev. 2, 165–221

(2008)16. Pettie, S.: An inverse-Ackermann type lower bound for online minimum spanning

tree verification. Combinatorica 26, 207–230 (2006)17. Pettie, S., Ramachandran, V.: An optimal minimum spanning tree algorithm. J.

Assoc. Comput. Mach. 49, 16–34 (2002)18. Pettie, S., Ramachandran, V.: Randomized minimum spanning tree algorithms us-

ing exponentially fewer random bits. ACM Trans. Algorithms 4(1), 5:1–5:27 (2008)19. Tarjan, R.E.: Applications of path compression on balanced trees. J. Assoc. Com-

put. Mach. 26, 690–715 (1979)20. Yao, A.C.: Space-time tradeoff for answering range queries. In: Proc. 14th Annual

ACM Symposium on Theory of Computing (STOC), pp. 128–136 (1982)

Page 200: Graph-Theoretic Concepts in Computer Science

The k-Disjoint Paths Problem on ChordalGraphs

Frank Kammer and Torsten Tholey

Institut fur Informatik, Universitat Augsburg, D-86135 Augsburg, Germany{kammer,tholey}@informatik.uni-augsburg.de

Abstract. Algorithms based on a bottom-up traversal of a tree decom-position are used in literature to develop very efficient algorithms forgraphs of bounded treewidth. However, such algorithms can also be usedto efficiently solve problems on chordal graphs, which in general do nothave a bounded treewidth. By combining this approach with a sparsi-fication technique we obtain the first linear-time algorithm for chordalgraphs that solves the k-disjoint paths problem. In this problem k pairsof vertices are to be connected by pairwise vertex-disjoint paths. We alsopresent the first polynomial-time algorithm for chordal graphs capableof finding disjoint paths solving the k-disjoint paths problem with mini-mal total length. Finally, we prove that the version of the disjoint pathsproblem, where k is part of the input, is NP-hard on chordal graphs.

1 Introduction

In the k-disjoint paths problem (k-DPP), k pairs of vertices are to be connectedby pairwise vertex-disjoint paths. This appears to be a hard problem since, formany classes of graphs, efficient algorithms are unknown or do not exist. Indeed,Fortune, Hopcroft, and Wyllie [3] have shown that the problem is NP-hard ondirected graphs, even if k is restricted to 2. As shown by Lynch [9] and by Knuth(see the paper of Karp [7]) the same is true on undirected graphs for the disjointpaths problem (DPP), where k, in contrary to the k-DPP, is part of the input. Itis a common approach in combinatorial optimization to construct for NP-hardproblems so-called fixed parameter algorithms that solve the original problem inpolynomial time if one or more of the input parameters are fixed. We presenta linear time algorithm for the k-DPP, which then can be considered also as afixed parameter algorithm for the DPP.

As usual in graph theory, we let n and m denote the number of vertices andedges, respectively, of the graph under consideration. For every fixed k, Robert-son and Seymour, in their series of papers, developed a polynomial algorithm forthe k-DPP on undirected graphs. Perkovic and Reed [13] presented an algorithmwith an improved running time. Unfortunately, the constants hidden in the O-notation of the running time of the algorithms above are extremely large andmake these algorithms unfeasible in practice. Algorithms with better practicalrunning times are known for several classes of graphs such as undirected graphsof bounded treewidth [16] and directed acyclic graphs [3]. However, for manyclasses of graphs, e.g., for general, for planar, or for chordal undirected graphs,

C. Paul and M. Habib (Eds.): WG 2009, LNCS 5911, pp. 190–201, 2010.c© Springer-Verlag Berlin Heidelberg 2010

Page 201: Graph-Theoretic Concepts in Computer Science

The k-Disjoint Paths Problem on Chordal Graphs 191

algorithms more efficient than the algorithm of Perkovic and Reed are knownonly for the special case k = 2. The first polynomial-time algorithms for thecase k = 2 on general undirected graphs are given, e.g., in [11,17,18,19]. Perland Shiloach [14] presented the first polynomial-time algorithm for the 2-DPPon undirected chordal graphs and on undirected planar graphs, namely with alinear running time. A simpler algorithm for chordal graphs can be found in [8].

The importance of chordal graphs is due to several facts. On the one hand,chordal graphs have nice properties that can be used to design efficient algo-rithms for many problems. For example, as shown by Fulkerson and Gross [4],chordal graphs are exactly the set of graphs with a perfect elimination order,and this order can be used to compute a maximal independent set, a maximumclique or an optimal coloring on chordal graphs in linear time [5]. On the otherhand, concerning the practical relevance of chordal graphs, Gavril [6] has shownthat the set of chordal graphs is equal to the set of subtree graphs, where a sub-tree graph is the intersection graph of a family of subtrees of a tree. Let us call atuple (G1, . . . , Gk, G) of graphs to be an intersection model for the intersectiongraph of G1, . . . , Gk if the latter are subgraphs of G. Many practical problems indifferent areas such as computer science and genetics can be modeled by an inter-section model and solved by a transformation to problems on the correspondingintersection graph; e.g., see [15]. In general, it seems that translating a prob-lem on an intersection model into a problem on the corresponding intersectiongraph makes the problem easier to solve. However, in this paper we study thereverse direction. We translate the k-DPP on a chordal graph into a problem onthe corresponding intersection model (T1, . . . , Tk, T ) or, more precisely, on a treedecomposition defined by this model, and we derive a simple approach to solvethe k-DPP on chordal graphs. From another point of view our paper shows thatalgorithms based on a bottom-up traversal of a tree decomposition are useful notonly for graphs of bounded treewidth, but can also be used for efficiently solvingdifferent problems on chordal graphs, even on those of unbounded treewidth. Weonly use the fact that we can choose the so-called bags of a tree decompositionas cliques. Following a similar approach, Okamato, Uno, and Uehara [12] haverecently shown that the number of independent sets in a chordal graph can becounted in linear time.

In Section 2 we present an algorithm for solving the k-DPP on a chordal graphwith a running time of O(n2k+2 +m). As shown in Section 3, this algorithm canbe modified to connect given pairs of vertices by pairwise disjoint paths such thatthe number of edges used by the paths is minimized among all such solutions.Note that so far no polynomial-time algorithm was known for solving this latterproblem for every fixed k on chordal graphs.

In Section 4, as the main result of our paper, we show that the tree decomposi-tion based algorithm of Section 2 can be combined with a sparsification techniquein order to reduce the running time for solving the k-DPP on chordal graphs toO(m+(2k)4k+2n). This means that we obtain a linear fixed parameter algorithmfor the DPP. Moreover, the additional constants hidden in the O-notation are ofmoderate size. For every fixed k, we obtain a running time which improves the

Page 202: Graph-Theoretic Concepts in Computer Science

192 F. Kammer and T. Tholey

running time of the previous best known algorithm for solving the k-DPP onchordal graphs, namely the algorithm of Perkovic and Reed mentioned earlierin this introduction for solving the problem on general graphs. Moreover, ouralgorithm is easy to implement and—for small values of k—it is practical. Itis not surprising that the running time increases exponentially in k since—asa further new result—we can proof that the DPP (with k being non-fixed) isNP-hard even for chordal graphs. Details can be found in Section 5.

2 The k-Disjoint-Paths Problem

Many graph problems can be solved in polynomial time by traversing a so-calledtree decomposition bottom-up if the so-called treewidth is taken to be a constant.

Definition 1. A tree decomposition for a graph G = (V, E) is a pair (T, B),where T = (VT , ET ) is a tree and B is a mapping that maps each node w of VT

to a subset B(w) of V —called the bag of w—such that (1) ∪w∈VT B(w) = V ,(2) for each edge e ∈ E, there exists a node w ∈ VT with e ⊆ B(w), (3)B(x) ∩ B(y) ⊆ B(w) for all w, x, y ∈ VT with w being a node on the path fromx to y in T . The treewidth of T is the maximal cardinality of a bag minus oneand the size of a tree decomposition is the sum of the cardinalities of its bags.

The treewidth of a graph G, denoted by tw(G), is the smallest width of a treedecomposition for G. One of the problems that can be solved efficiently on graphswith constant treewidth is the k-disjoint paths problem [16]. Unfortunately, thetreewidth of chordal graphs is not bounded by a constant but we can find a veryspecial tree decomposition that helps us to solve the k-DPP even on chordalgraphs. For a set U ⊆ V of a graph G = (V, E), we define G[U ] to be thesubgraph of G induced by the vertices in U .

Definition 2. A clique tree for a graph G = (V, E) is a tree decomposition(T, B) with the additional property that (4) B is a bijection between the nodesof T and {U ⊆ V | G[U ] is a maximal clique in G}.It is well known that chordal graphs are exactly the graphs that have a cliquetree [2,6,20] and that a clique tree of linear size can be constructed in linear time[1]. As one can show by using property (4) a clique tree has O(|V |) nodes. Asinput of our algorithm we will take a weak clique tree that is defined as a cliquetree if we replace (4) by the following property: (4’) the vertices of each baginduce a clique in G. More precisely, our algorithm starts with constructing, forthe graph G = (V, E) on which we search for k disjoint paths, in O(|V | + |E|)time a weak clique tree (T, B) of size O(|V |+ |E|) for G with T being a rootedtree having O(|V |) nodes. For example we can take a standard clique tree. Wecall the vertices to be connected by disjoint paths the terminals of G. For a nodew of T , we let G(w) be the subgraph of G induced by all vertices contained in atleast one set B(w′) for a descendant w′ of w in T , where w is also a descendantof itself. In order to obtain a simpler description of our algorithm, we describe

Page 203: Graph-Theoretic Concepts in Computer Science

The k-Disjoint Paths Problem on Chordal Graphs 193

our problem as a coloring problem. A coloring of a graph G′ or a vertex setU is a mapping that assigns a color to some of the vertices in G′ and in U ,respectively. For an instance of the k-DPP, we always define an initial coloringthat, for each pair of terminals to be connected, colors both terminals with thesame color different from the colors of the other terminals. In general, we calla coloring C2 of a vertex set V2 an extension of a coloring C1 of a vertex setV1 ⊆ V2 if all colored vertices of V1 are also colored by C2 with the same color.Let us call a coloring of a graph G legal if it is an extension of the initial coloringof the terminals and if, for each pair t1 and t2 of terminals sharing a color c,there is a path from t1 to t2 in the subgraph of G induced by the vertices of colorc. Moreover, we call a legal coloring good with respect to a (weak) clique tree(T, B) for G if each bag of a node in T contains at most two vertices of color c.

For a node w with a father p(w), let us call the set of vertices in B(w)∩B(p(w))the transition set of w denoted by A(w). On the one hand, our algorithm willneed to know the colors of all vertices in a bag for finally obtaining a completecoloring of G. On the other hand, our algorithm will extend stepwise coloringsof G(w) for a node w to colorings of G(p(w)) and for determining the colors forthe new vertices of this extension (namely the vertices in G(p(w)) − G(w)) itonly needs to know the colors of the vertices in A(w). Thus, we define a full anda reduced characteristic for a node w of T as a coloring of the nodes in B(w) andA(w), respectively, such that for each color c at most two vertices are coloredwith c. Let Z be a full or a reduced characteristic of a node w. Then Z is validif and only if

1. there exists a good coloring C of G(w) extending Z and the initial coloringof the terminals in G(w).

2. for each color c the following is true: if there is exactly one terminal in G(w)of color c, a vertex in A(w) is colored with c by Z.

A coloring C with properties 1 and 2 is then called conform to Z. We also calltwo characteristics compatible if one characteristic is an extension of the other.

There is a connection between the k-DPP and good colorings: If the k-DPPhas a solution, take a solution with minimal total length. Then a coloring thatcolors the vertices of each path of the solution with the color of its endpoints isa good coloring because the following is true: if one of the disjoint paths visitsthree vertices v1, v2, and v3 of one bag in this order, we obtain a shorter pathby replacing the subpath from v1 to v3 by edge {v1, v3}. In the reverse directionassume that we are given a good coloring conform to a valid full characteristic ofthe root of T . Then disjoint paths connecting the terminals of the same color canbe obtained by a depth-first search on each subgraph induced by the vertices ofone color. Hence, we can solve the k-DPP by computing a good coloring conformto a valid full characteristic of the root of T .

For all nodes of T , we want to determine bottom-up all valid full and allvalid reduced characteristics. If we restrict a coloring of G(w) conform to a validfull characteristic of a node w to the graph G(w′) for a descendant w′ of w,this restricted coloring is conform to a valid full as well as to a valid reduced

Page 204: Graph-Theoretic Concepts in Computer Science

194 F. Kammer and T. Tholey

characteristic of w′. In the reverse direction, a full characteristic Z of a node wis valid if and only if

– the terminals in B(w) are colored by Z with their original color,– for each child w′ of w, the reduced characteristic of w′ compatible to Z is

valid,– each color is used by Z to color at most two vertices, and– for each color c, the following is true: if there is exactly one terminal in G(w)

of color c, a vertex in A(w) is colored with c by Z.

Because of the above conditions there exists a good coloring of G(w) extendingZ; in particular, using the last condition we can conclude by induction that, foreach pair of terminals t1 and t2 sharing a color c, there is a path from t1 to t2in the subgraph of G induced by the vertices of color c. By iterating over allvalid full characteristics of a node w in T we can easily compute a lookup-tablestoring 1 for each valid reduced characteristic of w and 0 for each non-validreduced characteristic of w. The time for updating the whole table for w is ofsize O(� · tw(G) deg(w)), where � is the number of full characteristics of w.

Hence, by a bottom-up traversal of T we can find a good coloring for Gif such a coloring exists. We next analyze the running time of our algorithm.For each node, we can test whether a certain full characteristic is valid in atmost O((tw(G) + k) deg(w)) time by testing the four properties listed above.For testing the last condition, note the following: in O(k deg(w)) time, we canupdate the set of colors c for which there is exactly one terminal of color c inG(w) if we are given the corresponding sets for the children of w. There are atmost (tw(G) + 1)2k full characteristics for a node w since for each color we canchoose twice either no vertex or one of the ≤ tw(G) + 1 vertices in B(w). Sincethe time needed to initialize the lookup-table for the reduced characteristics of anode w is bounded linear in O(|A(w)|) times the number of full characteristics,we obtain the next lemma.

Lemma 3. The k-DPP can be solved in O((tw(G)+1)2k(tw(G)+k)|V |+ |E|) =O(|V |2k+2 + |E|) time on a chordal graph G = (V, E).

3 Shortest k-Disjoint Paths

Define the weight of a coloring as the number of edges whose endpoints are bothcolored and have the same color. The cost of a characteristic Z of a node w is theminimal possible weight of a coloring of G(w) conform to Z. In order to outputdisjoint paths using a minimal number of edges, we also have to compute thecosts of the characteristics. Given, for a full characteristic Z of a node w, thecosts W (Z1), . . . , W (Z�) of the reduced characteristics Z1, . . . , Z� of the childrenof w compatible to Z, one can compute the cost W (Z) of Z as follows: InitializeW (Z) with W (Z1)+W (Z2)+ . . .+W (Z�). Subsequently, for each color c used byZ to color two vertices v1, v2 ∈ B(w), add one minus the number of children of wwith their bags containing both, v1 and v2. This update takes O(min{k, |B(w)|}·deg(w)) time and does not increase the asymptotic running time.

Page 205: Graph-Theoretic Concepts in Computer Science

The k-Disjoint Paths Problem on Chordal Graphs 195

Theorem 4. On a chordal graph G = (V, E) one can find in O(|V |2k+2 + |E|)time paths solving an instance of the k-DPP using a minimal number of edgesamong all sets of paths solving the instance.

4 A Speedup

In this section we present a speed-up of the algorithm in Section 2. Once again,we first construct in O(|V |+|E|) time a weak clique tree (T, B) of size O(|V |+|E|)for our input graph G = (V, E) with T having O(|V |) nodes. We assume thatthere is no edge {t1, t2} in G for a pair {t1, t2} of terminals that are to beconnected in G. Otherwise, our problem would be reduced to the (k − 1)-DPPon G[V − {t1, t2}]. For each pair (t1, t2) of terminals t1 and t2 that should beconnected by a path, let us choose Γ (t1) and Γ (t2) as the unique pair of nodesin T with their bags containing t1 and t2, respectively, such that the distancebetween the nodes is minimal. We choose for an arbitrary terminal t the nodeΓ (t) as the root of T . Let f be a fixed bijection from V to {1, . . . , |V |} assigningthe highest numbers to the terminals of G. For nodes w1 and w2 of T and fora vertex v of G, we define the (w1, w2)B-count of v as a tuple (a, f(v)), wherea is the number of nodes w′ on the path from w1 to w2 in T whose bags B(w′)contain v. We say that a vertex v1 with (w1, w2)B-count (a1, b1) has a larger(w1, w2)B-count than a vertex v2 with (w1, w2)B-count (a2, b2) if and only ifeither a1 = a2 and b1 > b2 or a1 > a2 holds. For a node w ∈ T , we letI(w) = {t | t is terminal with Γ (t) contained in the subtree of T rooted in w}.

In order to improve the efficiency of the algorithm presented in Section 2,we replace (T, B) by a new tuple (T ∗, B∗), where T ∗ will be a subtree of Tand where B∗ will be a function that maps each node w of T ∗ to a subset ofB(w) of size ≤ 4k2. In order to describe (T ∗, B∗) more precisely, we need somefurther definitions. A bag B(w) of a node w is called small if |B(w)| ≤ 2k and bigotherwise. For each node w of T and for each terminal t, we define D(w, t) as theset of the min{2k, |B(w)|} vertices of B(w) with the largest (w, Γ (t))B-count.We also let D(w) be the union of D(w, t) over all t ∈ I(w) and of the set of allterminals in B(w) \ I(w).

We now obtain T ∗ from T by deleting all nodes w with I(w) = ∅. We choosethe same root for T ∗ as for T and, for each node w, we insert the vertices ofD(w) into B∗(w). Moreover, for each child w′ of w, we insert an arbitrary subsetof D(w) ∩ B(w′) of size min{2k, |D(w) ∩ B(w′)|} into B∗(w′). Let t ∈ I(w′).Keep in mind that, if |B(w) ∩ B(w′)| ≥ 2k, then D(w, t)—and consequentlyalso B∗(w)—contains 2k vertices of B(w′) since these vertices have the largest(w, Γ (t))B-count. Thus, if |B(w) ∩ B(w′)| ≥ 2k, the rules for node w add 2kvertices of B∗(w) to B∗(w′), i.e., |B∗(w) ∩ B∗(w′)| ≥ 2k. Note that by ourdefinition B(w) = B∗(w) holds for each small bag B(w). We also can conclude:

Lemma 5. Let v be a vertex of G, w′ be a node of T ∗ with v ∈ B∗(w′), andw′′ be the node of lowest depth with v ∈ B(w′′). Then v ∈ B∗(w) holds for eachnode w on the path from w′ to w′′ in T ∗.

Page 206: Graph-Theoretic Concepts in Computer Science

196 F. Kammer and T. Tholey

Proof. Since B(w) and B∗(w) share the same terminals, Lemma 5 holds if v is aterminal. If it is not, we merely need to show that, for each node w on the pathfrom w′ to w′′ in T with v ∈ B(w), the following holds: if w has a father x withv ∈ B(x), we also have v ∈ B∗(x). Since B∗(x) = B(x) if B(x) is small, we onlyneed to consider the case, where B(x) is big. Let us consider the case, whereB(w) is small. Because of v ∈ B∗(w) there is a t ∈ I(w) for which v ∈ D(w, t) orv ∈ D(x, t) holds. Since |B(w)| ≤ 2k, v ∈ D(w, t)∩B(x) also implies v ∈ D(x, t).Consequently, v ∈ B∗(x). Let us finally consider the case where both, B(w) andB(x), are big. If the insertion rule for x inserts v into B∗(w), we have v ∈ B∗(x).Otherwise, the only reason for v being contained in B∗(w) is that v ∈ D(w, t)for a terminal t ∈ I(w). Then v must also be one of the vertices with the 2klargest (x, Γ (t))B-counts and therefore is also contained in B∗(x). �

Corollary 6. For each vertex v of G, the subtree of T ∗ induced by the nodes wwith v ∈ B∗(w) is connected.

Let G∗ be the graph obtained from G by removing all vertices v and all edges{v1, v2} from G for which there is no longer any node w with v ∈ B∗(w) and{v1, v2} ⊆ B∗(w), respectively.

Lemma 7. (T ∗, B∗) is a weak clique tree for G∗ of width 4k2 − 1.

Proof. By our construction and Corollary 6 all properties of a weak cliquetree hold for (T ∗, B∗). Concerning the treewidth, for the root r of T , we have|B∗(r)| ≤ |D(r)| ≤ 4k2 since |I(r)| = 2k. By our choice of r there is a ter-minal t1 with Γ (t1) = r. We have |D(w)| ≤ 4k2 − 2k for all nodes w = r inT since the subtree of T rooted in w does not contain Γ (t1). Consequently,|B∗(w)| ≤ 4k2. �

Lemma 8. The k-DPP has a solution on G if and only if this is true for G∗.

Proof. Clearly, an instance of the k-DPP is solvable on G if this true for G∗. Forthe reverse direction we merely need to show that a solution of the k-DPP on Gallows us to construct a good coloring of G∗ with respect to (T ∗, B∗). Moreover,for a legal coloring C and a pair of terminals t1 and t2 colored with c by C, letus call a pair of incident nodes w1 and w2 on the unique path from Γ (t1) toΓ (t2) a color break with respect to c (and C) if no vertex in B∗(w1) ∩ B∗(w2)is colored with c. Let C be the set of all legal colorings of G that color at mosttwo vertices of each bag in (T ∗, B∗) with the same color. The solvability of thek-DPP implies C = ∅ since there exists—as shown in Section 2—at least onegood coloring with respect to (T, B) and since each good coloring is containedin C. In the reverse direction, our Lemma holds if there is a C ∈ C without anycolor break since C then is a good coloring of G∗ with respect to (T ∗, B∗).

Assume now that we can find no coloring in C without color breaks. Let uschoose a fixed numbering with 1, . . . , k for the colors assigned to the terminalsand a coloring C ∈ C such that the lowest number among the colors with a colorbreak is as large as possible. Moreover, if c is the color with the lowest numberfor which there is a color break and if t1 and t2 are the terminals of color c, we

Page 207: Graph-Theoretic Concepts in Computer Science

The k-Disjoint Paths Problem on Chordal Graphs 197

choose the coloring C ∈ C with the above properties such that there is a maximaldistance between Γ (t1) and the node wσ0 of the first color break (wσ0 , wσ0+1)on the path p = (w1, w2, w3, . . .) from Γ (t1) to Γ (t2) in T . Let v be a vertex ofcolor c with v ∈ B(wσ0 ) ∩B(wσ0+1) and v ∈ B∗(wσ0 ) ∩B∗(wσ0+1).

Assume |B∗(wσ0) ∩ B∗(wσ0+1)| < 2k. Then |B(wσ0 ) ∩ B(wσ0+1)| < 2k. Letw ∈ {wσ0 , wσ0+1} be the father of the other node w′ ∈ {wσ0 , wσ0+1} and t ∈{t1, t2}∩I(w′). We can conclude v ∈ D(w, t) and consequently v ∈ B∗(w). Since|B(wσ0 ) ∩ B(wσ0+1)| < 2k, the rule for w adds all vertices of D(w, t) ∩ B(w′)including v into B∗(w′), a contradiction to v ∈ B∗(wσ0 ) ∩B∗(wσ0+1).

Hence |B∗(wσ0 ) ∩B∗(wσ0+1)| ≥ 2k. Since no vertex in B∗(wσ0 ) ∩B∗(wσ0+1)is colored with c and since C is a coloring which uses each color at most twice ina bag of (T ∗, B∗) and thus in B∗(wσ0)∩B∗(wσ0+1), it follows that there must bean uncolored vertex in B∗(wσ0)∩B∗(wσ0+1). Let us define u to be the uncoloredvertex in B∗(wσ0 )∩B∗(wσ0+1) that among all uncolored vertices has the largest(wσ0+1, Γ (t2))B-count. We next show that we can construct a coloring C∗ ∈ Cwithout any new color breaks for the colors different from c for which—if it hasa color break with respect to c—the first such color break occurs after the pair{wσ0 , wσ0+1} on p. This leads to a contradiction to our choice of C and proofsour lemma.

After having initially set C∗ = C we modify C∗ as follows. First of all, wecolor u with c. We then define wσ−1 and wσ1 as the first and the last node on p,respectively, such that u ∈ B∗(wσ−1)∩B∗(wσ1). Let S be the set consisting of uand all vertices colored with c by C contained in a bag of {B(wσ−1), . . . , B(wσ1 )}.

Second, modify C∗ as follows: For the set X of all nodes reachable fromone of the nodes in {wσ−1 , . . . , wσ1} without visiting wσ−1−1 or wσ1+1, uncolorall c-colored vertices in B∗(X) apart from u, the vertex v′ ∈ S ∩ B∗(wσ−1)with the largest (wσ−1 , Γ (t1))B∗ -count, and the vertex v′′ ∈ S with the largest(wσ1 , Γ (t2))B-count. Note that v′′ ∈ B(wσ1+1) or wσ1 = Γ (t2).

Third, if v′′ ∈ B(wσ0+1) \ D(wσ0+1, t2), no vertex is colored with c by Cin D(wσ0+1, t2). Then, let u be the vertex of highest (wσ0+1, Γ (t2))B-count inD(wσ0+1, t2) not colored by C, let wσ2 be the last node on p with u ∈ B(wσ2),and let v′′′ be the vertex in B(wσ2) with C(v′′′) = c that among all such verticeshas the largest (wσ2 , Γ (t2))B-count. In particular, v′′′ ∈ B(wσ2+1) or we havewσ2 = Γ (t2) and v′′′ = t2. If v′′ ∈ B(wσ0+1) \D(wσ0+1, t2) and v′′ = u = u, so-called extra modifications of C∗ are required: For the set Y of all nodes reachablefrom one of the nodes in {wσ1 , . . . , wσ2} without visiting wσ1−1 or wσ2+1, changeC∗ by uncoloring v′′ and all c-colored vertices in B∗(Y ). See Fig. 1. (Some rangesare explained later in more detail.) Coloring v′ with c guarantees that there isno new color break between Γ (t1) and wσ0 on p.

Let us first consider the case, where no extra modifications are applied. Bycoloring v′′ with c we can guarantee that C∗ is a legal coloring. Hence, if C∗ doesnot belong to C, there is a bag B∗(w) containing u, v′, v′′ and |{u, v′, v′′}| = 3.By Corollary 6 we can choose w w.l.o.g. as a node on p. Due to our choice ofv′ we know that v′ ∈ B∗(wσ−1 ). There is no node w′ on the subpath of p fromwσ0+1 to Γ (t2) with v′ ∈ B∗(w′) since otherwise v′ ∈ B∗(wσ0 ) ∩ B∗(wσ0+1)

Page 208: Graph-Theoretic Concepts in Computer Science

198 F. Kammer and T. Tholey

by Corollary 6. Thus, w is on the subpath of p from Γ (t1) to wσ0 . Note thatv′′ ∈ B∗(w) implies v′′ ∈ B(w). We consider two subcases:

– wσ0+1 is the father of wσ0 . Since v′′ ∈ B(wσ1 ), we also have v′′ ∈ B(wσ0 ) ∩B(wσ0+1). Therefore, v′′ ∈ B∗(wσ0)∩B∗(wσ0+1) according to Lemma 5 andwe obtain a contradiction since (wσ0 , wσ0+1) is a color break.

– wσ0 is the father of wσ0+1. Since no extra modifications are applied and sinceu = v′′, we have v′′ /∈ B(wσ0+1) or v′′ ∈ D(wσ0+1, t2) ⊆ B∗(wσ0+1) or u = u.In the first case, v′′ has a smaller (wσ1 , Γ (t2))B-count than u. In the secondcase, we have v′′ ∈ B∗(wσ0 ) ∩ B∗(wσ0+1) by Corollary 6. If only the thirdcase holds, because of u ∈ D(wσ0+1, t2) and v′′ /∈ D(wσ0+1, t2), vertex u hasa larger (wσ1 , Γ (t2))B-count than v′′. Consequently, a contradiction occursin each case.

Let us finally assume that the extra modifications are being applied. Then u = uand hence u /∈ B∗(wσ0 ). Like in the previous case without extra modifications,v′ can not be contained in one of the bags B∗(wσ0+1), . . . , B∗(Γ (t2)). Thus,no bag of (T ∗, B∗) contains v′ and u. Since D(wσ0+1, t2) ∩ {v′′, u} = {u}, the(wσ0+1, Γ (t2))B-count of v′′ is smaller than that of u. Therefore and because ofv′′ ∈ B(wσ0+1), the (wσ1 , Γ (t2))B-count of v′′ is smaller than that of u. Notethat v′′′ /∈ B(wσ1 ) since otherwise v′′′ ∈ S and the fact that v′′′ ∈ B(wσ2+1)or v′′′ = t2 would imply that v′′′ has a larger (wσ1 , Γ (t2))B-count than that ofu and that of v′′. Thus, no bag of (T, B) contains u and v′′′. Consequently, C∗

colors at most two vertices in each bag of (T ∗, B∗). Our choice of v′′′ guaranteesthat C∗ is a legal coloring.

We have shown that C∗ ∈ C and that the distance between Γ (t1) and the firstnode of a color break on p with respect to c and C∗—if indeed there is a colorbreak—is larger than the corresponding distance for C. This is a contradictionto our choice of C. �

We can therefore solve the k-DPP on a chordal graph G as follows: we firstdetermine for each node w of T the set I(w) and subsequently all sets D(w, s)and D(w) (s ∈ I(w)). This can easily be done in a bottom-up traversal of T in at

v′

u

v′′

u

v′′′

Γ (t2)wσ1 wσ1+1 wσ2 wσ2+1wσ−1Γ (t1) wσ0 wσ0+1

∈ B∗ ∈ B, possibly ∈ B∗ possibly ∈ B,B∗ /∈ B∗, possibly ∈ B

Fig. 1. The ranges of the variables in the case where the extra modifications are applied.Black lines represent vertices uncolored by C.

Page 209: Graph-Theoretic Concepts in Computer Science

The k-Disjoint Paths Problem on Chordal Graphs 199

most O(m+ k3n) time. Hence, we can replace G and (T, B) by G∗ and (T ∗, B∗)in the same running time. We then apply the algorithm of the Section 2 on G∗.

Theorem 9. The k-DPP on chordal graphs with n vertices and m edges can besolved in O(m + (4k2)2k+1n) = O(m + (2k)4k+2n) time.

5 Hardness of the Disjoint-Paths Problem

Theorem 10. The disjoint-paths problem on chordal graphs is NP-hard.

Proof. We can prove the theorem by a reduction from a restricted case of 1-in-3 SAT. In 1-in-3 SAT we are given a formula in conjunctive normal formwith 3 variables per clause and we have to find an assignment of the variablessuch that exactly one of the three literals is true in every clause. A formula inconjunctive normal form is monotone if every literal is positive and it is cubic ifevery variable occurs exactly three times. In [10] it is shown that 1-in-3 SAT isNP-complete even on monotone and cubic formulas. We now reduce an instanceof 1-in-3 SAT consisting of a monotone and cubic formula F to an instance ofthe DPP on a chordal graph G. Fig. 2 should represent a clique tree of G. Eachsubgraph induced by the vertices of a bag should be a clique whose edges arecolored gray in Fig. 2—however, not all existing edges are shown in the figure.Black lines represent paths of length 0. Therefore, the endpoints of black linesrepresent the same vertex even if they appear in different shapes.

In detail, we construct G as follows: For each variable x and each clause C inF , we introduce a variable and a clause gadget, respectively, as shown in Fig. 2.A variable gadget has six terminals a1, a2, a3, b1, b2, b3 and a clause gadget sixterminals y1, y2, y3, z1, z2, z3. Each gadget is connected to one big clique Γ—seethe rightmost bag Fig. 2. Γ contains 6� vertices where � is the number of clauses.We next divide the terminals into pairs such that the resulting instance of theDPP has a solution if and only if F has a satisfying assignment. If a clauseC contains a variable x as the i-th variable and if it is the j-th occurrence ofvariable x in F that is part of C, the pairs (aj , yi) and (bj , zi) are added toour instance of the DPP, where the four terminals aj , bj, yi, and zi belong tothe gadgets for x and C. Moreover, we identify one triangular and one squarevertex in the gadget of x with one triangular and one square vertex, respectively,in the gadget of C different from the triangular and square vertices chosen forother variables or clauses. For a simpler notation, the terminals a1, a2 and a3

shown in Fig. 2 are called A-terminals and the remaining terminals B-, Y - andZ-terminals, respectively.

Let us consider a satisfying assignment of F . For a variable x, we constructin the gadget of x six paths from terminals to the triangular and square verticessuch that, if x is set to true, the paths starting in the A-terminals are routedexclusively to the triangular vertices; otherwise, they are routed exclusively tothe square vertices. Since each clause C has exactly one true variable, for eachclause gadget, exactly one path from an A-terminal to the gadget of C arrivesat a triangular vertex, whereas the other two paths from an A-terminal to the

Page 210: Graph-Theoretic Concepts in Computer Science

200 F. Kammer and T. Tholey

���

�� �

���

���

�� �

� �

�� �

� �

�� �

� �

���

�� �

� �

���

��

��

��

��

��

��

� ��

���

� ��

���

���

�� �

���

�� �

���

�� �

� ��

���

� ��

���

C2 x2

x4 C4

x3

C3

x1

C1

a1

b2

a2

b3

a3

b1

y1y2y3

z1z2z3

Fig. 2. Reduction from (x1 ∨ x2 ∨ x4)∧ (x1 ∨ x2 ∨ x3) ∧ (x2 ∨ x3 ∨ x4)∧ (x1 ∨ x3 ∨ x4)

gadget of C arrive at a square vertex. Thus, we can forward the three paths tothe Y -terminals of C. Similarly, we can forward the paths from the B-terminalsto the Z-terminals. Hence, we have found a solution to our instance of the DPP.

Let us now consider a solution of our DPP. It remains to show that F can besatisfied. In our construction, the number of vertices in the big clique Γ is equalto the number of pairs that have to be connected in our instance. Moreover, eachpath has to use at least one and therefore exactly one vertex of Γ . Note that foreach clause C and each variable x of C, Γ contains exactly two vertices commonwith the gadgets of C and x, respectively: one triangular and one square vertex.Thus, these two vertices must be the two vertices visited by the two paths con-necting two pairs of terminals in the gadgets of C and x. As a consequence, forany fixed variable gadget the paths starting from the A-terminals must pass ei-ther exclusively through the triangular vertices or exclusively through the squarevertices of this gadget—see the variable gadget in Fig. 2. We define a variable xof F to be true if the paths of the A-terminals from the gadget of x pass throughthe triangular vertices. Since the A-terminals are connected to the Y -terminals,exactly one path from an A-terminal uses a triangular vertex of each clausegadget, i.e., exactly one variable of each clause is set to true. �

References

1. Blair, J.R.S., England, R.E., Thomason, M.G.: Cliques and their separators intriangulated graphs, Tech. Report UT-CS-88-73, Dept. Comput. Sci., Universityof Tennessee, Knoxville (1988)

2. Buneman, P.: A characterisation of rigid circuit graphs. Discrete Math. 9, 205–212(1974)

Page 211: Graph-Theoretic Concepts in Computer Science

The k-Disjoint Paths Problem on Chordal Graphs 201

3. Fortune, S., Hopcroft, J., Wyllie, J.: The directed subgraph homeomorphism prob-lem. Theoret. Comput. Sci. 10, 111–121 (1980)

4. Fulkerson, D.R., Gross, O.A.: Incidence matrices and interval graphs. Pacific J.Math. 15, 835–855 (1965)

5. Gavril, F.: Algorithms for minimum coloring, maximum clique, minimum coveringby cliques, and maximum independent set of a chordal graph. SIAM J. Comput. 1,180–187 (1972)

6. Gavril, F.: The intersection graphs of subtrees in trees are exactly the chordalgraphs. J. Combin. Theory Ser. B 16, 47–56 (1974)

7. Karp, R.M.: On the computational complexity of combinatorial problems. Net-works 5, 45–68 (1975)

8. Krishnan, S.V., Pandu Rangan, C., Seshadri, S.: A new linear algorithm for thetwo path problem on chordal graphs. In: Kumar, S., Nori, K.V. (eds.) FSTTCS1988. LNCS, vol. 338, pp. 49–66. Springer, Heidelberg (1988)

9. Lynch, J.F.: The equivalence of theorem proving and the interconnection problem(ACM) SIGDA Newsletter 5, 31–36 (1975)

10. Moore, C., Robson, J.M.: Hard tiling problems with simple tiles. Discrete andComput. Geom. 26, 573–590 (2001)

11. Ohtsuki, T.: The two disjoint path problem and wire routing design. In: Saito, N.,Nishizeki, T. (eds.) Graph Theory and Algorithms. LNCS, vol. 108, pp. 207–216.Springer, Heidelberg (1981)

12. Okamoto, Y., Uno, T., Uehara, R.: Linear-time counting algorithms for indepen-dent sets in chordal graphs. In: Kratsch, D. (ed.) WG 2005. LNCS, vol. 3787, pp.433–444. Springer, Heidelberg (2005)

13. Perkovic, L., Reed, B.: An improved algorithm for finding tree decompositions ofsmall width. International Journal of Foundations of Computer Science (IJFCS) 11,365–372 (2000)

14. Perl, Y., Shiloach, Y.: Finding two disjoint paths between two pairs of vertices ina graph. J. ACM 25, 1–9 (1978)

15. Roberts, F.S.: Discrete Mathematical Models with Applications to Social, Biolog-ical, and Environmental Problems. Prentice Hall, Englewood Cliffs (1976)

16. Scheffler, P.: A practical linear time algorithm for disjoint paths in graphs withbounded tree-width, Report No. 396/1994, TU Berlin, FB Mathematik (1994)

17. Seymour, P.D.: Disjoint paths in graphs. Discrete Math. 29, 293–309 (1980)18. Shiloach, Y.: A polynomial solution to the undirected two paths problem. J.

ACM 27, 445–456 (1980)19. Thomassen, C.: 2-linked graphs. European J. Combin. 1, 371–378 (1980)20. Walter, J.R.: Representations of chordal graphs as subtrees of a tree. J. Graph

Theory 2, 265–267 (1978)

Page 212: Graph-Theoretic Concepts in Computer Science

Local Algorithms for Edge Colorings in UDGs

Iyad A. Kanj1, Andreas Wiese2, and Fenghui Zhang3

1 School of Computing, DePaul University, 243 S. Wabash Avenue, Chicago, IL60604, USA

[email protected] Institute fur Mathematik, Technische Universitat Berlin, Germany

[email protected] Department of Computer Science, Texas A&M University, College Station, TX

77843-3112, [email protected]

Abstract. In this paper we consider two problems: the edge coloring

and the strong edge coloring problems on unit disk graphs (UDGs).Both problems have important applications in wireless sensor networksas they can be used to model link scheduling problems in such networks.It is well known that both problems are NP-complete, and approximationalgorithms for them have been extensively studied under the centralizedmodel of computation. Centralized algorithms, however, are not suitablefor ad-hoc wireless sensor networks whose devices typically have limitedresources, and lack the centralized coordination.

We develop local distributed approximation algorithms for the edge

coloring and the strong edge coloring problems on unit disk graphs.For the edge coloring problem, our local distributed algorithm has ap-proximation ratio 2 and locality 50. We show that the locality upper boundcan be improved to 28 while keeping the same approximation ratio, at theexpense of increasing the computation time at each node. For the strong

edge coloring problem on UDGs, we present two local distributed al-gorithms with different tradeoffs between their approximation ratio andlocality. The first algorithm has ratio 128 and locality 22, whereas the sec-ond algorithm has ratio 10 and locality 180.

1 Introduction

The edge coloring problem is to color the edges of a given graph G using theminimum number of colors so that no two edges of the same color are adjacent.The strong edge coloring problem is to color the edges of a given graph Gwith the minimum number of colors so that no two edges with the same color areof distance less than 2. The edge coloring and the strong edge coloring

problems are known to be NP-complete even on restricted classes of graphs [4,9].Since both problems have numerous applications in networks where they modelchannel assignments/scheduling problems (see [1,2,3,7,11,12], among others), itis natural to seek approximation algorithms for them.

For the edge coloring problem, Vizing’s theorem [13] showed that any graphwith maximum degree Δ has an edge coloring that uses at most Δ + 1 colors;

C. Paul and M. Habib (Eds.): WG 2009, LNCS 5911, pp. 202–213, 2010.c© Springer-Verlag Berlin Heidelberg 2010

Page 213: Graph-Theoretic Concepts in Computer Science

Local Algorithms for Edge Colorings in UDGs 203

however, his result was nonconstructive. Misra and Gries [10] gave a polynomial-time constructive proof of Vizing’s theorem, thus showing that the problem canbe approximated to within an additive constant of 1. Ramanathan [11] gave a verysimple centralized greedy algorithm for the problem of ratio 2. Under the distribu-tive model of computation, Gandam et al. [3] gave a distributed approximationalgorithm based on Misra and Gries’ [10] constructive proof of Vizing’s theoremthat approximates the problem to within an additive constant of 1. Kodialam andNandagopal [7] gave a simple distributive algorithm of ratio 2, which was basedon the centralized greedy algorithm of Ramanathan [11].

For the strong edge coloring problem on planar graphs, Barrett el al. [1]gave a centralized algorithm that approximates the strong edge coloring

problem to ratio 17. This ratio has recently been improved to 2 by Ito et al. [5].The assumed underlying graph model and the assumed computational model

in the above results, however, do not seem appropriate for ad-hoc wireless sensornetworks. In wireless sensor networks, devices can in principal communicate ifthey are in each other’s transmission range. Therefore, a general graph model,or even a plane (embedded planar) graph model, is too flexible in the sense thatit does not reflect the restrictions on the connectivity of such networks. More-over, the topology of such networks undergoes constant change, and the devicesin those ad-hoc networks have limited energy/power. Therefore, any assumedcomputational model should take into account the decentralized nature of suchnetworks, and should be sensitive to issues such as scalability, robustness, andfault tolerance. In terms of the underlying graph model, when studying wire-less sensor networks, it is natural to embed them in a Euclidean metric space.A common simple embedding assumes that the space is two dimensional, andthat the transmission range of all devices is the same. In that case, the net-work is modeled as a Unit Disk Graph, abbreviated UDG henceforth, in theEuclidean plane: the nodes of the UDG correspond to the mobile wireless de-vices, and its edges connect pairs of nodes whose corresponding devices are ineach other’s transmission range equal to one unit. While this model is ideal-ized, it has the advantage of being easier to work with. Meaningful theoreti-cal and practical results can be derived under this model that, hopefully, willcarry (at least partially) to more general models. Moreover, there are real ex-amples where such models make sense: boats on water surfaces, vehicles in arelatively flat desert, etc.... In terms of the computational model, most of theabove issues (scalability, robustness, fault tolerance) can be dealt with under thelocal distributed computational model, as defined by Linial [8]. A distributedalgorithm is said to be k-local (where k ≥ 0 is an integer) if the computa-tion at each node of the graph depends solely on the initial state (in our casethe ID and coordinates) of the nodes at distance (number of edges) at mostk from the node (i.e., within k hops from the node). An algorithm is calledlocal if it is k-local for some integer constant k. Efficient local distributed algo-rithms are naturally fault-tolerant and robust because faults and changes can behandled locally by such algorithms. These algorithms are also scalable because

Page 214: Graph-Theoretic Concepts in Computer Science

204 I.A. Kanj, A. Wiese, and F. Zhang

the computation performed by a device is not affected by the total size of thenetwork.

Local distributed algorithms for the edge coloring problems on UDGs havebeen considered in [2]. However, the results in [2] only deal with a restrictedsubclass of UDGs called the “Yao-Like” subgraphs, and give an approximationalgorithm for the edge coloring problem within an additive constant of 1 fromthe optimal solution. For the strong edge coloring problem on UDGs, weare only aware of the distributed approximation algorithm given by Barrett [1]which achieves an O(1) ratio; however, this algorithm is distributed but not local.

In this paper we develop local distributed approximation algorithms for thethe edge coloring and the strong edge coloring problems on UDGs.For the edge coloring problem, we present a local distributed algorithm ofapproximation ratio 2 and locality 50; this algorithm works for a generalizationof UDGs, called quasi-UDGs. We show that the locality upper bound can beimproved to 28, while keeping the same approximation ratio, at the expense ofincreasing the computation time at each node. For the strong edge coloring

problem on UDGs, we present two local distributed algorithms with differenttradeoffs between their approximation ratio and locality. The first algorithm hasapproximation ratio 128 and locality 22, whereas the second algorithm has ratio10 and locality 180.

2 Definitions and Notations

We assume familiarity with the basic graph-theoretic notations and terminologies.Given a set of nodes S in the Euclidean plane, the Euclidean graph E on S is

the complete graph whose node-set is S. The unit disk graph, shortly UDG, Gon S is the subgraph of E with the same node-set as E , and such that (u, v) isan edge of G if and only if |(u, v)| ≤ 1, where |(u, v)| is the Euclidean length ofedge (u, v).

Let 0 < r ≤ 1 be a constant. The quasi-UDG on S with parameter r, is thesubgraph G of E with the same node-set as E , and such that for any two nodesu and v in G: if |(u, v)| ≤ r then |(u, v)| is an edge of G, if r < |(u, v)| ≤ 1 then(u, v) may or may not be an edge of G, and if |(u, v)| > 1 then (u, v) is not anedge of G. Clearly, a UDG is a quasi-UDG with r = 1.

Let H be a graph. We denote by V (H) and E(H) the set of nodes and theset of edges of H , respectively. The length of a path P in H , denoted |P |, is thenumber of edges in P . A shortest path between two nodes u and v in H is apath between u and v with the minimum length. A node v is said to be an i-hopneighbor of u in H , if the length of a shortest path between u and v in H is atmost i. If u is an i-hop neighbor of v in H , we will say that the hop distancebetween u and v in H is at most i. For a node u ∈ H , and a natural number i,define Ni[u] to be the set of i-hop neighbors of u in H .

For two edges e and e′ in H , the distance between e and e′ is the minimumlength of a path, among all paths in H connecting an endpoint of e to an endpointof e′. Two distinct edges are adjacent if their distance is 0, or equivalently, if they

Page 215: Graph-Theoretic Concepts in Computer Science

Local Algorithms for Edge Colorings in UDGs 205

share an endpoint. An edge coloring of H is an assignment of colors1 to the edgesin E(H) such that no two adjacent edges in H are assigned the same color. Astrong edge coloring of a graph H is an assignment of colors to the edges inE(H) such that no two edges of distance at most 1 are assigned the same color.A minimum edge coloring of H is an edge coloring of H that uses the minimumnumber of colors. Similarly, a minimum strong edge coloring of H is a strongedge coloring of H that uses the minimum number of colors.

An approximation algorithm for a minimization problem Q is an algorithmthat for each instance of Q computes a solution to the instance. The ratio of anapproximation algorithm for a minimization problem is the maximum value, overall instances of the problem, of the size of the solution to the instance returnedby the algorithm over the minimum-size solution to the instance.

The algorithms designed in this paper are k-local distributed algorithms. Eachnode in these algorithms starts by computing its k-hop neighbors, and performsonly local computations afterwards. For a fixed k, it was shown in [6] that thek-hop neighborhoods of the nodes in a UDG (or a quasi-UDG) can be computedby a local distributed algorithm in which the total number of messages sent byall the nodes in the UDG is O(n), where n is the number of nodes in the UDG.Therefore, the message complexity of each of the presented local distributedalgorithms is O(n).

3 Preliminaries

Let α > 2 be a constant. Fix an infinite square tiling (i.e., a grid) T of the planeof tile dimensions α× α.

Let T1 be the translation with vector (0, 0) (the identity translation), T2 thetranslation of vector (α/2, 0) (horizontal translation), T3 the translation of vec-tor (0, α/2) (vertical translation), and T4 the translation of vector (α/2, α/2)(diagonal translation). We have the following simple lemma whose proof can beeasily verified by the reader (note that α > 2).

Fact 3.1. Let G be a quasi-UDG, and let (u, v) be any edge in G. There existsa translation T in {T1, T2, T3, T4} such that the translations of the nodes u andv under T , i.e., T (u) and T (v), reside in the interior of the same tile of T .

The following lemma uses a folklore packing argument to bound the length of apath between two nodes in a UDG that reside within a region of bounded areaof the plane (see for example [14]).

Lemma 3.1. Let G be a quasi-UDG of parameter 0 < r ≤ 1. Let H be aconnected induced subgraph of G residing in a region R of the plane. Let R′ be aregion of area a′ that contains R such that for any node p in R the disk centeredat p and of radius r/2 is contained in R′. Then for any two nodes u and v ofH, there exists a path in H between u and v of length at most �8a′/(πr2)�.1 Without loss of generality, we shall assume that the colors are natural numbers.

Page 216: Graph-Theoretic Concepts in Computer Science

206 I.A. Kanj, A. Wiese, and F. Zhang

4 Edge Coloring

In this section we present a local distributed algorithm that approximates theedge coloring problem on quasi-UDGs which are a super class of UDGs. Theidea behind the algorithm is to tile the plane as discussed in Section 3, andthen to have the nodes residing in the same tile color the edges interior to theirtile using the greedy algorithm given in [7,11]. This is a proper coloring sincetwo edges contained in two distinct tiles are not adjacent. However, not everyedge in the graph is interior to a tile because an edge may cross the horizontalor vertical (or both) boundary of a tile. To deal with this issue, we affect anappropriate set of translations to the nodes so that, for any edge in the graph,its translation under at least one of the translations is contained in some tile.This ensures that every edge of the graph will eventually be colored appropri-ately. Implementing this algorithm under a centralized model of computationis straightforward. However, implementing this algorithm under a localized dis-tributed model poses some potential issues since the effect of the color of an edgeover other edges needs to be limited, and some consensus problems need to beresolved.

We use the tiling T described in Section 3. Let G be a quasi-UDG withparameter r, where 0 < r ≤ 1. Each node p ∈ G executes the algorithmEdgeColoring-APX given in Figure 1.

Lemma 4.1. The algorithm EdgeColoring-APX is a k-local distributed algo-rithm, where k = �(22α2 + 8r2 + 32αr)/(πr2)�.

1: p collects the coordinates of the nodes in Nk[p] in G, where k = �(22α2 + 8r2 +32αr)/(πr2)�

2: for round i = 1, 2, 3, 4 do3: let Gi(p) be a copy of the subgraph of G consisting of the set Ei(p) of uncolored

edges whose endpoints are in Nk[p], and such that, for any edge (u, v) ∈ Ei(p),Ti(u) and Ti(v) are in the same tile of T

4: let C1i (p), . . . , C�

i (p), where � ≥ 1, be the connected components of Gi(p)5: for j = 1, . . . , � do6: p orders all the edges in Cj

i (p) using the lexicographic order into the sequenceof edges Ej

i (p)7: for each edge e in Ej

i (p) do8: color e in Gi(p) with the smallest available color, i.e., the smallest color

that has not been used in the previous rounds to color any of the edgesadjacent to e

9: end for10: end for11: for each edge e ∈ Gi(p) incident on p do12: p colors e in G with the same color in Gi(p)13: end for14: end for

Fig. 1. The algorithm EdgeColoring-APX

Page 217: Graph-Theoretic Concepts in Computer Science

Local Algorithms for Edge Colorings in UDGs 207

Proof. It is clear that the computation at each node depends solely on the co-ordinates of its k-hop neighbors, where k = �(22α2 + 8r2 + 32αr)/(πr2)�. ��For each i ∈ {1, 2, 3, 4}, let Gi be the subgraph of G consisting of the edges(u, v) ∈ G such that Ti(u) and Ti(v) are in the same tile of T ; we call eachconnected component C in Gi an i-cluster, and we say that i is the label of C.Note that, by definition, any two distinct i-clusters are disjoint. A cluster is ani-cluster for some i ∈ {1, 2, 3, 4}. A sequence of clusters is said to be a poten-tial affecting sequence, if the labels of the clusters on this sequence are strictlyincreasing, and each two consecutive clusters in the sequence are adjacent, i.e.,share at least one node in G. Note that a potential affecting sequence of clustershas length at most 4. The notion of a potential affecting sequence will be usedto confine the “effect” of the color of an edge on the color of another edge, asshown by the following lemma whose proof is omitted for lack of space:

Lemma 4.2. Let S = (C1, C2, C3, C4) be a potential affecting sequence of clus-ters (we allow Ci, i ∈ {1, 2, 3, 4}, to be empty). Then for any two nodes u and vin S, u is a k-hop neighbor of v in G, where k = �(22α2 + 8r2 + 32αr)/(πr2)�and r is the parameter of the quasi-UDG G.

Lemma 4.3. The algorithm EdgeColoring-APX is an approximation algo-rithm of ratio 2 for the edge coloring problem on quasi-UDGs.

Proof. We first show that the algorithm computes an edge coloring of a givenquasi-UDG G.

Let u be a node in G. By Fact 3.1, every edge incident on u belongs to oneof the subgraphs Gi(u), i ∈ {1, 2, 3, 4}, defined in line 3 of algorithm. Since uapplies the greedy algorithm to the edges of Gi(u) coloring an edge in Gi(u)with a color that has not been used so far by an edge incident on it, node u willcolor its incident edges properly. Therefore, it suffices to show that for any edge(u, v), both u and v assign the same color to edge (u, v) to conclude that thecoloring of G by the algorithm is consistent, and hence is an edge coloring of G.

For an edge e ∈ G, define label(e) to be the minimum i ∈ {1, 2, 3, 4} such thate is contained in an i-cluster. We say that an edge e directly affects another edgee′ if e and e′ are adjacent and either label(e) < label(e′) or label(e) = label(e′)and e comes before e′ in the lexicographic order. We say that an edge e affectsan edge e′ if there exists an affecting sequence of edges (e = e0, e1, . . . , ej = e′)such that for � = 0, . . . , j − 1, e� directly affects e�+1. Observe that the labels ofthe edges in any affecting sequence must be non-decreasing. Therefore, all theedges with the same label i in an affecting sequence form a connected subgraphof G, and hence are contained within a single i-cluster. It follows that, for anyedge e ∈ G, any affecting sequence of edges containing e must be contained insome potential affecting sequence of clusters that contains e.

By looking at how the algorithm works, if the color of an edge e “influences”the color of an edge e′, then edge e affects e′. For a potential affecting sequence Sand an edge (u, v) in some cluster in S, both u and v in the algorithm collect thecoordinates of all their k-hop neighbors, where k = �(22α2 +8r2 +32αr)/(πr2)�.

Page 218: Graph-Theoretic Concepts in Computer Science

208 I.A. Kanj, A. Wiese, and F. Zhang

Therefore, by Lemma 4.2, both u and v have collected the coordinates of everynode in S. It follows that both u and v must assign edge (u, v) the same colorbecause both u and v have the coordinates of the endpoints of all edges affecting(u, v) and will color these edges in the same order using the same algorithm.

This shows that the algorithm computes a proper edge coloring of G.To prove that the algorithm has approximation ratio 2, let apxG be the number

of colors used by the algorithm to color the edges of G, and let optG be thenumber of colors in a minimum edge coloring of G. Note that optG ≥ Δ, whereΔ is the maximum degree of G. Let e = (u, v) be the edge with the highest colornumber, i.e., color(e) = maxe′∈E(G) color(e′). Let Δu and Δv be the degrees ofnodes u and v. Since color(e) is the smallest color number that is not used byany edge incident on u or v, it follows that color(e) ≤ (Δu − 1) + (Δv − 1) + 1.Since e has the highest color number among all edges in G, we have apxG ≤(Δu − 1) + (Δv − 1) + 1 ≤ 2 ·Δ− 1 ≤ 2 · optG − 1. ��Theorem 4.1. The algorithm EdgeColoring-APX is a k-local distributed ap-proximation algorithm for the edge coloring problem on quasi-UDGs, wherek = �(22α2 + 8r2 + 32αr)/(πr2)�, 0 < r ≤ 1 is the quasi-UDG parameter, andα > 2 is a constant. For a UDG (r = 1), and by choosing α to be slightly largerthan 2, the algorithm EdgeColoring-APX is a 50-local distributed approxima-tion algorithm for edge coloring of ratio 2.

The above upper bound on the locality of the algorithm (i.e., k) can be improvedby using smaller dimensions for the tiles; this will reduce the size of the regioncontaining any affecting sequence, and hence decrease the upper bound on k.However, if we decrease the dimensions of the tiles, the above set of translationswill no longer be sufficient to color all the edges in G (some edges may no longerreside in the interior of a tile under any of the above translations). To overcomethis problem, we will need to use a family of translations, rather than a singletranslation, along each of the horizontal, vertical, and diagonal, directions. Byfixing the dimensions of the tiles to be (1 + ε) × (1 + ε), where ε > 0 is aconstant, and picking an appropriate family of translations, we can prove that,in the worst case, any affecting sequence will be contained in a region whosearea is at most r2 + (3ε + 5)r + ε2 + 5ε + 5. This will give an upper bound of8(r2 + (3ε + 5)r + ε2 + 5ε + 5)/(πr2) on k. In Table 1 we show the values of kcorresponding to the values ε = 0.1, . . . , 0.9, and the asymptotic value of k whenε→ 0. We note that, as ε decreases, the number of translations needed increases,and hence, the local computation time at the nodes increases.

Theorem 4.2. For any constant ε > 0, there exists a k-local distributed approx-imation algorithm of ratio 2 for the edge coloring problem on quasi-UDGs,

Table 1. Locality for different tile sizes

ε 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 → 0k 48 45 43 41 38 36 34 32 30 28

Page 219: Graph-Theoretic Concepts in Computer Science

Local Algorithms for Edge Colorings in UDGs 209

where k = �8(r2+(3ε+5)r+ε2+5ε+5)/(πr2)�, and 0 < r ≤ 1 is the quasi-UDGparameter.

5 Strong Edge Coloring

In this section we present local distributed algorithms that approximate thestrong edge coloring problem on UDGs. Although the same approach usedfor the edge coloring problem—in the previous section—works for the strong

edge coloring problem, this approach does not lead to good bounds on the lo-cality of the algorithm. Therefore, we will adopt a different approach here. We notethat the techniques in this section can be extended to quasi-UDGs; however, forsimplicity, we restrict our attention to UDGs.

The local distributed algorithms we present use a centralized algorithm as abuilding block. We start by presenting this centralized algorithms.

5.1 The Centralized Algorithm

Barrett et al. [1] proposed a centralized greedy algorithm for approximating thestrong edge coloring problem on UDGs that works as follows. The nodesare first ordered using a lexicographic order. This lexicographic order on thenodes is used to induce a certain order on the edges (a bottom-up order). Theedges are then considered with respect to this order, and an edge e is coloredwith the smallest color that has not been used to color any edge of distance atmost 1 from e. If optG is the number of colors in a minimum strong edge coloringof G, then it was proved in [1] that the greedy algorithm computes a strong edgecoloring of G that uses at most 8optG + 1 colors. We will refer to the algorithmin [1] as the Centralized-StrongEdgeColoring algorithm.

We can show that, irrespective of the ordering in which the edges in G are con-sidered, the algorithm Centralized-StrongEdgeColoring produces a strongedge coloring of G that uses at most 10optG colors. This property will be essen-tial to bounding the approximation ratio of the algorithm we present in Subsec-tion 5.3. The proof of this upper bound on the ratio is very similar to the proofgiven in [1] that the algorithm Centralized-StrongEdgeColoring has ratio8optG + 1 when the specific bottom-up ordering is used.

Theorem 5.1. For any orderingO of the edges in G, the algorithm Centralized-StrongEdgeColoring, when it considers the edges in G with respect to the order-ing O, has approximation ratio 10.

5.2 The Local Distributed Algorithm

In this subsection we present a local distributed algorithm that approximates thestrong edge coloring problem on UDGs. The approach is similar in flavorto the one used in Section 4. Using a different approach, we shall improve onthe approximation ratio significantly at the expense of worsening the locality inSubsection 5.3.

Page 220: Graph-Theoretic Concepts in Computer Science

210 I.A. Kanj, A. Wiese, and F. Zhang

Consider the same rectilinear tiling T of the plane discussed in Section 4whose tiles are α×α squares, where α > 2. We can label the tiles in T with thelabels 1, 2, 3, 4, so that any two tiles with the same label are separated by atleast one tile. We denote by label(t) the label of a tile t ∈ T .

Fact 5.1. Let G be a UDG, and let e and e′ be two edges in G such that theendpoints of e reside in the interior of a tile t, and the endpoints of e′ reside inthe interior of a tile t′, where t = t′, and such that label(t) = label(t′). Then thedistance between e and e′ is at least 2.

Proof. (Sketch) The statement follows from the facts that: (1) any two differenttiles with the same label are separated by at least one tile, and (2) the dimensionof a tile is greater than 1. ��Let T1, T2, T3, and T4, be the translations described in Section 4, and note thatsince α > 2, Lemma 3.1 still holds true. Let C1

i , C2i , C3

i , and C4i , for i = 1, 2, 3, 4,

be 16 mutually disjoint color classes. We assume that each of the color classescontains enough colors to color the edges of G, and that the colors in each classare ordered from smallest to largest.

Suppose that A is a centralized approximation algorithm of ratio ρA for thestrong edge coloring problem on UDGs. Intuitively, the algorithm can besummarized as follows. The algorithm runs in 4 rounds, each round correspondsto one of the above translations. Different color classes are used in differentrounds to ensure that edges that are colored in different rounds do not conflict.In a given round i, translation Ti is applied to all the edges, and only the edgeswhose translations are interior to the tiles in T are colored as follows: the edgeswhose translations are in the same connected component of a tile of label jare colored with colors from class Cj

i , using the centralized algorithm A. Thisensures that edges whose translations end up in tiles of different labels are coloreddifferently. Since different tiles of the same label are far enough from each other,and the centralized algorithm A is used to color the edges within the same tile,edges that are colored in the same round are colored properly.

More formally, eachnodep inGapplies the algorithmStrong-Edge-Coloring-APX given in Figure 2.

Lemma 5.1. The algorithm Strong-Edge-Coloring-APX is a k-local dis-tributed algorithm, where k = �8(α + 1)2/π�.Lemma 5.2. The algorithm Strong-Edge-Coloring-APX computes a validstrong edge coloring of G.

Lemma 5.3. The algorithm Strong-Edge-Coloring-APX approximates thestrong edge coloring problem on UDGs to a ratio 16 · ρA, where ρA is theapproximation ratio of A.

Proof. Let j be the round among the 4 rounds of the algorithm in which themaximum number of colors, apxj , is used. It follows from the choice of j thatthe total number of colors used by the algorithm, call it apxG, is at most 4 ·apxj .

Page 221: Graph-Theoretic Concepts in Computer Science

Local Algorithms for Edge Colorings in UDGs 211

1: p collects the coordinates of the nodes in Nk[p] in G, where k = �8(α+ 1)2/π�2: for round i = 1, 2, 3, 4 do3: p applies translation Ti and computes its virtual coordinates under Ti

4: if Ti(p) is interior to some tile t0 with label �0 ∈ T , where �0 ∈ {1, 2, 3, 4}, pdetermines the set Si(p) of all the nodes in Nk[p] whose translations under Ti

reside in the same connected component as Ti(p) in the interior of tile t0; LetHi(p) be the subgraph of G induced by Si(p)

5: p applies the algorithm A to the subgraph Hj(p) to compute a strong edgecoloring of Hj(p), using only colors from the color class Cj

�0, and starting with

the smallest color in Cj�0

; if an edge e ∈ Hj(p) has already been colored in aprevious round, p overwrites the previous color of e

6: end for

Fig. 2. The algorithm Strong-Edge-Coloring-APX

Let �j be the label of the color class from which the maximum number of colors,apxj

�jis used in round j. Since there are 4 labels, it follows that apxj

�j≤ 4 ·apxj,

and hence, apxG ≤ 16 · apxj�j

. Let optG be the number of colors in a minimumstrong edge coloring of G.

From the way the algorithm works, in round j, every set of nodes S in Gwhose translations are in the same connected component in the interior of sometile with label �j, apply the algorithm A to compute a strong edge coloring of theedges of the subgraph of G induced by S, using the same set of colors Cj

�j, and

in the same order (all starting with the smallest color in Cj�j

). Therefore, thereexists a set of nodes Sj in G, whose translations reside in the same connectedcomponent in the interior of some tile, such that algorithm A uses apxj

�jcolors

to properly color the edges of the subgraph Hj induced by Sj . Since A hasapproximation ratio ρA, a minimum strong edge coloring of Hj requires at leastapxj

�j/ρA colors. Since Hj is an induced subgraph of G, a minimum strong edge

coloring of G requires at least apxj�j

/ρA colors. It follows that optG ≥ apxj�j

/ρA,and 16 · apxj ≤ 16 · ρA · optG. This shows that the algorithm properly colorsthe edges of G using no more than 16 · ρA · optG colors, and hence has ratio16 · ρA. ��

Theorem 5.2. There exists a 22-local distributed algorithm that, given a UDGG, computes a strong edge coloring of G using at most 128 · optG + 16 colors,where optG is the number of colors in a minimum strong edge coloring of G.

Proof. Since a node p in the algorithm Strong-Edge-Coloring-APX can con-sider the edges in Hp in any order, p can order these edges according to thebottom-up ordering used in [1]. Under this specific ordering, as was mentionedbefore, the algorithm Centralized-StrongEdgeColoring computes a strongedge coloring of Hp using at most 8 · optHp + 1 colors, where optHp is thenumber of colors in a minimum strong edge coloring of Hp. Using the algo-rithm Centralized-StrongEdgeColoring as the subroutineA in the algorithm

Page 222: Graph-Theoretic Concepts in Computer Science

212 I.A. Kanj, A. Wiese, and F. Zhang

Strong-Edge-Coloring-APX, and setting α to a value slightly larger than 2,the statement follows from Lemma 5.1, Lemma 5.2, and Lemma 5.3. ��

5.3 The Improved Algorithm

In this subsection we present a local distributed algorithm for the strong edge

coloring problem on UDGs with a smaller approximation ratio, but largerlocality, than the algorithm presented in Subsection 5.2. The algorithm uses thesame tiling T , but we require that α > 3. The tiles are labeled with the labels1, 2, 3, 4 as in Subsection 5.2.

Each node is assigned to the tile which contains it. Ambiguities caused bynodes on the boundaries of tiles are resolved by assigning them to the tile with thesmallest label which contains them (any other resolving method works as well).We observe that two tiles of the same label have a Euclidean distance more than3. Therefore, if we place a bounding square box of dimensions (α + 1)× (α + 1)centered at each tile, two bounding boxes of two tiles with the same label have aEuclidean distance larger than 1. Consequently, two edges contained in differentbounding boxes of two tiles with the same label have distance at least 2, andcan be colored in the same round. The improved algorithm is given in Figure 3.

1: p collects the coordinates of the nodes in Nk[p] in G, where k = �(32α2 + 80α +40)/π�

2: for round i = 1, 2, 3, 4 do3: let Gi(p) be a copy of the subgraph of G consisting of the set Ei(p) of uncolored

edges whose endpoints are in Nk[p], and such that, for any edge (u, v) ∈ Ei(p),u and v are in the bounding box of some tile of label i

4: p colors all the uncolored edges in Gi(p) using the algorithm Centralized-StrongEdgeColoring

5: for each edge e ∈ Gi(p) incident on p do6: p colors e in G with the same color in Gi(p)7: end for8: end for

Fig. 3. The algorithm Improved-StrongEdgeColoring-APX

Lemma 5.4. The algorithm is a k-local distributed algorithm, where k=�(32α2

+ 80α + 40)/π�, that computes a strong edge coloring of a given UDG.

Lemma 5.5. The algorithm is an approximation algorithm of ratio 10 for thestrong edge coloring problem on UDGs.

Proof. By Lemma 5.4, the algorithm Improved-StrongEdgeColoring-APXis an approximation algorithm for the strong edge coloring problem onUDGs. To prove that the algorithm has ratio 10, note that the algorithmImproved-StrongEdgeColoring-APX is equivalent to the algorithmCentralized-StrongEdgeColoring applied to the edges of G in the order theywere colored by the algorithm Improved-StrongEdgeColoring-APX. It fol-lows from Theorem 5.1 that the algorithm has ratio 10. ��

Page 223: Graph-Theoretic Concepts in Computer Science

Local Algorithms for Edge Colorings in UDGs 213

Theorem 5.3. Given a UDG G and a constant α > 3, the algorithm Improved-StrongEdgeColoring-APX is a a k-local distributed algorithm, where k =�(32α2 + 80α + 40)/π�, that computes a strong edge coloring of G using at most10optG colors, where optG is the number of colors in a minimum strong edge col-oring of G. By choosing α to be slightly larger than 3, the algorithm Improved-StrongEdgeColoring-APX is a 180-local distributed algorithm of ratio 10.

References

1. Barrett, C., Kumar, V., Marathe, M., Thite, S., Istrate, G.: Strong edge coloring forchannel assignment in wireless radio networks. In: PERCOMW 2006, pp. 106–110(2006)

2. Czyzowicz, J., Dobrev, S., Kranakis, E., Opatrny, J., Urrutia, J.: Local edge colour-ing of yao-like subgraphs of unit disk graphs. In: Prencipe, G., Zaks, S. (eds.)SIROCCO 2007. LNCS, vol. 4474, pp. 195–207. Springer, Heidelberg (2007)

3. Gandham, S., Dawande, M., Prakash, R.: Link scheduling in sensor networks: dis-tributed edge coloring revisited. In: INFOCOM, pp. 2492–2501 (2005)

4. Holyer, I.: The NP-completeness of edge-coloring. SIAM J. Comput. 10(4), 718–720(1981)

5. Ito, T., Kato, A., Zhou, X., Nishizeki, T.: Algorithms for finding distance-edge-colorings of graphs. J. Discrete Algorithms 5(2), 304–322 (2007)

6. Kanj, I., Wiese, A., Zhang, F.: Computing the k-hop neighborhoods locally. Tech-nical report # 08-007 at:http://www.cdm.depaul.edu/research/Pages/TechnicalReports.aspx

7. Kodialam, M., Nandagopal, T.: Characterizing achievable rates in multi-hop wire-less mesh networks with orthogonal channels. IEEE/ACM Trans. Netw. 13(4),868–880 (2005)

8. Linial, N.: Locality in distributed graph algorithms. SIAM J. Comput. 21(1), 193–201 (1992)

9. Mahdian, M.: On the computational complexity of strong edge coloring. DiscreteApplied Mathematics 118(3), 239–248 (2002)

10. Misra, J., Gries, D.: A constructive proof of vizing’s theorem. IPL 41 (1992)11. Ramanathan, S.: A unified framework and algorithm for channel assignment in

wireless networks. Wirel. Netw. 5(2), 81–94 (1999)12. Ramanathan, S., Lloyd, E.L.: Scheduling algorithms for multihop radio networks.

IEEE/ACM Trans. Netw. 1(2), 166–177 (1993)13. Vizing, V.: On the estimate of the chromatic class of p-graphs. Diskret. Analiz 3,

25–30 (1964)14. Wiese, A., Kranakis, E.: Local construction and coloring of spanners of location

aware unit disk graphs. Technical report # 07-18 at,http://www.scs.carleton.ca/~kranakis/Papers/TR-07-18.pdf

Page 224: Graph-Theoretic Concepts in Computer Science

Directed Rank-Width and Displit Decomposition�

Mamadou Moustapha Kanté1 and Michaël Rao2

1 LIMOS - Université Blaise Pascal, France2 LABRI - Université Bordeaux 1, [email protected], [email protected]

Abstract. Rank-width is a graph complexity measure that has manystructural properties. It is known that the rank-width of an undirectedgraph is the maximum over all induced prime graphs with respect to splitdecomposition and an undirected graph has rank-width at most 1 if andonly if it is a distance-hereditary graph. We are interested in an extensionof these results to directed graphs. We give several characterizations ofdirected graphs of rank-width 1 and we prove that the rank-width ofa directed graph is the maximum over all induced prime graphs withrespect to displit decomposition, a new decomposition on directed graphs.

1 Introduction

Rank-width [18,19] is a graph complexity measure introduced by Oum and Sey-mour in their investigations on recognition algorithms for undirected graphs ofclique-width [4] at most k, for fixed k. It is known that a class of graphs hasbounded rank-width if and only if it has bounded clique-width [19]. However,rank-width has better algorithmic properties: undirected graphs of rank-widthat most k can be recognized by a cubic-time algorithm [13] and are characterizedby a finite list of undirected graphs to exclude as vertex-minors [18].

Another interesting fact is that rank-width is related to split decomposition.The split decomposition, introduced by Cunningham [5], is a generalisation ofthe well known modular decomposition [10,16]. It was defined on graphs (directedor not), but only the undirected case has been widely studied in literature. Splitdecomposition of undirected graphs can be computed in linear time [7], and canbe used in several problems such as: circle graph recognition [9,21], parity graphrecognition [3,7], and solving some optimization problems [5,3,11,20]. The rank-width of an undirected graph is the maximum over the rank-width of its inducedprime graphs with respect to split decomposition. Moreover, undirected graphsof rank-width at most 1 are exactly distance hereditary graphs [18], which aregraphs that are completely decomposable by the split decomposition.

Despite all these positive results of rank-width on clique-width, clique-widthhas an undeniable advantage on rank-width: it is defined for undirected as wellas directed graphs and its definition can be extended to relational structures. In

� Research supported by the French ANR-project "Graph decompositions and algo-rithms" (GRAAL).

C. Paul and M. Habib (Eds.): WG 2009, LNCS 5911, pp. 214–225, 2010.c© Springer-Verlag Berlin Heidelberg 2010

Page 225: Graph-Theoretic Concepts in Computer Science

Directed Rank-Width and Displit Decomposition 215

his investigations for an extension of rank-width to relational structures, Kantédefined in [15] a notion of rank-width for directed graphs, called GF(4)-rank-width, and that generalized the rank-width of undirected graphs. He, moreover,generalized two results on undirected graphs: directed graphs of GF(4)-rank-width k can be recognized by a cubic-time algorithm and are also characterizedby a finite list of directed graphs to exclude as vertex-minors. It is thus natural toask whether we can generalize all the results known for rank-width of undirectedgraphs.

In this paper, we are interested in a characterization of directed graphs ofGF(4)-rank-width 1, similar to the one for undirected graphs. In the literature,there exist several characterizations of undirected graphs of rank-width 1 thatwe recall in the following.

Theorem 1 ([1,12,18]). Let G be a connected undirected graph. Then the fol-lowing conditions are equivalent:

1. G is completely decomposable by the split decomposition ( i.e., every node inthe split decomposition tree is degenerated).

2. G can be obtained from a single vertex by creating twins or adding pendantvertices.

3. G has rank-width 1.4. For every W ⊆ VG with |W | ≥ 4, G[W ] has a non trivial split.5. G is (house, hole, domino, gem)-free.6. G is distance hereditary ( i.e., for every x, y ∈ VG, every chordless path

between x and y has the same length).

The main result of this paper is the extension of Theorem 1 to directed graphs(Theorem 6). We will show in particular that directed graphs of GF(4)-rank-width 1 are obtained by orienting in a certain way distance hereditary graphsand are exactly directed graphs completely decomposable by the displit decom-position, a new decomposition that generalizes split decomposition. As a conse-quence we get that the GF(4)-rank-width of a directed graph is the maximumover the GF(4)-rank-width of its induced prime graphs with respect to displitdecomposition.

The paper is organized as follows. We give some notations in Section 2 andrecall the notion of GF(4)-rank-width in Section 3. In Section 4 we define thenotion of displit decomposition and derive some basic properties. In Section5 we prove our main result. We conclude by a comparison between the splitdecomposition of directed graphs introduced by Cunningham [5] and the displitdecomposition.

2 Preliminaries

When the context is clear we will write u to denote the set {u}. We denote by 2V

the power-set of a set V and we let � be the set of natural integers. A functionf : 2V → � is said symmetric if for any X ⊆ V, f(X) = f(V \X); it is saidsub-modular if for any X, Y ⊆ V, f(X ∪ Y ) + f(X ∩ Y ) ≤ f(X) + f(Y ).

Page 226: Graph-Theoretic Concepts in Computer Science

216 M.M. Kanté and M. Rao

diamondgemhousedomino

C ′k KkK1,k (star)Ck

For sets R and C, an (R, C)-matrix is a matrix where the rows are indexed byelements in R and columns indexed by elements in C. For an (R, C)-matrix M ,if X ⊆ R and Y ⊆ C, we let M [X, Y ] be the sub-matrix of M where the rowsand the columns are indexed by X and Y respectively. If M is an (X, Y )-matrix,M t denotes the transposed (Y, X)-matrix. A Y -vector is an (X, Y )-matrix where|X | = 1. The matrix rank function is denoted by rk.

A directed graph (or digraph) G is a couple (VG, EG) where VG is the set of ver-tices and EG, the set of edges, is a set of ordered pairs (x, y) with x, y ∈ VG andx = y. We consider undirected graphs as special cases of directed graphs where(x, y) ∈ EG ⇔ (y, x) ∈ EG (edges are denoted xy in this case). Unless otherwisespecified, a graph is considered as directed. If G is a digraph and x a vertex of G,we denote by N+

G (x) the set {y | (x, y) ∈ EG}, by N−G (x) the set {y | (y, x) ∈ EG}and by NG(x) the set N+

G (x) ∪N−G (x). The degree of x is |NG(x)|.For a graph G, we denote by G[X ] the sub-graph of G induced by X ⊆ VG and

we let G−X be the sub-graph G[VG\X ]. If G is a digraph, let u(G) be the undi-rected graph obtained from G by forgetting the directions of edges, i.e., u(G) =(VG, EG∪{(y, x) | (x, y) ∈ EG}). A digraphG is said strongly connected if for everypair x, y ∈ VG, there is a sequence x0 = x, x1, . . . xk = y such that (xi, xi+1) ∈ EG

for every i ∈ {0, . . . k − 1}, and it is said connected if u(G) is connected.An undirected graph is acyclic if it does not contain simple cycles of length

at least 3. A tree is an acyclic connected undirected graph. In order to avoidconfusions, the vertices of trees will be called nodes. The nodes of degree atmost 1 in trees are called leaves and denoted by LT . A sub-cubic tree is a treesuch that the degree of each node is at most 3.

A layout of a set V is a pair (T,L) of an undirected tree T and a bijectivefunction L : V → LT . For each edge (u, v) of T , we let Xuv be the set of leavesreachable from u by a path going through v. Each edge (u, v) of T inducesa bipartition {Xuv, LT \Xuv} of LT , and thus a bipartition {Xuv, V \Xuv} ={L−1(Xuv),L−1(LT \Xuv)} of V .

3 Rank-Width of Digraphs

In [15] Kanté defined a notion of rank-width for digraphs named GF(4)-rank-width. This notion is based on a function, called cut-rank function, that measures

Page 227: Graph-Theoretic Concepts in Computer Science

Directed Rank-Width and Displit Decomposition 217

how some bipartitions of sets of vertices are connected. The cut-rank function isbased on a representation of digraphs by matrices over the field GF(4). We recallthat GF(4) has four elements {0, 1, �, �2} with the property that 1 + �+ �

2 = 0and �

3 = 1 and is of characteristic 2.For a digraph G, we denote by MG the (VG, VG)-matrix over GF(4) where:

MG[x, y] =

⎧⎪⎪⎪⎨

⎪⎪⎪⎩

0 if (x, y) /∈ EG and (y, x) /∈ EG

� if (x, y) ∈ EG and (y, x) /∈ EG

�2 if (y, x) ∈ EG and (x, y) /∈ EG

1 if (x, y) ∈ EG and (y, x) ∈ EG.

For every subset X of VG, we let cutrk(4)G (X), called cut-rank function, be

rk(MG[X, VG\X]

).

Lemma 1 ([15]). For every digraph G, the function cutrk(4)G is symmetric and

sub-modular.

Definition 1 (GF(4)-Rank-Width). A sub-cubic layout of a digraph G is alayout (T,L) of VG where T is sub-cubic. Let (T,L) be a sub-cubic layout of adigraph G. The GF(4)-rank-width of an edge (u, v) of T is cutrk(4)

G (Xuv). TheGF(4)-rank-width of a sub-cubic layout (T,L) is the maximum GF(4)-rank-widthover all edges of T . The GF(4)-rank-width of G, denoted by rwd(4)(G), is theminimum GF(4)-rank-width over all sub-cubic layouts of G.

Observation 1. Since GF(4) is an extension of GF(2), for every undirectedgraph G, we have rwd(4)(G) = rwd(G), where rwd(G) denotes the rank-width ofG.

4 Displit Decomposition

4.1 Bi-Partitive Families

Two bipartitions {X1, X2} and {Y1, Y2} of a set V overlap if Xi ∩ Yj = ∅ forevery i, j ∈ {1, 2}.Definition 2 (Bi-Partitive Family). Let V be a finite set and let F be afamily of bipartitions of V . Then F is bi-partitive if:

– {∅, V } ∈ F ,– for all v ∈ V , {{v}, V \{v}} ∈ F and– for all {X1, X2} ∈ F and {Y1, Y2} ∈ F such that {X1, X2} and {Y1, Y2}

overlap, then {Xi ∩ Yj , V \(Xi ∩ Yj)} ∈ F , for every i, j ∈ {1, 2}.A member {X1, X2} of a bi-partitive family F is trivial if |X1| ≤ 1 or |X2| ≤ 1,and is strong if there is no {Y1, Y2} ∈ F such that {X1, X2} and {Y1, Y2} overlap.

Page 228: Graph-Theoretic Concepts in Computer Science

218 M.M. Kanté and M. Rao

Bi-partitive families have been studied in [6]. They are very close to partitivefamilies [2,16] introduced in order to generalize properties of modular decompo-sition. An example of a bi-partitive family is the family of splits1 in a stronglyconnected digraph [5]. The following proposition gives another example of abi-partitive family.

Proposition 1 (Folklore). Let f : 2V → � be a symmetric and sub-modularfunction and let m = min

∅�X�Vf(X). Then the family F = {{X, V \X} | f(X) =

m} is bi-partitive.

Proof. Let {X, V \X} and {Y, V \Y } be in F such that {X, V \X} and {Y, V \Y }overlap. Thus f(X ∩ Y ) + f(X ∪ Y ) ≤ 2m. Since X ∩ Y and X ∪ Y are non-empty, f(X ∩Y ) ≥ m and f(X ∪Y ) ≥ m. Thus f(X ∩Y ) = f(X ∪Y ) = m and{X ∩ Y, V \(X ∩ Y )} and {X ∪ Y, V \(X ∪ Y )} are in F . � A major result on bi-partitive families, that we recall in the following theorem,is that every bi-partitive family can be represented by a unique labeled tree.

Theorem 2. Let F be a bi-partitive family on a finite set V . Then there isa unique layout (T,L) of V , called the representative layout, such that eachinternal node of T has at least 3 neighbors, is marked degenerate, linear orprime and:

– For every (u, v) ∈ ET , the bipartition {Xuv, V \Xuv} is a strong bipartitionin F and there is no other strong bipartition in F .

– For every internal node u of T :• If u is degenerated, then for every ∅ � W � NT (u), the bipartition{∪v∈W Xuv, V \ ∪v∈W Xuv} is in F .• If u is linear, there is an ordering v1, . . . , vk of NT (u) such that for

every 1 ≤ i ≤ j < k, the bipartition {∪�∈{i,...,j}Xuv� , V \∪�∈{i,...,j}Xuv�}is in F .

– There is no other bipartition in F .

(By convention, an internal node of degree 3 is always degenerated.)

Remark 1. Theorem 2 is proved in [6] using a different formalism. It followsalso directly from results on partitive families [2,16] using the simple bijectionf(F) = {X ⊆ V \{v} | {X, V \X} ∈ F} between bi-partitive families on V andpartitive families on V \{v}, where v ∈ V is fixed.

Remark 2. If F is a bi-partitive family with the additional property:

– for all {X1, X2} ∈ F and {Y1, Y2} ∈ F such that {X1, X2} and {Y1, Y2}overlap, {X1ΔY1, X1ΔY2} ∈ F 2,

1 A split in a digraph G is a bipartition {X,VG\X} of VG, where ∅ � X � VG, suchthat for every u, v ∈ X, (N+

G (u) \ X �= ∅) ∧ (N+G (v) \ X �= ∅) ⇒ (N+

G (u) \ X =N+

G (v) \X), and (N−G (u) \X �= ∅)∧ (N−

G (v) \X �= ∅) ⇒ (N−G (u) \X = N−

G (v) \X).2 For two sets X and Y , we let XΔY be the set X\Y ∪ Y \X.

Page 229: Graph-Theoretic Concepts in Computer Science

Directed Rank-Width and Displit Decomposition 219

X0

Y�

Y1X1

X�

X�2

Y�2

Y0

Y(0,1)

Y(1,0)

Y(0,0)

Y(1,1)

X(0,1)

X(0,0)

X(1,1)

X(1,0)

Fig. 1. Schematic view of a displit (left) and a Cunningham’s split (right)

then F is said to be strongly bi-partitive. The representative layout of a stronglybi-partitive family has no linear node. Cunningham showed that the familyof splits in a connected undirected graph is strongly bi-partitive [5]. Anotherexample is the family of bi-joins in an undirected graph [17].

4.2 Displits

Definition 3 (Displit). Let G be a digraph. A bipartition {X1, X2} of VG is adisplit if X1 = ∅, X2 = ∅ and cutrk(4)

G (X1) ≤ 1.

Figure 1 shows a comparison between displits and splits on digraphs. A digraphG is degenerated (for the displit decomposition) if every bipartition of VG is adisplit, and G is prime if every displit in G is trivial. Finally G is linear if thereis an ordering x1, . . . , xn of its vertices such that the family of displits in G is{{{xi, . . . , xj}, VG\ {xi, . . . , xj}} | 1 ≤ i ≤ j < n}. By convention, a graph withat most 3 vertices is only degenerated.

By Proposition 1, the family of displits in a connected digraph is bi-partitive.By Theorem 2, this family can be represented by a unique labeled layout, thatwe call displit decomposition.

Observation 2. If {X1, X2} is a displit in G, then {X1, X2} is a split in u(G).The converse is not necessarily true.

4.3 Quotient Graphs

Let (T,L) be a displit decomposition of a connected digraph G and let u be aninternal node of T . We recall that for every node v in NT (u), Xuv is the set ofleaves reachable from u by a path going through v. The set {Xuv = L−1(Xuv) |v ∈ NT (u)} is a proper partition of VG, and for every v ∈ NT (u), {Xuv, VG\Xuv}is a displit.

For every v ∈ NT (u), we choose a vertex xv in Xuv such that xv is adjacentto a vertex in VG\Xuv. Such a xv always exists since G is connected. Let C(u)be the graph of vertex set NT (u) and of edge set {(v, w) | (xv, xw) ∈ EG}. It isworth noticing that C(u) is isomorphic to G[{xv | v ∈ NT (u)}], and that C(u)is not unique for a node u. Then we will consider C(u) as an induced sub-graphof G. We now prove or state some technical lemmas.

Page 230: Graph-Theoretic Concepts in Computer Science

220 M.M. Kanté and M. Rao

Lemma 2. Let {X, Y } be a displit in G, and let x ∈ X and y ∈ Y such thatx is adjacent to y. Let {X ′, Y ′} be a bipartition of VG with Y ′ ⊆ Y . Thencutrk(4)

G (Y ′) = cutrk(4)G′ (Y ′), where G′ = G[Y ∪ {x}].

Proof. Obviously cutrk(4)G′ (Y ′) ≤ cutrk(4)

G (Y ′). By definition of displits, there isan X-vector A and a Y -vector B such that MG[X, Y ] = At ·B. Since x is adjacentto a vertex in Y , A[x] = 0. Thus MG[X, Y ′] = A[x]−1 ·At ·MG[{x}, Y ′]. There-fore, rk(MG[X ′\(X\{x}), Y ′]) = rk(MG[X ′, Y ′]) since all rows in MG[X, Y ′] aregenerated by the row MG[{x}, Y ′]. � Lemma 3. Let (T,L) be a displit decomposition of a digraph G and let u be anode of T . If u is prime (resp. degenerated, linear), then C(u) is prime (resp.degenerated, linear).

Proof. Let {X, Y } be a bi-partition of VC(u), let X ′ = ∪v∈XXuv and let Y ′ =VG\X ′. We show that {X, Y } is a displit in C(u) if and only if {X ′, Y ′} is adisplit in G. Trivially, if {X ′, Y ′} is a displit in G, then {X, Y } is a displit inC(u).

Now suppose that {X, Y } is a displit in C(u). {X ′, Y ′} does not overlap{Xuv, VG\Xuv} for every v ∈ NT (u). We apply |NT (u)| times Lemma 2, for all{Xuv, VG\Xuv}. Thus {X ′, Y ′} is a displit if and only if {X, Y } is a displit. � The following lemmas give characterization of degenerated and linear digraphs.(Proofs are omitted.)

Lemma 4. If G is degenerated with at least 4 vertices, then either u(G) is astar, or G is C′3 where each of the 3 vertices is substituted by a complete graph(maybe with 0 vertex).

Lemma 5. If G is linear and has at least 4 vertices, then there is an ordering(x1, . . . , xn) of vertices of VG, and a function f : VG → {0, 1, 2} such that for allj > i:

– (xi, xj) ∈ EG if f(xi) ≡ f(xj) (mod 3) or f(xi) ≡ f(xj) + 1 (mod 3),– (xj , xi) ∈ EG if f(xi) ≡ f(xj)− 1 (mod 3) or f(xi) ≡ f(xj) + 1 (mod 3),– there are no other edges in the graph.

Theorem 3. Let G be a connected digraph with at least 3 vertices, and let (T,L)be its displit decomposition. Then rwd(4)(G) = max{rwd(4)(C(u)) | u ∈ VT \LT }.Proof. Let m = max{rwd(4)(C(u)) | u ∈ VT \LT}. Obviously m ≤ rwd(4)(G)(since C(u) is an induced sub-graph of G). For every u ∈ VT \LT , let (Tu,Lu) bea sub-cubic layout of C(u) of GF(4)-rank-width at most m. We suppose w.l.o.g.that the Tu are pairwise disjoint. We construct a sub-cubic layout (T ′,L′) of G ofGF(4)-rank-width at most m. Let T ′ be the union of all Tu (for u ∈ VT \LT ), afterthe identification of the vertices u in Tv and v in Tu for every (u, v) ∈ ET−LT , andafter contraction of every vertex of degree 2. For all x ∈ VG, let L′(x) = Lu(L(x))where {u} = NT (L(x)).

It is not hard to see that (T ′,L′) is a sub-cubic layout of G. Moreover, byLemma 2, in T ′ every edge has GF(4)-rank-width at most m. �

Page 231: Graph-Theoretic Concepts in Computer Science

Directed Rank-Width and Displit Decomposition 221

4.4 Decomposition Algorithm

It is known that the split decomposition of an undirected graph can be computedin linear time [7], and the split decomposition of a digraph in time O(m log(n))[14]. We present here a simple O(nm) algorithm to compute the displit decom-position of a digraph. This algorithm is a simple adaptation of [9]. Due to spacelimitation, we present only the main lines, stated in the following two lemmaswithout proofs.

Lemma 6. Let x and y be two vertices of a connected digraph G. We can com-pute in time O(n + m) a non trivial displit {X, Y } such that x ∈ X and y ∈ Y(if it exists).

Lemma 7. Given a digraph G, we can compute in time O(nm) a family F ofnon overlapping displits such that for every displit {X, Y } in G, either {X, Y } ∈F , or there is a bipartition {X ′, Y ′} ∈ F such that {X, Y } and {X ′, Y ′} overlap.

The family constructed in the previous lemma contains obviously all strongdisplits in G. A final O(nm) procedure finds every non-strong displits in F . Thisleads to the following theorem.

Theorem 4. The displit decomposition of every digraph can be computed intime O(nm).

5 Digraphs of GF(4)-Rank-Width 1

In [15] Kanté defined a notion of vertex-minor for digraphs that extended theone for undirected graphs. He also characterized the class of digraphs of GF(4)-rank-width at most k in the following.

Theorem 5 ([15]). For each k, there is a finite list Ck of digraphs having atmost (6k+1 − 1)/5 vertices such that a digraph G has GF(4)-rank-width at mostk if and only if no digraph in Ck is isomorphic to a vertex-minor of G.

When k = 1, the digraphs to exclude as vertex-minors have at most 7 vertices.However, we do not know any polynomial-time algorithm that checks whethera given graph is a vertex-minor of another. We will give in this section severalcharacterizations of digraphs of GF(4)-rank-width 1. As a consequence we getan algorithm for recognizing digraphs of GF(4)-rank-width 1.

A vertex x of a digraph G is a pendant vertex of another vertex y if y is the onlyneighbor of x in G. Two vertices x and y of a digraph G are called dtwins if x andy verify one of the following exclusive conditions (A = N+

G−y(x), B = N−G−y(x)):

1. N+G−x(y) = A, N−G−x(y) = B or,

2. N+G−x(y) = B, N−G−x(y) = (B\A) ∪ (A\B) or,

3. N+G−x(y) = (A\B) ∪ (B\A), N−G−x(y) = A.

Page 232: Graph-Theoretic Concepts in Computer Science

222 M.M. Kanté and M. Rao

We say that a digraph is completely decomposable by the displit decomposition ifevery node in the displit decomposition is degenerated or linear. The main resultof this paper is the following theorem, analogous to Theorem 1.

Theorem 6. Let G be a connected digraph with at least 2 vertices. Then thefollowing conditions are equivalent:

1. G is completely decomposable by the displit decomposition.2. G can be obtained from a single vertex by creating dtwins or adding pendant

vertices.3. G has GF(4)-rank-width 1.4. For every W ⊆ V with |W | ≥ 4, G[W ] has a non-trivial displit.5. u(G) is distance-hereditary and for every W ⊆ V with |W | ≤ 5, we have

rwd(4)(G[W ]) ≤ 1.

Condition 5 gives a characterization of digraphs of GF(4)-rank-width 1 by for-bidden induced sub-graphs: a digraph has GF(4)-rank-width 1 if and only if it is(H, C)-free, where H is the set of digraphs G such that u(G) is a house, a gem,a domino or a hole (Ck, k ≥ 5), and C is the set of connected digraphs G with atmost 5 vertices such that rwd(4)(G) > 1 and for every x ∈ VG, rwd(4)(G−x) ≤ 1.

Before proving Theorem 6, let us state and prove two technical propositions.The following is immediate from the definitions.

Proposition 2. Let x and y be two vertices of a digraph G. Then {x, y} is adisplit if and only if x and y are dtwins or x is a pendant vertex of y or y is apendant vertex of x.

The following proposition is a straightforward adaptation of [18, Proposition7.1].

Proposition 3. Let x and y be dtwins of a digraph G such that G − x has atleast one edge. Then rwd(4)(G− x) = rwd(4)(G).

Proof. By definition of GF(4)-rank-width we have rwd(4)(G − x) ≤ rwd(4)(G).We will prove that rwd(4)(G−x) ≥ rwd(4)(G). Let (T,L) be a sub-cubic layout ofGF(4)-rank-width k = rwd(4)(G−x) of G−x. By definition, there is a bijectionL between VG−x and LT . Let v = L(y) and let u ∈ VT such that uv ∈ ET . Let T ′

be obtained from T as follows: VT ′ is the set VT ∪{u′, w} (where u′ and w are twonew nodes) and ET ′ the set (ET \{uv}) ∪ {uu′, u′v, u′w}. We let L′ : VG → LT ′

be such that L′(x) = w and for every z ∈ VG\x, L′(z) = L(z).It is clear that (T ′,L′) is a sub-cubic layout of G. We claim that the GF(4)-

rank-width of (T ′,L′) is equal to the GF(4)-rank-width of (T,L).It is clear that the GF(4)-rank-width of the edges u′v and u′w are at most

1. Since x and y are dtwins, the GF(4)-rank-width of the edge uu′ is at most 1(Proposition 2). Moreover, the other edges of T ′ are in T , then their GF(4)-rank-width in (T ′,L′) is equal to their GF(4)-rank-width in (T,L) (Lemma 2). SinceG−x has at least one edge we have rwd(4)(G−x) ≥ 1. Therefore rwd(4)(G−x) ≥rwd(4)(G). �

Page 233: Graph-Theoretic Concepts in Computer Science

Directed Rank-Width and Displit Decomposition 223

We can now begin the proof of Theorem 6.

Proof (Proof of Theorem 6). 1→ 2). By induction on |VG|. It is trivial if |VG| ≤ 2.Otherwise, let (T,L) be the displit decomposition of G, and let u be a leaf in T −LT . If u is degenerated, let {v, w} ⊆ NT (u)∩LT . Otherwise, u is linear and has atleast 4 neighbors. Let v1, . . . vk be its ordering. If NT (u)\LT ⊆ {v2, . . . , vk−1},take v = v1 and w = vk. Otherwise, take v = v2 and w = v3. In all cases,{L−1({v, w}), VG\L−1({v, w})} is a displit. By Proposition 2, either x = L−1(v)and y = L−1(w) are dtwins, or one is a pendant vertex of the other. If x and yare dtwins or x is a pendant vertex of y, we let G′ = G−x, otherwise G′ = G−y.By induction G′ is obtained from a single vertex by creating dtwins or addingpendant vertices.

2 → 3). By induction on |VG|. It is trivial if |VG| ≤ 2. Otherwise, let x ∈ VG

be the last added vertex. If x is a pendant vertex, let {y} = NG(x), otherwiselet y be the dtwin of x. By induction, rwd(4)(G − x) = 1. Using Proposition 3,rwd(4)(G) = 1.

3 → 4). If rwd(4)(G) ≤ 1, then for every W ⊆ VG, rwd(4)(G[W ]) ≤ 1. When|W | ≥ 4, a sub-cubic layout of G[W ] has an edge (u, v) such that {Xuv, V \Xuv}is non-trivial, and thus G[W ] has a non-trivial displit.

4 → 1). Suppose that G is not completely decomposable. Then the displitdecomposition of G has a prime node u. By definition of a representative layout,the degree of u is at least 4. By Lemma 3, the quotient graph C(u) is prime andis an induced sub-graph of G with at least 4 vertices.

3 → 5). By Observation 2, rwd(u(G)) = 1 since the layout of GF(4)-rank-width 1 for G is a layout of rank-width 1 for u(G). Thus by Theorem 1, u(G) isdistance hereditary. Moreover, for every W ⊆ V , we have rwd(4)(G[W ]) ≤ 1.

5→ 3). Due to space limitation we will give only a sketch of the proof. Supposethat G is a digraph such that rwd(4)(G) > 1 and such that u(G) is distancehereditary. Let W be a minimal subset of VG such that rwd(4)(G[W ]) > 1.Working on the split decomposition of u(G[W ]), one can show successively that:

– u(G[W ]) has no pendant vertex,– if u(G[W ]) has a false twin, then G[W ] has at most 4 vertices,– if u(G[W ]) has no false twin and no pendant vertex, then u(G) is complete,– and if u(G[W ]) is complete, then G[W ] has at most 5 vertices.

Thus there is a W ⊆ VG of size at most 5 such that rwd(4)(G[W ]) > 1. � As a corollary of Theorems 4 and 6, we get an algorithm for recognizing digraphsof GF(4)-rank-width 1.

Corollary 1. Digraphs of GF(4)-rank-width 1 can be recognized in time O(nm).

6 Concluding Remarks

Differences with Cunningham’s split decomposition of digraphs. Cunninghamshowed that the family of splits in a strongly connected digraph is bi-partitive.

Page 234: Graph-Theoretic Concepts in Computer Science

224 M.M. Kanté and M. Rao

He also gave a characterization of degenerated and linear digraphs for the splitdecomposition: a digraph is degenerated for the split decomposition if and onlyif it is complete or is a star, and is linear if and only if it is a circle of transitivetournaments (CTT) [5].

The displit decomposition and the split decomposition of digraphs are bothgeneralization of the split decomposition of undirected graphs. A first differenceis that for the displit decomposition the graph has only to be connected.

The quotient graphs of the displit decomposition are induced sub-graphs ofthe original graph; this is not necessarily true for the split decomposition ofdigraphs.

Finally, the split decomposition and the displit decomposition are mutuallyexclusive. For all k ≥ 3, the graph C′k is linear for the split decomposition(and thus completely decomposable) since it is a CTT, but it is prime for thedisplit decomposition since u(C′k) is prime for the split decomposition. In theother hand, we can construct an infinite family of graphs linear for the displitdecomposition and prime for the split decomposition.

Links between bi-rank-width and Cunningham’s split decomposition. Kanté de-fined another digraph parameter called bi-rank-with, and showed relations be-tween GF(4)-rank-width and bi-rank-width [15]. A strongly connected digraphis completely decomposable by Cunningham’s split decomposition if and only ifit has bi-rank-width 2. It is open to find another characterization for digraphsof bi-rank-width 2.

Generalization to 2-structures. A 2-structure is a complete digraph with labelson edges. We mention that GF(4)-rank-width and displit decomposition can begeneralized to 2-structures over finite fields. For a field �, we obtain a decompo-sition for 2-structures over � with a characterization theorem similar to Theorem6. An interesting case is GF(3), which gives a decomposition theory for orientedgraphs (i.e., directed anti-symmetric graph).

References

1. Bandelt, H.J., Mulder, H.M.: Distance-Hereditary Graphs. Journal of Combinato-rial Theory, Series B 41(2), 182–208 (1986)

2. Chein, M., Habib, M., Maurer, M.C.: Partitive Hypergraphs. Discrete Mathemat-ics 37(1), 35–50 (1981)

3. Cicerone, S., Di Stefano, D.: On the Extension of Bipartite Graphs to ParityGraphs. Discrete Applied Mathematics 95(1-3), 181–195 (1999)

4. Courcelle, B., Olariu, S.: Upper Bounds to the Clique-Width of Graphs. DiscreteApplied Mathematics 101, 77–114 (2000)

5. Cunningham, W.H.: Decomposition of Directed Graphs. SIAM Journal on Alge-braic and Discrete Methods 3(2), 214–228 (1982)

6. Cunningham, W.H., Edmonds, J.: A Combinatorial Decomposition Theory. Cana-dian Journal of Mathematics 32, 734–765 (1980)

Page 235: Graph-Theoretic Concepts in Computer Science

Directed Rank-Width and Displit Decomposition 225

7. Dahlhaus, E.: Parallel Algorithms for Hierarchical Clustering and Applications toSplit Decomposition and Parity Graph Recognition. Journal of Algorithms 36(2),205–240 (2000)

8. Ehrenfeucht, A., Harju, T., Rozenberg, G.: The Theory of 2-Structures - A Frame-work for Decomposition and Transformation of Graphs. World Scientific, Singapore(1999)

9. Gabor, C.P., Hsu, W.L., Supowit, K.J.: Recognizing Circle Graphs in Polynomial-Time. Journal of the ACM 36(3), 435–473 (1989)

10. Gallai, T.: Transitiv orientierbare Graphen. Acta Mathematica Academiae Scien-tiarum Hungaricae 18(1-2), 25–66 (1967)

11. Gavoille, C., Paul, C.: Distance Labeling Scheme and Split Decomposition. DiscreteMathematics 273(1), 115–130 (2003)

12. Hammer, P., Maffray, F.: Completely Separable Graphs. Discrete Applied Mathe-matics 27(1-2), 85–99 (1990)

13. Hliněný, P., Oum, S.: Finding Branch-Decompositions and Rank-Decompositions.SIAM Journal on Computing 38(3), 1012–1032 (2008)

14. Joeris, B.L., Lundberg, S., McConnell, R.M.: O(mlogn) Split Decomposition ofStrongly-Connected Graphs. In: Proceedings of Graph Theory, Computational In-telligence and Thought. LNCS. Springer, Heidelberg (2008)

15. Kanté, M.M.: The Rank-Width of Directed Graphs (2009) (in revision)16. Möhring, R.H., Radermacher, F.J.: Substitution Decomposition for Discrete Struc-

tures and Connections with Combinatorial Optimization. Annals of Discrete Math-ematics 19, 257–356 (1984)

17. de Montgolfier, F., Rao, M.: The Bi-Join Decomposition. Electronic Notes in Dis-crete Mathematics 22, 173–177 (2005)

18. Oum, S.: Rank-Width and Vertex-Minors. Journal of Combinatorial Theory, SeriesB 95(1), 79–100 (2005)

19. Oum, S., Seymour, P.D.: Approximating Clique-Width and Branch-Width. Journalof Combinatorial Theory, Series B 96(4), 514–528 (2006)

20. Rao, M.: Solving some NP-complete problems using split decomposition. DiscreteApplied Mathematics 156(14), 2768–2780 (2008)

21. Spinrad, J.: Recognition of Circle Graphs. Journal of Algorithms 16, 264–282 (1994)

Page 236: Graph-Theoretic Concepts in Computer Science

An Algorithmic Study of Switch Graphs

Bastian Katz1, Ignaz Rutter1, and Gerhard Woeginger2

1 Faculty of Informatics, Universitat Karlsruhe (TH), KIT{katz,rutter}@iti.uka.de

2 Department of Mathematics and Computer Science, TU [email protected]

Abstract. We derive a variety of results on the algorithmics of switchgraphs. On the negative side we prove hardness of the following problems:Given a switch graph, does it possess a bipartite / planar / triangle-free/ Eulerian configuration? On the positive side we design fast algorithmsfor several connectivity problems in undirected switch graphs, and forrecognizing acyclic configurations in directed switch graphs.

1 Introduction

What is a switch graph? A switch s on an underlying vertex set V is a pair(ps, Ts) where ps ∈ V is the pivot vertex and where Ts ⊆ V is a non-empty setof target vertices. The vertex set V and some set S of switches on V togetherform a switch graph G = (V, S). A configuration of a switch graph is a mappingc : S → V such that c(s) ∈ Ts for all s ∈ S. The configuration selects exactly oneedge ec(s) := {ps, c(s)} for every switch s ∈ S, and thus yields a correspondingmulti-set Ec = {ec(s) : s ∈ S} of edges. The corresponding multi-graph isdenoted Gc = (V, Ec); see Fig. 1 for an illustration. Biologically speaking, aswitch graph represents the genotype of an entire population of graphs, and everyconfiguration specifies the phenotype of one concrete member in this population.

A brief history of switch graphs. Over the last 30 years a huge number of fairlyunrelated combinatorial structures has been introduced under the name switchgraph or switching graph; see the introduction of [5] for some pointers to the lit-erature. The switching graph model of Meinel [6] comes very close to the model

s1

s2

s3

s4

s5

s6

s1

s2

s3

s4

s5

s6

Fig. 1. To the left: A switch graph G with six switches, where s5 has only a singletarget. To the right: A configuration yielding a multigraph Gc.

C. Paul and M. Habib (Eds.): WG 2009, LNCS 5911, pp. 226–237, 2010.c© Springer-Verlag Berlin Heidelberg 2010

Page 237: Graph-Theoretic Concepts in Computer Science

An Algorithmic Study of Switch Graphs 227

that is investigated in this paper. Another somewhat restricted type of switchgraph has been introduced by Cook [1] who studied cyclic configurations as anabstraction of certain features in Conway’s game of life. In Cook’s model thevertices are not allowed to have degrees higher than three, and every switch hasan obligatory incident edge that must show up in every configuration. Reinhardt[8] essentially studies Cook’s model, but drops the constant degree constraint.Reinhardt constructs a polynomial-time O(|V |4) algorithm that decides whetherthere exists a configuration that contains a simple path between two prespecifiedvertices. He also links switch graphs to certain matching problems in computa-tional biology [9]. We note that Cook’s and Reinhardt’s switch graph modelscan both easily be emulated by our switch graph model.

Groote and Ploeger [5] concentrate on switch graphs with binary switches(where every target set contains two elements). Their work is motivated by cer-tain questions around the modal μ-calculus, and among other results they studythe complexity of certain graph properties on switch graphs. For instance theyshow that in directed binary switch graphs, one can decide in polynomial timewhether there is a configuration that connects (respectively disconnects) twoprespecified vertices. Our current paper was heavily inspired by the conclusionssection of [5]; our results in Theorems 3, 5, and 7 answer open questions thathave been posed in [5].

Results of this paper. Every graph property P naturally leads to a correspondingalgorithmic problem on switch graphs: Given a switch graph, does there exista configuration with property P? We will derive a collection of positive andnegative results for various graph properties.– It is NP-hard to decide whether a given switch graph has a configuration that

is (a) bipartite, (b) planar, or (c) triangle-free. The three hardness proofsare presented in Section 3.

– We establish a number of matroid properties for switch graphs that possessa connected configuration. This yields a simple O(|S| + |V |2) time greedyalgorithm for finding a configuration that minimizes the number of con-nected components (and of course also settles the question whether there isa connected configuration); see Section 4.

– We provide a fast algorithm to detect a configuration that connects two givenvertices in an undirected switch graph. This substantially improves the timecomplexity of Reinhardt’s result [8]; see Section 5.

– Finding a configuration in which all vertex degrees are even is easy, butfinding a configuration with an Eulerian cycle is NP-hard for forward directedswitch graphs as well as for undirected switch graphs. Moreover, it is NP-hardto find a configuration that is biconnected (for undirected switch graphs) orstrongly connected (for forward directed switch graphs); see Section 6.

– Deciding whether a forward directed switch graph allows an acyclic configu-ration can be done in linear time. In contrast to this, finding a configurationthat minimizes the number of directed cycles is NP-hard; see Section 7.

We stress that our negative results hold in the most restricted binary switchmodel, whereas our positive results apply to the general model.

Page 238: Graph-Theoretic Concepts in Computer Science

228 B. Katz, I. Rutter, and G. Woeginger

2 Basic Definitions

Let G = (V, S) be a switch graph. For a subset S′ ⊆ S of switches and aconfiguration c, we denote Ec(S′) = {ec(s) : s ∈ S′} and Gc(S′) = (V, Ec(S′)).We denote V (s) := Ts ∪{ps} and V (S′) :=

⋃s∈S′ V (s). For S′ ⊆ S and V ′ ⊆ V ,

we denote by S′(V ′) := {s ∈ S′ | V (s) ⊆ V ′} the set of inner switches of V ′.Observe that V (S′(V ′)) ⊆ V ′. A switch graph has fan-out k if |Ts| ≤ k for alls ∈ S. It is called binary if |Ts| ≤ 2 holds for all s ∈ S. Throughout we will usen := |V | and m := |S|.

Although the paper mainly deals with undirected graphs, all definitions easilycarry over to directed switches and directed multi-graphs. In a forward switchs = (ps, Ts), arcs must be directed from pivot to target. In a reverse switchs = (Ts, ps), arcs must be directed from target to pivot. A directed switch graphmay contain both, forward and reverse switches. A forward directed switch graphcontains only forward switches.

Note that all problems we consider in this paper ask for configurations of agiven switch graph with properties that can be tested in polynomial time. Sincethere are at most nm configurations, all NP-hard problems presented in thispaper are also NP-complete.

3 Bipartite, Planar, Triangle-Free Graphs

In this section, we show hardness of finding configurations that are bipartite,triangle-free or planar.

Theorem 1. For binary undirected switch graphs, it is NP-hard to decide ifthere is a bipartite configuration (SwitchBipartite).

Proof. We sketch a reduction from SetSplitting: Given a ground set X ={x1, . . . , xn} and a set T of 3-element subsets of X , it is NP-hard to decidewhether there is a partition of X into two sets X1, X2, such that every t ∈T has non-empty intersection with both, X1 and X2. For a given instance ofSetSplitting, we construct a switch graph G = (V, S), containing verticesx1, . . . , xn for the elements of X . For each triplet ti ∈ T we introduce a switchsi = (xj , ti − {xj}) for an arbitrary xj ∈ ti.

Every solution X1, X2 to SetSplitting yields a bipartite configuration: Colorthe vertices xi according to X1, X2. Then every triplet t contains both colors,which allows to set the corresponding switch to connect two vertices of distinctcolors. Conversely, every bipartition of some configuration Gc induces a biparti-tion of the xi. For any triplet in T , the switches prevent the corresponding threevertices from receiving all the same color, and thus the induced partition yieldsa solution to SetSplitting.

Theorem 2. For binary undirected switch graphs, it is NP-hard to decide ifthere is a triangle-free configuration (SwitchTriangleFree).

Page 239: Graph-Theoretic Concepts in Computer Science

An Algorithmic Study of Switch Graphs 229

x�1 x1 x1 x�

2 x2 x2 x�3 x3 x3 x�

4 x4 x4

v11 v1

2 v13 v2

1 v22 v2

3

(x1 ∨ x2 ∨ x3)∧(x2 ∨ x3 ∨ x4)

Fig. 2. Reduction of 3Sat to SwitchTriangleFree

Proof. The proof is by reduction from 3Sat. Let φ be an instance of 3Sat.Without loss of generality we assume that each clause contains three differentvariables. For each variable xi we create three vertices x�

i , xi and xi, and avariable switch si = (x�

i , {xi, xi}). For every clause Cj , we add three new verticesvj1, v

j2, v

j3. If the kth literal in clause Cj corresponds to variable xi, we introduce

an edge (vjk, {x�

i }). If it is xi, we introduce a switch (vjk, {vj

k+1, xi}). If it is xi, weintroduce a switch (vj

k, {vjk+1, xi}), defining vj

4 := vj1. See Fig. 2 for an example.

The variable switch intuitively picks the true literal. A clause switch can onlyconnect outside the clause, if its corresponding literal is satisfied. Consequently,in a satisfying truth assignment we can connect at least one switch of every clauseto the outside, thus avoiding all triangle. Conversely a triangle-free configurationspecifies a truth assignment for the variables such that every clause containsat least one satisfied literal. Otherwise, the corresponding clause switch wouldinduce a triangle.

Theorem 3. For binary undirected switch graphs, it is NP-hard to decide ifthere is a planar configuration (SwitchPlanar).

Proof. The proof is by reduction from monotone planar 3Sat. Planar 3Sat is awell-known NP-hard restriction of 3Sat where additionally the variable-clausegraph is assumed to be planar. Monotone planar 3Sat is even more restricted:the literals of each clause must be either all positive or all negative. Moreoverthe variable clause graph can be drawn in the plane without crossings such thatall the variables are on the x-axis, the clauses with positive literals are abovethe x-axis and the clauses with negative literals are below the x-axis. Monotoneplanar 3Sat is NP-hard [3].

Let φ be an instance of planar monotone 3Sat. For every variable x, weintroduce a variable gadget as depicted in Fig. 3 (a) with one variable switchsx and switches with pivots �i

x and �ix for every occurrence of a literal x or

x in a clause. For every clause C, we introduce a clause gadget as depicted inFig. 3 (b) which basically is a K5 of which three edges can be disabled by settinga switch appropriately. We identify the pivots of these switches (and the pivotsthemselves) with the vertices �i

x or �ix for the respective literal x or x and an i

induced by the drawing of φ. An example is given in Fig. 3 (c).A solution to φ induces a planar drawing by switching sx for a true x to x

and the switches with pivots �ix to the inner of the variable gadget, the switches

with pivots �ix to the inner of the clause gadget. For a false x, we set switches

Page 240: Graph-Theoretic Concepts in Computer Science

230 B. Katz, I. Rutter, and G. Woeginger

x

x

x�

(x1 ∨ x4 ∨ x5) ∧ (x2 ∨ x3 ∨ x4)∧(x1 ∨ x2 ∨ x3) ∧ (x3 ∨ x4 ∨ x5)

�1x�2x�...x

�1x�2x�...x

(a)

(b)

(c)

sx

�·x

�·y

�·z

tx

Fig. 3. Reduction of monotone planar 3Sat to SwitchPlanar

accordingly. Conversely, in a planar drawing at most two switches of a clausegadget may be switched to the inner of the clause, which otherwise would bea K5. If, in turn, some switch with pivot �i

x is switched to the inner of thevariable gadget, the switch sx must be switched to x, since otherwise contractionof the path tx�1

x . . . �ix would make the upper half of the variable gadget a K5.

Analogously, any switch with pivot �ix being switched to the inner of the variable

clause forces sx to be switched to x. ��

4 Global Connectivity

In this section we discuss the question whether a given switch graph G = (V, S)has a connected configuration. It turns out that this question has many tiesto matroid theory, which allows us to invoke some powerful machinery frommathematical programming.

First, we consider two matroids (E, I1) and (E, I2) that both have the sameground set E, which is the set of all the multi-edges over V that can possiblyresult from some switch in S. The set system I1 consists of all cycle-free subsets ofE. The set system I2 consists of all subsets of E that contain at most one multi-edge from each switch. Then (E, I1) forms a graphic matroid and (E, I2) formsa partition matroid. Obviously, the switch graph G = (V, S) has a connectedconfiguration, if and only if there exists a set E′ ⊆ E of cardinality n − 1 thatbelongs to both I1 and I2. This is a standard matroid intersection problem,which can be solved in polynomial time [4].

It is not hard to see that the intersection (E, I1 ∩ I2) itself does not form amatroid. In the following, we will model the problem in terms of a single ma-troid, which yields simpler and faster algorithms. Our approach is based on athird structure (S, I3) that is defined over the ground set S of switches. A sub-set S′ ⊆ S lies in I3, if there exists a configuration c such that Ec(S′) is cycle-free

Page 241: Graph-Theoretic Concepts in Computer Science

An Algorithmic Study of Switch Graphs 231

(or in other words, such that Ec(S′) belongs to I1). The sets in I3 are calledindependent sets.

Theorem 4. The structure (S, I3) forms a matroid.

Proof. Clearly the set system I3 contains the empty set and is closed undertaking subsets. It remains to show that for two independent sets A, B ⊆ S with|A| < |B|, there is an s ∈ B −A such that also A ∪ {s} is independent.

Since A and B are independent, there exist configurations a and b for whichthe corresponding edge sets Ea(A) and Eb(B) are cycle-free. Among all suchconfigurations a and b, we consider a pair that maximizes the number of switchesthat are in A ∩ B and that configure into the same edge both in configurationEa(A) and in configuration Eb(B); such switches are called good switches. SinceEa(A) and Eb(B) are cycle-free, they belong to I1 in the underlying graphicmatroid. Since |Ea(A)| = |A| < |B| = |Eb(B)|, there exists an edge e ∈ Eb(B)−Ea(A) such that Ea(A) ∪ {e} is cycle-free.

Let se ∈ B denote the switch that in configuration b generates edge e. Weclaim that this switch se cannot be in A: Otherwise configuration a would con-figure this switch se into an edge f . Then we can modify configuration a intoa new configuration c by switching se into e instead of f . The resulting edgeset Ec(A) is still cycle-free, whereas the number of good switches has increased.That is a contradiction. Hence se /∈ A, and A ∪ {se} is an independent set ofswitches. ��

Our next goal is to get a better understanding of independence in (S, I3).

Lemma 1. A set S′ ⊆ S is independent if and only if |T | < |V (T )| holds forall T ⊆ S′.

Proof. One direction of the proof is easy: If there is a T ⊆ S′ with |T | ≥ |V (T )|,then every configuration c induces a cycle on T since |Ec(T )| = |T | ≥ |V (T )|holds.

s3

s1

s2

s5

0

3

12

5

4

s4

Fig. 4. A proper switch sequence s1, . . . , s5 that eventually breaks the cycle. Switchesare reinserted changing s5, s4, s1.

Page 242: Graph-Theoretic Concepts in Computer Science

232 B. Katz, I. Rutter, and G. Woeginger

For the other direction of the proof, we consider a set S′ ⊆ S that containssome switch s ∈ S′ for which S′′ = S′ − {s} is independent. We will show thatthen either S′ itself is independent, or that it contains an appropriate subset Twith |T | ≥ |V (T )|. Indeed, since S′′ is independent there exists a configurationc for which Ec(S′′) is cycle-free. Adding an arbitrary edge e from switch s toEc(S′′) produces a configuration c for S′ whose edge set E := Ec(S′′) ∪ {e}contains a single cycle. Let C0 denote the connected component that containsthe cycle, and let V0 denote the set of all vertices in V (S′) that are not in C0.

We work through a number of removal phases. In the ith phase (i ≥ 1) weselect a switch si = (pi, Ti) that contributes an edge ei to component Ci−1, andwhose target set Ti contains a target t∗i in some set Vj(i) with 0 ≤ j(i) ≤ i−1. Weremove the edge ei from the edge set, and thus split component Ci−1 into twoconnected parts. The part containing the cycle becomes the new component Ci,and the vertices in the other (cycle-free) part form the set Vi. Then the (i+1)thremoval phase starts.

There are two possibilities how this process can terminate: Either (i) there isno appropriate switch with a target in V0, . . . , Vi−1, or (ii) removing the edgedestroys the cycle in component Ci−1. In case (i), we choose T as the set ofswitches in component Ci−1; then |T | ≥ |V (T )|, and we are done. In case (ii)we will show how to reinsert and how to reconfigure the removed edges andswitches step by step in reverse order sk, sk−1, . . . , s1 so that the resulting edgeset is cycle-free (here k denotes the number of the last phase).

Throughout we will maintain the following invariant: Just after the reconfigu-ration of switch si (1 ≤ i ≤ k), there exists an index �(i) with 0 ≤ �(i) < i, suchthat the vertex set V�(i) ∪

⋃h≥i Vh forms a cycle-free connected component with

respect to the current edge set. This component is called the crucial component;intuitively speaking we will make it grow until it covers all of V (S′). We startthe growing process with switch sk, which by definition has a target t∗k in theset Vj(k) with j(k) < k. By reinserting the edge {pk, t∗k} for switch sk and bysetting �(k) := j(k), we satisfy the invariant. In handling a switch si with i < kwe distinguish two cases: First, if i �= �(i + 1) then we simply reinsert its oldedge ei and keep �(i) := �(i + 1). This merges the vertices in Vi into the crucialcomponent while maintaining the invariant. In the second case i = �(i + 1). Weinsert the new edge {pi, t

∗i }, and set �(i) := j(i). This merges the vertices in

Vj(i) into the crucial component, and again maintains the invariant. This recon-figuration process eventually produces a cycle-free configuration for S′, and thuscompletes the proof. ��

The statement of Lemma 1 is combinatorial, but its proof is algorithmical andyields as a by-product a fast independence test for the matroid (S, I3): Givenan acyclic configuration of an independent set S′′ we can check in O(kn) timewhether a given switch s can be added to S′′ without destroying independence:The independence of S′′ implies that |S′′+s| ≤ n, which also bounds the numberof removal phases. To achieve selection of removable switches within a total ofO(kn) time, we direct all edges in Ec(S′) which are not part of the cycle to pointaway from it. Whenever a switch si is removed, we use this information to mark

Page 243: Graph-Theoretic Concepts in Computer Science

An Algorithmic Study of Switch Graphs 233

all vertices in Vi. Obviously, this only adds O(n) time. A switch s is a candidateif it has a marked target and both ps and c(s) are unmarked. A set of candidatescan be maintained in O(kn) total time.

If the test is positive, we obtain a corresponding cycle-free configuration forS′′ ∪ {s}. If the test is negative, we get the final component Ck−1 that containsthe cycle. Let U denote the set of all switches in S′′ that contribute an edge toCk−1. Then |U | = |V (Ck−1)| − 1, and none of the switches in U has a targetoutside of V (Ck−1). Hence in any cycle-free configuration of S′′ the switches inU induce a connected graph on V (Ck−1); such a set U of switches is called atight set. These ideas lead to the following theorem, which is the main result ofthis section. Note that it as a special case yields a polynomial-time algorithmfor recognizing switch graphs with connected configurations.

Theorem 5. For a given switch-graph with fan-out k, we can determine inO(km+ kn2) time a configuration that minimizes the number of connected com-ponents.

Proof. Any basis B of the matroid (S, I3) yields a cycle-free configuration withthe maximum number of edges, and hence a configuration with the minimumnumber of connected components; the switches not in B then can be set arbi-trarily. Hence it is enough to determine a basis, and this is done by the standardgreedy algorithm.

We start with the empty set, and test the switches one by one. If the test ispositive, we add the switch and update the cycle-free configuration. If the testis negative, we forget the switch and contract all switches in the correspondingtight set U . These contractions can be done in overall O(nα(n)) time by usinga union-find data structure. Every test on a non-trivial graph costs O(kn) time.Every positive test adds an edge to a cycle-free edge set; hence there are at mostn − 1 of these tests. Every negative test on a non-trivial graph contracts somevertices; hence there are at most n − 1 of these tests. Every negative test on atrivial graph (that has been contracted to a single vertex) costs O(k) time. Allin all, this yields the claimed time complexity. ��

5 Local Connectivity

In this section, we investigate configurations that connect two given vertices aand b by a path. In the following, we call a sequence of switches a forward path ifevery switch’s pivot is a target of its predecessor. A contraction of a switch s ina switch graph is defined as the switch graph identifying all vertices in Ts∪{ps}.Lemma 2. Let G = (V, S) be a switch graph and s be any switch such that in(V, S − s), there is a (possibly trivial) forward path from ps to b. Let G′ be theresult from contracting s. Then G can be switched to connect a and b if and onlyif this is possible for G′.

Proof. First, by contracting a switch, it is not possible to lose connectivity. Wewill thus assume that it is possible to find a configuration c′ that connects a and

Page 244: Graph-Theoretic Concepts in Computer Science

234 B. Katz, I. Rutter, and G. Woeginger

a b

ps

ta tb

Pa b

ps

ta tbx

a b

ps

ta tbx

Fig. 5. A path in G′c′ witnesses a path in Gc for some configuration c

b in G′ and show that this witnesses such a configuration c for G. We denotethe path in G′c′ as sequence of switches P . If P forms a single path in Gc′ , orif P connects either a or b to ps, finding a connecting configuration is trivial.Otherwise, P forms two paths, connecting a to some ta ∈ Ts and b to sometb ∈ Ts. In this situation, depicted in Fig. 5, we can make use of the fact thatin S − s, there is a forward path from ps to b. Its first switch is not part of P ,and we simply follow the forward path until we hit some vertex x on P . Now,switching the forward path from ps to x gives us a bypass on either ps − ta orps − tb and switching s accordingly connects a and b. ��This lemma provides a simple test for a-b-connectivity: If there is a configurationc that connects a and b in Gc, there either is a forward path from b to a or thereis a contractable switch, since there must be a first switch that is used “forward”on the path from a to b in Gc. The proof of Lemma 2 is constructive, naivelyimplemented, it yields an O(n2 + knm) time algorithm to test the existenceof and compute a connecting configuration by storing a forward path for eachcontraction. The time complexity can be further improved to almost linear (forthe proof, we refer the reader to the full paper):

Theorem 6. For a given switch-graph G = (V, S) with fan-out k and two ver-tices a, b ∈ V , we can determine in O(km + nα(n)) time, where α denotes theinverse Ackermann function, a configuration that connects a and b, if such aconfiguration exists.

6 Even Degrees and Eulerian Graphs

Lemma 3. For an undirected switch graph G = (V, S), a configuration in whichall vertex degrees are even can be detected in polynomial time.

Proof. We use the results of Cornuejols [2] on the general factor problem: Let(W, E) be an undirected graph, and for every v ∈ W let D(v) be a subset of{1, . . . , |W |}. Does there exist a subset F ⊆ E, such that in the graph (W, F )every vertex has its degree in D(v)? Cornuejols [2] shows that this problem canbe decided in polynomial time, as long as the sets D(v) do not contain any gapof length 2. (A set D of integers contains a gap of length 2, if it contains twoelements d1 and d2, such that d2 ≥ d1 + 3 and such that none of the numbersd1 + 1, . . . , d2 − 1 is in D.)

Page 245: Graph-Theoretic Concepts in Computer Science

An Algorithmic Study of Switch Graphs 235

For the proof of the lemma, construct a bipartite auxiliary graph between theset of switches and the set of vertices in the switch graph. Put an edge betweenany switch s and all targets in Ts. A vertex v ∈ V is called odd (even), if it is thepivot of an odd (even) number of switches. For any switch s ∈ S set D(s) = {1}.For any even vertex v ∈ V set D(v) = {0, 2, 4, . . .}, and for any odd vertexv ∈ V set D(v) = {1, 3, 5, . . .}. Note that none of these sets contains a gap oflength 2. It can be seen that the auxiliary graph has a factor obeying the degreeconstraints if and only if the graph G has a configuration in which all vertexdegrees are even. ��Theorem 7. For binary undirected switch graphs it is NP-hard to decide if thereis an Eulerian or a biconnected configuration. For forward directed switch graphsit is NP-hard to decide if there is an Eulerian or a strongly connected configu-ration.

Proof. We reduce from DirectedHamiltonianCycle which is known to beNP-hard for directed graphs with out-degree bounded by two [7].

Let G = (V, E) be a directed graph with out-degrees 1, 2. We define a switchgraph H = (V, S) as follows. For each vertex v ∈ V we add a switch sv =(v, N(v)) where N(v) = {u ∈ V | (v, u) ∈ E}. Now since for every configurationc, Hc has n vertices and n edges, the following properties are equivalent:

(i) G has a directed Hamiltonian cycle(ii) H has a directed Eulerian configuration as a directed switch graph(iii) H has a strongly connected configuration as a directed switch graph(iv) H has a biconnected configuration as an undirected switch graph(v) H has a Eulerian cycle as an undirected switch graph

7 Acyclic and Almost Acyclic Graphs

This section mainly deals with forward directed switch graphs (as defined inSection 2): We check in polynomial time whether such a graph has a DAG con-figuration, and we show that finding a configuration with the minimum numberof directed cycles is NP-hard.

Hence, let G = (V, S) be a forward directed switch graph, and observe thefollowing. First: The out-degree of every vertex in Gc is independent of the chosenconfiguration. Second: If all vertices in a digraph have out-degree at least 1, thenthe graph contains a directed cycle. Third: If G contains a sink v (that is, a vertexv with out-degree 0), then it is safe to configure all switches s with v ∈ Ts towardsthis sink. These three observations suggest a simple procedure: As long as thegraph contains a sink v, we first set c(s) := v for all switches s with v ∈ Ts, andthen remove v together with all these switches. The procedure either stops withan empty graph (and an acyclic configuration), or with a non-empty subgraph ofG in which all vertices have out-degree at least 1 (in which case there is no acyclicconfiguration). The algorithm can easily be implemented to run in linear time.In contrast, finding an acyclic configuration in general directed switch graphsand minimizing the number of cycles in forward directed switch graphs is hard.

Page 246: Graph-Theoretic Concepts in Computer Science

236 B. Katz, I. Rutter, and G. Woeginger

Theorem 8. For a forward directed switch graph, it can be decided in O(n+m)time if it has an acyclic configuration. If an acyclic configuration exists, it canbe found within the same time complexity.

Theorem 9. For a directed switch graph, it is NP-hard to decide if it has anacyclic configuration (SwitchDirectedAcyclic).

Proof. The proof is by reduction from 3Sat. Let φ be an instance of 3Sat withvariables x1, . . . , xn and clauses C1, . . . , Cm. We construct a switch graph Gφ asfollows: We start with two vertices z and w and the arc (w, z). For each variable xi

we create two corresponding vertices xi, xi and a reverse switch si = ({xi, xi}, w).For each clause Ci we add a vertex vi and the arc (z, vi). Let xu, xv, xw be thevariables occurring in clause Ci. We set �u = xu if xu occurs negated in Ci and�u = xu otherwise. We define �v, �w analogously. We then add a clause switchsC

i = (vi, {�u, �v, �w}). See Fig. 6 for an example.A satisfying truth assignment for φ yields an acyclic configuration c of Gφ: For

each variable xi we set c(si) = xi if xi is assigned the value true and c(si) = xi

otherwise. Since each clause of φ is satisfied in this configuration at least onetarget of every clause switch has out-degree 0. Hence every clause switch caneasily be configured to avoid all cycles.

Furthermore, an acyclic configuration c of Gφ yields a satisfying truth assign-ment for φ: We set variable xi to true if c(si) = xi and to false otherwise. Asthe configuration is acyclic every clause switch must have a sink as target, andthis sink represents a satisfied literal in the corresponding clause.

Note that although the clause switches have fan-out 3, the result also holds forbinary switch graphs, as we can replace each switch with fan-out 3 by two binaryswitches without affecting the number of cycles with respect to any configuration.

Theorem 10. For a forward directed switch graph G and an integer k > 0, itis NP-hard to decide if there is a configuration with at most k cycles (Switch-

MinimumDirectedCycles).

Proof. We show how to simulate binary reverse switches with usual binary for-ward switches at the cost of one cycle per reverse switch. Let G′ be an instance

x1 x1 x2 x2 x3 x3 x4

v1 v2

(x1 ∨ x2 ∨ x3)∧(x2 ∨ x3 ∨ x4)

x4

w

z

x x

w

xin xin

xoutxout

sx sx

Fig. 6. Reduction of 3Sat to SwitchDirectedAcyclic with reverse switches (left).Replacement of reverse switches for reduction of 3Sat to SwitchMinimumDirected-

Cycles (right).

Page 247: Graph-Theoretic Concepts in Computer Science

An Algorithmic Study of Switch Graphs 237

of SwitchDirectedAcyclic with k binary reverse switches. We construct adirected switch graph G by replacing each reverse switch s = ({x, x}, w) by theconstruction depicted in Fig. 6. As each replacement creates at least one cycleevery configuration of G has at least k cycles. Each replacement has four distinctconfigurations. Two of them directly correspond to a configuration of the origi-nal reverse switch, namely the ones where one of the vertices x, x is connectedto its in- and the other one to its out-vertex. We say that a configuration of Gis good for the replacement in this case. There is a bijection between the acyclicconfigurations of G′ and the configurations of G with k cycles that are good foreach replacement.

Let c be a configuration of G with k cycles. We can modify c such that itis good for each replacement without increasing the number of cycles: The casec(sx) = xout, c(sx) = xout can be excluded, as it would induce two cycles. Incase c(sx) = xin, c(sx) = xin we can change c(sx) := xout without increasing thenumber of cycles thus making c good for the replacement.

Acknowledgments. We thank Alexander Wolff for pointing us to switch graphproblems. We thank the anonymous referees for helpful comments.

References

1. Cook, M.: Still Life Theory. In: New Constructions in Cellular Automata, vol. 226,pp. 93–118. Oxford University Press, Oxford (2003)

2. Cornuejols, G.: General factors of graphs. Journal of Combinatorial Theory, SeriesB 45, 185–198 (1988)

3. de Berg, M., Khosravi, A.: Optimal binary space partitions (Manuscript) (2008)4. Edmonds, J.: Submodular functions, matroids, and certain polyhedra. In: Proceed-

ings of the Calgary International Conference on Combinatorial Structures and TheirApplications, Calgary, pp. 69–87 (1969)

5. Groote, J.F., Ploeger, B.: Switching graphs. In: Proceedings of the 2nd Workshopon Reachability Problems (RP 2008). ENTCS, pp. 119–135 (2008)

6. Meinel, C.: Switching graphs and their complexity. In: Kreczmar, A., Mirkowska,G. (eds.) MFCS 1989. LNCS, vol. 379, pp. 350–359. Springer, Heidelberg (1989)

7. Plesnik, J.: The NP-completeness of the Hamiltonian Cycle Problem in planar di-graphs with degree bound two. Information Processing Letters 8(4), 199–201 (1979)

8. Reinhardt, K.: The simple reachability problem in switch graphs. In: Nielsen, M.,Kucera, A., Miltersen, P.B., Palamidessi, C., Tuma, P., Valencia, F.D. (eds.) SOF-SEM 2009. LNCS, vol. 5404, pp. 461–472. Springer, Heidelberg (2009)

9. Sharan, R., Gramm, J., Yakhini, Z., Ben-Dor, A.: Multiplexing schemes for genericSNP genotyping assays. Journal of Comp. Biology 15, 514–533 (2005)

Page 248: Graph-Theoretic Concepts in Computer Science

Hardness Results and Efficient Algorithms forGraph Powers

Van Bang Le1 and Ngoc Tuy Nguyen1,2,�

1 Universitat Rostock, Institut fur Informatik, D-18051 Rostock, [email protected]

2 Hong Duc University, Thanh Hoa, [email protected]

Abstract. The k-th power Hk of a graph H is obtained from H byadding new edges between every two distinct vertices having distanceat most k in H . Lau [Bipartite roots of graphs, ACM Transactions onAlgorithms 2 (2006) 178–208] conjectured that recognizing k-th powersof some graph is NP-complete for all fixed k ≥ 2 and recognizing k-thpowers of a bipartite graph is NP-complete for all fixed k ≥ 3. We provethat these conjectures are true. Lau and Corneil [Recognizing powers ofproper interval, split and chordal graphs, SIAM J. Discrete Math. 18(2004) 83–102] proved that recognizing squares of chordal graphs andsquares of split graphs are NP-complete. We extend these results byshowing that recognizing k-th powers of chordal graphs is NP-completefor all fixed k ≥ 2 and providing a quadratic-time recognition algorithmfor squares of strongly chordal split graphs. Finally, we give a polynomial-time recognition algorithm for cubes of graphs with girth at least ten.This result is related to a recent conjecture posed by Farzad et al. [Com-puting graph roots without short cycles, Proceedings of STACS 2009,pp. 397–408] saying that k-th powers of graphs with girth at least 3k−1is polynomially recognizable.

1 Introduction and Results

In a graph H = (VH , EH), the distance dH(x, y) between two vertices x and yin H is the number of edges of a shortest path in G connecting x and y. Givena positive integer k, the k-th power of H , written Hk, is the graph obtainedfrom H by adding new edges between any pair of vertices at distance at mostk in H ; formally, Hk = (VH , {xy | 1 ≤ dH(x, y) ≤ k}). A graph G is the k-thpower of a graph H if G = Hk, and in this case, H is a k-th root of G. For thecases of k = 2 and k = 3, we say that H2 and H3 is the square, respectively,is the cube of H and H is a square root of G = H2, respectively, a cube root ofG = H3. Graph powers and roots are fundamental graph-theoretic concepts andhave been extensively studied in the literature, both in theoretic and algorithmic

� This author is supported by the Ministry of Education and Training, Vietnam, GrantNo. 3766/QD-BGD & DT.

C. Paul and M. Habib (Eds.): WG 2009, LNCS 5911, pp. 238–249, 2010.c© Springer-Verlag Berlin Heidelberg 2010

Page 249: Graph-Theoretic Concepts in Computer Science

Hardness Results and Efficient Algorithms for Graph Powers 239

senses; see, e.g., [1,4,8,9,10,11] for recent results and the numerous referenceslisted there.

Let k ≥ 2 be a given integer and let C be a given graph class. We consider thefollowing problems:

k-th power of graph

Instance: A graph G.Question: Does there exist a graph H such that G = Hk?

k-th power of C graph

Instance: A graph G.Question: Does there exist a graph H in C such that G = Hk?

In general, it is very unlikely that good characterizations of powers can existas Motwani and Sudan [14] proved that square of graph is NP-complete. In[9], Lau proved that square of bipartite graph is polynomially solvable butcube of bipartite graph and cube of graph are NP-complete. He thenstrongly believes that the following conjectures should be true:

Conjecture 1 ([9]). k-th power of graph is NP-complete for all fixed k ≥ 2.

Conjecture 2 ([9]). k-th power of bipartite graph is NP-complete forall fixed k ≥ 3.

Our first set of results (Theorems 4 and 5) consists of the proofs showing thatboth Conjectures 1 and 2 are indeed true. Moreover, our results in Section 5will imply, on the positive side, that cubes of bipartite graphs without cycles oflength at most eight can be recognized efficiently.

square of C graph remains NP-complete for various classes C, such aschordal graphs and split graphs [10]. Our next set of results (Theorems 6, 7,and 8) consists of the proof that k-th power of chordal graph is NP-complete for all fixed k ≥ 2 and, on the positive side, a good characterizationof squares of strongly chordal split graphs that leads to a quadratic-time algo-rithm for solving square of strongly chordal split graph. Notice that thecomputational complexity of k-th power of chordal graph was unknownbefore and k-th power of split graph is trivial for k ≥ 3; k-th powers ofsplit graphs, k ≥ 3, are exactly the complete graphs.

Very recently, square roots with girth conditions have been considered in [4];the girth of a graph is the smallest length of a cycle in the graph. It is shown in[4] that square of graph with girth ≤ 4 is NP-complete, while square of

graph with girth ≥ 6 is polynomially solvable; the case of square roots withgirth 5 still remains open. In [4], the following conjecture is proposed:

Conjecture 3 ([4]). k-power of graph with girth ≥ 3k−1 is polynomiallysolvable.

Our last set of results (Theorems 11 and 12) is related to Conjecture 3 andconsists of a good characterization of cubes of graphs with girth at least ten anda polynomial-time algorithm for solving cube of graph with girth ≥ 10.Moreover, our Theorem 11 will imply a good characterization of cubes of treesas well as of bipartite graphs without ‘short’ cycles.

Page 250: Graph-Theoretic Concepts in Computer Science

240 V.B. Le and N.T. Nguyen

In the last section we give our conclusion as well as discuss some open problems.

2 Preliminaries

All graphs considered are finite, undirected and simple. Since the power of agraph is the union of the powers of the connected components of that graph, wemay assume that all graphs considered are connected. The diameter of a graphis the maximum distance in the graph.

Let G = (VG, EG) be a graph. We often write xy ∈ EG for {x, y} ∈ EG.Following [14,10], we sometimes also write x↔ y for the adjacency of x and y inthe graph in question; this is particularly the case when we describe reductions inNP-completeness proofs. For disjoint sets of vertices X and Y , we write X ↔ Y ,meaning each vertex in X is adjacent to each vertex in Y ; if X = {x}, we simplywrite x↔ Y .

The neighborhood NG(v) in G of a vertex v is the set all vertices in G adjacentto v and the closed neighborhood of v in G is NG[v] = NG(v)∪ {v}. For U ⊆ VG

we write NG(U) =⋃

u∈U NG(u) and NG[U ] = NG(U)∪U . The k-th neighborhoodNk

G(v) of v is the set of vertices at distance k from v. Set degG(v) = |NG(v)|, thedegree of v in G. We call vertices of degree one end-vertices. A universal vertexis one that is adjacent to all other vertices.

A u, v-path is a path P connecting two vertices u, v; u and v are the end-vertices of P . For k ≥ 1, let Pk denote a chordless path with k vertices andk− 1 edges, and for k ≥ 3, let Ck denote a chordless cycle with k vertices and kedges. A complete graph is one in which every two distinct vertices are adjacent.A graph is chordal if it does not contain any induced C�, � ≥ 4.

A set of vertices Q ⊆ VG is called a clique in G if every two distinct verticesin Q are adjacent; a maximal clique is a clique that is not properly contained inanother clique. A vertex is simplicial if its neighborhood is a clique. C(G) denotesthe set of all maximal cliques of G. A stable set is a set of pairwise non-adjacentvertices. A graph is bipartite if its vertex set can be partitioned into two stablesets. A split graph is one whose vertex set can be partitioned into a clique and astable set. Clearly, split graphs are chordal. Given a set of vertices X ⊆ VG, thesubgraph induced by X is written G[X ] and G−X stands for G[V \X ].

Due to space limitations, most of the proofs are omitted.

3 Hardness Results

In proving NP-completeness results we will consider the well-known NP-completeproblem set splitting ([5, Problem SP4]), also known as hypergraph 2-

colorability.set splitting

Instance: Collection D of subsets of a finite set S.Question: Is there a partition of S into two disjoint subsets S1 and S2 such

that each subset in D intersects both S1 and S2?

Page 251: Graph-Theoretic Concepts in Computer Science

Hardness Results and Efficient Algorithms for Graph Powers 241

Throughout this section, we will consider the following small instance of set

splitting to illustrate our reductions:Example. S = {u1, u2, u3, u4, u5, u6, u7} and D = {d1, d2, d3} with d1 = {u2, u3,u4}, d2 = {u1, u5} and d3 = {u3, u4, u6, u7}. In this example, S1 = {u1, u2, u3}and S2 = {u4, u5, u6, u7} is a possible solution.

We will also make use of the tail structure, described first in [14] and generalizedlater in [9]. The tail structure of a vertex v enables us to pin down exactly theneighborhood of v in any k-th root H of G.

Lemma 1 ([9]). Let G = (VG, EG) be a connected graph with {v1, . . . , vk+1} ⊂VG where NG(v1) = {v2, . . . , vk+1} and NG(vi) ⊂ NG[vi+1] for all 1 ≤ i ≤ k.Then in any k-th root H of G, (1) NH(v1) = {v2}, (2) NH(vi) = {vi−1, vi+1}for all 2 ≤ i ≤ k, and (3) NH(vk+1)− vk = NG(v2)− {v1, . . . , vk+1}.The vertices v1, . . . , vk are ‘tail vertices’ of vk+1; see Figure 1 for an illustration.

Clique

v1 v2 vi vk

vk+1

vk+1

G = Hk

H

v1 v2 vi vk

Fig. 1. Tail in G and in k-th root H of G

We remark that k-th power of C graph is obvious in NP whenever recog-nizing C is polynomially because guessing a k-th root H , verifying if H is in Cand if G = Hk can be done in polynomial time. This is the case for all graphclasses considered in this paper.

We first prove that, for fixed k ≥ 3, k-th power of bipartite graph isNP-complete by reducing set splitting to it. Our reduction generalizes thosein [9] for cube of bipartite graph. Let S = {u1, . . . , un}, D = {d1, . . . , dm}where dj ⊆ S, 1 ≤ j ≤ m, be an instance of set splitting, and let k ≥ 3be a fixed integer. We construct an instance G = G(D, S) for k-th power of

bipartite graph as follows.The vertex set of G consists of:

– Ui, for all 1 ≤ i ≤ n. Each ‘element vertex’ Ui corresponds to the elementui in S.

– Dj , for all 1 ≤ j ≤ m. Each ‘subset vertex’ Dj corresponds to the subset dj

in D.

Page 252: Graph-Theoretic Concepts in Computer Science

242 V.B. Le and N.T. Nguyen

– D1j , . . . , D

kj , for all 1 ≤ j ≤ m. k ‘tail vertices’ D1

j , . . . , Dkj of the subset

vertex Dj.– P 1

1 , . . . , P k−21 and P 1

2 , . . . , P k−22 are k − 2 pairs of ‘partition vertices’.

– Connection vertex: X .

The edge set of G consists of:

– Edges of tail vertices:(E1) Dj , D

1j , . . . , D

kj form a clique;

(E2) For all 1 ≤ t ≤ k − 1: Dtj ↔ {Ui | ui ∈ dj , 1 ≤ i ≤ n};

(E3) For all 1 ≤ t ≤ k − 2: Dtj ↔ X , Dt

j ↔ {Dj′ | dj ∩ dj′ = ∅},Dt

j ↔ {P h1 | 1 ≤ h ≤ k − t− 1} and Dt

j ↔ {P h2 | 1 ≤ h ≤ k − t− 1};

(E4) For all 1 ≤ t ≤ k − 3: Dtj ↔ {Ui | 1 ≤ i ≤ n},

Dtj ↔ {Dh

j′ | 1 ≤ h ≤ k − t− 2, dj ∩ dj′ = ∅};(E5) For all 1 ≤ t ≤ k − 4: Dt

j ↔ {Dj′ | 1 ≤ j′ ≤ m};(E6) For all 1 ≤ t ≤ k − 5: Dt

j ↔ {Dhj′ | 1 ≤ h ≤ k − t− 4, 1 ≤ j′ ≤ m}.

– Edges of subset vertices:(E7) Dj ↔ {X, P 1

1 , . . . , P k−21 , P 1

2 , . . . , P k−22 },

Dj ↔ {Ui | 1 ≤ i ≤ n}, Dj ↔ {Dj′ | dj ∩ dj′ = ∅}.(E8) If k ≥ 4: Dj ↔ {Dj′ | 1 ≤ j′ ≤ m}.– Edges of element vertices:(E9) U1, . . . , Un form a clique, and Ui ↔ {X, P 1

1 , . . . , P k−21 , P 1

2 , . . . , P k−22 }.

– Edges of partition vertices:(E10) P 1

1 , . . . , P k−21 , X, U1, . . . , Un form a clique, P 1

2 , . . . , P k−22 , X, U1, . . . , Un

form a clique.(E11) For all 1 ≤ t ≤ k − 3, P t

1 ↔ {P h2 | 1 ≤ h ≤ k − t − 2}, P t

2 ↔ {P h1 | 1 ≤

h ≤ k − t− 2}.Clearly, G can be constructed from D, S in polynomial time. For an illustration,in case k = 4, the example instance yields the graph G is depicted in Figure 2.

In this and other figures, each ellipse corresponds to a clique and we omit theclique edges to keep the figures simpler. The two dotted lines from a vertex tothe cliques mean that the vertex is adjacent to all vertices in those cliques.

Lemma 2. If there exists a partition of S into two disjoint subsets S1 and S2

such that each subset in D intersects both S1 and S2, then there exists a bipartitegraph H such that G = Hk.

Proof. Let H have the same vertex set as G. The edges of H are as follows; seealso Figure 3.

– Edges of subset vertices and its tail vertices: For all 2 ≤ t ≤ k, Dtj ↔ Dt−1

j

and D1j ↔ Dj , and Dj ↔ {Ui | ui ∈ dj , 1 ≤ i ≤ n}.

– Edges of partition vertices:P 1

1 ↔ {Ui | ui ∈ S1, 1 ≤ i ≤ n} and P 12 ↔ {Ui | ui ∈ S2, 1 ≤ i ≤ n}, and

for all 2 ≤ t ≤ k − 2, P t1 ↔ P t−1

1 and P t2 ↔ P t−1

2 .– Edges of connection vertex: X ↔ {U1, . . . , Un}.

Page 253: Graph-Theoretic Concepts in Computer Science

Hardness Results and Efficient Algorithms for Graph Powers 243

D32D4

2 D22 D1

2 D2

Clique Clique

Clique

P22

X

D43 D3

3 D23 D1

3 D3D41 D3

1 D21 D1

1 D1

U1 U2 U3 U6

Clique

P11

P21

P12

U7U4U5

Fig. 2. The graph G for the example instance of set splitting and k = 4

For the example instance, the k-th root graph H corresponds to the solutionS1, S2 is shown in Figure 3. ��Lemma 3. If H is a k-th root of G, then there exists a partition of S into twodisjoint subsets S1 and S2 such that each subset in D intersects both S1 and S2.

Notice that in the Lemma 3, we did not use the property that H is a bipartitegraph. In fact, any k-th root of G would tell us how to do set splitting. Inparticular, any bipartite k-th root H of G will do. Hence, by Lemmas 2 and 3,we conclude

Theorem 4. k-th power of bipartite graph is NP-complete for all fixedk ≥ 3.

By the same reason, k-th power of C graph is NP-complete for all fixedk ≥ 3 whenever C contains all bipartite graphs (such as triangle-free graphs,parity graphs, perfect graphs, etc.). In particular, applied for the class of allgraphs, this observation and the NP-completeness of square of graph [14]together give

Theorem 5. k-th power of graph is NP-complete for all fixed k ≥ 2.

Lau and Corneil [10] shown that square of chordal graph is NP-complete.We are able to extend this result by showing that k-th power of chordal

Page 254: Graph-Theoretic Concepts in Computer Science

244 V.B. Le and N.T. Nguyen

Dk1

Dk−11

D11

Dk2

Dk−12

D12

Dk3

Dk−13

D13

U4 U5 U6

P11 P1

2

P22

P32

Pk−22P

k−21

Pk−32

D1 D2 D3

U1 U3

X

U2 U7

P21

P31

Pk−31

Fig. 3. A bipartite k-th root H in Lemma 2 to the example solution S1, S2

graph is NP-complete for all fixed k ≥ 2. The reduction is almost the same asthe previous one and generalizes those in [10] for square of chordal graph.

Theorem 6. k-th power of chordal graph is NP-complete for all fixedk ≥ 2.

4 Squares of Strongly Chordal Split Graphs

Lau and Corneil [10] shown that square of split graph is NP-complete. Incontrast, we will show in this section that there exists a good characterizationof squares of strongly chordal split graphs that gives a recognition algorithm intime O(min{n2, m log n}) for such squares.

A chordal graph is strongly chordal if it does not contain any �-sun as aninduced subgraph; here a �-sun, � ≥ 3, consits of a stable set {u1, u2, . . . , u�}and a clique {v1, v2, . . . , v�} such that for i ∈ {1, . . . , �}, ui is adjacent to exactlyvi and vi+1 (index arithmetic modulo �). We will make use of the followingwell-known fact:

Lemma 4 ([2,12,16]). Powers of strongly chordal graphs are strongly chordal.

In a graph, a vertex is maximal if its closed neighborhood is maximal with respectto set-inclusion. For split graphs H = (VH , EH) we write H = (C ∪ S, EH),meaning VH = C ∪ S is a partition of the vertex set of H into a clique C and astable set S.

Page 255: Graph-Theoretic Concepts in Computer Science

Hardness Results and Efficient Algorithms for Graph Powers 245

Lemma 5. Let H = (C∪S, EH) be a connected split graph without 3-sun. ThenQ is a maximal clique in H2 if and only if Q = NH [v] for some maximal vertexv ∈ C of H.

Theorem 7. G is square of a strongly chordal split graph if and only if G isstrongly chordal and

∣∣⋂

Q∈C(G) Q∣∣ ≥ |C(G)|.

Theorem 8. Given an n-vertex and m-edge graph G, recognizing if G is thesquare of some strongly chordal split graph H can be done in time O(min{n2,m log n}), and if so, such a square root H for G can be constructed in the sametime.

Proof. By the constructive proof of Theorem 7, the following Algorithm 1 cor-rectly computes a strongly chordal split graph H that is a square root for G, ifany.

Algorithm 1

Input: Connected graph G = (VG, EG) with n = |VG| and m = |EG|.Output: A strongly chordal split graph H with G = H2 if such H exists

or ‘NO’ otherwise.

1. if G is strongly chordal then2. compute all maximal cliques Q1, . . . , Qq of G3. compute C =

⋂1≤i≤q Qi

4. if |C| ≥ q then5. VH := VG; EH := {xy | x, y ∈ C}6. for i := 1 to q do7. choose a vertex vi ∈ C with vi �= vj for i �= j8. for i := 1 to q do9. EH := EH ∪ {vvi | v ∈ Qi \ C}10. return H11. else return ‘NO’12. else return ‘NO’

The time complexity of Algorithm 1 is dominated by the time consumed atlines 1 and 2. Testing if G is strongly chordal can be done in time O(min{n2,m log n}) ([3,13,15,17]). Assuming G is strongly chordal, all maximal cliquesQ1, . . .Qq of G can be listed in linear time (cf. [6,17]); note that q ≤ n. So, thetotal time of the algorithm is bounded by O(min{n2, m log n}). ��

5 Powers versus Girth

The girth of a graph is the smallest length of a cycle in the graph. In otherwords, G has girth k if and only if G contains a cycle of length k but does notcontain any (induced) cycle of length � = 3, . . . , k− 1. Note that the girth of ann-vertex and m-edge graph can be computed in O(nm) [7].

Page 256: Graph-Theoretic Concepts in Computer Science

246 V.B. Le and N.T. Nguyen

In [4] square roots with girth conditions have been considered. It is shownthere that square of graph with girth ≤ 4 is NP-complete, while square

of graph with girth ≥ 6 is polynomially solvable, and it has been conjec-tured that k-power of graph with girth ≥ 3k− 1 is polynomially solvable.In this section, we give a good characterization of graphs that are cubes of agraph having girth at least 10. Our characterization leads to an O(nm2)-timerecognition for such graphs.

The following fact is the key observation for further discussions.

Lemma 6. Let G = (V, EG) be a connected, non-complete graph such that G =H3 for some graph H = (V, EH) with girth at least 10. Then Q ⊆ V is a maximalclique in G if and only if Q = NH [u, v] for some edge uv ∈ EH with degH(u) ≥ 2and degH(v) ≥ 2.

Corollary 1. If G = (VG, EG) is the cube of some graph with girth at least 10,then G has at most |EG| maximal cliques.

Definition 1. Let G be an arbitrary graph. An edge e of G is called forced if eis the intersection of two distinct maximal cliques in G.

The meaning of forced edges is that if the graph considered is the cube of somegraph with girth at least 10, then its forced edges must belong to the edge setof any cube root with such girth condition.

Observation 9 Let G = H3 for some graph H with girth at least 10. Then, anedge of G is forced if and only if it is the mid-edge of an P6 in H.

Definition 2. A connected graph G is said to be trivial if it contains a non-empty clique C such that G \ C is the disjoint union of at most |C| − 1 cliquesand every vertex in C is adjacent to every vertex in G \ C.

Observation 10 (i) A graph is trivial if and only if it is the cube of some treeof diameter at most 4;

(ii) Trivial graphs can be recognized in linear time.

By Observation 10, we need consider non-trivial graphs only. A star is a treewith at least two vertices and diameter at most two. For an edge e, let Ce denotethe set of all maximal cliques containing e.

Proposition 1. Let G be a connected, non-trivial graph such that G = H3 forsome graph H with girth at least 10, and let F be the subgraph of G consistingof all forced edges of G. Then

(i) F is a connected induced subgraph of H;(ii) For each e ∈ F , there exists a unique maximal clique Qe ∈ Ce such that

(a) for every two disctint non-disjoint forced edges e and e′, e∪e′ ⊆ Qe∩Qe′ ,(b) for every Q ∈ C(G) \ {Qe | e ∈ F}, and for all forced edges e1, e2 in Q,

Qe1 ∩Q = Qe2 ∩Q;

Page 257: Graph-Theoretic Concepts in Computer Science

Hardness Results and Efficient Algorithms for Graph Powers 247

(iii) For each e ∈ F , Ce \ {Qe} can be partitioned into non-empty disjoint setsAe and Be with

(a) Q ∩Q′ = e if and only if Q ∈ Ae and Q′ ∈ Be or vice versa,(b) setting Ae =

⋂Q∈Ae

Q, Be =⋂

Q∈BeQ, all pairs of maximal cliques in

Ae have the same intersection Ae, all pairs of maximal cliques in Be

have the same intersection Be,(c) Qe = Ae ∪Be, and |Ae| ≥ |Ae|+ 2, |Be| ≥ |Be|+ 2,(d) F [Ae ∩ VF ] and F [Be ∩ VF ] are stars with distinct universal vertices in

e;(iv) C(G) =

⋃e∈F Ce;

(v) VG \⋃

e∈F Qe consists of exactly the simplicial vertices of G.

Theorem 11. Let G be a connected, non-trivial graph. Let F be the subgraph ofG consisting of all forced edges in G. Then, G is the cube of a graph with girthat least 10 if and only if F is connected and has girth at least 10 and G satisfiesthe conditions (ii) – (v) listed in Proposition 1.

Theorem 12. Given an n-vertex m-edge graph G, recognizing if G is the cubeof some graph H with girth at least 10 can be done in time O(nm2), and if so,such a cube root H for G can be constructed in the same time.

Proof. Note that by Corollary 1, any cube of an m-edge graph with girth atleast ten has at most m maximal cliques. Then, use the algorithm in [18] to listthe maximal cliques of G in time O(nm2). If there are more than m maximalcliques, G is not the cube of any graph with girth at least ten. Otherwise, the (atmost m) maximal cliques of G are available. Then computing the forced edgesof G to form the subgraph F of G, as well as the lists Ce for each e ∈ F can bedone in time O(m2) in an obvious way.

Moreover, the partitions Ce = Ae ∪ {Qe} ∪ Be satisfying (iii) (if any) for allforced edges e can be found in time O(nm2). Given these partitions, conditions(ii) – (v) in Proposition 1 then can be tested within the same time bound, aswell as the square root H , in case all conditions are satisfied, can be constructedby Algorithm 2 below; K := {Qe | e ∈ F}. ��Remark. In the proof of Theorem 11, if F is a tree or a (C4, C6, C8)-free bipartitegraph, then the root H for G is also a tree, respectively, a (C4, C6, C8)-freebipartite graph. Thus, if we replace the condition on F in Theorem 11 by ‘Fis a (C4, C6, C8)-free bipartite graph’, we obtain a good characterization and anO(nm2)-time recognition for cubes of bipartite roots of this kind, while cube

of bipartite graph is NP-complete in general [9].

6 Conclusion and Open Problems

Although it has been gererally expected that k-th power of graph and k-

th power of bipartite graph are NP-complete for all fixed k ≥ 2, respec-tively, k ≥ 3, this paper contains the first proofs that these problems are indeed

Page 258: Graph-Theoretic Concepts in Computer Science

248 V.B. Le and N.T. Nguyen

Algorithm 2

1. H := F2. for each Qe ∈ K do3. let e = xy where x is universal in F [Ae ∩ VF ] and4. y is universal in F [Be ∩ VF ] // cf. (iii)(d)5. put all edges ux, vy into H , u ∈ Ae \ VF , v ∈ Be \ VF

6. // H [Qe] = NH [x, y] for all e = xy ∈ F7. for each Q �∈ K do8. let Q ∈ Ce for some forced edge e9. choose a vertex cQ ∈ (Q ∩Qe) \ VF ; cQ �= cQ′ for Q �= Q′ �∈ K10. // Note that Q ∩Qe = Ae or Q ∩Qe = Be, hence the choices11. // of cQ’s are possible by (iii)(c); cQ is independent of e by (ii)(b)13. put all edges vcQ, v ∈ Q \ VH , into H14. return H

NP-complete. We also have proved that k-th power of chordal graph isNP-complete for all fixed k ≥ 2. On the positive side, we have found efficientalgorithms for recognizing squares of strongly chordal split graphs and of cubesof graph with girth at least ten.

Some interesting open questions are: What is the computational complexityof recognizing powers of strongly chordal graphs? of chordal bipartite graphs(bipartite graphs without cycles of length at least six)? and of graphs with‘large’ girth (cf. Conjecture 3)? We note that strongly chordal split graphs andchordal bipartite graphs are closely related: a bipartite graph is chordal bipartiteiff completing one of its bipartition part yielding a strongly chordal split graph.Hence, given our result on squares of strongly chordal split graphs, cube of

chordal bipartite graph could be polynomially solvable. Note also that theopen questions we posed here are of particular interest as they generalize treepowers, which have been widely investigated in the literature.

References

1. Chang, M.-S., Ko, M.-T., Lu, H.-I.: Linear-time algorithms for tree root prob-lems. In: Arge, L., Freivalds, R. (eds.) SWAT 2006. LNCS, vol. 4059, pp. 411–422.Springer, Heidelberg (2006)

2. Dahlhaus, E., Duchet, P.: On strongly chordal graphs. Ars Combin. 24 B, 23–30(1987)

3. Farber, M.: Characterizations of strongly chordal graphs. Discrete Math. 43, 173–189 (1983)

4. Farzad, B., Lau, L.C., Le, V.B., Nguyen, N.T.: Computing graph roots withoutshort cycles. In: Proceedings of the 26th International Symposium on TheoreticalAspects of Computer Science (STACS 2009), pp. 397–408 (2009)

5. Garey, M.R., Johnson, D.S.: Computers and Intractability–A Guide to the Theoryof NP-Completeness. Freeman, New York (1979); Twenty-third printing (2002)

6. Golumbic, M.C.: Algorithmic Graph Theory and Perfect Graphs. Academic Press,New York (1980)

Page 259: Graph-Theoretic Concepts in Computer Science

Hardness Results and Efficient Algorithms for Graph Powers 249

7. Itai, A., Rodeh, M.: Finding a minimum circuit in a graph. SIAM J. Computing 7,413–423 (1978)

8. Kearney, P.E., Corneil, D.G.: Tree powers. J. Algorithms 29, 111–131 (1998)9. Lau, L.C.: Bipartite roots of graphs. ACM Transactions on Algorithms 2, 178–

208 (2006); Proceedings of the 15th Annual ACM-SIAM Symposium on DiscreteAlgorithms (SODA 2004), pp. 952–961

10. Lau, L.C., Corneil, D.G.: Recognizing powers of proper interval, split and chordalgraphs. SIAM J. Discrete Math. 18, 83–102 (2004)

11. Lin, Y.-L., Skiena, S.S.: Algorithms for square roots of graphs. SIAM J. DiscreteMath. 8, 99–118 (1995)

12. Lubiw, A.: Γ -free matrices, Master Thesis, Dept. of Combinatorics and Optimiza-tion, University of Waterloo, Canada (1982)

13. Lubiw, A.: Doubly lexical orderings of matrices. SIAM J. Computing 16, 854–879(1987)

14. Motwani, R., Sudan, M.: Computing roots of graphs is hard. Discrete Appl.Math. 54, 81–88 (1994)

15. Paige, R., Tarjan, R.E.: Three partition refinement algorithms. SIAM J. Comput-ing 16, 973–989 (1987)

16. Raychaudhuri, A.: On powers of strongly chordal and circular arc graphs. ArsCombin. 34, 147–160 (1992)

17. Spinrad, J.P.: Efficient Graph Representations. Fields Institute Monographs,Toronto (2003)

18. Tsukiyama, S., Ide, M., Ariyoshi, H., Shirakawa, I.: A new algorithm for generatingall the maximal independent sets. SIAM J. Computing 6, 505–517 (1977)

Page 260: Graph-Theoretic Concepts in Computer Science

Graph Partitioning and Traffic Groomingwith Bounded Degree Request Graph�

Zhentao Li1 and Ignasi Sau2,3

1 School of Computer Science - McGill University - Montreal, [email protected]

2 Mascotte project - INRIA/CNRS/UNS - Sophia Antipolis, France3 Graph Theory and Combinatorics group of UPC - Barcelona, Spain

[email protected]

Abstract. We study a graph partitioning problem which arises fromtraffic grooming in optical networks. We wish to minimize the equip-ment cost in a SONET WDM ring network by minimizing the numberof Add-Drop Multiplexers (ADMs) used. We consider the version intro-duced by Munoz and Sau [12] where the ring is unidirectional with agrooming factor C, and we must design the network (namely, place theADMs at the nodes) so that it can support any request graph with max-imum degree at most Δ. This problem is essentially equivalent to findingthe least integer M(C,Δ) such that the edges of any graph with maxi-mum degree at most Δ can be partitioned into subgraphs with at mostC edges and each vertex appears in at most M(C,Δ) subgraphs [12].The cases where Δ = 2 and Δ = 3, C �= 4 were solved by Munoz andSau [12]. In this article we establish the value of M(C,Δ) for many morecases, leaving open only the case where Δ ≥ 5 is odd, Δ (mod 2C) isbetween 3 and C − 1, C ≥ 4, and the request graph does not contain aperfect matching. In particular, we answer a conjecture of [12].

Keywords: optical networks, traffic grooming, ADM, graph decompo-sition, cubic graph.

1 Introduction

Traffic grooming is the generic term for packing low rate signals into higher speedstreams in optical networks [4, 7, 11, 15]. By using traffic grooming, it is possi-ble to bypass the electronics at the nodes which are not sources or destinationsof traffic, and therefore reduce the cost of the network. Typically, in a Wave-length Division Multiplexing (WDM) network, instead of having one SONETAdd Drop Multiplexer (ADM) on every wavelength at every node, it is possibleto have ADMs only for the wavelengths used at that node; the other wavelengthsbeing optically routed without electronic switching. The so called traffic groom-ing problem consists of minimizing the total number of ADMs to be used, in� This work has been partially supported by: 1st author: NSERC; 2nd author: Euro-

pean project IST FET AEOLUS, PACA region of France, Ministerio de Ciencia eInnovacion, European Regional Development Fund under project MTM2008-06620-C03-01/MTM, and Catalan Research Council under project 2005SGR00256.

C. Paul and M. Habib (Eds.): WG 2009, LNCS 5911, pp. 250–261, 2010.c© Springer-Verlag Berlin Heidelberg 2010

Page 261: Graph-Theoretic Concepts in Computer Science

Graph Partitioning and Traffic Grooming 251

order to reduce the overall cost of the network. The problem is easily seen to beNP-hard for an arbitrary set of requests in very simple topologies. In fact, hard-ness and approximation results exist for traffic grooming in ring, star, and treenetworks [9, 8, 2]. Here we consider unidirectional SONET/WDM ring networkswith symmetric requests. In this case, the routing is unique and to each requestbetween two nodes, we assign a wavelength and some bandwidth on this wave-length. If the traffic is uniform and any given wavelength can carry at most Crequests, we can assign at most 1

C of the bandwidth to each request. C is knownas the grooming factor. Furthermore, if the traffic requirement is symmetric, wemay assume that symmetric requests are assigned the same wavelength, as it iseasy to show (by exchanging wavelengths) that there exists an optimal solutionwhere all symmetric requests are given the same wavelength. Then each pairof symmetric requests uses 1

C of the bandwidth in the whole ring. If the twoend-nodes are u and v, we need one ADM at node u and one at node v. Themain point is that if two requests have a common end-node, they can share anADM if they are assigned the same wavelength.

The traffic grooming problem for a unidirectional SONET ring with n nodes,grooming ratio C, and a symmetric request graph R has been modeled as agraph partition problem as follows (see [3,10]). Each edge of R corresponds to apair of symmetric requests, and edges are colored by their assigned wavelengthλ. All edges of color λ induce a connected subgraph Bλ of R, where each nodecorresponds to an ADM. The grooming constraint, i.e. the fact that a wavelengthcan carry at most C requests, translates to an upper bound C on the numberof edges in each Bλ. The cost corresponds to the total number of vertices usedin the subgraphs, and the objective is therefore to minimize

∑λ |V (Bλ)|. While

most of previous work has focused on the case where the requests are given asinput [2,4,7,8,9,11,3,10], we consider the case where only the network topology isgiven, together with a bound Δ on the request graph. We would like to place, foreach value of the grooming factor C, a minimum number of ADMs at each nodein such a way that they could support any traffic pattern where each node isthe end-node of at most Δ requests. This model was recently introduced in [12],and it is interesting because the network can support dynamic traffic withoutreplacement of the ADMs. The problem can be formulated as a graph partitionproblem as follows.

Δ-Degree-Bounded Traffic Grooming in Unidirectional Rings

Input: Three integers n (size of the ring), C (grooming factor), and Δ (max-imum degree).Output: An assignment of A(v) ADMs to each vertex v of the ring, in sucha way that for any request graph G with maximum degree at most Δ, thereexists a partition of E(G) into subgraphs {Bλ}1≤λ≤Λ = B, such that:(i) |E(Bλ)| ≤ C for all λ; and

(ii) each vertex v ∈ V (G) appears in at most A(v) subgraphs.Objective: Minimize

∑v A(v).

Page 262: Graph-Theoretic Concepts in Computer Science

252 Z. Li and I. Sau

The optimum to the above problem for each n, C, Δ is denoted by A(n, C, Δ).Given a graph with maximum degree at most Δ, a partition of G into subgraphswith at most C edges is called a C-edge-partition of G.

Previous work and our contribution. The cases where Δ = 2 and the cases Δ = 3,C �= 4 were solved in [12]. In this article we establish the value of M(C, Δ) forthe following cases: when Δ = 3 and C = 4 (answering a conjecture of [12],c.f. Section 3), when Δ ≥ 4 is even for any C (c.f. Section 4), and when Δ ≥ 5 isodd (c.f. Section 5) and either C ∈ {2, 3}, Δ (mod 2C) = 1, Δ (mod 2C) ≥ C,or the request graph contains a perfect matching. We first fix the notation belowand give some preliminaries in Section 2.

Notation. The (multi)graphs considered in this paper are finite and withoutself-loops. Edges are denoted {u, v}. The degree of a vertex v is the numberof edges containing v as an end-point. The maximum degree of a (multi)graphis the maximum degree over all its vertices. A Δ-graph is a (multi)graph withmaximum degree at most Δ. GΔ denotes the class of all Δ-graphs. A Δ-regular(multi)graph is a graph in which all vertices have degree Δ. An almost Δ-regular(multi)graph is a (multi)graph in which all vertices have degree Δ except possiblyone which has degree Δ − 1. A bridge in a (multi)graph G is an edge whoseremoval disconnects G. A matching in a (multi)graph G = (V, E) is a subset M ⊆E which contains each vertex at most once. A perfect matching is a matchingcontaining all vertices. A digon is a cycle of length 2. A trail in a (multi)graphis a sequence {{x1, x2}, {x2, x3}, . . . , {xk−1, xk}} of distinct edges in which thesecond end of an edge is the first end of the next edge (the same pair of verticesmay appear more than once if there is more than one edge between them).Vertices x2, x3, . . . , xk−1 of a trail are called midpoints. The length of a trail isthe number of edges in it. Given a (multi)graph G = (V, E) and a subset ofvertices V ′ ⊆ V , we denote by G − V ′ the (multi)graph obtained from G byremoving the vertices in V ′, the edges incident with vertices in V ′, and isolatedvertices (if any). Similarly, given a subset of edges E′ ⊆ E, we denote by G−E′

the (multi)graph obtained from G by removing the edges in E′ and isolatedvertices (if any).

2 Reducing the Problem

We begin by applying some easy reductions to the problem and recalling someresults from [12] that will be used throughout. Let M(C, Δ) be the smallestnumber M such that A(n, C, Δ) ≤ Mn for all n. It is known that M(C, Δ) isan integer for all values of C, Δ [12]. If the request graph is further restricted tobelong to a subclass of graphs C ⊆ GΔ, then the corresponding positive integeris denoted by M(C, Δ, C).

By the discussion above, A(n, C, Δ) is of the form A(n, C, Δ) = M(C, Δ)n−α(C, Δ), where M(C, Δ) and α(C, Δ) are integers depending only on C and Δ.Suppose that a Δ-graph H requires at least M(C, Δ)+1 ADMs at some vertex.Since any Δ-graph must be supported with the same ADMs, by relabeling the

Page 263: Graph-Theoretic Concepts in Computer Science

Graph Partitioning and Traffic Grooming 253

vertices of H we could force at least M(C, Δ) + 1 ADMs in Ω(n) nodes of thenetwork. This would contradict the definition of M(C, Δ). Therefore, each vertexcan appear in at most M(C, Δ) subgraphs. So we may conclude the following.

Remark 1. For each value of C and Δ, Δ-Degree-Bounded Traffic

Grooming in Unidirectional Rings reduces to finding the least integerM(C, Δ) such that the edges of any Δ-graph can be partitioned into subgraphswith at most C edges and each vertex appears in at most M(C, Δ) subgraphs.

This allows us to give an equivalent definition of M(C, Δ). Let G ∈ GΔ and letPC(G) be the set of C-edge-partitions of G. For P ∈ PC(G), let occ(P ) be themaximum number of occurrences of a vertex in the partition, that is,

occ(P ) = maxv∈V (G)

|{Bλ ∈ P : v ∈ Bλ}|,

and then M(C, Δ) = maxG∈GΔ

(min

P∈PC(G)occ(P )

).

In the remainder of this paper, we use Remark 1 and focus on determiningM(C, Δ) for each value of C and Δ. Observe also that any Δ-graph H is asubgraph of some Δ-regular graph G (with possibly more vertices). Note alsothat if we restrict a partition of G to the vertices of H , the number of occurrencesof the vertices cannot increase. Therefore,

Remark 2. M(C, Δ) = M(C, Δ, C), where C is the class of Δ-regular graphs.

The following two results will be used throughout the article.

Lemma 1 (Munoz and Sau [12]). The following statements hold trivially:

(i) M(C, 1) = 1 for all C ≥ 1.(ii) M(1, Δ) = Δ for all Δ ≥ 1.(iii) If C′ ≥ C, then M(C′, Δ) ≤M(C, Δ).(iv) If Δ′ ≥ Δ, then M(C, Δ′) ≥M(C, Δ).(v) M(C, Δ) ≤ Δ for all C, Δ ≥ 1.

Proposition 1 (Munoz and Sau [12]). M(C, Δ) ≥ ⌈C+1C

Δ2

⌉for all C, Δ ≥ 1.

In [12] it is proved that M(C, 2) = 2 for any C ≥ 1, that M(C, 3) = 3 forC ≤ 3, and that M(C, 3) = 2 for C ≥ 5. The latter result was proved usinga result of Thomassen [14], settling a conjecture of Bermond et al. [5], statingthat the edges of a cubic graph can be 2-colored such that each monochromaticcomponent is a path of length at most 5.

Let us now discuss how these ideas can be extended to other values of C, Δ.A linear C-forest in a graph is a forest consisting of paths of length at mostC. The linear C-arboricity of a graph G is the minimum number of linear C-forests required to partition E(G), and is denoted by laC(G) [5]. Let laC(Δ) =maxG∈GΔ laC(G). Clearly M(C, Δ) ≤ laC(Δ) for all C, Δ, since the paths in alinear C-forest are graphs with at most C edges. Therefore, the following upperbound given by Alon et al. [1] also applies to M(C, Δ).

Page 264: Graph-Theoretic Concepts in Computer Science

254 Z. Li and I. Sau

Theorem 3 (Alon et al. [1]). There is an absolute constant β > 0 such thatfor√

Δ > C ≥ 2,

laC(Δ) ≤ C + 1C

Δ

2+ β

√CΔ log Δ. (1)

The first term of the right-hand side of Equation (1) is equal to the lower bound ofProposition 1, so Theorem 3 provides an additive O(

√CΔ log Δ)-approximation

of M(C, Δ) for√

Δ > C ≥ 2. We improve this bound for M(C, Δ) in Sec-tions 4 and 5 (without using the linear C-arboricity), providing an additive1-approximation of M(C, Δ) for any value of C and Δ, which is optimal for anyeven Δ, and in many cases for odd Δ.

3 Case Δ = 3, C = 4

Munoz and Sau conjectured that M(4, 3) = 2 [12], which we now prove. We firstneed the following classical result and an easy generalization (although it is wellknown, we provide a short proof here for the sake of completeness).

Theorem 4 (Petersen [13]). Any cubic bridgeless graph has a perfect match-ing.

Corollary 1. Any cubic bridgeless multigraph without self-loops has a perfectmatching.

Proof: Let G be a cubic multigraph without self-loops. We can assume that Ghas no triple edges, otherwise G has only 2 vertices and any of the 3 edges isa perfect matching. Consider the simple graph G′ built from G as follows: foreach digon {{u, v}, {u, v}}, add 2 new vertices suv and tuv, and replace the digonwith the edges {u, suv}, {u, tuv}, {v, suv}, {v, tuv}, and {suv, tuv}. By Theorem4, G′ has a perfect matching M ′. We now construct a perfect matching M ofG from M ′. For each edge e ∈ M ′ such that e was also an edge of G, put e inM ′. For each digon {{u, v}, {u, v}} of G, if any of the pairs {{u, suv}, {v, tuv}}or {{u, tuv}, {v, suv}} is in M ′, put one of the copies of {u, v} in M . Otherwise,{suv, tuv} belongs to M ′ and we do nothing. It is easy to check that M is aperfect matching of G. �viamWe are ready to prove the main result of this section.

Theorem 5. The edges of every almost 3-regular multigraph G without self-loops can be partitioned into a set W = {W1, W2, . . . , Wk} of trails of length atmost 4 such that each vertex appears as the midpoint of a trail.

Proof: Suppose the theorem is false and let G be a counterexample with theminimum number of vertices. G is connected as otherwise, we can take the unionof the partitions of its connected components, which exist by minimality of G.

Case 1: G contains a bridge e = {u, v}. Then G − {e} has exactly twocomponents: U containing u and V containing v. Without loss of generality, we

Page 265: Graph-Theoretic Concepts in Computer Science

Graph Partitioning and Traffic Grooming 255

v deg 2x

y

u

uW Wv

deg 2x

y

u

U V

e

(a) (b)

Fig. 1. (a) A bridge e = {u, v} in an almost 3-regular graph G with components Uand V of G − {e}. (b) Graphs smaller than G from which we obtain a partition intotrails W u and W v.

may choose U to be the component with no degree 2 vertex in G and e is chosenso that U is maximal with this property. Thus this component U of G− {e} isalmost 3-regular (only u has degree 2). By minimality of G, U can be partitionedinto a set Wu of trails as in the statement of the theorem.

If v has degree 2 in G then V − {v} is almost 3-regular. By minimality of G,V − {v} can be partitioned into a set Wv of trails as in the theorem. Now theonly edges of G not in any trail inWu∪Wv are those incident to v. Thus takingWu∪Wv together with a trail consisting of the 2 edges incident to v (which hasv as a midpoint) yields the required partition of the edges of G into trails. Thiscontradicts the fact that G is a counterexample.

If v has degree 3 in G, let x, y be the neighbors of v in V (see Fig. 1(a)). Wecan assume x �= y (i.e., {v, x} and {v, y} are not parallel edges) since otherwise,the third edge incident to x = y is a cut edge whose choice (instead of e) wouldincrease the size of U . Let H be the graph obtained from V −{v} by adding anedge f = {x, y} (see Fig. 1(b)). By minimality of G, H can be partitioned intoa set Wv of trails. We now attempt to transform Wu ∪ Wv into a partition ofG into trails.

The edge f appears in some trail {W1, {x, y}, W2} of Wv, where W1 is a(possibly empty) trail ending at x and W2 is a (possibly empty) trail startingat y. At least one of the subtrails {W1, {x, y}} or {{x, y}, W2} has fewer than3 edges. Without loss of generality, it is {W1, {x, y}}. Replace this trail with{W1, {x, v}, {v, u}} which has length at most 4, and {{v, y}, W2} which haslength less than or equal to {W1, {x, y}, W2}. Note that x and v are midpointsof the first trail and y is the midpoint of the second trail. Furthermore, anyother vertex which was a midpoint in {W1, {x, y}, W2} is still a midpoint (sinceW1 and W2 appear as subtrails). Thus the union ofWu and Wv with the abovereplacement yields a partition of G into trails of length at most 4 with the desiredproperty, which is a contradiction.

Case 2: G does not contains a bridge. If G is 3-regular, let G′ = G.Otherwise, let G′ be the graph obtained from G by replacing the vertex of degree2 with an edge between its endpoints. Note that G′ is 3-regular and contains nobridges. Therefore, by Corollary 1, G′ contains a perfect matching M ⊆ E(G′).

Since G′ is 3-regular, G′−M is 2-regular. Thus, G′−M is a union of disjointcycles. We can orient the cycles of G′−M so that each vertex v has exactly oneedge ev pointing towards v. For each edge {u, v} ∈ M , Wuv = {eu, {u, v}, ev}

Page 266: Graph-Theoretic Concepts in Computer Science

256 Z. Li and I. Sau

(a) (b) (c)

Fig. 2. (a) A 3-regular graph G′ with no bridges. (b) A matching M of G′ (shown indashed lines) and an orientation of the cycles of G′ −M . (c) A partition of the edgesof G′ into trails of length 3 using M and the orientation of the cycle of G′ −M in (b).

is a trail of length 3 (see Fig. 2). Note that W = {Wuv | {u, v} ∈ M} is apartition of the edges of G′ into trails of length 3. Furthermore, every vertexu in the matching appears as the midpoint of the trail corresponding to theedge of the matching in which u appears. Since M is a perfect matching, everyvertex appears as the midpoint of some trail in W . Thus G′ �= G as otherwise,we have constructed a partition as required by the theorem. So G has a ver-tex v of degree 2 which we replaced with an edge e = {x, y} to obtain G′. LetW = {W1, {x, y}, W2} be the trail in W containing e, and recall that W haslength 3. Replacing W with {W1, {x, v}, {v, y}, W2} in W yields a partition ofE(G) into trails of length at most 4, which is a contradiction. �

Note that the simple trees with some vertex of degree 3 and the digon with apendant edge at each side are not allowed in the partition stated in Theorem 5,since these graphs cannot be thought of as trails. The following corollary answersthe conjecture of [12].

Corollary 2. M(4, 3) = 2.

Proof: By Remark 2, we may restrict ourselves to 3-regular graphs. Thus, a3-regular graph G is almost 3-regular and we may apply Theorem 5 to obtain apartition W . Let B = {E(W )}W∈W . Each vertex of G appears in at most twoelements of B, as G is 3-regular and each vertex appears as the midpoint of sometrail in W . �

4 Case Δ ≥ 4 Even

In this section we establish the value of M(C, Δ) for Δ ≥ 4 even and any valueof C.

Theorem 6. Let Δ ≥ 4 be even. Then for any C ≥ 1, M(C, Δ) =⌈

C+1C

Δ2

⌉.

Proof: The lower bound follows from Proposition 1. Let us give an explicitconstruction for any Δ-regular graph G = (V, E). Orient the edges of G inan Eulerian tour, and assign to each vertex v ∈ V its Δ/2 out-edges, namelyE+

v . For each v ∈ V , partition E+v into

⌈Δ2C

⌉stars with C edges centered at v

Page 267: Graph-Theoretic Concepts in Computer Science

Graph Partitioning and Traffic Grooming 257

(except, possibly, one star with fewer edges). Each vertex v appears as a leaf instars centered at other vertices exactly Δ − Δ/2 = Δ/2 times. Therefore, thenumber of occurrences of each vertex in this partition is

⌈Δ

2C

⌉+

Δ

2=⌈

Δ

2

(1 +

1C

)⌉=⌈

C + 1C

Δ

2

⌉.

5 Case Δ ≥ 5 Odd

The cases where Δ is odd turn out to be inherently much more complicatedthan the cases where Δ is even. In Section 5.1, we present a general construc-tion which differs from the lower bound of Proposition 1 by at most 1, and wedetermine when this construction is optimal. In Section 5.2, we present an op-timal construction for graphs with a perfect matching. Finally, in Section 5.3,we provide an improved lower bound when Δ ≡ C (mod 2C), which meets ourupper bound.

5.1 General Upper Bound

The following proposition provides a general upper bound, which differs fromthe lower bound of Proposition 1 by at most 1.

Proposition 2. Let Δ≥5 be odd. Then for any C≥1, M(C, Δ)≤⌈C+1C

Δ2 + C−1

2C

⌉.

Proof: Let G be a Δ-regular graph. Since Δ is odd, |V (G)| is even. Add a perfectmatching M to G to obtain a (Δ + 1)-regular multigraph G′. Orient the edgesof G′ in an Eulerian tour, and assign to each vertex v ∈ V (G′) its (Δ + 1)/2out-edges E+

v . Remove the edges of M and, as in the case Δ even, partition E+v

into stars with at most C edges. To count the number of occurrences of eachvertex, we distinguish two cases. If an edge of M is in E+

v , then v appears ascenter in

⌈Δ−12C

⌉stars and as a leaf in Δ− Δ−1

2 stars. Summing both terms yields

⌈Δ− 12C

⌉+ Δ− Δ− 1

2=⌈

C + 1C

Δ

2+

C − 12C

⌉.

Otherwise, if no edge of M is in E+v , the number of occurrences of v is

⌈Δ + 12C

⌉+ Δ− Δ + 1

2=⌈

C + 1C

Δ

2+

1− C

2C

⌉≤⌈

C + 1C

Δ

2+

C − 12C

⌉.

The upper bound of Proposition 2 and the lower bound of Proposition 1 areequal for, roughly speaking, half of the pairs C, Δ, as shown in the followingcorollary.

Corollary 3. Let Δ ≥ 5 be odd. If Δ (mod 2C) = 1 or Δ (mod 2C) ≥ C + 1,then M(C, Δ) =

⌈C+1

CΔ2

⌉.

Page 268: Graph-Theoretic Concepts in Computer Science

258 Z. Li and I. Sau

Proof: Let Δ = λ · 2C + h, with h odd, 1 ≤ h ≤ 2C − 1. Writing k :=λ(C + 1) + h−1

2 , the lower bound of Proposition 1 equals k +⌈

12 + h

2C

⌉, and

the upper bound of Proposition 2 equals k +⌈1 + h−1

2C

⌉. If h = 1 both bounds

equal k + 1, and if h ≥ C + 1 both bounds equal k + 2. �

In particular, when C = 2 and Δ is odd, Δ (mod 2C) is either 1 or 3, and thenby Corollary 3 the lower bound is attained.

Corollary 4. For any Δ ≥ 5 odd, M(2, Δ) =⌈

3Δ4

⌉.

We shall see in Theorem 7 that if Δ≡C (mod 2C), then M(C, Δ)=⌈

C+1C

Δ2

⌉+1.

5.2 Optimal Construction for Graphs with a Perfect Matching

If the input graph has a perfect matching, we can prove that the lower bound isattained for all values of C.

Proposition 3. Let Δ ≥ 5 be odd and let C be the class of Δ-regular graphsthan contain a perfect matching. Then M(C, Δ, C) =

⌈C+1

CΔ2

⌉.

Proof: First, it is easy to check that the proof of the lower bound of Proposition 1in [12] still carries over when restricted to the class of graphs with a perfectmatching. To prove the upper bound, if G is Δ-regular with a perfect matchingM , we orient the edges of G−M in an Eulerian tour, and assign to each vertexv ∈ V (G) its Δ−1

2 out-edges E+v . We distinguish three cases.

(1) Δ < C. For each edge {u, v} ∈ M , build the tree with Δ edges consistingof {u, v}, Δ−1

2 edges from E+u , and Δ−1

2 edges from E+v . The number of

occurrences of each vertex is 1 + Δ − Δ+12 = Δ+1

2 . The lower bound equals⌈C+1

CΔ2

⌉= Δ−1

2 +⌈

12 + Δ

2C

⌉, which equals Δ+1

2 as Δ < C.

(2) Δ ≥ C and C ≥ 3 is odd (the case C = 1 is trivial by Lemma 1). For eachedge {u, v} ∈M , build the tree with C edges consisting of {u, v}, C−1

2 edgesfrom E+

u , and C−12 edges from E+

v . Partition the remaining Δ−12 − C−1

2 =Δ−C

2 edges assigned to each vertex into⌈

Δ−C2C

⌉stars with at most C edges.

The number of occurrences of each vertex is

1 +⌈

Δ− C

2C

⌉+ Δ− Δ + 1

2=⌈

C + 1C

Δ

2

⌉.

(3) Δ ≥ C and C ≥ 4 is even (the case C = 2 is solved by Corollary 4). Buildthe tree with C− 1 edges consisting of {u, v}, C−2

2 edges from E+u , and C−2

2

edges from E+v . Partition the remaining Δ−1

2 − C−22 = Δ−C+1

2 edges assignedto each vertex into stars with at most C edges. The number of occurrencesof each vertex is

1 +⌈

Δ− C + 12C

⌉+

Δ− 12

=⌈

Δ(C + 1) + 12C

⌉=⌈

C + 1C

Δ

2

⌉,

where the last equality holds because both Δ and (C + 1) are odd. �

Page 269: Graph-Theoretic Concepts in Computer Science

Graph Partitioning and Traffic Grooming 259

5.3 Improved Lower Bounds

In this section we prove a new lower bound which strictly improves on Propo-sition 1 when Δ ≡ C (mod 2C). The idea is to generalize the counterexamplegiven in [12, Proposition 4] to prove that M(3, 3) = 3.

Theorem 7. Let Δ ≥ 5 be odd and let LB(C, Δ) =⌈

C+1C

Δ2

⌉, the lower bound

of Proposition 1. If Δ ≡ C (mod 2C), then M(C, Δ) = LB(C, Δ) + 1.

Proof: We prove that if Δ = kC with k odd, then M(C, Δ) ≥ LB(C, Δ)+1 andthus, by Proposition 2, M(C, Δ) is equal to LB(C, Δ) + 1. Since both Δ and kare odd, so is C, and therefore LB(C, Δ) = k · C+1

2 .We proceed to build a Δ-regular graph G with no C-edge-partition where each

vertex is incident to at most LB(C, Δ) subgraphs, hence implying that M(C, Δ) >LB(C, Δ). First, we construct a graph H where all vertices have degree Δ exceptone which has degree Δ− 1. Furthermore, we build H so that it has girth strictlygreater than C. H exists by [6]. Make Δ copies of H and add a cut-vertex v joinedto all vertices of degree Δ− 1 to make our Δ-regular graph G.

Now suppose for the sake of contradiction that there is a C-edge-partition B ofG where each vertex is incident to at most LB(C, Δ) subgraphs. Since the girthof G is greater than C, all the subgraphs in B are trees. Since LB(C, Δ) < Δ,v must have degree at least 2 in some subgraph T ′ ∈ B. Since |E(T ′)| ≤ C, thetree T ′ contains at most

⌊C−2

2

⌋= C−3

2 edges of a copy H ′ of H intersecting T ′.Now we only work in H ′. Let α = |E(T ′ ∩H ′)| ≤ C−3

2 .Let B′ = {B ∩H ′}B∈(B−{T ′}), with the empty subgraphs removed. That is,

B′ contains the subgraphs in B that partition the edges in H ′ that are not in T ′.Let n = |V (H ′)|, which is odd as in H ′ there is one vertex of degree Δ− 1 andall the others have degree Δ. Therefore, the total number of edges of the treesin B′ is

T∈B′|E(T )| = |E(H ′)| − α =

nΔ− 12

− α =nkC − 1

2− α. (2)

As α ≤ C−32 , from Equation (2) we get

T∈B′|E(T )| ≥ nkC − 1

2− C − 3

2=(

nk − 12

)· C + 1. (3)

As each tree in B′ has at most C edges, from Equation (3) we get that |B′|, thenumber of trees in B′, satisfies

|B′| ≥⌈

nk − 12

+1C

⌉=

nk − 12

+⌈

1C

⌉=

nk − 12

+ 1. (4)

Clearly, the total number of vertices in the trees in B′ is exactly the totalnumber of edges in the trees in B′ plus the number of trees in B′, that is,∑

T∈B′ |V (T )| = ∑T∈B′ |E(T )| + |B′|. On the other hand, the tree T ′ contains

Page 270: Graph-Theoretic Concepts in Computer Science

260 Z. Li and I. Sau

α+1 vertices of H ′, that is, |V (T ′ ∩H ′| = α+1. Therefore, using Equations (2)and (4), we get that the total number of occurrences of the vertices in H ′ insome tree of B is∑

v∈V (H′)

|{T ∈ B : v ∈ T }| =∑

T∈B′|V (T )|+|V (T ′ ∩H ′)|=

T∈B′|E(T )|+|B′|+α+1

=nkC − 1

2−α+|B′|+α+1 ≥ nkC − 1

2+

nk − 12

+1+1

= nk · C + 12

+ 1 = n · LB(C, Δ) + 1 ,

which implies that at least one vertex of H ′ appears in at least LB(C, Δ) + 1subgraphs, which is a contradiction to B being a C-edge-partition of G in whicheach vertex appears in at most LB(C, Δ) subgraphs. The theorem follows. �

It turns out that Theorem 7 allows us to find the value of M(3, Δ) for any Δ ≥ 5odd.

Corollary 5. For any Δ ≥ 5 odd, M(3, Δ) =⌈

2Δ+13

⌉.

Proof: If Δ ≡ 1 (mod 6) or Δ ≡ 5 (mod 6), then by Corollary 3, M(3, Δ) =⌈2Δ3

⌉=⌈

2Δ+13

⌉. Otherwise, if Δ ≡ 3 (mod 6), then by Theorem 7, M(3, Δ) =⌈

2Δ3

⌉+ 1 =

⌈2Δ+1

3

⌉. �

6 Conclusions

We considered the traffic grooming problem in unidirectional WDM rings whenthe request graph belongs to the class of graphs with maximum degree Δ. Thisproblem is essentially equivalent to finding the least integer M(C, Δ) such that

Table 1. Known values ofM(C,Δ). The bold cases remain open. The cases in bracketsonly hold if the graph has a perfect matching. The symbol “(=)” means that thecorresponding lower bound is attained.

C|Δ 1 2 3 4 5 6 7 8 9 . . . Δ even Δ odd

1 1 2 3 4 5 6 7 8 9 . . . Δ Δ

2 1 2 3 3 4 5 6 6 7 . . .⌈

3Δ4

⌉ ⌈3Δ4

3 1 2 3 (2) 3 4 5 (4) 5 6 7 (6) . . .⌈

2Δ3

⌉ ⌈2Δ+1

3

⌉ (⌈2Δ3

⌉)

4 1 2 2 3 4 4 5 5 6 . . .⌈

5Δ8

⌉ ≥ ⌈ 5Δ8

⌉(=)

5 1 2 2 3 4 (3) 4 5 5 6 . . .⌈

3Δ5

⌉ ≥ ⌈ 3Δ5

⌉(=)

6 1 2 2 3 ≥ 3 (=) 4 5 5 6 . . .⌈

7Δ12

⌉ ≥ ⌈ 7Δ12

⌉(=)

7 1 2 2 3 ≥ 3 (=) 4 5 (4) 5 6 . . .⌈

4Δ7

⌉ ≥ ⌈ 4Δ7

⌉(=)

8 1 2 2 3 ≥ 3 (=) 4 ≥ 4 (=) 5 6 . . .⌈

9Δ16

⌉ ≥ ⌈ 9Δ16

⌉(=)

9 1 2 2 3 ≥ 3 (=) 4 ≥ 4 (=) 5 6 (5) . . .⌈

5Δ9

⌉ ≥ ⌈ 5Δ9

⌉(=)

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

C 1 2 2 3 ≥ 3 (=) 4 ≥ 4 (=) 5 ≥ 5 (=) . . .⌈

C+1C

Δ2

⌉ ≥ ⌈C+1C

Δ2

⌉(=)

Page 271: Graph-Theoretic Concepts in Computer Science

Graph Partitioning and Traffic Grooming 261

the edges of any graph with maximum degree at most Δ can be partitioned intosubgraphs with at most C edges and each vertex appears in at most M(C, Δ)subgraphs. We established the value of M(C, Δ) for many cases, leaving openonly the case where Δ ≥ 5 is odd, Δ (mod 2C) is between 3 and C − 1, C ≥ 4,and the graph does not contain a perfect matching. Table 1 summarizes whatis known about M(C, Δ), including the case where the graph has a perfectmatching. For the remaining cases, we hope to either extend the counterexamplegiven in Section 5.3 or strengthen Proposition 3 in order to meet the lower bound.

References

1. Alon, N., Teague, V., Wormald, N.C.: Linear Arboricity and Linear k-Arboricityof Regular Graphs. Graphs and Combinatorics 17(1), 11–16 (2001)

2. Amini, O., Perennes, S., Sau, I.: Hardness and Approximation of Traffic Grooming.In: Tokuyama, T. (ed.) ISAAC 2007. LNCS, vol. 4835, pp. 561–573. Springer,Heidelberg (2007)

3. Bermond, J.-C., Coudert, D.: Traffic Grooming in Unidirectional WDM Ring Net-works using Design Theory. In: IEEE ICC, vol. 2, pp. 1402–1406 (2003)

4. Bermond, J.-C., Coudert, D.: Grooming. In: Colbourn, C.J., Dinitz, J.H. (eds.)The CRC Handbook of Combinatorial Designs, ch. VI.27, 2nd edn. Discrete Math-ematics and its Applications, vol. 42, pp. 493–496. CRC Press, Boca Raton (2006)

5. Bermond, J.-C., Fouquet, J.-L., Habib, M., Peroche, B.: On linear k-arboricity.Discrete Mathematics 52(2-3), 123–132 (1984)

6. Chandran, L.S.: A high girth graph construction. SIAM J. Discrete Math. 16(3),366–370 (2003)

7. Dutta, R., Rouskas, N.: Traffic grooming in WDM networks: Past and future. IEEENetwork 16(6), 46–56 (2002)

8. Flammini, M., Monaco, G., Moscardelli, L., Shalom, M., Zaks, S.: Approximatingthe traffic grooming problem in tree and star networks. Journal of Parallel andDistributed Computing 68(7), 939–948 (2008)

9. Flammini, M., Moscardelli, L., Shalom, M., Zaks, S.: Approximating the trafficgrooming problem. Journal of Discrete Algorithms 6(3), 472–479 (2008)

10. Goldschmidt, O., Hochbaum, D., Levin, A., Olinick, E.: The SONET edge-partitionproblem. Networks 41(1), 13–23 (2003)

11. Modiano, E., Lin, P.: Traffic grooming in WDM networks. IEEE CommunicationsMagazine 39(7), 124–129 (2001)

12. Munoz, X., Sau, I.: Traffic Grooming in Unidirectional WDM Rings with BoundedDegree Request Graph. In: Broersma, H., Erlebach, T., Friedetzky, T., Paulusma,D. (eds.) WG 2008. LNCS, vol. 5344, pp. 300–311. Springer, Heidelberg (2008)

13. Petersen, J.P.: Die Theorie der Regularen Graphs. Acta Mathematica 15, 193–220(1891)

14. Thomassen, C.: Two-coloring the edges of a cubic graph such that each monochro-matic component is a path of length at most 5. J. Comb. Theory Ser. B 75(1),100–109 (1999)

15. Zhu, K., Mukherjee, B.: A review of traffic grooming in WDM optical networks:Architectures and challenges. Optical Networks Magazine 4(2), 55–64 (2003)

Page 272: Graph-Theoretic Concepts in Computer Science

Injective Oriented Colourings

Gary MacGillivray1,�, Andre Raspaud2, and Jacobus Swarts1

1 Mathematics and Statistics, University of Victoria, P.O. BOX 3060 STN CSC,Victoria, B.C., Canada V8W 3R4

2 LaBRI UMR CNRS 5800, Universite Bordeaux I, 33405 Talence Cedex, France

Abstract. We develop the theory of oriented colourings which are injec-tive on in-neighbourhoods. The complexity of deciding if the minimumnumber of colours is at most the fixed integer k is determined, as isBrooks-Theorem type bound. The latter relies, in part, on a character-ization of the oriented graphs in which each vertex must be assigned adifferent colour. A better, tight bound is determined for oriented trees,and a linear algorithm that decides if a given tree can be coloured withat most k colours, where k is fixed, is described.

Keywords: oriented colouring, injective colouring, digraph. homomor-phisms.

1 Introduction

We study oriented colourings which are injective on in-neighbourhoods. Thesefirst arose in work of Courcelle [2] under the name “good” and “semi-strong”.Raspaud and Sopena [14] improved a result of Courcelle’s by showing that everyplanar graph can be oriented to have such a colouring with at most 320 colours.Related topics that are studied in the literature include injective homomorphisms[12,16] injective colourings and homomorphisms of undirected graphs (e.g. see[5,6,7,8]), and oriented colourings (e.g. see [3,15,17]).

The parameter in which we are interested is the injective oriented chromaticnumber of an oriented graph D. Informally, it is the minimum number of coloursneeded in an oriented colouring of D having the additional property that no twoin-neighbours of any vertex are assigned the same colour. Our goal is to developa comprehensive theory of injective oriented colourings of digraphs.

When considering a colouring parameter, the following questions naturallyarise:

– Is there a homomorphism model?– What is the complexity of deciding if it is no more than a fixed integer k?– Can obstructions and critical digraphs be identified in the polynomial cases?– What bounds are available?– Is there anything that can be said for special classes of digraphs?– How many such colourings exist?

� Research supported by NSERC.

C. Paul and M. Habib (Eds.): WG 2009, LNCS 5911, pp. 262–272, 2010.c© Springer-Verlag Berlin Heidelberg 2010

Page 273: Graph-Theoretic Concepts in Computer Science

Injective Oriented Colourings 263

A homomorphism model for injective oriented colourings is described in SectionTwo. It leads to the complexity results presented in the following section. Theobstructions and critical digraphs can be identified, and algorithms that eitherreturn an injective oriented colouring, or an obstruction that certifies that thereis no such colouring exist. These are described elsewhere [11]. Before givingbounds for the injective oriented chromatic number in terms of vertex degreesin Section Five, in Section Four we give a structural characterization of theoriented graphs whose injective oriented chromatic number equals the numberof vertices. The results imply a polynomial time recognition algorithm. Finally,Section Six presents a polynomial time algorithm that tests whether a givenoriented tree has an injective homomorphism to a fixed directed graph H . Aconsequence is that it is possible to decide in polynomial time if an oriented treehas an injective oriented colouring with k colours, and find a colouring whenone exists. We have obtained similar results to those presented in this paper inthe case where the colourings need not be proper [11]. Finding results on theenumeration of injective oriented colourings remains an open problem.

2 Preliminaries

For basic results and notation concerning graphs and digraphs we follow the textof Bondy and Murty [1]. We consider oriented graphs: directed graphs such that,for every pair of distinct vertices x and y, at most one of the arcs xy and yxexists. A vertex x of digraph D is a dominating vertex for a X ⊆ V (respectively,subgraph H) if it is adjacent to every vertex of X (respectively, H). Similarly,a vertex x is dominated by X ⊆ V (respectively, subgraph H) if it is adjacentfrom every vertex of X (respectively, H).

Let G and H be directed graphs. A homomorphism of G to H is a functionf : V (G) → V (H) such that f(x)f(y) is an arc of H whenever xy is an arc ofD. A homomorphism of G to H is injective if, for each vertex x of D, no two in-neighbours of x have the same image. Because homomorphisms generalize colour-ings, the problem of deciding if a given digraph has a homomorphism to a fixeddigraph H has been called H-colouring. If the mapping is required to be injective,it is called injective H-colouring. The book by Hell and Nesetril [9] is an excellentintroduction to the theory of homomorphisms of graphs and digraphs.

Let D be an oriented graph and k be a positive integer. An oriented k-colouring of D is an assignment of the colours 1, 2, . . . , k to the vertices of D sothat adjacent vertices get different colours and if some arc of D joins a vertexof colour i to a vertex of colour j, then no arc of D joins a vertex of colour j toa vertex of colour i. The oriented chromatic number of D is the smallest k forwhich there is an oriented k-colouring of D. Equivalently, an oriented k-colouringof D is a homomorphism to an oriented graph T on k vertices, and the orientedchromatic number of D is the least k for which such a homomorphism exists.Since arcs can be added joining non-adjacent vertices of T without destroyingthe existence of a homomorphism of D to T , the oriented graph T can be takento be a tournament.

Page 274: Graph-Theoretic Concepts in Computer Science

264 G. MacGillivray, A. Raspaud, and J. Swarts

An injective oriented k-colouring of an oriented graph D is an oriented colour-ing of D such that, for each vertex x of D, no two in-neighbours of x are assignedthe same colour. The injective oriented chromatic number of an oriented graphD, denoted χi(D), is the smallest k for which there is an injective orientedk-colouring of D. It is clear from comparing the definitions that an injectiveoriented k-colouring of an oriented graph D is an injective homomorphism of Dto a digraph T on k vertices, and χi(D) is the least k for which such a homo-morphism exists. As for oriented colourings, the digraph T can be assumed tobe a tournament.

The directed graph that consists of two arcs meeting at a vertex plays animportant role in our work. We define the hat H3(v0, s, v1) with point s andends v0 and v1 to be the digraph with vertices v0, s, v1 and arcs v0s, v1s. It willbe denoted by H3 when it is not necessary to emphasize the vertices. All threevertices belonging to a hat must be assigned different colours in an injectiveoriented colouring.

3 Complexity

In this section we determine, for each fixed positive integer k, the complexity ofdeciding whether a given oriented graph D has an injective oriented k-colouring.The dividing line is the same as for oriented colouring (see [10]).

Theorem 1. [12,16] Let T be a tournament. Then the injective T -colouringproblem is NP-complete, except when T has at most three vertices or consists of3-cycle dominated by a single vertex. If T has at most three vertices or consistsof 3-cycle dominated by a single vertex, then the injective T -colouring problemis polynomial.

The polynomial algorithms are via reduction to 2-SAT.The proof of the following theorem can be greatly simplified if the restriction

to connected inputs is dropped. On the one hand, the restriction seems unnec-essary because connected components can always be considered separately. Ourmotivation for doing some extra work in the proof is a subtlety that arises inoriented colourings of disconnected digraphs: one has to take care that all ofthe components of the given digraph are mapping to the same tournament onk vertices. The proof shows how to handle that small concern when the targettournament is strongly connected.

Theorem 2. Let k be a fixed positive integer. If k ≤ 3 then oriented k-colouringis polynomial. If k ≥ 4 then oriented k-colouring is NP-complete when restrictedto inputs whose underlying graph is connected.

Proof. When k ≤ 3 the result follows from Theorem 1.Let T4 denote the unique strong tournament on four vertices. Let z be a vertex

with in-degree two, and let x and y be its two in-neighbours. Every vertex of T4

is joined to y by a directed walk of length nine.

Page 275: Graph-Theoretic Concepts in Computer Science

Injective Oriented Colourings 265

Let P be the oriented path p0, p1, . . . , p12, where p0p1 ∈ E(P ) and pi+1pi ∈E(P ) for i = 1, 2, . . . , 11. For any vertex v of T4 there is an injective homomor-phism of P to T4 that maps p0 to x and p12 to v.

We first show that injective oriented 4-colouring is NP-complete for connectedinputs. The transformation is from injective T4-colouring. Given an orientedgraph D, construct D′ from the disjoint union of D and T4 by, for each componentC of the underlying graph of D, adding a new copy of P and identifying p0

with x and p12 with some vertex c of C. We claim that there is an injectivehomomorphism of D to T4 if and only if D′ has an injective oriented 4-colouring.

Suppose first that there is an injective homomorphism of D to T4. It can beextended to D′ by mapping the copy of T4 identically to itself and extend themapping to each of the oriented paths.

Suppose D′ has an injective 4-colouring. Then there is an injective homomor-phism of D′ to a tournament T on four vertices. Since T4 is a subdigraph ofD′, it follows that T = T4. The result follows on restricting the mapping to thevertices of D.

This argument generalizes to larger values of k. For a fixed integer k > 4, letTk be any tournament obtained from T4 by adding k − 4 dominating verticesand arbitrarily orienting the arcs among them. Then injective Tk-colouring isNP-complete. The argument is identical to that for T4 except that T4 is replacedby Tk. ��

4 Cliques

An io-clique is a oriented graph G such that χi(G) = |V (G)|. For a given orientedgraph D, if ωi(D) denotes the maximum number of vertices in a subgraph of Dwhich is an io-clique, then χi(D) ≥ ωi(D). In this section we give a structuralcharacterization of io-cliques. It is similar to the characterization of ocliques:oriented graphs for which the oriented chromatic number equals the number ofvertices [10].

Theorem 3. An oriented graph G is an io-clique if and only if every two verticesx and y either have a common out-neighbour or are joined by a directed path oflength at most two.

Proof. Suppose first that the condition holds. Let x, y ∈ V (G). Since adja-cent vertices must be assigned different colours, suppose that x and y are non-adjacent. If x and y have a common out-neighbour, then they must be assigneddifferent colours because of injectivity, and if they are joined by a directed pathof length two then they must be assigned different colours in order to have anoriented colouring.

We prove the contrapositive of the converse implication. Suppose that thecondition does not hold. Then there are non-adjacent vertices x and y whichhave no common out-neighbour and are not joined by a directed path of lengthtwo. Consider the colouring in which x and y are assigned the same colour andevery other vertex is assigned its own unique colour. Since x and y are not joined

Page 276: Graph-Theoretic Concepts in Computer Science

266 G. MacGillivray, A. Raspaud, and J. Swarts

by a directed path of length two, this is an oriented colouring, and since theyhave no common out-neighbour, it is an injective colouring. Hence G is not anio-clique. ��

Theorem 3 implies that io-cliques can be recognized in polynomial time. It alsoimplies that a tournament is an io-clique, as is any o-clique (because any twonon-adjacent vertices are joined by a directed path of length two). More examplesof io-cliques can be obtained from the following corollary.

Informally, the wreath product, D[H ], of two digraphs D and H is obtained byreplacing each vertex of D by a copy of H and, if uv is an arc of D, putting allpossible arcs from the vertices of the copy of H that replaced u to the verticesof the copy of H that replaced v. Formally, D[H ] is the digraph with vertex setV (D) × V (H) and (d1, h1) adjacent to (d2, h2) if and only if d1d2 ∈ E(D) ord1 = d2 and h1h2 ∈ E(H).

Corollary 4. If G and H are both io-cliques, so is the wreath product G[H ].

Proof. Let x and y be two vertices of G[H ]. If they belong to the same copyof H then, since H is an io-clique, they are either joined by a directed path oflength at most two, or they have a common out-neighbour. Otherwise, these twovertices belong to different copies of H corresponding to to different vertices ofG. Since G is an io-clique, these vertices are joined by a directed path of lengthat most two, or they have a common out-neighbour. By the definition of wreathproduct, the same is true of x and y. Therefore, by Theorem 3, the digraph G[H ]is an io-clique. ��

By the corollary, the wreath products T [H3], where T is a transitive tournamentand H3 denotes the hat, are acyclic io-cliques (which are not o-cliques).

5 Bounds on the Oriented Injective Chromatic Number

The quantity Δ− + 1 is a lower bound for χi. It is natural to wonder whetherthere is a theorem giving upper bounds on χi in terms of Δ−. To see that thereis no such bound, let k ≥ Δ− be a fixed positive integer. Start with a set L ofk vertices, and for each Δ−-subset X ⊆ L add a new vertex adjacent from allvertices in X . The maximum in-degree of the resulting graph is Δ−, but sinceno two vertices in L can be assigned the same colour, χi ≥ k.

It is possible to bound the injective oriented chromatic number if one takesinto account the maximum in-degree, maximum out-degree and the maximumdegree of the underlying undirected graph. To see that such a bound is necessar-ily exponential, let D = T1∪T2∪· · ·∪Tm be the disjoint union of all tournamentson k+1 vertices. Then the maximum in-degree of D is k. Any tournament T forwhich there is an injective homomorphism of D to T has to contain each tourna-ment on k + 1 vertices as a subgraph. Therefore T is a k-universal tournament,and must have at least 2k/2 vertices [13].

Page 277: Graph-Theoretic Concepts in Computer Science

Injective Oriented Colourings 267

Next, we present an upper bound on χi(D). It is derived by constructingand colouring a suitable undirected graph, and then refining the (undirected)colouring into an injective oriented colouring.

We define the undirected io-square of an oriented graph D to be the undirectedgraph D• with vertex V (D) and x adjacent to y whenever they have a commonout-neighbour in D, or are joined by a directed path of length at most two in D.Any two vertices which are adjacent in D• must be assigned different colours inan injective oriented colouring of D.

Theorem 5. Let D be an oriented graph. If D• is k-colourable, then χi(D) ≤2k − 1.

Proof. Consider a colouring of D• with colours 1, 2, . . . , k. By definition of D•,no two vertices with a common out-neighbour in D are assigned the same colour.We will obtain an injective oriented colouring of D by refining this partition ofV (D) into independent sets.

Let the colour of v be j. For any colour i = j, the vertex v has at mostone in-neighbour of colour i because the in-neighbours of v are adjacent in D•.Furthermore, v does not have both an in-neighbour and an out-neighbour ofcolour i because vertices joined by a directed path of length two in D are adjacentin D•. Therefore, v either has exactly one in-neighbour in colour class i or onlyout-neighbours in colour class i.

Define the signature of a vertex v to be a k-tuple where the jth entry is “·” andthe ith entry is either “+” or “−” depending on whether v has out-neighboursor in-neighbours respectively in colour class i, 1 ≤ i ≤ k, i = j.

We now use the information encoded in the signatures of each vertex to decidehow to recolour it so that we have an oriented colouring. Since the collection ofvertices of colour 1 is an independent set, we assign them all the same colour. Next,consider the possible arcs between vertices of colour 1 and vertices of colour 2:every vertex of colour 2 either has an out-neighbour of colour 1 (so its signaturestarts with (+ · . . .)) or an in-neighbour of colour 1 (so its signature starts with(− · . . .)). These vertices must receive different colours in an oriented colouring.If we now consider the arcs between the vertices of colour 3 and those of colour i,i = 1, 2, we see that the signatures start in one of four ways: (−− · . . .), (−+ · . . .),(+ − · . . .) or (+ + · . . .). The vertices of colour 3 with different signatures on thefirst two coordinates must be assigned different colours in an oriented colouring.In general, the vertices in colour class j can be partitioned into 2j−1 independentsets depending on their signatures on the first j−1 coordinates. As before, verticesof colour j in different blocks of the partition need different colours in an orientedcolouring. In total we therefore need 1 + 2 + 22 + · · · + 2k−1 = 2k − 1 coloursin an injective oriented colouring of D. Colouring according to the partition justdescribed yields an injective oriented colouring of D. ��Corollary 6. Let D be an oriented graph. Then χi(D) ≤ 2χ(D•) − 1.

Lemma 7. Let D be an oriented graph. The graph D• is complete if and onlyif D is an io-clique. The graph D• can not be an undirected odd cycle of lengthgreater than three.

Page 278: Graph-Theoretic Concepts in Computer Science

268 G. MacGillivray, A. Raspaud, and J. Swarts

Proof. It is clear that D• is complete if and only if D is an io-clique.In order for D• to be an undirected odd cycle, the underlying undirected

graph of D must be connected and have maximum degree two. Thus it is eithera path or a cycle. If D• contains no 3-cycles, then D can have no vertices ofin-degree two and no directed path of length two. But any orientation of a pathor cycle with more than three vertices contains either a vertex of in-degree twoor a directed path of length two. This completes the proof. ��

Corollary 8. Let D be an oriented graph which is not an io-clique Then

χi(D) ≤ 2(Δ+(Δ−−1)Δ++(Δ+)2) − 1.

Proof. Each vertex in D• has at most Δ neighbours from the underlying graphof D, at most (Δ− − 1)Δ+ neighbours that are derived from joining common in-neighbours by an edge and at most (Δ+)2 vertices that are at a distance two fromit. Therefore the maximum degree of D• is at most k=Δ+(Δ−−1)Δ++(Δ+)2. ByBrooks’ Theorem, D• has a k-colouring, so the result follows from Corollary 6. ��

A tight bound which is linear in Δ−, and depends only on Δ−, is available fororiented trees.

Proposition 9. Let T be an oriented tree. Then the injective chromatic numberof T satisfies χi ≤ 2Δ− + 1, and the bound is best possible.

Proof. Let k = Δ−(T ), and let H be a k-regular tournament. It is easy to proveby induction on |V (T )| that there is an injective homomorphism of any tree Twith maximum in-degree to H . This is clear if T has only one vertex. Supposeany tree with n− 1 vertices and maximum in-degree at most k has an injectivehomomorphism to H . Let x be a leaf of (the underlying graph of ) T . By theinduction hypothesis, there is an injective homomorphism of T − x to H . SinceH is k-regular, and the vertex of T adjacent to x has in-degree at most k− 1 inT − x, it is possible to extend this mapping to T .

Suppose that the injective oriented chromatic number of every complete k-ary tree (a tree in which every internal vertex has in-degree k and out-degree 1except the root, which as out-degree 0) is at most b ≤ 2k. Let T be such a treethat requires b colours. We claim that T can be chosen so that every colour isused on an internal vertex of T . Suppose not. Then some colour appears only ona leaf of T . Let T ′ be obtained from T by adding k = Δ− in-neighbours to everyleaf. If T ′ does not have the desired property then some colour is only used on aleaf. Restricting this colouring of T ′ to T gives a colouring of T with fewer thanb = χi(T ) colours, a contradiction.

By the claim, an optimal colouring of T is a homomorphism to a tournamentH on b ≤ 2k vertices such that every vertex of H has in-degree at least k, andtherefore out-degree at most k− 1. Therefore, the sum of the in-degrees can notequal the sum of the out-degrees, a contradiction.

It follows that there exist k-ary trees with injective chromatic number 2k+1. ��

Page 279: Graph-Theoretic Concepts in Computer Science

Injective Oriented Colourings 269

6 Oriented Injective Colourings of Trees

Let T be an oriented tree. In this section we give an algorithm that tests whetherthere is an injective homomorphism of T to a fixed digraph H , and finds one ifit exists. In turn, this implies a polynomial time algorithm to find an injectiveoriented k-colouring of T (for fixed k), if one exists. Our algorithm is straight-forward and involves a small amount of local graph information and consistencychecking. A different algorithm follows from the results of Courcelle [2].

If T is an oriented tree rooted at a vertex x, we may arrange the vertices ofT into its level sets based on the distance from x (in the underlying undirectedtree T ′): Vi = {v | dT ′(v, x) = i}, 0 ≤ i ≤ �, where � is the eccentricity of x. V�

is considered to be the bottom of the tree and V0 the top of the tree.The algorithm first assigns lists, L(v) ⊆ V (H), v ∈ V (T ), to the vertices of T .

These lists are to be thought of as possible images (or colours) for the vertices ofT . The assignment is based on the fact that if f is an injective homomorphismof T to H , then d−H(f(v)) ≥ d−T (v) since the image of v has to accommodate thein-neighbours of v in H . The lists are then processed from the bottom-up andthe eventual colouring is from the top-down.

Since the colouring will be from the top-down, the processing of the listshas to ensure that once a possible image for a vertex has been decided upon(i.e. we’ve made a choice from L(v)), this choice can be extended downwards.“Extending downwards” means that we can make choices for vertices lower downin the tree (from their lists) that will preserve arcs as well as respect injectivityon in-neighbours.

To preserve arcs we essentially do a one-sided consistency check. That is ifu ∈ Vi and v ∈ Vi+1 such that uv (vu) is an arc of T , we remove a ∈ L(u) ifthere does not exist a b ∈ L(v) such that ab (ba) is an arc of H . This is done forall u ∈ Vi, for i from �−1 to 0. In this way if we reach the root, x, and L(x) = ∅,we can make a choice for the image of x and extend all the way down preservingarcs in the process.

Let A = {v ∈ V (T ) | |N−(v)| ≥ 2}. If u ∈ A, with N−(u) = {u1, u2, . . . , uk}and y ∈ L(u), then there exists an injective mapping of N−(u) with u �→ y, ifand only if there exists a system of distinct representatives (SDR) for the sets

L(u1) ∩N−(y), L(u2) ∩N−(y), . . . , L(uk) ∩N−(y).

Therefore to process L(u) we remove y from L(u) if there does not exist an SDRas shown above. Note that the lists have to be intersected with N−(y) in orderto “localize” them around y in H .

If u ∈ A ∩ Vi, for some 0 ≤ i ≤ � − 1, is such that N−(u) ⊆ Vi+1, thenthe processing above is sufficient since a top-down colouring will colour u first(make a choice from L(u)) and if the SDR checks succeeded we will then beable to extend downwards (injectively). On the other hand it could happen thatN−(v)∩ Vi−1 = ∅ for some v ∈ A∩ Vi. In this case |N−(v)∩ Vi−1| = 1. Let u bethe vertex in |N−(v) ∩ Vi−1|. Here u will be coloured (in a top down colouring)before any of {v} ∪ (N−(v) − {u}) have been coloured. For such a vertex u we

Page 280: Graph-Theoretic Concepts in Computer Science

270 G. MacGillivray, A. Raspaud, and J. Swarts

have to ensure that a choice a ∈ L(u) can be extended downwards. Of course, umay be an in-neighbour of more than one vertex in Vi. Let A∗ = {v ∈ V (T ) | v ∈Vi and N+(v) ∩ Vi+1 = ∅, 0 ≤ i ≤ �− 1}. Suppose that u ∈ A∗ ∩ Vi. That is, uis an in-neighbour of some vertices v1, v2, . . . , vk ∈ Vi+1. We remove a ∈ L(u) ifthere exists vj ∈ {v1, v2, . . . , vk} ∩ A, such that for every z ∈ L(vj) there doesnot exist an SDR for the sets

{a} ∩N−(z), L(uj1) ∩N−(z), L(uj2) ∩N−(z), . . . , L(ujk) ∩N−(z),

where (N−(vj) − {u}) = {uj1 , uj2 , . . . , ujk}. In essence, we are checking here

whether u �→ a can be extended to an injective mapping on all the in-neighbour-hoods of vertices in {v1, v2, . . . , vk}∩A — we only need to consider vertices withmore than one in-neighbour, hence the intersection with A.

The algorithm is shown below (Algorithm 10).

Algorithm 10. Injective homomorhism of an oriented tree T to H.Input: An oriented tree T rooted at a vertex x.

Level sets V0 = {x}, V1, . . . , V�.The sets A and A∗ as defined as above.A target digraph H.

Task: Find an injective homomorphism of T to H if one exists.Assign lists to V (T ) as follows:

L(v) = {y ∈ V (H) | d−H(y) ≥ d−T (v)}.For i = �− 1 to 0 perform the following for all u ∈ Vi.

For each arc uv (vu) with v ∈ Vi+1, remove a ∈ L(u) ifthere does not exist a b ∈ L(v) with ab (ba) an arcof H.

If u ∈ A, remove y ∈ L(u) if there does not exist anSDR for the sets:

L(u1) ∩N−(y), L(u2) ∩N−(y), ..., L(uk) ∩N−(y),where N−(u) = {u1, u2, . . . , uk}.

If u ∈ A∗ and N+(u) ∩ Vi+1 = {v1, v2, . . . , vk}, removea ∈ L(u) if there exists a vj ∈ {v1, v2, . . . , vk} ∩A, suchthat for every z ∈ L(vj) there does not exist an SDRfor the sets:{a} ∩N−(z), L(uj1) ∩N−(z), L(uj2) ∩N−(z), ...,L(ujk

)∩N−(z), where (N−(vj)− {u})={uj1, uj2 , . . . , ujk}.

Let T be an oriented tree rooted at a vertex x together with the correspond-ing level sets V0 = {x}, V1, . . . , V�. For v ∈ Vi, consider the forest induced byV (T )− (V0 ∪ V1 ∪ · · · ∪ Vi−1). Let Tv be the sub-tree of T that contains v in theaforementioned forest. This is the sub-tree of T rooted at v, relative to x. Theheight of Tv is at most �− i.

Theorem 11. Let H be a digraph and T an oriented tree rooted at a vertex x. IfAlgorithm 10 terminates with L(x) = ∅, then for every v ∈ V (T ) and for everya ∈ L(v), there exists an injective homomorphism f of Tv to H such that f(v) = a.

Page 281: Graph-Theoretic Concepts in Computer Science

Injective Oriented Colourings 271

Proof. If L(x) = ∅, then L(v) = ∅ for every v ∈ V (T ) (an empty list in Vi wouldlead to empty lists in Vj , j ≤ i, in particular V0 = {x} would have an emptylist).

Let v ∈ Vi. The proof is by induction on the height of Tv: h = �− i, 0 ≤ i ≤ �.When h = 0, i = �, v is a leaf and Tv = {v}. Therefore any element in L(v)

defines an injective homomorphism f of Tv to H .Assume that the statement is true for all 0 ≤ h < k ≤ �. That is, the

statement is true for all v ∈ Vj with � − k + 1 ≤ j ≤ �. Let v ∈ V�−k so thatTv has height h = k. Since L(v) = ∅, there exists an a ∈ L(v) such that wecan define an injective homomorphism f of T [(N(v)∩ V�−k+1)∪ {v}] to H withf(v) = a (we might have to re-compute some of the SDRs to do this). Letu ∈ N(v) ∩ V�−k+1, with f(u) = b ∈ L(u). The height of (Tv)u is k − 1 and bythe induction hypothesis there exists an injective homomorphism fu of :(Tv)u toH such that fu(u) = f(u) = b. Since this applies to every u ∈ N(v) ∩ Vk−1 wecan extend f to all of Tv. ��Corollary 12. Let H be a digraph and T an oriented tree rooted at a vertex x.Then there exists an injective homomorphism of T to H if and only if Algorithm10 terminates with L(x) = ∅.Proof. If there is an injective homomorphism f of T to H , then d−H(f(v)) ≥d−T (v) and so f(v) ∈ L(v). Furthermore, f(v) is never removed from L(v) duringthe execution of the algorithm. In particular f(x) ∈ L(x), and so L(x) = ∅.

The converse follows from Theorem 11. ��The algorithm has a running time that is proportional to the number of verticesin T . This follows from the fact that each vertex of T is processed only onceand the processing (one-sided consistency check and SDR computation) at eachvertex is a function of |V (H)|, which is fixed.

Corollary 13. For each fixed positive integer k there exists a linear time al-gorithm that determines if a given oriented tree has an injective oriented k-colouring, and finds one if it exists.

Proof. The oriented tree T has an injective oriented k-colouring if and only if ithas an injective homomorphism to a tournament on k vertices. The number ofsuch tournaments is a function of k alone (i.e. it does not depend on the numberof vertices of T ). The existence of an injective homomorphism to each candidatetournament can be tested in linear time by Algorithm 10. ��

References

1. Bondy, J.A., Murty, U.S.R.: Graph Theory. Springer, Berlin (2007)2. Courcelle, B.: The monadic second order logic of graphs VI: On several reresenta-

tions of graphs by relational structures. Discrete Appl. Math. 54, 117–149 (1994);Erratum: Discrete Appl. Math. 63, 199–200 (1995)

3. Esperet, L., Ochem, P.: Oriented colorings of 2-outerplanar graphs. Inform. Pro-cess. Lett. 101, 215–219 (2007)

Page 282: Graph-Theoretic Concepts in Computer Science

272 G. MacGillivray, A. Raspaud, and J. Swarts

4. Feder, T., Vardi, M.: The computational structure of monotone monadic SNPand constraint satisfaction: A study through Datalog and group theory. SIAM J.Comput 28, 57–104 (1998)

5. Fertin, G., Rizzi, R., Vialette, S.: Finding exact and maximum occurrences of pro-tein complexes in protein-protein interaction graphs. In: Jedrzejowicz, J., Szepi-etowski, A. (eds.) MFCS 2005. LNCS, vol. 3618, pp. 328–339. Springer, Heidelberg(2005)

6. Fiala, J., Kratochvil, J.: Locally injective graph homomorphism: lists guaranteedichotomy. In: Fomin, F.V. (ed.) WG 2006. LNCS, vol. 4271, pp. 15–26. Springer,Heidelberg (2006)

7. Fiala, J., Kratochvil, J., Por, A.: On the computational complexity of partial coversof theta graphs. Discrete Appl. Math. 156, 1143–1149 (2008)

8. Hahn, G., Kratochvil, J., Sıran, J., Sotteau, D.: On the injective chromatic numberof graphs. Discrete Math. 256, 179–192 (2002)

9. Hell, P., Nesetril, J.: Graphs and Homomorphisms. Oxford University Press, Lon-don (2004)

10. Klostermeyer, W., MacGillivray, G.: Analogues of cliques for oriented colouring.Discussions Mathematicae Graph Theory 24, 373–387 (2004)

11. MacGillivray, G. , Raspaud, A. and Swarts, J.: Injective Oriented Colourings II(Manuscript) (2009)

12. MacGillivray, G., Swarts, J.: The complexity of injective homomorphisms (Sub-mitted) (2008)

13. Moon, J.W.: Topics on Tournaments. Holt, Rinehart and Winston, New York(1968)

14. Raspaud, A., Sopena, E.: Good and semi-strong colorings of oriented planar graphs.Information Processing Letters 51, 171–174 (1994)

15. Sopena, E.: Oriented graph coloring. Discrete Math. 229, 359–369 (2001)16. Swarts, J.: The complexity of digraph homomorphisms: Local tournaments, Injec-

tive Homomorphisms and Polymorphisms. Ph.D. Thesis, Department of Mathe-matics and Statistics, University of Victoria, Victoria, BC, Canada (2008)

17. Wood, D.: Acyclic, star and oriented colourings of graph subdivisions. DiscreteMath. Theor. Comput. Sci. 7, 37–50 (2005)

Page 283: Graph-Theoretic Concepts in Computer Science

Chordal Digraphs�

Daniel Meister and Jan Arne Telle

Department of Informatics, University of Bergen, [email protected], [email protected]

Abstract. Chordal graphs, also called triangulated graphs, are impor-tant in algorithmic graph theory. In this paper we generalise the defini-tion of chordal graphs to the class of directed graphs. Several structuralproperties of chordal graphs that are crucial for algorithmic applicationscarry over to the directed setting, including notions like simplicial ver-tices, perfect elimination orderings, and characterisation by forbiddensubgraphs resembling chordless cycles. Moreover, just as chordal graphsare related to treewidth, the chordal digraphs will be related to Kelly-width. Chordal digraphs coincide with the perfect elimination digraphsarising in the study of Gaussian elimination on sparse linear systems[Haskins and Rose, 1973].

1 Introduction

Chordal graphs have many applications in algorithmic graph theory. In somecases the input graph itself is chordal, in other cases we work on a (minimal)triangulation of the input graph, with edges added so that we have a chordalgraph. The algorithmic interest in triangulations and chordality is based onthe many structural properties associated with chordal graphs. Since graphscan be regarded as a subclass of directed graphs (digraphs) a basic questionis which algorithmic properties of graphs extend to digraphs. In this paper wegeneralise the definition of chordal graphs to digraphs and show that many ofthe properties that hold for chordal graphs carry over to the directed setting.Such properties are essential for algorithmic applications of chordal digraphs.Many problems that are NP-hard on general graphs become polynomial-timesolvable on chordal graphs of bounded clique-size, and also on their subgraphs.The corresponding graph parameter, called treewidth, is in this way relatedto chordal graphs. The chordal digraphs will in an analogous way be relatedto the digraph parameter called Kelly-width, recently introduced by Hunterand Kreutzer [7]. The amount of research devoted to algorithms for digraphsis steadily increasing, see e.g. the monograph of Bang-Jensen and Gutin [1]. Thestructural properties we would like the chordal digraphs to capture include thefollowing equivalent characterisations of chordal graphs:

(a) iteratively constructed by adding a new vertex adjacent to a clique(b) have a perfect elimination ordering [10]� This work is supported by the Research Council of Norway.

C. Paul and M. Habib (Eds.): WG 2009, LNCS 5911, pp. 273–284, 2010.c© Springer-Verlag Berlin Heidelberg 2010

Page 284: Graph-Theoretic Concepts in Computer Science

274 D. Meister and J.A. Telle

(a) (b) (c) (d)

Fig. 1. The forbidden induced subgraphs of uni(G) for G a chordal digraph

(c) have vertex layout such that if u ≺ v ≺ w, and {v, u}, {u, w} edges then{v, w} also an edge [10]

(d) contain no chordless (or induced) cycle of length at least 4(e) every minimal separator is a clique [3](f) are the intersection graphs of families of subtrees of trees [2,4,13].

Our definition of chordal digraphs in Section 3 is based on a generalisation of theiterative construction (a), which also serves to define Kelly-width [7,9]. We thenshow that chordal digraphs allow equivalent characterisations in terms of naturalgeneralisations of perfect elimination orderings (b) and also vertex layouts (c). Infact, chordal digraphs coincide with the perfect elimination digraphs introducedby Haskins and Rose [6], see also [8]. Their interest stemmed from the studyof Gaussian elimination of (unsymmetric) sparse matrices. Chordal digraphsalso satisfy nice properties like closure under taking induced subgraphs andclosure under reversal of all arcs. To generalise the characterisation by forbiddensubgraphs (d) to chordal digraphs requires more work. Let us describe our resultsinformally.

Partition the arcs of digraph G to define two digraphs uni(G) and bi(G),with uni(G) containing the arcs (u, v) for which (v, u) is not an arc, and bi(G)containing the arcs (u, v) for which (v, u) is also an arc. Our first result statesthat if bi(G) is empty (equivalently, if G is an orientation) then G is a chordaldigraph if and only if G is acyclic (equivalently, contains no chordless directedcycle of length at least 3). On the other hand, if uni(G) is empty then G ischordal if and only if G contains no chordless directed cycle of length at least4. Note that G could be viewed as an undirected graph precisely when uni(G)is empty, and hence the latter result shows that indeed the chordal digraphsare a generalisation of chordal (undirected) graphs. We also show that if G isa chordal digraph then bi(G) contains no chordless directed cycle of length atleast 4. An important and large class of digraphs are the semi-complete digraphswhere every pair of vertices have at least one arc. We show that a semi-completedigraph G is chordal if and only if bi(G) is chordal and uni(G) does not containan induced subgraph isomorphic to a digraph in Figure 1.

Regarding the characterisation of chordal graphs by minimal separators (e)and by intersections of subtrees of a tree (f) it is an interesting open problem toprovide a nice generalisation that will work for chordal digraphs. We discuss theseand other open problems in the Conclusion section. For example, perfect elimi-nation digraphs and thus chordal digraphs can be recognised in time O(nm) [11].Rose and Tarjan showed that recognising perfect elimination digraphs is closely

Page 285: Graph-Theoretic Concepts in Computer Science

Chordal Digraphs 275

related to transitivity check [11]. Thus, perfect elimination digraph recognitionfalls into a well-studied class of problems.

2 Preliminaries

We consider directed and undirected graphs. Directed graphs are called digraphs.All graphs are simple and finite. In particular, digraphs contain no loops. By“graph”, we may refer to a directed or undirected graphs. Let G be a digraph.The vertex and arc set of G are denoted as respectively V (G) and A(G). Tovertices u, v of G can be connected by one or two arcs, namely (u, v) or (v, u).If u and v are not connected by any of these arcs, we call u and v non-adjacent;otherwise, u and v are adjacent. If (u, v) ∈ A(G) then u is in-neighbour of vand v is out-neighbour of u. By N in(u) and Nout(u), we denote the respectivelyin-neighbourhood and out-neighbourhood of u. For a set X ⊆ V (G), G[X ] denotesthe subgraph of G induced by X , i.e., the digraph on vertex set X and (u, v) ∈A(G[X ]) if and only if u, v ∈ X and (u, v) ∈ A(G) for all u, v ∈ V (G). For x avertex of G, we denote G[V (G)\{x}] as G−x. A directed path in G is a sequence(x1, . . . , xk) of pairwise different vertices of G where (xi, xi+1) ∈ A(G) for all1 ≤ i < k. A directed cycle in G is a sequence (x1, . . . , xk) of pairwise differentvertices of G that is a directed path and (xk, x1) ∈ A(G). Note that k ≥ 2, sinceG contains no loops.

Let H be an undirected graph. The vertex and edge set of H are denoted asV (H) and E(H). Edges of H are denoted as {u, v}. For undirected graphs, we usedefinitions analogous to the definitions for digraphs. For a set E′ ⊆ E(H), theundirected graph H \E′ has vertex set V (H) and edge set E(H)\E′. A cycle Cin H is a sequence (x1, . . . , xk) of pairwise different vertices of H with k ≥ 3where {xi, xi+1} ∈ E(H) for all 1 ≤ i < k and {x1, xk} ∈ E(H); k denotes thelength of C. If {xi, xj} ∈ E(H) for some i, j ∈ {1, . . . , k} and 1 < |j − i| < k− 1then {xi, xj} is a chord in C. A cycle without chord is called chordless. A vertexlayout for a graph F is a linear order of its vertices, denoted as β = 〈x1, . . . , xn〉.For a pair u, v of vertices of F , we write u ≺β v if u = xi and v = xj and i < j.

An undirected graph without chordless cycles of length at least 4 is calledchordal. Chordal graphs have a large number of different characterisations, suchas by properties of minimal separators [3] or as intersection graphs [2,4,13].Another characterisation is by vertex layouts.

Theorem 1 ([10]). An undirected graph H is chordal if and only if there is avertex layout β for H such that for all vertex triples u, v, w of H with u ≺β v ≺β

w, {v, u}, {u, w} ∈ E(H) implies {v, w} ∈ E(H).

A digraph is called acyclic if it contains no directed cycle. Acyclic digraphs haveat most one arc between every pair of vertices. The following characterisationis folklore: a digraph G is acyclic if and only if there is a vertex layout β for Gsuch that for all arcs (u, v) of G, u ≺β v.

The structure of digraphs is often studied by looking only at the adjacencyrelation. For a digraph G, the underlying graph is the undirected graph H on

Page 286: Graph-Theoretic Concepts in Computer Science

276 D. Meister and J.A. Telle

vertex set V (G), and for every pair u, v of vertices of G, {u, v} ∈ E(H) if andonly if (u, v) ∈ A(G) or (v, u) ∈ A(G).

3 Definition of Chordal Digraphs and First Results

We define a new class of digraphs. This class is defined inductively, in a mannersimilar to k-trees. We call our digraphs chordal and show by several characteri-sation results that the chordal digraphs and the chordal undirected graphs haveanalogous properties.

Definition 11. A d-clique of a digraph G is a pair (A, B) with A, B ⊆ V (G) where for all

a ∈ A and b ∈ B with a = b, (a, b) ∈ A(G).2. The class of chordal digraphs is inductively defined as follows:

– a graph on a single vertex is a chordal digraph– let G be a chordal digraph and let u be a vertex that does not appear in

G. Let (A, B) be a d-clique of G. The graph is also a chordal digraphthat is obtained from G by adding u and the set of arcs {(a, u) : a ∈A} ∪ {(u, b) : b ∈ B}.

In other words, a chordal digraph is extended by a new vertex u by chosing ad-clique and making the one set the in-neighbours of u and the other set theout-neighbours of u. In case of k-trees or general chordal undirected graphs,the chosen d-clique corresponds to the chosen clique and there is no distinctionbetween in- and out-neighbours. For a digraph G that is constructed accordingto Definition 1, the vertex layout that lists the vertices in order they are added tobuild G where the leftmost vertex is the last added vertex is called constructionsequence. Note that a chordal digraph can have different construction sequences,since the construction of a chordal digraph is no unique process.

The class of chordal digraphs is closely related to the notion of Kelly-width [7].We can introduce a parameter k that bounds the size of the second componentin a d-clique. A chordal digraph has width k if it can be constructed accordingto Definition 1 by only choosing d-cliques with size of the second component atmost k. With the results in [7] and [9], it is easy to verify that a digraph hasKelly-width at most k + 1 if and only if it is subgraph of a chordal digraph ofwidth at most k.

Chordal digraphs can be understood as a generalisation of chordal undirectedgraphs, since every chordal undirected graph can be seen as a chordal digraph ina natural sense: from an undirected graph H , obtain a digraph H by replacingevery edge by the two arcs between the connected vertices. If we only use theadjacency matrix as graph representation, we can call H and G equivalent. Wewill see in the next section that G is chordal if and only if H is chordal. Forchordal digraphs with all pairs of adjacent vertices connected by two arcs, wecan make the following observation about the construction process: for everyadded vertex x, the in-neighbourhood and out-neighbourhood have to be the

Page 287: Graph-Theoretic Concepts in Computer Science

Chordal Digraphs 277

same, which means that the chosen d-clique is of the form (A, A). Such d-cliquesinduce complete subgraphs.

Chordal undirected graphs have many equivalent characterisations. We showthat some of these characterisations have analogues for chordal digraphs. Webegin with a vertex layout characterisation for chordal digraphs, that is an ana-logue of Theorem 1.

Definition 2. Let G be a digraph with vertex layout β. We say that β is directedtransitive if for every triple u, v, w of pairwise different vertices of G with u ≺β v,u ≺β w, (v, u) ∈ A and (u, w) ∈ A, it holds (v, w) ∈ A.

Theorem 2. Let G be a digraph with vertex layout β. G is a chordal digraphwith construction sequence β if and only if the reverse of β is directed transitive.

Proof. We show the theorem by induction over the number of vertices in adigraph. The statement is obviously true for digraphs on a single vertex. Now,let G be a digraph on at least two vertices, and let β = 〈x1, . . . , xn〉 be a vertexlayout for G. Let G′ =def G[{x1, . . . , xn−1}] and β′ =def 〈x1, . . . , xn−1〉. Let G bea chordal digraph with construction sequence β. Then, G′ is a chordal digraphwith construction sequence β′ according to Definition 1. Applying the inductionhypothesis, β′ is directed transitive for G′. It remains to prove that (a, b) ∈ A forevery pair a, b of vertices where a ∈ N in

G (xn) and b ∈ NoutG (xn). Let xn be added

to G′ by chosing d-clique (A, B). By definition, every vertex in A is in-neighbourof every vertex in B. Let a ∈ N in

G (xn) and b ∈ NoutG (xn) with a = b, i.e., a ∈ A

and b ∈ B. Then, (a, b) ∈ A(G). For the converse, let β be directed transitivefor G. Then, β′ is directed transitive for G′, and by induction hypothesis, G′

is a chordal digraph with construction sequence β′. Let A =def N inG (xn) and

B =def NoutG (xn). By definition of directed transitive, (a, b) ∈ A(G) for every

a ∈ A and b ∈ B and a = b. Hence, (A, B) is a d-clique in G′, and G can beobtained from G′ by adding xn in the sense of Definition 1. Hence, G is a chordaldigraph with construction sequence β. ��Since “directed transitive” generalises “topological ordering”, it directly followsfrom Theorem 2 that acyclic digraphs are chordal. We will see later that acyclicdigraphs are the only chordal digraphs that have at most one arc between everypair of vertices.

Lemma 1. Every induced subgraph of a chordal digraph is chordal.

For a digraph G, denote by rev(G) the digraph on vertex set V (G) and witharc set A(rev(G)) where for all u, v ∈ V (G), (u, v) ∈ A(rev(G)) if and only if(v, u) ∈ A(G). We call rev(G) the reverse graph of G.

Lemma 2. A digraph G is chordal if and only if rev(G) is chordal.

It is a natural question to ask whether chordality of a digraph can be determinedby looking at the connected components separately. With the characterisation ofTheorem 2, it is an easy observation that a digraph is chordal if and only if all its

Page 288: Graph-Theoretic Concepts in Computer Science

278 D. Meister and J.A. Telle

Fig. 2. The depicted digraph is chordal and has exactly one di-simplicial vertex

weakly connected components are chordal. A directed transitive vertex layout forthe whole digraph can be constructed by concatenating directed transitive vertexlayouts for the weakly connected components. However, the same is generally nottrue for strongly connected components. In fact, there is a non-chordal digraphon four vertices with only chordal strongly connected components.

Our first type of characterisations of chordal digraphs was by vertex layouts.The second type of characterisations involves vertices of special properties. Infact, we define and consider analogues of simplicial vertices for undirected chordalgraphs.

Definition 3. A vertex u of a digraph G is di-simplicial if (N inG (u), Nout

G (u)) isa d-clique of G.

A vertex of an undirected graph is simplicial if its neighbourhood is a clique. Itis an easy result that a vertex u of an undirected graph G is simplicial if and onlyif for every path P of G of length at least 1, P−u is a path in G. An analoguecharacterisation holds for digraphs and di-simplicial vertices where paths aredirected paths. In this sense, di-simplicial vertices are the directed analogue ofsimplicial vertices.

Lemma 3. The first vertex of a directed transitive vertex layout is di-simplicial.In particular, every chordal digraph has a di-simplicial vertex.

Non-complete chordal undirected graph have two non-adjacent simplicial vertices[3]. The same is not generally true for chordal digraphs. The digraph in Figure 2has exactly one di-simplicial vertex.

Theorem 3. A digraph G is chordal if and only if G can be reduced to a digraphon a single vertex by repeatedly deleting an arbitrary di-simplicial vertex.

Theorem 3 also shows that chordal digraphs are exactly the perfect eliminationdigraphs, introduced by Haskins and Rose [6], see also [8]. Rose and Tarjan gavean O(nm)-time algorithm for recognising perfect elimination digraphs [11], andtherefore for chordal digraphs.

It is not difficult to see that there is a 1-to-1 correspondence between the di-rected transitive vertex layouts of a chordal digraph and the orderings defined bythe elimination process in Theorem 3. Note that a result analogous to Theorem 3exists for chordal undirected graphs [10].

Page 289: Graph-Theoretic Concepts in Computer Science

Chordal Digraphs 279

4 Two Classes of Chordal Digraphs

We consider two classes of digraphs and characterise their chordal digraphs.First, we consider digraphs that have at most one arc between every pair ofvertices, and second, we consider digraphs that have two arcs between everypair of adjacent vertices. For a digraph G, we denote by uni(G) the digraphon vertex set V (G), and for all u, v ∈ V (G), (u, v) ∈ A(uni(G)) if and onlyif (u, v) ∈ A(G) and (v, u) ∈ A(G). In other words, uni(G) is the restrictionof G to the arcs that uniquely connected two vertices. We call uni(G) the uni-restriction of G. As examples, if G is a tournament graph or an acyclic digraphthen uni(G) = G.

Theorem 4. A digraph G with uni(G) = G is chordal if and only if G containsno chordless directed cycle of length at least 3.

Proof. If G contains no chordless directed cycle of length at least 3 then G isacyclic. Any topological ordering for G is directed transitive for G. Let G bechordal with directed transitive vertex layout β. Suppose that (x1, . . . , xk) is ashortest chordless directed cycle in G. We can assume x1 ≺β x2 and x1 ≺β xk.Then, (xk, x1), (x1, x2) ∈ A(G) implies (xk, x2) ∈ A(G), which contradicts thechoice of the cycle. ��Corollary 1. A digraph G with uni(G) = G is chordal if and only if G is acyclic.

Every undirected graph is underlying graph of an acyclic digraph. So, everyundirected graph is underlying graph of a chordal digraph. This also means thatlooking at underlying graphs of chordal digraphs cannot provide any insight intothe structure of chordal digraphs.

The second class of digraphs in this section consists of the digraphs withalways two arcs between every pair of adjacent vertices. For a digraph G, wedenote by bi(G) the digraph on vertex set V (G), and for all u, v ∈ V (G), (u, v) ∈A(bi(G)) if and only if (u, v) ∈ A(G) and (v, u) ∈ A(G). We call bi(G) the bi-restriction of G. Clearly, uni(G) and bi(G) are complementary to each other. Thedigraphs G with bi(G) are the ones that are obtained from undirected graphsby replacing every edge {u, v} by the two arcs (u, v) and (v, u). Note that fordigraphs G with bi(G) = G, the adjacency matrices of G and the underlyinggraph of G are equal.

Lemma 4. If a digraph G is chordal then bi(G) contains no chordless directedcycle of length at least 4.

Proof. Let G be chordal with β directed transitive vertex layout for G. Supposethat bi(G) contains a chordless directed cycle (x1, . . . , xk) where k ≥ 4. We canassume that x1 ≺β x2, . . . , xk. Then, (xk, x1), (x1, x2) ∈ A(G) implies (xk, x2) ∈A(G), and (x2, x1), (x1, xk) ∈ A(G) implies (x2, xk) ∈ A(G). Thus, x2 and xk

are adjacent in bi(G), contradicting k ≥ 4. ��In other words, Lemma 4 shows that for every chordal digraph G, the underlyinggraph of bi(G) is chordal.

Page 290: Graph-Theoretic Concepts in Computer Science

280 D. Meister and J.A. Telle

Theorem 5. A digraph G with bi(G) = G is chordal if and only if G containsno chordless directed cycle of length at least 4.

For every chordal undirected graph H , there is a digraph G with bi(G) = G suchthat H is the underlying graph of G. Since H is chordal, G contains no chordlessdirected cycle of length at least 4, and thus G is chordal due to Theorem 5.Hence, the chordal undirected graphs are exactly the underlying graphs of thebi-restriction of chordal digraphs.

5 Chordal Semi-complete Digraphs

A digraph is called semi-complete if every pair of vertices is adjacent. Pairs ofvertices can be connected by one or two arcs. We give a complete characteri-sation of chordal semi-complete digraphs by forbidden induced subgraphs. Wewill obtain this result by mainly studying simplicial vertices in the underlyingundirected graph of bi(G). Our approach to the forbidden induced subgraphscharacterisation is to give a characterisation of semi-complete digraphs withoutdi-simplicial vertices. Remember from Lemma 3 that every chordal digraph hasa di-simplicial vertex.

We use the notion of uni- and bi-restriction defined in the previous section.The uni-restrictions will be our main study objects. Let F be a semi-completedigraph and let G =def uni(F ). Let u, v, w be a vertex triple of F . We call(u, v, w) a witness triple for u in G if one of the following three conditions issatisfied:

– (u, v), (v, u), (u, w), (w, u) ∈ A(G) and (v, w) ∈ A(G)– (u, v), (v, w) ∈ A(G) and (u, w), (w, u) ∈ A(G), or

(w, v), (v, u) ∈ A(G) and (u, w), (w, u) ∈ A(G)– (v, u), (u, w), (w, v) ∈ A(G) .

We refer to the different schemes as “witness triple of the first, second or thirdtype”.

Lemma 5. 1) A vertex u of a semi-complete digraph F is di-simplicial if andonly if there is no witness triple for u in uni(F ).

2) If a vertex u of a digraph F is di-simplicial in F then u is simplicial in theunderlying graph of bi(F ).

For the proof of our main result, we need two properties of chordal undirectedgraphs. Let x and y be adjacent simplicial vertices of an undirected graph H .Then, NH [x] = NH [y]. Equivalently, x and y have the same non-neighbours.The second tool property is the following: for H a chordal undirected graph ua vertex of H that is not universal, every connected component of H \ NH [u]contains a vertex that is simplicial in H . We are ready for the main result ofthis section.

Lemma 6. Let F be a semi-complete digraph with the underlying graph of bi(F )being chordal. If F is not chordal then uni(F ) contains one of the digraphs ofFigure 1 as induced subgraph.

Page 291: Graph-Theoretic Concepts in Computer Science

Chordal Digraphs 281

Proof. Let F not be chordal. We first consider the case that F contains nodi-simplicial vertex; the other case is discussed at the end of the proof. LetG =def uni(F ) and let H be the underlying graph of bi(F ). By assumption,H is chordal. Due to Lemma 5, a vertex that is not simplicial in H is not di-simplicial in F . If a simplicial vertex of H is not di-simplicial in F then it isnot di-simplicial because of orientations of arcs in G. Applying Lemma 5, theassumption that F contains no di-simplicial vertex means that every vertex ofG has a witness triple in G. In particular, every simplicial vertex of H has awitness triple in G. If there is a vertex with a witness triple of the third typethen G contains a copy of digraph (a) of Figure 1 as induced subgraph. Now,assume that all witness triples in G are of the first or second type. Let u be asimplicial vertex of H . Then, u cannot have a witness triple of the first type.Hence, all simplicial vertices of H have only witness triples of the second type inG. We construct an auxiliary digraph based on these witness triples and showthe existence of a digraph of Figure 1 as induced subgraph.

Let S be the set of vertices of F that are simplicial in H . We construct adigraph D that has vertex set S, and there is an arc (u, v) if and only if thereis a vertex w of G such that (u, v, w) is a witness triple for u in G. We showthat every vertex of D has an out-neighbour. Let u be a vertex of S. By theabove considerations, there is a witness triple (u, y, z) for u in G. Since u andz are adjacent to y in G, u and z are non-adjacent to y in H . Furthermore, uand z are non-adjacent in G, thus adjacent in H . So, y is vertex in a connectedcomponent K of H \ (NH(u)∪NH(z)). Since u is simplicial and z is a neighbourof u in H , NH(u) ⊆ NH [z]. There exists a vertex v from S in K. We want toshow that (u, v, z) is a witness triple for u in G or G contains a copy of a digraphof Figure 1 as induced subgraph. Since K is connected, there is a spanning tree Tfor K. Let all vertices of T be unmarked. We show by induction that (u, x, z) is awitness triple for u in G for all vertices x of T . Mark y in T . By assumption, theclaim is true for every marked vertex of T . Let x′ be an unmarked vertex of Tthat has a marked neighbour x′′ in T . Mark x′. We consider the triple (u, x′, z).Remember that u and z are non-adjacent in G and x′ is adjacent to both uand z in G. Assume that (u, x′, z) is not a witness triple for u in G. Then,(u, x′), (z, x′) ∈ A(G) or (x′, u), (x′, z) ∈ A(G). This implies that {u, z, x′, x′′}induces a copy of digraph (d) of Figure 1 in G. If no copy of digraph (d) has beendetected, (u, v, z) is a witness triple for u in G, since all vertices of T have beenmarked, and thus D contains arc (u, v). We conclude that every vertex of D hasan out-neighbour or G contains a copy of digraph (d) as induced subgraph. Thiscompletes the construction of D.

Assume that every vertex of D has an out-neighbour in D, i.e., D is notacyclic and contains a directed cycle. Let C = (u1, . . . , uk) be a directed cycle inD of shortest length. It can be shown that in case k = 2, G contains a copy ofdigraph (b), (c) or (d) of Figure 1 as induced subgraph. Henceforth, let k ≥ 3.If (u1, u2), . . . , (uk−1, uk), (uk, u1) ∈ A(G) or (u1, uk), (uk, uk−1), . . . , (u2, u1) ∈A(G) then G contains a directed cycle as subgraph, and therefore, G containsdigraph (a) or (c) of Figure 1 as induced subgraph. Now, assume that (u1, . . . , uk)

Page 292: Graph-Theoretic Concepts in Computer Science

282 D. Meister and J.A. Telle

does not define a directed cycle in G. We can assume that (u1, u2), (u1, uk) ∈A(G). It can be shown that no witness triple has all its vertices on C.

Suppose that k ≥ 4. We consider the vertices u1, u2, uk. Let a, b be verticessuch that (u1, u2, b) is a witness triple for u1 and (uk, u1, a) is a witness triple foruk in G. Remember that (u1, u2), (u1, uk) ∈ A(G). Thus, (u1, u2), (u2, b) ∈ A(G)and (a, u1), (u1, uk) ∈ A(G). By the considerations above, a and b are not verticeson C. Furthermore, a = b. If a and u2 are non-adjacent in G then (u2, u1, a) isa witness triple for u2 in G, which means (u2, u1) ∈ A(D), and D has a cycle oflength 2. This contradicts our assumption k ≥ 4. Thus, a and u2 are adjacent inG. If (u2, a) ∈ A(G) then {u1, u2, a} induces a copy of digraph (a) of Figure 1in G, and we are done. Otherwise, let (a, u2) ∈ A(G). Since u2 and uk aresimplicial in H and have different neighbourhoods, they are adjacent in G. If(u2, uk) ∈ A(G) then (uk, u2, a) is a witness triple for uk in G, which means(uk, u2) ∈ A(D), and C has a chord. This contradicts the above results. Hence,(uk, u2) ∈ A(G). If uk and b are non-adjacent in G then (uk, u2, b) is a witnesstriple for uk in G, and (uk, u2) ∈ A(G). Since this yields a contradiction, uk

and b must be adjacent. If (b, uk) ∈ A(G) then {uk, u2, b} induces a copy ofdigraph (a) of Figure 1 in G. Otherwise, if (uk, b) ∈ A(G) then (u1, uk, b) is awitness triple for u1 in G, which means (u1, uk) ∈ A(D), thus a contradiction.We conclude that k ≥ 4, i.e., k = 3.

We distinguish between two cases: (u2, u3) ∈ A(G) and (u3, u2) ∈ A(G).Let a, b, c be vertices such that (u1, u2, b), (u2, u3, c) and (u3, u1, a) are witnesstriples for respectively u1, u2, u3 in G. Note that a, b, c are pairwise different.And since u1, u2, u3 are pairwise adjacent in G, {a, b, c}∩{u1, u2, u3} = ∅. Hence,u1, u2, u3, a, b, c are pairwise different. For the first case, let (u2, u3) ∈ A(G). Thismeans that (u3, c) ∈ A(G). We consider a and u2. If a and u2 are non-adjacentin G then {a, u1, u2, b} induces a copy of digraph (b) or (c) or (d) of Figure 1 inG. If (u2, a) ∈ A(G) then {a, u1, u2} induces a copy of digraph (a) of Figure 1in G. And if (a, u2) ∈ A(G) then {a, u2, u3, c} induces a copy of digraph (b) or(c) or (d) of Figure 1 in G. For the second case, let (u3, u2) ∈ A(G). This meansthat (c, u3) ∈ A(G). We consider b and u3 and conclude in the above mannerthat {c, u3, u2, b} or {u3, u2, b} or {a, u1, u3, b} induces a copy of a digraph ofFigure 1 in G. Hence, we have found a copy of a digraph of Figure 1 as inducedsubgraph in G in every case, so that we can conclude the case when G has nodi-simplicial vertex.

Now, we consider the case that F contains di-simplicial vertices. We applyTheorem 3 and conclude that F contains an induced subgraph F ′ on at leasttwo vertices without di-simplicial vertex. Then, F ′ is not chordal and satisfiesthe conditions of the above case. Note that the underlying graph of bi(F ′) ischordal, since it is an induced subgraph of a chordal undirected graph. We applythe above case and conclude that uni(F ′) contains a copy of a digraph of Figure 1as induced subgraph. This completes the proof. ��Theorem 6. A semi-complete digraph F is chordal if and only if the underlyinggraph of bi(F ) is chordal and uni(F ) does not contain a copy of any of thedigraphs of Figure 1 as induced subgraph.

Page 293: Graph-Theoretic Concepts in Computer Science

Chordal Digraphs 283

Proof. Let H be the underlying graph of bi(F ). If H is not chordal then bi(F )contains a chordless directed cycle of length at least 4. With Lemma 4, F is notchordal. Now, let uni(F ) contain a copy C of a digraph of Figure 1 as inducedsubgraph. Then, F contains a non-chordal induced subgraph, thus is not chordaldue to Lemma 1. For the converse, let F not be chordal and let H be chordal.Then, uni(F ) contains a copy of one of the digraphs of Figure 1 as inducedsubgraph due to Lemma 6. ��

The actual set of minimal forbidden induced subgraphs for chordal semi-completedigraphs is the following: all semi-complete digraphs F with the underlying graphof bi(F ) a chordless cycle of length at least 4 and the four digraphs that areobtained from the digraphs of Figure 1 by adding the two arcs between everypair of non-adjacent vertices (of each digraph). We want to conclude with tworemarks. Firstly, note that even though the actual set of minimal forbiddeninduced subgraphs for chordal semi-complete digraphs is much bigger than theset of minimal forbidden induced subgraphs for chordal undirected graphs (due tothe many different orientations), the structure of chordal semi-complete digraphis already much richer than the structure of the whole class of chordal undirectedgraphs. This can give a first impression of the significant difference betweendirected and undirected graphs. Secondly, it is an interesting observation thateach digraph of Figure 1 is isomorphic to its own reverse graph.

6 Conclusion

In Section 3, we have given two characterisations of chordal digraphs (Theorem 2and Theorem 3), which are analogues of characterisations of chordal undirectedgraphs. We have also introduced the notion of d-clique as a directed analogue oreven generalisation of the undirected notion of clique. A famous characterisationof chordal undirected graphs gives a connection between cliques and minimalseparators [3]. Is there a directed notion of minimal separator that is connectedto d-cliques in a similar way for chordal digraphs?

Another famous characterisation of chordal undirected graphs is as intersec-tion graphs of subtrees of a tree. Can this be generalised to chordal digraphs?Let us remark that there is a generalisation of intersection graphs to ’intersec-tion digraphs’ that results in an interesting directed analogue of interval graphs[12,14]. However, if using this definition of ’intersection digraphs’ then all di-graphs become representable by ’intersection subtrees’ [5], see also Bang-Jensenand Gutin [1] [Proposition 4.13.2]. Thus, a different approach is needed to definethe proper directed analogue of ’intersection graph of subtrees of a tree’.

On the structural side, the main open problem for chordal digraphs is a charac-terisation by forbidden induced subgraphs. We have given such characterisationsfor large subclasses of digraphs, such as digraphs G with bi(G) empty and semi-complete digraphs. The case of semi-complete digraphs shows that a forbiddeninduced subgraphs characterisation for the whole class of chordal digraphs ischallenging.

Page 294: Graph-Theoretic Concepts in Computer Science

284 D. Meister and J.A. Telle

On the algorithmic side, there are many interesting problems. A di-simplicialvertex can trivially be found in O(nm) time. Can this be reduced to O(n2)or even linear time? There is an O(nm)-time algorithm for recognising chordaldigraphs [6,8,11]. Rose and Tarjan showed that this problem is closely relatedto other well-studied problems like transitivity test [11]. Improvements on thechordal digraph recognition directly carry over to other problems, and thus areof great interest. The study of chordal digraph recognition for digraph classesmay be a way of implicitly attacking also other problems. Finally, we want toask whether there exists an O(n2)-time algorithm for verifying whether a givenvertex ordering is directed transitive.

One motivation for the study of chordal digraphs is their connection to Kelly-width. Can the structural properties exhibited by chordal digraphs be exploitedalgorithmically for graphs of bounded Kelly-width?

References

1. Bang-Jensen, J., Gutin, G.: Digraphs. Theory, Algorithms and Applications.Springer, Heidelberg (2000)

2. Buneman, P.: A Characterisation of Rigid Circuit Graphs. Discrete Mathematics 9,205–212 (1974)

3. Dirac, G.A.: On rigid circuit graphs. Abhandlungen aus dem Mathematischen Sem-inar der Universitat Hamburg 25, 71–76 (1961)

4. Gavril, F.: The Intersection Graphs of Subtrees in Trees Are Exactly the ChordalGraphs. Journal of Combinatorial Theory (B) 16, 47–56 (1974)

5. Harary, F., Kabell, J.A., McMorris, F.R.: Bipartite intersection graphs. Commen-tationes Mathematicae Universitatis Carolinae 23, 739–745 (1982)

6. Haskins, L., Rose, D.J.: Toward characterization of perfect elimination digraphs.SIAM Journal on Computing 2, 217–224 (1973)

7. Hunter, P., Kreutzer, S.: Digraph measures: Kelly decompositions, games, andorderings. Theoretical Computer Science 399, 206–219 (2008)

8. Kleitman, D.J.: A note on perfect elimination digraphs. SIAM Journal on Com-puting 3, 280–282 (1974)

9. Meister, D., Telle, J.A., Vatshelle, M.: Characterization and Recognition of Di-graphs of Bounded Kelly-width. In: Brandstadt, A., Kratsch, D., Muller, H. (eds.)WG 2007. LNCS, vol. 4769, pp. 270–279. Springer, Heidelberg (2007)

10. Rose, D.J.: Triangulated Graphs and the Elimination Process. Journal of Mathe-matical Analysis and Applications 32, 597–609 (1970)

11. Rose, D.J., Tarjan, R.E.: Algorithmic Aspects of Vertex Elimination on DirectedGraphs. SIAM Journal on Applied Mathematics 34, 176–197 (1978)

12. Sanyal, B.K., Sen, M.K.: New characterization of digraphs represented by intervals.Journal of Graph Theory 22, 297–303 (1996)

13. Walter, J.R.: Representations of Chordal Graphs as Subtrees of a Tree. Journal ofGraph Theory 2, 265–267 (1978)

14. West, D.B.: Short proofs for interval digraphs. Discrete Mathematics 178, 287–292(1998)

Page 295: Graph-Theoretic Concepts in Computer Science

A New Intersection Model and ImprovedAlgorithms for Tolerance Graphs

George B. Mertzios1, Ignasi Sau2, and Shmuel Zaks3

1 Department of Computer Science, RWTH Aachen University, [email protected]

2 Mascotte joint Project of INRIA/CNRS/UNSA, Sophia-Antipolis, France; andGraph Theory and Combinatorics Group, Applied Maths. IV Dept. of UPC,

Barcelona, [email protected]

3 Department of Computer Science, Technion, Haifa, [email protected]

Abstract. Tolerance graphs model interval relations in such a waythat intervals can tolerate a certain degree of overlap without beingin conflict. This class of graphs, which generalizes in a natural wayboth interval and permutation graphs, has attracted many researchefforts since their introduction in [9], as it finds many importantapplications in constraint-based temporal reasoning, resource allocation,and scheduling problems, among others. In this article we propose thefirst non-trivial intersection model for general tolerance graphs, givenby three-dimensional parallelepipeds, which extends the widely knownintersection model of parallelograms in the plane that characterizesthe class of bounded tolerance graphs. Apart from being important onits own, this new representation also enables us to improve the timecomplexity of three problems on tolerance graphs. Namely, we presentoptimal O(n log n) algorithms for computing a minimum coloring and amaximum clique, and an O(n2) algorithm for computing a maximumweight independent set in a tolerance graph with n vertices, thusimproving the best known running times O(n2) and O(n3) for theseproblems, respectively.

Keywords: Tolerance graphs, parallelogram graphs, intersectionmodel, minimum coloring, maximum clique, maximum weight indepen-dent set.

1 Introduction

A graph G = (V, E) on n vertices is a tolerance graph if there is a set I = {Ii | i =1, . . . , n} of closed intervals on the real line and a set T = {ti | i = 1, . . . , n} ofpositive real numbers, called tolerances, such that for any two vertices vi, vj ∈ V ,vivj ∈ E if and only if |Ii ∩ Ij | ≥ min{ti, tj}, where |I| denotes the length of theinterval I. These sets of intervals and tolerances form a tolerance representationof G. If G has a tolerance representation such that ti ≤ |Ii| for i = 1, . . . , n,

C. Paul and M. Habib (Eds.): WG 2009, LNCS 5911, pp. 285–295, 2010.c© Springer-Verlag Berlin Heidelberg 2010

Page 296: Graph-Theoretic Concepts in Computer Science

286 G.B. Mertzios, I. Sau, and S. Zaks

then G is called a bounded tolerance graph and its representation is a boundedtolerance representation.

Tolerance graphs were introduced in [9], mainly motivated by the need to solvescheduling problems in which resources that would be normally used exclusively,like rooms or vehicles, can tolerate some sharing among users. Since then, tole-rance graphs have been widely studied in the literature [1, 2, 5, 10, 11, 14, 16, 20],as they naturally generalize both interval graphs (when all tolerances are equal)and permutation graphs (when |Ii| = ti for i = 1, . . . , n) [9]. For more details,see [12].

Notation. All the graphs considered in this paper are finite, simple, and undi-rected. Given a graph G = (V, E), we denote by n the cardinality of V . An edgebetween vertices u and v is denoted by uv, and in this case vertices u and vare said to be adjacent. G denotes the complement of G, i.e. G = (V, E), whereuv ∈ E if and only if uv /∈ E. Given a subset of vertices S ⊆ V , the graph G[S]denotes the graph induced by the vertices in S, i.e. G[S] = (S, F ), where forany two vertices u, v ∈ S, uv ∈ F if and only if uv ∈ E. A subset S ⊆ V isan independent set in G if the graph G[S] has no edges. For a subset K ⊆ V ,the induced subgraph G[K] is a complete subgraph of G, or a clique, if each twoof its vertices are adjacent (equivalently, K is an independent set in G). Themaximum cardinality of a clique in G is denoted by ω(G) and is termed theclique number of G. A proper coloring of G is an assignment of different colorsto adjacent vertices, which results in a partition of V into independent sets. Theminimum number of colors for which there exists a proper coloring is denotedby χ(G) and is termed the chromatic number of G. A partition of V into χ(G)independent sets is a minimum coloring of G.

Motivation and previous work. Besides generalizing interval and permutationgraphs in a natural way, the class of tolerance graphs has other important sub-classes and superclasses. Let us briefly survey some of them.

A graph is perfect if the chromatic number of every induced subgraph equalsthe clique number of that subgraph. Perfect graphs include many importantfamilies of graphs, and serve to unify results relating colorings and cliques inthose families. For instance, in all perfect graphs, the graph coloring problem,maximum clique problem, and maximum independent set problem can all besolved in polynomial time using the Ellipsoid method [13]. Since tolerance graphswere shown to be perfect [10], there exist polynomial time algorithms for theseproblems. However, these algorithms are not very efficient and therefore, as ithappens for most known subclasses of perfect graphs, it makes sense to devisespecific fast algorithms for these problems on tolerance graphs.

A comparability graph is a graph which can be transitively oriented. A co-comparability graph is a graph whose complement is a comparability graph.Bounded tolerance graphs are co-comparability graphs [9], and therefore allknown polynomial time algorithms for co-comparability graphs apply to boun-ded tolerance graphs. This is one of the main reasons why for many problemsthe existing algorithms have better running time in bounded tolerance graphsthan in general tolerance graphs.

Page 297: Graph-Theoretic Concepts in Computer Science

A New Intersection Model and Improved Algorithms for Tolerance Graphs 287

A graph G = (V, E) is the intersection graph of a family F = {S1, . . . , Sn} ofdistinct nonempty subsets of a set S if there exists a bijection μ : V → F suchthat for any two distinct vertices u, v ∈ V , uv ∈ E if and only if μ(u)∩μ(v) �= ∅.In that case, we say that F is an intersection model of G. It is easy to see thateach graph has a trivial intersection model based on adjacency relations [18].Some intersection models provide a natural and intuitive understanding of thestructure of a class of graphs, and turn out to be very helpful to find efficientalgorithms to solve optimization problems [18]. Therefore, it is of great import-ance to establish non-trivial intersection models for families of graphs. A graphG on n vertices is a parallelogram graph if we can fix two parallel lines L1 andL2, and for each vertex vi ∈ V (G) we can assign a parallelogram P i with parallelsides along L1 and L2 so that G is the intersection graph of {P i | i = 1, . . . , n}.It was proved in [1, 17] that a graph is a bounded tolerance graph if and onlyif it is a parallelogram graph. This characterization provides a useful way tothink about bounded tolerance graphs. However, this intersection model cannotcope with general tolerance graphs, in which the tolerance of an interval can begreater than its length.

Our contribution. In this article we present the first non-trivial intersection mo-del for general tolerance graphs, which generalizes the widely known parallelogramrepresentation of bounded tolerance graphs. The main idea is to exploit the thirddimension to capture the information given by unbounded tolerances, and as a re-sult parallelograms are replaced with parallelepipeds. The proposed intersectionmodel is very intuitive and can be efficiently constructed from a tolerance repre-sentation (actually, we show that it can be constructed in linear time).

Apart from being important on its own, this new representation proves to bea powerful tool for designing efficient algorithms for general tolerance graphs.Indeed, using our intersection model we improve the best existing running timesof three problems on tolerance graphs. We present algorithms to find a minimumcoloring and a maximum clique inO(n log n) time, which turns out to be optimal.The best existing algorithm was O(n2) [11,12]. We also present an algorithm tofind a maximum weight independent set in O(n2) time, whereas the best knownalgorithm was O(n3) [12]. We note that [20] proposes an O(n2 log n) algorithmto find a maximum cardinality independent set on a general tolerance graph,and that [12] refers to an algorithm transmitted by personal communicationwith running time O(n2 log n) to find a maximum weight independent set on ageneral tolerance graph; to the best of our knowledge, this algorithm has notbeen published.

It is important to note that the complexity of recognizing bounded and generaltolerance graphs is a challenging open problem [3, 12, 20], and this is the reasonwhy we assume throughout this paper that along with the input tolerance graphwe are also given a tolerance representation of it. The only “positive” result in theliterature concerning recognition of tolerance graphs is a linear time algorithmfor the recognition of bipartite tolerance graphs [3].

Organization of the paper. We provide the new intersection model of generaltolerance graphs in Section 2. In Section 3 we present a canonical representation

Page 298: Graph-Theoretic Concepts in Computer Science

288 G.B. Mertzios, I. Sau, and S. Zaks

of tolerance graphs, and then show how it can be used in order to obtain optimalO(n log n) algorithms for finding a minimum coloring and a maximum clique ina tolerance graph. In Section 4 we present an O(n2) algorithm for finding amaximum weight independent set. Finally, Section 5 is devoted to conclusionsand open problems. Some proofs have been omitted due to space limitations; afull version can be found in [19].

2 A New Intersection Model for Tolerance Graphs

One of the most natural representations of bounded tolerance graphs is givenby parallelograms between two parallel lines in the Euclidean plane [1,12,17]. Inthis section we extend this representation to a three-dimensional representationof general tolerance graphs.

Given a tolerance graph G = (V, E) along with a tolerance representation ofit, recall that vertex vi ∈ V corresponds to an interval Ii = [ai, bi] on the realline with a tolerance ti ≥ 0. W.l.o.g. we may assume that ti > 0 for every vertexvi [12].

Definition 1. Given a tolerance representation of a tolerance graph G = (V, E),vertex vi is bounded if ti ≤ |Ii|. Otherwise, vi is unbounded. VB and VU are thesets of bounded and unbounded vertices in V , respectively. Clearly V = VB ∪VU .

We can also assume w.l.o.g. that ti = ∞ for any unbounded vertex vi, since ifvi is unbounded, then the intersection of any other interval with Ii is strictlysmaller than ti. Let L1 and L2 be two parallel lines at distance 1 in the Euclideanplane.

Definition 2. Given an interval Ii = [ai, bi] with tolerance ti, P i is the par-allelogram defined by the points ci, bi in L1 and ai, di in L2, where ci =min {bi, ai + ti} and di = max {ai, bi − ti}. The slope φi of P i is φi =arctan

(1

ci−ai

).

An example is depicted in Figure 1, where P i and P j correspond to boundedvertices vi and vj , and P k corresponds to an unbounded vertex vk. Observethat when vertex vi is bounded, the values ci and di coincide with the tolerancepoints defined in [7, 12, 15], and φi = arctan

(1ti

). On the other hand, when

vertex vi is unbounded, the values ci and di coincide with the endpoints bi andai of Ii, respectively, and φi = arctan

(1|Ii|

). Observe also that in both cases

ti = bi − ai and ti = ∞, parallelogram P i is reduced to a line segment (c.f. P j

and P k in Figure 1). Since ti > 0 for every vertex vi, it follows that 0 < φi < π2 .

Furthermore, we can assume w.l.o.g. that all points ai, bi, ci, di and all slopes φi

are distinct [7, 12, 15].

Observation 1. Let vi ∈ VU , vj ∈ VB . Then |Ii| < tj if and only if φi > φj.

We are ready to give the main definition of this article.

Page 299: Graph-Theoretic Concepts in Computer Science

A New Intersection Model and Improved Algorithms for Tolerance Graphs 289

L1

L2

1

ti

ai

bici

di

ti

φi

P iP j

aj = dj

cj = bj

φj

P k

|Ij |

tj

|Ik||Ii|

ck = bk

ak = dk

tk =∞

φk

Fig. 1. Parallelograms P i and P j correspond to bounded vertices vi and vj , respec-tively, whereas P k corresponds to an unbounded vertex vk

Definition 3. Let G = (V, E) be a tolerance graph with a tolerance representati-on {Ii = [ai, bi], ti | i = 1, . . . , n}. For every i = 1 . . . , n, Pi is the parallelepipedin �3 defined as follows:

(a) If ti ≤ bi − ai (that is, vi is bounded), then Pi = {(x, y, z) ∈ �3 | (x, y) ∈P i, 0 ≤ z ≤ φi}.

(b) If ti > bi− ai (vi is unbounded), then Pi = {(x, y, z) ∈ �3 | (x, y) ∈ P i, z =φi}.

The set of parallelepipeds {Pi | i = 1, . . . , n} is a parallelepiped representationof G.

Observe that for each interval Ii, the parallelogram P i of Definition 2 (see al-so Figure 1) coincides with the projection of the parallelepiped Pi on the planez = 0. An example of the construction of these parallelepipeds is given in Fi-gure 2, where a set of eight intervals with their associated tolerances is givenin Figure 2(a). The corresponding tolerance graph G is depicted in Figure 2(b),while the parallelepiped representation is illustrated in Figure 2(c). In the caseti < bi− ai, the parallelepiped Pi is three-dimensional, c.f. P1, P3, and P5, whilein the border case ti = bi − ai it degenerates to a two-dimensional rectangle,c.f. P7. In these two cases, each Pi corresponds to a bounded vertex vi. In theremaining case ti =∞ (that is, vi is unbounded), the parallelepiped Pi degene-rates to a one-dimensional line segment above plane z = 0, c.f. P2, P4, P6, andP8.

We prove now that these parallelepipeds form a three-dimensional intersectionmodel for the class of tolerance graphs (namely, that every tolerance graph Gcan be viewed as the intersection graph of the corresponding parallelepipeds Pi).

Theorem 1. Let G = (V, E) be a tolerance graph with a tolerance representation{Ii = [ai, bi], ti | i = 1, . . . , n}. Then for every i �= j, vivj ∈ E if and only ifPi ∩ Pj �= ∅.Proof. We distinguish three cases according to whether vertices vi and vj arebounded or unbounded:

(a) Both vertices are bounded, that is ti ≤ bi−ai and tj ≤ bj−aj . It follows thatvivj ∈ E(G) if and only if P i ∩ P j �= ∅ [12]. However, due to the definition

Page 300: Graph-Theoretic Concepts in Computer Science

290 G.B. Mertzios, I. Sau, and S. Zaks

I = [1,17] t = 51 1

I = [4,26] t = 2 2

I = [21,37] t = 103 3

I = [32,36] t =4 4

I = [41,60] t = 65 5

I = [43,68] t = 6 6

I = [49,52] t = 37 7

I = [61,66] t = 8 8

88 8

8

(a)

1v 2v 3v 4v 5v 6v

7v

8vG

(b)

φ

P

1 6 12 17 21 27 32 37 41 43 4947 52 54 61 66 684

P

PP

P

P

P

P1

1

2

2

33

4

4

5

6

5

8

77

6

8

1

L1

L2 x

yz

φ

φ

φ

φ

φ

φ

φ

(c)

Fig. 2. The intersection model for tolerance graphs: (a) a set of intervals Ii = [ai, bi]and tolerances ti, i = 1, . . . , 8, (b) the corresponding tolerance graph G and (c) aparallelepiped representation of G

of the parallelepipeds Pi and Pj , in this case Pi ∩ Pj �= ∅ if and only ifP i ∩ P j �= ∅ (c.f. P1 and P3, or P5 and P7, in Figure 2).

(b) Both vertices are unbounded, that is ti = tj =∞. Since no two unboundedvertices are adjacent, vivj /∈ E(G). On the other hand, the line segments Pi

and Pj lie on the disjoint planes z = φi and z = φj of �3, respectively, sincewe assumed that the slopes φi and φj are distinct. Thus, Pi∩Pj = ∅ (c.f. P2

and P4).(c) One vertex is unbounded (that is, ti = ∞) and the other is bounded (that

is, tj ≤ bj − aj). If P i ∩ P j = ∅, then vivj /∈ E and Pi ∩ Pj = ∅ (c.f. P1 andP6). Suppose that P i ∩ P j �= ∅. We distinguish two cases:

(i) φi < φj . It is easy to check that |Ii ∩ Ij | ≥ tj and thus vivj ∈ E. SinceP i ∩P j �= ∅ and φi < φj , then necessarily the line segment Pi intersectswith the parallelepiped Pj on the plane z = φi, and thus Pi ∩ Pj �= ∅(c.f. P1 and P2).

(ii) φi > φj . Clearly |Ii ∩ Ij | < ti = ∞. Furthermore, since φi > φj , Ob-servation 1 implies that |Ii ∩ Ij | ≤ |Ii| < tj . It follows that |Ii ∩ Ij | <min{ti, tj}, and thus vivj /∈ E. On the other hand, z = φi for all points(x, y, z) ∈ Pi, while z ≤ φj < φi for all points (x, y, z) ∈ Pj , and thereforePi ∩ Pj = ∅ (c.f. P3 and P4). aa

Page 301: Graph-Theoretic Concepts in Computer Science

A New Intersection Model and Improved Algorithms for Tolerance Graphs 291

Clearly, for each vi ∈ V the parallelepiped Pi can be constructed in constanttime. Therefore, given a tolerance representation of a tolerance graph G with nvertices, a parallelepiped representation of G can be constructed in O(n) time.

3 Coloring and Clique Algorithms in O(n log n)

In this section we present optimal O(n log n) algorithms for constructing a mini-mum coloring and a maximum clique in a tolerance graph G = (V, E) with n ver-tices, given a parallelepiped representation of G. These algorithms improve thebest known running time O(n2) of these problems on tolerance graphs [11, 12].First, we introduce a canonical representation of tolerance graphs in Section 3.1,and then we use it to obtain the algorithms for the minimum coloring and themaximum clique problems in Section 3.2.

3.1 A Canonical Representation of Tolerance Graphs

We associate with every vertex vi of G the point pi = (xi, yi) in the Euclideanplane, where xi = bi and yi = π

2 − φi. Since all endpoints of the parallelogramsP i and all slopes φi are distinct, all coordinates of the points pi are distinct aswell. Similarly to [11, 12], we state the following two definitions.

Definition 4. An unbounded vertex vi ∈ VU of a tolerance graph G is cal-led inevitable (for a certain parallelepiped representation), if replacing Pi with{(x, y, z) | (x, y) ∈ Pi, 0 ≤ z ≤ φi} creates a new edge in G. Otherwise, vi iscalled evitable.

Definition 5. Let vi ∈ VU be an inevitable unbounded vertex of a tolerancegraph G (for a certain parallelepiped representation). A vertex vj is called ahovering vertex of vi if aj < ai, bi < bj, and φi > φj.

It is now easy to see that, by Definition 5, if vj is a hovering vertex of vi, thenvivj /∈ E. Note that, in contrast to [11], in Definition 4, an isolated vertex vi

might be also inevitable unbounded, while in Definition 5, a hovering vertexmight be also unbounded. Definitions 4 and 5 imply the following lemma:

Lemma 1. Let vi ∈ VU be an inevitable unbounded vertex of the tolerance graphG (for a certain parallelepiped representation). Then, there exists a hoveringvertex vj of vi.

Definition 6. A parallelepiped representation of a tolerance graph G is calledcanonical if every unbounded vertex is inevitable.

For example, in the tolerance graph depicted in Figure 2, v4 and v8 are ine-vitable unbounded vertices, v3 and v6 are hovering vertices of v4 and v8, re-spectively, while v2 and v6 are evitable unbounded vertices. Therefore, thisrepresentation is not canonical for the graph G. However, if we replace Pi with

Page 302: Graph-Theoretic Concepts in Computer Science

292 G.B. Mertzios, I. Sau, and S. Zaks

{(x, y, z) | (x, y) ∈ Pi, 0 ≤ z ≤ φi} for i = 2, 6, we get a canonical representationfor G.

In the following, we present an algorithm that constructs a canonical repre-sentation of a given tolerance graph G.

Definition 7. Let α = (xα, yα) and β = (xβ , yβ) be two points in the plane.Then α dominates β if xα > xβ and yα > yβ. Given a set A of points, the pointγ ∈ A is called an extreme point of A if there is no point δ ∈ A that dominatesγ. Ex(A) is the set of the extreme points of A.

Algorithm 1. Construction of a canonical representation of a tolerance graph G

Input: A parallelepiped representation R of a given tolerance graph G with n verticesOutput: A canonical representation R′ of G

Sort the vertices of G, such that ai < aj whenever i < j�0 ← min{xi : 1 ≤ i ≤ n}; r0 ← max{xi : 1 ≤ i ≤ n}ps ← (�0 − 1, π

2); pt ← (r0 + 1, 0)

P ← (ps, pt); R′ ← Rfor i = 1 to n do

Find the point pj having the smallest xj with xj > xi

if yj < yi then {no point of P dominates pi}Find the point pk having the greatest xk with xk < xi

Find the point p� having the greatest y� with y� < yi

if xk ≥ x� thenReplace points p�, p�+1 . . . , pk with point pi in the list P

elseInsert point pi between points pk and p� in the list P

if vi ∈ VU then {vi is an evitable unbounded vertex}Replace Pi with {(x, y, z) | (x, y) ∈ Pi, 0 ≤ z ≤ φi} in R′

else {yj > yi; pj dominates pi}if vi ∈ VU then {vi is an inevitable unbounded vertex}vj is a hovering vertex of vi

return R′

Given a tolerance graph G = (V, E) with the set V = {v1, v2, . . . , vn} of vertices(and its parallelepiped representation), we can assume w.l.o.g. that ai < aj

whenever i < j. Recall that with every vertex vi we associated the point pi =(xi, yi), where xi = bi and yi = π

2 − φi, respectively. The following theoremshows that, given a parallelepiped representation of a tolerance graph G, we canconstruct in O(n log n) a canonical representation of G. This result is crucial forthe time complexity analysis of the algorithms of Section 3.2.

Theorem 2. Every parallelepiped representation of a tolerance graph G with nvertices can be transformed by Algorithm 1 to a canonical representation of G inO(n log n) time.

Page 303: Graph-Theoretic Concepts in Computer Science

A New Intersection Model and Improved Algorithms for Tolerance Graphs 293

3.2 Minimum Coloring and Maximum Clique

In the next theorem we present an optimal O(n log n) algorithm for computing aminimum coloring of a tolerance graph G with n vertices, given a parallelepipedrepresentation of G. The informal description of the algorithm is identical to theone in [11], which has running time O(n2); the difference is in the fact that weuse our new representation, in order to improve the time complexity.

Theorem 3. A minimum coloring of a tolerance graph G with n vertices canbe computed in O(n log n) time.

In the next theorem we prove that a maximum clique of a tolerance graph G withn vertices can be computed in optimal O(n log n) time, given a parallelepipedrepresentation of G. This theorem follows from Theorem 2 and from the cliquealgorithm presented in [6], and it improves the best known O(n2) running timementioned in [11].

Theorem 4. A maximum clique of a tolerance graph G with n vertices can becomputed in O(n log n) time.

Based on a lower time bound of Ω(n log n) for computing the length of a longestincreasing subsequence in a permutation [6, 8], it turns out that the time com-plexity O(n log n) of the presented algorithms for the minimum coloring and themaximum clique problems presented in Theorems 3 and 4 are oprimal.

4 Weighted Independent Set Algorithm in O(n2)

In this section we present an algorithm for computing a maximum weight in-dependent set in a tolerance graph G = (V, E) with n vertices in O(n2) time,given a parallelepiped representation of G, and a weight w(vi) > 0 for everyvertex vi of G. The proposed algorithm improves the running time O(n3) of theone presented in [12]. In the following, consider as above the partition of thevertex set V into the sets VB and VU of bounded and unbounded vertices of G,respectively.

Similarly to [12], we add two isolated bounded vertices vs and vt to G withweights w(vs) = w(vt) = 0, such that the corresponding parallelepipeds Ps

and Pt lie completely to the left and to the right of all other parallelepipedsof G, respectively. Since both vs and vt are bounded vertices, we augment theset VB by the vertices vs and vt. In particular, we define the set of verticesV ′B = VB ∪ {vs, vt} and the tolerance graph G′ = (V ′, E), where V ′ = V ′B ∪ VU .Since G′[V ′B] is a bounded tolerance graph, it is a co-comparability graph aswell [10, 12]. A transitive orientation of the comparability graph G′[V ′B] can beobtained by directing each edge according to the upper left endpoints of theparallelograms P i. Formally, let (V ′B ,≺) be the partial order defined on thebounded vertices V ′B , such that vi ≺ vj if and only if vivj /∈ E and ci < cj .Recall that a chain of elements in a partial order is a set of mutually comparableelements in this order [4].

Page 304: Graph-Theoretic Concepts in Computer Science

294 G.B. Mertzios, I. Sau, and S. Zaks

Observation 2 ([12]). The independent sets of G[VB ] are in one-to-one cor-respondence with the chains in the partial order (V ′B,≺) from vs to vt.

Using a dynamic programming algorithm that exploits the properties of the newparallelepiped representation of tolerance graphs, we derive the next theorem.The details can be found in [19].

Theorem 5. A maximum weight independent set of a tolerance graph G with nvertices can be computed in O(n2) time.

5 Conclusions and Further Research

In this article we proposed the first non-trivial intersection model for generaltolerance graphs, given by parallelepipeds in the three-dimensional space. Thisrepresentation generalizes the parallelogram representation of bounded tolerancegraphs. Using this representation, we presented improved algorithms for compu-ting a minimum coloring, a maximum clique, and a maximum weight indepen-dent set on a tolerance graph. The complexity of the recognition problem fortolerance and bounded tolerance graphs is the main open problem in this classof graphs. Even when the input graph is known to be a tolerance graph, it is notknown how to obtain a tolerance representation for it [20].

References

1. Bogart, K.P., Fishburn, P.C., Isaak, G., Langley, L.: Proper and unit tolerancegraphs. Discrete Applied Mathematics 60(1-3), 99–117 (1995)

2. Busch, A.H.: A characterization of triangle-free tolerance graphs. Discrete AppliedMathematics 154(3), 471–477 (2006)

3. Busch, A.H., Isaak, G.: Recognizing bipartite tolerance graphs in linear time. In:Brandstadt, A., Kratsch, D., Muller, H. (eds.) WG 2007. LNCS, vol. 4769, pp.12–20. Springer, Heidelberg (2007)

4. Diestel, R.: Graph Theory, 3rd edn. Springer, Berlin (2005)5. Felsner, S.: Tolerance graphs and orders. Journal of Graph Theory 28, 129–140

(1998)6. Felsner, S., Muller, R., Wernisch, L.: Trapezoid graphs and generalizations, geo-

metry and algorithms. Discrete Applied Mathematics 74, 13–32 (1997)7. Fishburn, P.C., Trotter, W.T.: Split semiorders. Discrete Mathematics 195, 111–

126 (1999)8. Fredman, M.L.: On computing the length of longest increasing subsequences. Dis-

crete Mathematics 11, 29–35 (1975)9. Golumbic, M.C., Monma, C.L.: A generalization of interval graphs with tolerances.

In: Proceedings of the 13th Southeastern Conference on Combinatorics, GraphTheory and Computing, Congressus Numerantium, vol. 35, pp. 321–331 (1982)

10. Golumbic, M.C., Monma, C.L., Trotter, W.T.: Tolerance graphs. Discrete AppliedMathematics 9(2), 157–170 (1984)

11. Golumbic, M.C., Siani, A.: Coloring algorithms for tolerance graphs: Reaso-ning and scheduling with interval constraints. In: Joint International Confe-rences on Artificial Intelligence, Automated Reasoning, and Symbolic Computation(AISC/Calculemus), pp. 196–207 (2002)

Page 305: Graph-Theoretic Concepts in Computer Science

A New Intersection Model and Improved Algorithms for Tolerance Graphs 295

12. Golumbic, M., Trenk, A.: Tolerance Graphs. Cambridge Studies in Advanced Ma-thematics (2004)

13. Grotshcel, M., Lovasz, L., Schrijver, A.: The Ellipsoid Method and its Conse-quences in Combinatorial Optimization. Combinatorica 1, 169–197 (1981)

14. Hayward, R.B., Shamir, R.: A note on tolerance graph recognition. Discrete App-lied Mathematics 143(1-3), 307–311 (2004)

15. Isaak, G., Nyman, K., Trenk, A.: A hierarchy of classes of bounded bitoleranceorders. Ars Combinatoria 69 (2003)

16. Keil, J.M., Belleville, P.: Dominating the complements of bounded tolerance graphsand the complements of trapezoid graphs. Discrete Applied Mathematics 140(1-3),73–89 (2004)

17. Langley, L.: Interval tolerance orders and dimension. PhD thesis, Dartmouth Col-lege (June 1993)

18. McKee, T., McMorris, F.: Topics in Intersection Graph Theory. Society for Indu-strial and Applied Mathematics. SIAM, Philadelphia (1999)

19. Mertzios, G.B., Sau, I., Zaks, S.: A New Intersection Model and Improved Algo-rithms for Tolerance Graphs. Technical report, RWTH Aachen University (March2009)

20. Narasimhan, G., Manber, R.: Stability and chromatic number of tolerance graphs.Discrete Applied Mathematics 36, 47–56 (1992)

Page 306: Graph-Theoretic Concepts in Computer Science

Counting the Number of Matchings in Chordaland Chordal Bipartite Graph Classes

Yoshio Okamoto1,�, Ryuhei Uehara2,��, and Takeaki Uno3,� � �

1 Graduate School of Information Science and Engineering, Tokyo Institute ofTechnology, Ookayama 2-12-1-W8-88, Meguro-ku, Tokyo 152-8552, Japan

[email protected] School of Information Science, JAIST, Asahidai 1-1 , Nomi,

Ishikawa 923-1292, [email protected]

3 National Institute of Informatics, Hitotsubashi 2-1-2, Chiyoda-ku,Tokyo 101-8430, Japan

[email protected]

Abstract. We provide polynomial-time algorithms for counting thenumber of perfect matchings in chain graphs, cochain graphs, and thresh-old graphs. These algorithms are based on newly developed subdivisionschemes that we call a recursive decomposition. On the other hand, weshow the #P-completeness for counting the number of perfect match-ings in chordal graphs, split graphs and chordal bipartite graphs. Thisis in an interesting contrast with the fact that counting the number ofindependent sets in chordal graphs can be done in linear time.

1 Introduction

The study of graph classes has been motivated by the fact that a lot of NP-hardproblems can be solved in polynomial time when the input is restricted. Whilethis research direction leads to many polynomial-time algorithms for decisionproblems and optimization problems, such results for counting problems seemrare. With this motivation, the authors studied problems to count the indepen-dent sets in chordal graphs [16], and refinement for interval graphs has beenproposed by Lin [14] and Lin and Chen [15]. However, the current understand-ing for counting problems in graph classes is still poor. Counting algorithmsmay require properties of graphs that are not needed for solving decision andoptimization problems.

This paper is concerned with perfect matchings. A perfect matching of agraph is one of the fundamental objects when we study counting problems.

� Supported by Global COE Program “Computationism as a Foundation of theSciences” and Grant-in-Aid for Scientific Research from Ministry of Education,Science and Culture, Japan, and Japan Society for the Promotion of Science.

�� Supported by Ministry of Education, Science and Culture, Japan, and JapanSociety for the Promotion of Science.

� � � Supported by Ministry of Education, Science and Culture, Japan, and JapanSociety for the Promotion of Science.

C. Paul and M. Habib (Eds.): WG 2009, LNCS 5911, pp. 296–307, 2010.c© Springer-Verlag Berlin Heidelberg 2010

Page 307: Graph-Theoretic Concepts in Computer Science

Counting the Number of Matchings in Graph Classes 297

When Valiant [21] introduced the complexity class #P, he already proved thatcounting the perfect matchings in a bipartite graph is #P-complete. In anotherpaper [22], he also proved that counting all matchings in a bipartite graph is#P-complete. His results were refined by Dagum and Luby [4] showing thatcounting the perfect matchings in a 3-regular bipartite graph is #P-complete,and by Vadhan [19] showing that counting all matchings in a bipartite graphof maximum degree 4 and in a planar bipartite graph of maximum degree 6is #P-complete. There are also some results on the positive side, namely forpolynomial-time algorithms. The perfect matchings in a planar graph can becounted in polynomial time [6,11,17] via the so-called Pfaffian orientations. Ageneralization of this approach yields a polynomial-time algorithm for graphsof bounded genus [8,18]. Furthermore, we can count the perfect matchings ina graph of bounded treewidth in polynomial time [1]. Basically, these positiveresults are concerned with sparse graphs.

This paper concentrates on classes of chordal graphs and chordal bipartitegraphs. An interesting phenomenon to be proven here is the #P-completenessfor the counting problem of perfect matchings in chordal graphs, while we cancount the number of independent sets in chordal graphs in linear time [16]. Wealso prove that the matching counting is #P-complete even for chordal bipar-tite graphs. Therefore, we seek for subclasses of these graph classes for whichthe perfect matchings can be counted in polynomial time. We give O(n2 log n)-time algorithms for the following classes of graphs on n vertices: Chain graphs,cochain graphs, and threshold graphs. The definitions will be given later, butthere is a relation among these classes as depicted in Fig. 1. In the figure, we alsohave the classes of bipartite permutation graphs, proper interval graphs, intervalgraphs and interval bigraphs. For these four classes, complexity of counting thematchings is unsettled. This is a main open problem this paper leaves for us.

We should note here that there exists an O(n2k+1)-time algorithm to countthe perfect matchings in a graph of cliquewidth k [13]. Since a threshold graph isa cograph and the cliquewidth of a cograph is at most 2, this immediately yieldsan O(n5)-time algorithm for threshold graphs. Similarly, since a chain graphis distance-hereditary and the cliquewidth of a distance-hereditary graph is atmost 3 [9], we obtain an O(n7)-time algorithm for chain graphs. Furthermore,the complement of a graph of cliquewidth k has cliquewidth at most 2k [3] anda cochain graph is the complement of some chain graph. Therefore, we obtainan O(n13)-time algorithm for cochain graphs. However, these algorithms are lessefficient than ours.

Due to the page limitation, some proofs are omitted. They can be found inthe journal version.

2 Preliminaries

We assume the reader is familiar with basic terminology on graphs. A graph isdenoted by G = (V, E) when V is the vertex set and E is the edge set of G.The neighborhood of a vertex v ∈ V is the set NG(v) = {u ∈ V | {u, v} ∈ E}.

Page 308: Graph-Theoretic Concepts in Computer Science

298 Y. Okamoto, R. Uehara, and T. Uno

chordal

interval

proper interval

chainthresholdcochain

bipartite permutation

interval bigraph

chordal bipartite

split

#P-complete

unknown

polynomial

Fig. 1. Inclusion relationship among the graph classes in this paper and the summaryof our results

For a subset U ⊆ V , the subgraph of G induced by U is the graph (U, F ), whereF = {{u, v} ∈ E | u, v ∈ U}, and denoted by G[U ]. For given two graphsG = (V, E) and G′ = (V ′, E′), we denote the graph (V ∪ V ′, E ∪E′) by G ∪G′.A vertex set C is a clique if all pairs of vertices in C are joined by an edge. Avertex set I is independent if no pair of vertices in I is joined by an edge. Anedge set M is a matching if no pair of edges in M shares an endpoint. Note thatthe empty set is a matching of size zero in any graph. An endpoint v of an edge ein a matching M is said to be matched by M . A matching is perfect if all verticesare matched by the matching.

A graph G = (V, E) is bipartite if V can be partitioned into two sets X and Ysuch that every edge joins a vertex in X and the other vertex in Y . We denote abipartite graph by G = (X, Y, E) when the partition is given. A bipartite graphG is complete if every vertex in X is adjacent to all vertices in Y .

For a graph G, the number of matchings in G is denoted by μ(G), the numberof matchings of size i in G is denoted by μi(G), and the number of perfectmatchings in G is denoted by π(G).

3 Polynomial-Time Algorithm for Chain Graphs

In this section, we study chain graphs. A chain graph is also called a differencegraph [10], a bisplit graph [7], and nonseparable bipartite graph [5].

To define a chain graph, we need to define monotonicity on vertex sets. LetG = (X, Y, E) be a bipartite graph. An order < on X in G is increasing ifx < x′ implies N(x) ⊆ N(x′). Similarly, < on X is decreasing if x < x′ impliesN(x) ⊇ N(x′). An order is monotone if it is increasing or decreasing. A bipartitegraph G = (X, Y, E) is a chain graph if there exist monotone orders <X , <Y onX, Y respectively [12,23]. We assume that <X is decreasing and <Y is increasing.It is not hard to observe the following.

Proposition 1. Let G = (X, Y, E) be a connected chain graph with |X | = nx

and |Y | = ny. Then there exist a decreasing order <X and an increasing order<Y such that yny ∈ N(xi) for every i ∈ {1, . . . , nx} and x1 ∈ N(yj) for everyj ∈ {1, . . . , ny}, where x1 <X x2 <X · · · <X xnx and y1 <Y y2 <Y · · · <Y yny .

For a given chain graph, monotone orders on X and Y can be found in lineartime (e.g., using a PQ-tree), and from them, the orderings as in Proposition 1 can

Page 309: Graph-Theoretic Concepts in Computer Science

Counting the Number of Matchings in Graph Classes 299

yny

yj

y2

y1

x1 x2 xi xnxx1 x2 xnx

Gu

GrGc

x1 x2 xnx

Gu

GrGc

yny

y2

y1

yny

y2

y1

yj

xi

yj

xi

Fig. 2. The intersection model of a chain graph (left), a derived decomposition (middle)and its schematic representation (right)

be computed in linear time (e.g., [20]). Hence, hereafter, we assume that a chaingraph is given with two ordered vertex sets stated as in Proposition 1. Withoutloss of generality, we assume that a chain graph G = (X, Y, E) is connected,and the vertex sets X and Y are ordered as stated in Proposition 1. That is,we have N(xi) = {yji , . . . , yny} with 1 ≤ i ≤ nx and j1 ≤ j2 ≤ · · · ≤ jnx , andN(yj) = {x1, . . . , xij} with 1 ≤ j ≤ ny and i1 ≥ i2 ≥ · · · ≥ iny , where |X | = nx

and |Y | = ny. The main theorem in this section is as follows.

Theorem 1. Given a connected chain graph G = (X, Y, E), the number of per-fect matchings in G can be computed in O(n2 log n) time, where n = |X ∪ Y |.We prove Theorem 1 by providing an algorithm. This is based on the followingrecursive subdivision structure T (G). The structure T (G) is a rooted tree, whereeach node possesses an induced subgraph of G and a node G′ is a descendant ofa node G′′ only if G′ is a subgraph of G′′.

The structure T (G) is inspired by an intersection model of a chain graph(Fig. 2 (left)): The vertices xi in X correspond to vertical line segments Ixi

which are located from left to right according to the ordering, and the bottomof the segments are on a horizontal line. The vertices yj in Y correspond tohorizontal line segments Jyj from top to bottom and the left endpoints of thesegments are on a vertical line. From Proposition 1, it is easy to see that G isa chain graph if and only if G can be represented by the intersection model ofthose horizontal line segments and vertical line segments such that Ixi is longerthan or equal to Ixi+1 with 1 ≤ i < nx and Jyj+1 is longer than or equal to Jyj

with 1 ≤ j < ny.Let G = (X, Y, E) be a chain graph with two ordered vertex sets X, Y as

in Proposition 1. An edge e = {xi, yj} ∈ E, xi ∈ X, yj ∈ Y , is extremal if{xi′ , yj} �∈ E for any i′ > i or {xi, yj′} �∈ E for any j′ < j. Fix an extremaledge e = {xi, yj} ∈ E. Then we partition X and Y into Xu, Xr, Yu, and Yr

as follows; Xu := {xi′ | i′ ≤ i}, Xr := {xi′ | i′ > i}, Yu := {yj′ | j′ ≤ j}, andYr := {yj′ | j′ > j}. Using these vertex sets, we define three graphs Gc, Gu, andGr as follows; Gc = G[Xu ∪ Yr], Gr = G[Xr ∪ Yr], and Gu = G[Xu ∪ Yu]. Notethat the edge sets of these three graphs form a partition of E, and furthermore,Gu and Gr are connected chain graphs (unless empty), and Gc is a completebipartite graph. See Fig. 2 (middle, right).

Page 310: Graph-Theoretic Concepts in Computer Science

300 Y. Okamoto, R. Uehara, and T. Uno

Algorithm 1. RD(G, d)Input : A connected chain graph G = (X,Y,E) and a non-negative integer d,

where nx = |X|, ny = |Y |;Output: A recursive decomposition T (G) of G;add G as the root;1

if G is complete bipartite then return;2

if d is even then set kx := nx/2 and ky := min{j | {xkx , yj} ∈ E};3

if d is odd then set ky := ny/2 and kx := max{i | {xi, yky} ∈ E};4

find Gu, Gr, Gc from kx and ky ;5

add RD(Gu, d+1) as the left subtree rooted at G;6

add RD(Gr, d+1) as the right subtree rooted at G;7

return;8

We are now ready for defining T (G) for a connected chain graph G. The rootof T (G) is G. Let G′ be a node of T (G). If G′ is complete bipartite, then G′

has no child and hence it is a leaf of T (G). Otherwise, G′ has two children G′uand G′r constructed by an appropriate choice of an extremal edge of G′. We callT (G) a recursive decomposition of G.

Let us describe how to choose an appropriate extremal edge when we constructa recursive decomposition. To do this, we look at the depth of each node in T (G).Namely, the depth of a root node is zero, and if a node has depth d, then itschildren have depth d+1. According to the parity of the depth, we make thechoice. If d is even, then we let kx = nx/2 and ky = min{j′ | {xi, yj′} ∈ E}.If d is odd, then we let ky = ny/2 and kx = max{i′ | {xi′ , yj} ∈ E}. In bothcases, we see that {xkx , yky} is an extremal edge of G. Algorithm 1 computes arecursive decomposition T (G) of G according to this choice of an extremal edgewhen RD(G, 0) is called. We omit the proof of the following lemma.

Lemma 1. Let G = (X, Y, E) be a connected chain graph. Then, Algorithm 1finds a recursive decomposition T (G) with at most O(n) nodes and height atmost 1

2 log2 n in O(n) time, where n = |X |+|Y |.

To describe the number of matchings, we denote by π(G; a, b) the number ofperfect matchings in a chain graph G = (X, Y, E) with a vertices from X and bvertices from Y deleted. Namely, π(G; a, b) = |{M ⊆ E |M is a perfect matchingof G−(A∪B), where A ⊆ X, |A| = a, B ⊆ Y, |B| = b}|. Intuitively, we will countthe number of perfect matchings in G such that a vertices in X and b verticesin Y have been matched in the previous level. Since π(G; 0, 0) is the number ofperfect matchings of G, it suffices to compute π(G; a, b) for all possible a and b.

Let us look at how we can decompose π(G; a, b) into several independent parts.This gives a fundamental idea for our algorithm.

Lemma 2. Let G = (X, Y, E) be a connected chain graph. For 0 ≤ a < |X | and0 ≤ b < |Y |, it holds that π(G; a, b) =

∑au,br

π(Gu; au+ic, bu) · π(Gr; ar, br+ic) ·π(Gc; kx−ic, ny−ky−ic), where the sum is taken over the ranges 0 ≤ au ≤

Page 311: Graph-Theoretic Concepts in Computer Science

Counting the Number of Matchings in Graph Classes 301

min{a, kx} and 0 ≤ br ≤ min{b, ny−ky}, and other symbols are defined asbu = b−br, ar = a−au, and ic = kx−ky−au+b−br.

Proof. We first show the inequality “the left-hand side ≤ the right-hand side.”Every matching M counted in the left-hand side can be partitioned into threeparts M = Mu ∪ Mr ∪ Mc, where Mu, Mr, Mc is a matching of Gu, Gr, Gc,respectively. Since M is a perfect matching of G−(A∪B) for some A ⊆ X, B ⊆ Ywith |A| = a, |B| = b, it holds that |M | = nx−a = ny−b. Let |Mu| = iu, |Mr| =ir, |Mc| = ic. Let Ac ⊆ Xu and Bc ⊆ Yr be the set of vertices matched by Mc.Note that |Ac| = ic = |Bc|. Then, Mu is a perfect matching of Gu−(Au∪Ac∪Bu)for some Au ⊆ Xu \ Ac and Bu ⊆ Yu, and Mr is a perfect matching of Gr −(Ar ∪Br ∪Bc) for some Ar ⊆ Xr and Br ⊆ Yr \ Bc. It is important to observethat such Au, Bu, Ar, Br are unique. For example, Au is determined as the set ofvertices in Xu \Ac that are not matched by Mu. Therefore, if we let |Au| = au

and |Br| = br, then Mu is counted exactly once in π(Gu; au + ic, b−br) andsimilarly Mr is counted exactly once in π(Gr ; a−au, bu+ic). Then, we see thatkx−(au+ic) = iu = ky−(b−br) and nx−kx−(a−au) = ir = ny−ky−(bu+ic), andtherefore, ic = kx−ky−au+b−br. Then, it suffices to note that Mc is countedexactly once in π(Gc; kx−ic, ny−ky−ic).

Conversely, we show the inequality “the left-hand side ≥ the right-handside.” Let Mu and Mr be perfect matchings counted in π(Gu; au+ic, bu) andπ(Gr; ar, br+ic) respectively, for some au, br in the appropriate ranges andar, bu, ic as defined in the statement of the lemma. Specifically, let Mu be aperfect matching of Gu−(Au ∪Ac ∪ Bu) for some Au ∪ Ac ⊆ Xu and Bu ⊆ Yu,and Mr is a perfect matching of Gr−(Ar ∪ Br ∪ Bc) for some Ar ⊆ Xr andBr ∪Bc ⊆ Yr, where |Au| = au, |Ar| = ar, |Bu| = bu, |Br| = br, |Ac| = |Bc| = ic.Consider constructing a perfect matching M of G−(A ∪B) for some A, B with|A| = a, |B| = b as M = Mu∪Mr∪Mc with some matching Mc of Gc. Then, suchMc should be a perfect matching of Gc−((Xu−Ac) ∪ (Yr−Br)). This completesthe proof.

Since Gc is a complete bipartite graph, it is not difficult to see thatπ(Gc; kx−ic, ny−ky−ic) = ic!

(kx

ic

)(ny−ky

ic

). Hence Lemma 2 readily gives Algo-

rithm 2. To compute the number of perfect matchings in a given chain graph G,we first call #M(G, 0, 0).

Proof (of Theorem 1). Algorithm 2 can be implemented by dynamic program-ming on T (G). For each node G′ of T (G), we store the values returned by calls#M(G′, a, b) for all possible a and b. If the depth of G′ is d, then the num-ber of such possibilities is at most nx/2�d/2� · ny/2�d/2� ≤ nxny/2d. Therefore,the number of values stored for each node of T (G) is O(n2/2d). At the call to#M(G′, a, b) we need to look up at most nxny/2d values. Note that the values offactorials and binomial coefficients can be computed beforehand and stored aswell in O(n2) time and space. Since the number of nodes at depth d is at most

2d, the overall running time is at most∑ 1

2 log2 n

d=0 2dO(n2/2d) = O(n2 log n). Thespace requirement is also O(n2 log n).

Page 312: Graph-Theoretic Concepts in Computer Science

302 Y. Okamoto, R. Uehara, and T. Uno

Algorithm 2. #M(G, a, b)Input : A connected chain graph G = (X,Y,E) and two integers a, b together

with a recursive decomposition T (G);Output: π(G; a, b);if nx−a �= ny−b then return 0;1

else if G is complete bipartite then return (nx−a)!;2

else3

sum := 0; ar := a−au; bu = b−br; ic = kx−ky−au+b−br;4

foreach au = 0, 1, . . . ,min{a, kx} and br = 0, 1, . . . ,min{b, ny−ky} do5

sum := sum+ ic! ·(

kxic

) · (ny−kyic

) ·#M(Gu, au+ic, bu) ·#M(Gr, ar, br+ic);6

end7

return sum.8

end9

Note that if nx−a = ny−b, then π(G; a, b) is the number of matchings of sizenx−a. Hence, Algorithm 2 computes the number of matchings of each possiblesize. This implies the following corollary.

Corollary 1. Given a chain graph G = (X, Y, E), the number of matchings andthe number of matchings of fixed size in G can be computed in O(n2 log n) time,where n = |X ∪ Y |.

4 Polynomial-Time Algorithm for Cochain Graphs andThreshold Graphs

Similarity among chain graphs, cochain graphs and threshold graphs allows usto provide polynomial-time algorithms to count the number of perfect matchingsin cochain graphs and threshold graphs.

A cochain graph is simply defined as the complement of a chain graph.From Proposition 1, we can immediately see a cochain graph has the followingproperty.

Proposition 2. Let G = (V, E) be a cochain graph and G = (X, Y, E) be achain graph that is the complement of G with |X | = nx and |Y | = ny. Then Xand Y are cliques of G, and there exist a decreasing order <X and an increasingorder <Y such that yny ∈ N(xi)\X for every i ∈ {1, . . . , nx} and x1 ∈ N(yj)\Yfor every j ∈ {1, . . . , ny}, where x1 <X x2 <X · · · <X xnx and y1 <Y y2 <Y

· · · <Y yny . Namely, a cochain graph can be constructed from a chain graph by filling upboth of the color classes to cliques. See Fig. 3.

A graph G = (V, E) is a threshold graph if there exist a weight assignmentw : V → R such that {u, v} ∈ E if and only if w(u) + w(v) > 0. The following isa well-known property (or actually a characterization) of threshold graphs.

Proposition 3 (Chvatal and Hammer [2]). For a threshold graph G =(V, E), a partition {X, Y } of V with the following properties can be found in

Page 313: Graph-Theoretic Concepts in Computer Science

Counting the Number of Matchings in Graph Classes 303

O(|V |+|E|) time. First, X = {x1, . . . , xnx} is a clique of G, Y = {y1, . . . , yny}is an independent set of G, and there exist a decreasing order <X and an in-creasing order <Y such that yny ∈ N(xi) \ X for every i ∈ {1, . . . , nx} andx1 ∈ N(yj) for every j ∈ {1, . . . , ny}, where x1 <X x2 <X · · · <X xnx andy1 <Y y2 <Y · · · <Y yny .

Fig. 3. Comparison of three classes.(Left) A chain graph. (Middle) Acochain graph. (Right) A thresholdgraph.

Namely, a threshold graph can be con-structed from a chain graph by filling up oneof the color classes to a clique. See Fig. 3.

Since a cochain graph and a thresholdgraph possess a structure similar to a chaingraph, we may define a recursive decomposi-tion for them analogously. An important dif-ference is that Gc is not an induced subgraphof G, but Gc will be a subgraph of G withvertex set Xu ∪ Yr and edge set consistingof those edges between Xu and Yr. Namely,Gc is complete bipartite. Then, the equationsimilar to one in Lemma 2 holds. The whole arguments are verbatim. Hence weobtain the following theorem.

Theorem 2. The number of perfect matchings in a cochain graph and a thresh-old graph with n vertices can be computed in O(n2 log n) time.

5 Hardness Results

In this section, we prove the #P-completeness of counting the perfect match-ings in split graphs and chordal bipartite graphs. The #P-completeness for splitgraphs immediately implies that for chordal graphs.

A graph is a split graph if the vertex set can be partitioned into two parts suchthat one part is a clique and the other is an independent set. In other words, asplit graph is constructed from a bipartite graph by filling up one color class toa clique. A graph is chordal if every induced cycle has length three. It is easy tosee that every split graph is chordal.

We omit the proof of the following theorem.

Theorem 3. Counting the number of perfect matchings in a split graph is #P-complete. By utilizing an interpolation technique, we are able to show the following.

Theorem 4. Counting the number of matchings in a split graph is #P-complete.

Proof. For our reduction, we use the problem to count the number of perfectmatchings in a bipartite graph, which is known to be #P-complete [21].Let G = (U, V, E) be a bipartite graph with |U | = |V | = n. We construct agraph Gi = (Vi, Ei) for every i ∈ {1, . . . , n+1} out of G as follows. Let V :={v1, . . . , vn}. For each vertex v� ∈ V , we use a set V

(�)i of i vertices for Gi

Page 314: Graph-Theoretic Concepts in Computer Science

304 Y. Okamoto, R. Uehara, and T. Uno

U V

G G1 G2 G3

Fig. 4. Construction in the proof of Theorem 4

where V(1)i , . . . , V

(n)i are all disjoint. We set Vi := U ∪ V ∪⋃n

�=1 V(�)i , and Ei :=

E ∪ (V2) ∪⋃n

�=1 F(�)i , where F �

i := {{v�, v} | v ∈ V(�)i } for every � ∈ {1, . . . , n}.

Fig. 4 illustrates the construction.For a graph H with n vertices, remember that we denote by μj(H) the number

of matchings in H of size j, by μ(H) the number of matchings in H . Furthermore,let Fi :=

⋃n�=1 F

(�)i .

Let us consider μ(Gi). Each matching M of Gi potentially uses some edgesfrom E and some edges from Fi. Let M use j edges from E and k edges from Fi.Consider constructing M by first choosing j edges from E, then k edges fromFi, and finally the rest of edges from

(V2

). Since M is a matching, we have μj(G)

ways to choose j edges from E for M . Then j vertices in V are already matched,so there are n−j vertices left unmatched in V . Therefore, the number of waysto choose k edges from Fi for M is

(n−j

k

)ik. Then there are n−j−k vertices

left unmatched in V . Among them we choose some edges for M . Therefore, thenumber of choices is μ(Kn−j−k), where Kn−j−k is a complete graph with n−j−kvertices. This way, we obtain the following formula: for every i ∈ {1, . . . , n+1}it holds that μ(Gi) =

∑nj=0 μj(G)

(∑n−jk=0

((n−j

k

)ik)μ(Kn−j−k)

). In a matrix

form, this can be written as⎡

⎢⎢⎢⎣

μ(G1)μ(G2)

...μ(Gn+1)

⎥⎥⎥⎦

= A

⎢⎢⎢⎣

μ0(G)μ1(G)

...μn(G)

⎥⎥⎥⎦

,

where A is a matrix with row index set {1, . . . , n+1} and column indexset {0, . . . , n} defined as Ai,j :=

∑n−jk=0

((n−j

k

)ik)μ(Kn−j−k) for each i ∈

{1, . . . , n+1} and j ∈ {0, . . . , n}.Now we claim that A defined above is non-singular. We would like to notice

that the claim finishes the proof of the theorem. If we are able to know μ(Gi)for every i ∈ {1, . . . , n+1}, then by computing the inverse of A, we are alsoable to know μj(G) for all j ∈ {0, . . . , n}. (Note that each entry of A can becomputed efficiently since μ(Km) =

∑�m/2�j=0 μj(Km) =

∑�m/2�j=0

(m2j

) (2j)!j!2j holds.)

In particular we obtain μn(G), the number of perfect matchings in G. Thiscompletes the reduction.

Page 315: Graph-Theoretic Concepts in Computer Science

Counting the Number of Matchings in Graph Classes 305

Therefore, it suffices to prove the claim. To do that, first observe that foreach row index i ∈ {1, . . . , n+1} and each column index j ∈ {0, . . . , n} thei, j-entry Ai,j can be written as Ai,j =

∑n−jk=0 ik

((n−j

k

)μ(Kn−j−k)

). Let B be a

matrix with row index set {1, . . . , n+1} and column index set {0, . . . , n} definedas Bi,k := ik for each i ∈ {1, . . . , n+1} and k ∈ {0, . . . , n}, and C be a matrixwith row index set {0, . . . , n} and column index set {0, . . . , n} defined as

Ck,j :=

⎧⎨

(n−j

k

)μ(Kn−j−k) if 0 ≤ k ≤ n−j,

0 otherwise,

for each k ∈ {0, . . . , n} and j ∈ {0, . . . , n}. Then, we can see that for everyi ∈ {1, . . . , n+1} and j ∈ {0, . . . , n} it holds that Ai,j =

∑nk=0 Bi,kCk,j . In other

words, A = BC as a matrix. The matrix B is a famous Vandermonde matrix,which is known to be non-singular. How about the non-singularity of C? Since(n−j

k

)μ(Kn−j−k) �= 0 when 0 ≤ k ≤ n−j, the upper-left half of C is occupied

with non-zero entries, and the lower-right half of C is occupied with zero entries.So, the matrix C is also non-singular. Thus, A is non-singular. A modification of this proof shows the following. We omit the proof.

Theorem 5. Counting the number of maximal matchings in a split graph is#P-complete. Next, we switch to chordal bipartite graphs. A bipartite graph is chordal bipartiteif every induced cycle is of length four. The #P-completeness for chordal bipartitegraphs will be proven via the interpolation technique.

Theorem 6. The problem to count the number of perfect matchings in a chordalbipartite graph is #P-complete.

Proof. We again use a reduction from the problem to count the number of perfectmatchings in a bipartite graph.

Given a bipartite graph G = (X, Y, E) with |X | = |Y | = n, we construct thefollowing chordal bipartite graph cbi(G) for each i ∈ {1, . . . , n+1}. The vertexset of cbi(G) is defined as V (G) = X ∪ Y ∪ {pj,v,e | 1 ≤ j ≤ i, v ∈ X, e ∈E} ∪ {qj,v,e | 1 ≤ j ≤ i, v ∈ Y, e ∈ E}. The edge set of cbi(G) is defined asE(G) = {{x, y} | x ∈ X, y ∈ Y } ∪ {{x, pj,x,e} | x ∈ X, e ∈ E, x ∈ e, 1 ≤ j ≤i} ∪ {{y, qj,y,e} | y ∈ Y, e ∈ E, y ∈ e, 1 ≤ j ≤ i} ∪ {{pj,x,e, qj,y,e} | x ∈ X, y ∈Y, e = {x, y} ∈ E}. Namely, to construct cbi(G) from G, we replace each edge ofG by i paths of length three, and join the vertices of X and Y by edges to makethem complete bipartite. It is not difficult to see that cbi(G) is chordal bipartite.Fig. 5 shows an example.

Consider a perfect matching M of cbi(G). We map M to a matching M ′ of Gif and only if the following conditions are satisfied.

– When e = {x, y} �∈M ′, it holds that {pj,x,e, qj,y,e} ∈M for all j ∈ {1, . . . , i}.– When e = {x, y} ∈ M ′, it holds that {x, pj,x,e}, {y, qj,y,e} ∈ M for exactly

one j ∈ {1, . . . , i}. (Then, it must hold that {pj,x,e, qj,y,e} ∈M for all otherj ∈ {1, . . . , i}.)

Page 316: Graph-Theoretic Concepts in Computer Science

306 Y. Okamoto, R. Uehara, and T. Uno

cb2(G)cb1(G)G

x y

p1,x,e q1,y,e

Fig. 5. Hardness for chordal bipartite graphs

There are several perfect matchings M that corresponds to M ′. We can countthe number of such matchings M from M ′. In the second condition, we have ichoices for each edge of M ′. Let |M ′| = k. Then, this gives rise to ik choices.Moreover, there are n−k vertices in both X and Y that do not appear in theseconditions, and they are supposed to be matched. Since these vertices induce acomplete bipartite subgraph of G, the number of ways to match them is exactly(n−k)!.

In this way, we obtain π(cbi(G)) =∑n

k=0 μk(G)ik(n−k)! for each i ∈{1, . . . , n+1}, where π(cbi(G)) means the number of perfect matchings in cbi(G).When we write it down in the matrix form as we did before, the coefficient ma-trix A can be defined as Ai,k := ik(n−k)! for every row index i ∈ {1, . . . , n+1}and every column index k ∈ {0, . . . , n}. We can see that the determinant of A isthe determinant of a non-singular Vandermonde matrix times

∏nk=0(n−k)!, thus

non-zero. Therefore, from the equality above, we can recover μn(G), the numberof perfect matchings of the given bipartite graph G, in polynomial time. Similar arguments show the following theorem. We omit the proofs.

Theorem 7. Counting the number of matchings in chordal bipartite graphs is#P-complete. Similarly, counting the number of maximal matchings in chordalbipartite graphs is #P-complete.

Acknowledgment. We thank anonymous referees for their valuable comments.

References

1. Arnborg, S., Lagergren, J., Seese, D.: Easy problems for tree-decomposable graphs.J. Algor. 12, 308–340 (1991)

2. Chvatal, V., Hammer, P.L.: Set-packing and threshold graphs. Res. Rep., Comput.Sci. Dept., Univ. Waterloo, CORR 73-21 (1973)

3. Courcelle, B., Olariu, S.: Upper bounds to the clique width of graphs. Discr. Appl.Math. 101, 77–114 (2000)

Page 317: Graph-Theoretic Concepts in Computer Science

Counting the Number of Matchings in Graph Classes 307

4. Dagum, P., Luby, M.: Approximating the permanent of graphs with large factors.Theor. Comput. Sci. 102, 283–305 (1992)

5. Ding, D.: Covering the edges with consecutive sets. J. Graph Theory 15, 559–562(1991)

6. Fisher, M.E.: Statistical mechanics of dimers on a plane lattice. Phys. Rev. Ser. 2124, 1664–1672 (1961)

7. Frost, H., Jacobson, M., Kabell, J., Morris, F.R.: Bipartite analogues of split graphsand related topics. Ars Comb. 29, 283–288 (1990)

8. Galluccio, A., Loebl, M.: On the theory of Pfaffian orientations I. Perfect matchingsand permanents. Electr. J. Comb. 6, Research Paper 6, 19 pages (1999)

9. Golumbic, M.C., Rotics, U.: On the clique-width of some perfect graph classes.Internat. J. Found. Comput. Sci. 11, 423–443 (2000)

10. Hammer, P.L., Peled, U.N., Sun, X.: Difference graphs. Discr. Appl. Math. 28,35–44 (1990)

11. Kasteleyn, P.W.: Dimer statistics and phase transitions. J. Math. Phys. 4, 287–293(1963)

12. Kloks, T., Kratsch, D., Muller, H.: Bandwidth of chain graphs. Infor. Proc. Lett. 68,313–315 (1998)

13. Makowsky, J.A., Rotics, U., Averbouch, I., Godlin, B.: Computing graph polyno-mials on graphs of bounded clique-width. In: Fomin, F.V. (ed.) WG 2006. LNCS,vol. 4271, pp. 191–204. Springer, Heidelberg (2006)

14. Lin, M.-S.: Fast and simple algorithms to count the number of vertex covers in aninterval graph. Infor. Proc. Lett. 102, 143–146 (2007)

15. Lin, M.-S., Chen, Y.-J.: Linear time algorithms for counting the number of mini-mal vertex covers with minimum/maximum size in an interval graph. Infor. Proc.Lett. 107, 257–264 (2008)

16. Okamoto, Y., Uno, T., Uehara, R.: Counting the independent sets in a chordalgraph. J. Discr. Algor. 6, 229–242 (2008)

17. Temperley, H.N.V., Fisher, M.E.: Dimer problem in statistical mechanics — anexact result. Phil. Magazine, Ser. 8 6, 1061–1063 (1961)

18. Tesler, G.: Matchings in graphs on non-orientable surfaces. J. Comb. Theory, Ser.B 78, 198–231 (2000)

19. Vadhan, S.P.: The complexity of counting in sparse, regular, and planar graphs.SIAM J. Comput. 31, 398–427 (2001)

20. Uehara, R., Uno, Y.: On computing longest paths in small graph classes. Internat.J. Found. Comput. Sci. 18, 911–930 (2007)

21. Valiant, L.G.: The complexity of computing the permanent. Theor. Comput. Sci. 8,189–201 (1979)

22. Valiant, L.G.: The complexity of enumeration and reliability problems. SIAM J.Comput. 8, 410–421 (1979)

23. Yannakakis, M.: Node-deletion problems on bipartite graphs. SIAM J. Comput. 10,310–327 (1981)

Page 318: Graph-Theoretic Concepts in Computer Science

Distance d-Domination Games

Stephan Kreutzer and Sebastian Ordyniak

Oxford University Computing Laboratory{kreutzer,ordyniak}@comlab.ox.ac.uk

Abstract. We study graph searching games where a number of cops try to cap-ture a robber that is hiding in a system of tunnels modelled as a graph. While thecurrent position of the robber is unknown to the cops, each cop can see a certainradius d around his position. For the case d = 1 these games have been studiedby Fomin, Kratsch and Muller [7] under the name domination games.

We are primarily interested in questions concerning the complexity andmonotonicity of these games. We show that dominating games are computation-ally much harder than standard graph searching games where the cops only seetheir own vertex and establish strong non-monotonicity results for various notionsof monotonicity which arise naturally in the context of domination games. An-swering a question of [7], we show that there exists graphs for which the shortestwinning strategy for a minimal number of cops must necessarily be of exponen-tial length. On the positive side, we establish tractability results for graph classesof bounded degree.

1 Introduction

Graph searching games are a form of two-player games played on graphs. A wide rangeof such games have been studied in the literature but they all share the common schemethat a number of cops tries to catch a robber who is hiding in the graph. The problemis to guide a party of as few cops as possible so that the robber is guaranteed to becaptured regardless of his moves. In the model of graph searching games known asnode searching, the cops and the robber occupy vertices of the graph. At each step ofthe play, the player controlling the cops can lift some of the cops from the graph andplace them somewhere else. While they are in transit, the robber can move in the graphfollowing any path from his current to his new position as long as this path does not gothrough a vertex occupied or “blocked” by a remaining cop (in which case the robberwould be have been captured).

Variants of this game are obtained by varying the abilities of the cops, for instance,whether or not they know the current position of the robber, and by the precise definitionof “blocking”. The minimal number of cops needed to catch a robber on a graph yieldsan interesting graph invariant related to the global connectivity of the graph. See [6] fora recent survey on the subject.

Graph searching games have found a wide range of applications in Computer Sciencein seemingly unrelated areas: there is a strong resemblance of graph searching gamesto pebble games modelling sequential computation as described in [10]. In [8], graphsearching games have been employed as a model for privacy in distributed systems,where the cops model eavesdroppers or intruders in networks. Furthermore, applica-tions of graph searching games can be found in VLSI design as the game theoretical

C. Paul and M. Habib (Eds.): WG 2009, LNCS 5911, pp. 308–319, 2010.c© Springer-Verlag Berlin Heidelberg 2010

Page 319: Graph-Theoretic Concepts in Computer Science

Distance d-Domination Games 309

approach to important graph layout parameters providing valuable tools for the de-sign of efficient algorithms. Of particular importance is the connection between graphsearching games and well-known graph parameters such as tree-width and path-width(see e.g. [5,3,4]). For instance, Seymour and Thomas [12] characterised the tree-widthof a graph in terms of a variant of graph searching games where the robber is visibleand hides on vertices of the graph.

An important concept in the theory of graph searching games is monotonicity. Intu-itively, a strategy for the cops is monotone if they can catch the robber without allow-ing him to revisit vertices from which he has previously been exspelled. Monotonicityhas featured highly in research on graph searching games for a number of reasons. Forinstance, monotone strategies correspond directly to graph decompositions such as tree-or path-decompositions. Also, for many game variants, winning strategies for the rob-ber can often be characterised by simple combinatorial structures, such as brambles forthe case of games corresponding to tree-width, and hence provide natural and intuitiveobstructions for tree-width and similar measures. However, these structures usually pro-vide a winning strategy even against cops following a non-monotone strategy. Hence,showing for a game variant that the number of cops needed to win against a robberis always the same as the number of cops needed for a monotone strategy brings allthese concepts together and establishes a smooth theory of decompositions and gamesin terms of min-max or duality theorems.

From an algorithmic perspective, an important property of monotone strategies isthat their length is usually linearly bounded in the order of the graph, whereas non-monotone strategies can have up to exponential length, although almost no game variantactually requires such long strategies. Hence, monotone strategies often provide poly-nomial certificates and thereby yield NP-algorithms for deciding the number of copsneeded to catch a robber.

Originally, graph searching games were introduced to model the chivvy for a robberthat is hiding in a system of tunnels. While the cops do not know the current position ofthe robber they do have knowledge of the graph modelling the system of tunnels. In thispaper we follow this idea of catching an invisible robber but consider games, which wecall d-domination games, where the cops do not only see their current vertex but have aradius d of visibility. That is, a cop placed on a vertex v can see any other vertex withindistance d of v and if this vertex is occupied by the robber then the cop can see therobber and capture him. We are primarily interested in complexity and monotonicityquestions related to these games.

For the case d = 1 these games correspond to domination games as introducedby Fomin, Kratsch and Muller [7]. This variant is related to the notion of “see-catch”games studied in Computational Geometry and Robotics, for instance motivated by ap-plications in robotics such as surveillance with a mobile robot equipped with a camera.In their paper, the authors develop the fundamental theory of domination games andestablish a relationship between domination games and the size of a minimum domi-nating set of a graph and an interesting connection between these games and a graphparameter called domination target number introduced in [11]. The focus of [7] is onestablishing bounds on the domination search number – the minimal number of copsthat are required to guarantee capture of the robber – for various classes of graphs such

Page 320: Graph-Theoretic Concepts in Computer Science

310 S. Kreutzer and S. Ordyniak

as k-dimensional cubes, asteroidal-triple free graphs, claw-free graphs, and graphs withcertain types of spanning trees and caterpillars. They also exhibit an example showingthat domination games are non-monotone.

In this paper we study d-domination games with a focus on complexity and monotonic-ity. Following the initial results on monotonicity of graph searching games mentionedabove, monotonicity proofs for a large number of graph searching games and also non-monotonicity proofs for some games have been obtained (see e.g. [6]). Most variants ofgraph searching games are either monotone or, if not, at least a bound on the differencebetween the number of cops needed for arbitrary or monotone strategies can be estab-lished. As it turns out, d-domination games exhibit a completely different behaviour inthis respect.

Organisation and results. In Section 4, we establish very strong non-monotonicityresults by exhibiting classes of graphs on which two cops can win on any graph in thisclass but the number of cops required for monotone winning strategies is unbounded.Hence, domination games are one of only very few types of games for which such adifference has been proved.

In [7, Problem 7], Fomin et al. raise the question whether any polynomial boundcould be proved for the length of winning strategies in domination games. We give anegative answer to this question by exhibiting a class of graphs where two cops havea winning strategy but only with an exponential number of steps. To the best of ourknowledge, this is the first type of graph search games for which such a lower boundhas been proved.

In terms of complexity, domination games are also much harder than standard copsand robber games. In particular, we show that deciding if two cops have a (non-monotone) winning strategy is PSPACE-complete. Again, to the best of our knowledge,this is the first type of graph searching games exhibiting this worst-case complexity.This result is in sharp contrast to other variants of graph searching games on undirectedgraphs, which often are in polynomial time for a fixed number of cops and often evenfixed-parameter tractable with the numbers of cops being the parameter. For mono-tone strategies we also prove that it is NP-hard to decide whether two cops have amonotone winning strategy in domination games. The complexity results are the focusof Section 5.

Finally, we establish a relation between domination games and Robber and Marshalgames played on hypergraphs. Robber and Marshal games were introduced in [9] toprovide a game theoretical characterisation of hypertree-width. In particular, we showthat every Robber and Marshal game on a hypergraph can be translated into a domina-tion game on an undirected graph and derive interesting consequences from this fact.

2 Preliminaries

We use standard notation from graph theory as can be found in, e.g., [5]. In particular,we write V (G) for the vertex set of a graph G and E(G) for its edge set. All graphsin this paper are simple and undirected and all graphs and hypergraphs are finite. LetG be a graph and d ≥ 1. The (open) d-neighbourhood of a vertex v in G is NG

d (v) :={u : 0 < distG(u, v) ≤ d}, where distG(u, v) is the distance between u and v in G.

Page 321: Graph-Theoretic Concepts in Computer Science

Distance d-Domination Games 311

The closed d-neighbourhood of v is NGd [v] := NG

d (v) ∪ {v}. If X is a set, we defineNG

d [X ] :=⋃

v∈X NGd [v]. For the case d = 1, we omit the index d and e.g. write NG(v)

for NG1 (v). Also, we omit the index G whenever G is clear from the context.

The notions of tree-width and path-width were introduced by Robertson and Sey-mour as part of their work on graph minors. We refer to [3,5] for definitions and furtherinformation. We write pw(G) for the path-width of a graph G and tw(G) for its tree-width.

3 d-Domination Games

In this section we introduce d-domination games and present basic results.A d-domination game on a graph G is played between two players, the cop and the

robber, where the goal of the cops is to capture the robber. At each step of the play,the robber occupies a vertex of the graph and the cop player controls a finite number ofcops each occupying vertices. A play starts by the robber choosing an initial position. Ineach step of the game, the cop either places a new cop on a vertex or removes an alreadyplaced cop from the graph. Suppose X is the set of vertices currently occupied by thecops and they want to place a new cop on vertex v. They first have to announce this tothe robber. The robber can then run away, but is not allowed to run through a vertex thatis in the d-neighbourhood of a vertex occupied by a cop, i.e. he can pick a new positionu anywhere on the graph as long as there is a path from his current position to u thatcontains no vertex in Nd[X ].

After the robber has chosen his new position, the new cop is placed on v and the playcontinues. The cops win a play if they can capture the robber, i.e. if they can place acop occupying or dominating the vertex occupied by the robber so that the robber is notable to escape. If the robber can escape forever, he wins.

d-domination games are a variant of the well-known cops and robber games usedto characterise graph parameters such as tree-width or path-width (see e.g. [12]). Thedifference is that in a cops and robber game, a cop only occupies his current positionbut does not block the d-neighbourhood of this position.

We will distinguish between two variants of d-domination games, i.e. the visibleand invisible variant. In the visible case, the cops can see the robber and can adapt theirstrategy accordingly. In the invisible case, the cops do not see the robber and hence haveto search the graph independently of the robbers current position. In this case, we areessentially dealing with a one player game and in describing the game, we can discardthe robber positions. In both cases, the aim of the cop player is to capture the robberusing as few cops as possible. In this paper we primarily consider the invisible caseand will therefore present the relevant notation and definitions in terms of the invisibledomination game. We briefly comment on the visible case in Section 6.

In the invisible domination game, the cops have to capture the robber without be-ing able to see him – and hence without being able to react to his actions. We cantherefore represent any cop strategy on a graph G in the invisible d-domination gameby a sequence S := (S1, . . . , Sn), where, for 1 ≤ i ≤ n, Si ⊆ V (G) is the copposition after step i. With any strategy S := (S1, . . . , Sn) we associate the corre-sponding sequence R0, . . . , Rn of robber spaces as follows: R0 := V (G) and for all

Page 322: Graph-Theoretic Concepts in Computer Science

312 S. Kreutzer and S. Ordyniak

i > 0, Ri := {v ∈ V (G) \ Nd[Si] : there is u ∈ Ri−1 and a path from u to v inG \Nd[Si−1 ∩ Si]}, where we take S0 := ∅. Hence, Ri is the set of vertices availableto the robber after i steps of the play. Vertices in V (G) \Ri are called clear at stage i.

Definition 3.1. Let S := (S1, . . . , Sn) be a strategy and (R0, . . . , Rn) be the corre-sponding robber spaces.1. S is a winning strategy if it is finite and Rn = ∅.2. The width w(S) of S is defined as w(S) := max{|Si| : 1 ≤ i ≤ n}.3. The d-domination search number dsd(G) := min{w(S) : S is a winning strat-

egy on G} of G is the minimal number of cops required to win the invisible d-domination game on G.

Clearly, every graph of order n can be searched by n cops. Hence dsd(G) is well-defined. We next introduce a general construction that will be used frequently through-out the paper. As a first application of this we show that questions about complexity andmonotonicity of d-domination games for d > 1 can be reduced to the correspondingquestions for the case of d = 1.

For k > 0, let Kk be the k-clique, i.e. the complete graph on k vertices. Further, if Xis a set, we write K[X ] for the complete graph with vertex set X . For each k > 0 andd > 0, we define Sd

k as the graph (up to isomorphism) obtained from Kk by subdividingeach edge 2d times, i.e. replacing each edge by a path of length 2d + 1. We call Sd

k ad-subdivided k-clique. Note that Sd

k contains more than k vertices but in the rest of thepaper the vertices in the paths replacing edges will usually not play a role. We say thatS is the d-subdivided clique over a set X if S is obtained from K[X ] by subdividingeach edge 2d times. We write Sd[X ] for this graph and call X the original vertices ofSd[X ]. As before, we omit the indices in case d = 1. The following lemma, whoseproof is straightforward, will be used frequently in the sequel.

Lemma 3.2. For all k > 0 and d > 0, dsd(Sdk) = k.

For a graph G, k > 0 and a function f : V (G) → 2V (G) we define the subdividedk-clique graph of G, denoted by SC(G, k, f), to be the graph obtained from G by1) replacing each vertex v ∈ V (G) by a disjoint copy of S1

k , denoted SC(v), and 2)replacing each edge {u, v} ∈ E(G) by a perfect matching between the original verticesin SC(u) and the original vertices in SC(v) and 3) for each v ∈ V (G) we add a newvertex denoted c(v) so that {c(v) : v ∈ V (G)} induces a clique in SC(G, k, f) andfor each v ∈ V (G), SC(G, k, f) contains edges between c(v) and all vertices in everySC(u) for u ∈ f(v).

Now it is easily seen that k cops have a winning strategy in the d-domination gameon G if, and only if, k cops have a winning strategy in the 1-domination game onSC(G, k, NG

d []), where in addition they only play on the new extra vertices c(v), forv ∈ V (G). The same holds for monotone winning strategies as defined in Section 4below. Here, NG

d [] denotes the function f(v) := NGd [v]. By setting k := |V (G)| we

obtain the following corollary.

Corollary 3.3. Fix d > 0. There is a polynomial time algorithm which constructs foreach graph G a graph G′ such that for all k > 0, k cops win the d-domination gameon G if, and only if, k cops win the 1-domination game on G′. The analogous statementholds for monotone winning strategies.

Page 323: Graph-Theoretic Concepts in Computer Science

Distance d-Domination Games 313

The converse direction is also true. By subdividing each edge 2d-times, we can con-struct for each graph G a graph G′ so that k cops win the 1-domination game on G if,and only if, k cops win the d-domination game on G′. This construction follows essen-tially from [7] and also shows that the cops and robber game underlying tree-width canbe reduced to the 1-domination game. It follows that all questions concerning mono-tonicity and complexity about d-domination games can be reduced to the case of d = 1.We will therefore only consider this case in the sequel. As described in the introduc-tion, this case was already studied under the name of domination games by Fomin etal. [7]. We will therefore follow their terminology and refer to these games as dom-ination games and write ds(G) for the minimal number of cops required to win thedomination game on a graph G.

4 Monotonicity of Domination Games

In this section we study monotone strategies of invisible domination games. In particu-lar, we establish strong non-monotonicity results for common notions of monotonicity– cop- and robber-monotonicity – in showing that in general more cops are needed tocatch a robber with a monotone strategy than with an unrestricted strategy and that theratio between the monotone and the non-monotone case is unbounded. We then con-sider a third type of monotonicity specific to domination games.

Definition 4.1. Let S := (S1, . . . , Sn) be a strategy and (R0, . . . , Rn) be the corre-sponding robber spaces (see Section 3).

1. S is robber-monotone, if Ri ⊇ Rj for all i < j.2. S is cop-monotone if for all i < j < l and all v ∈ V (G), if v ∈ Si\Sj then v �∈ Sl.3. The cop-monotonedomination search number is defined as c-ds(G) := min{w(S) :S is a cop-monotone winning strategy on G}. The robber-monotone dominationsearch number r-ds(G) is defined analogously.

In a non-monotone strategy, a vertex v ∈ Rj \Ri, for j > i, is called recontaminated.

Note that, unlike cops and robber games, in domination games cop-monotone strategiesmight not be robber-monotone and vice versa. In [7], Stefan Dobrev exhibited an exam-ple where three cops can win the domination game but four cops are needed to searchthe graph using a monotone strategy. We now strengthen this result considerably byshowing that the ratio between the (robber- or cop-) monotone and the non-monotonesearch numbers is unbounded.

Lemma 4.2. For every k > 2, there is a graph Gk such that ds(Gk)=2 but r-ds(Gk)=c-ds(Gk) = k.

Proof. For k ∈ N we define Gk as follows. Let U := {u1, . . . , uk} be a set of size k.For all permutations ρ of (1, . . . , k) and all 1 ≤ i ≤ k, let P ρ

i be a subdivided cliqueon k vertices and let Hρ be the graph obtained from the disjoint union

⋃iP

ρi of these

subdivided cliques by adding edges forming a perfect matching of the original vertices inP ρ

i and P ρi+1, for 1 ≤ i < k. Then Gk is defined as K

[X

]∪⋃ρHρ augmented by edges

Page 324: Graph-Theoretic Concepts in Computer Science

314 S. Kreutzer and S. Ordyniak

a) Graph Gk from Lemma 4.2. b) Graph Gk from Lemma 4.3.

Fig. 1. Examples for non-monotonicity in domination games

{{vi, v} : v ∈ P ρρ(i), 1 ≤ i ≤ k and ρ is a permutation of (1, . . . , k)}. The construction

is illustrated in Figure 1 a). Here, dashed lines represent edges from a vertex ui to allvertices in a subdivided clique whereas solid lines represent actual edges.

It is easily seen that two cops can search Gk as follows: for each permutation ρof (1, . . . , k) they play Sρ := ({uρ(1), uρ(2)}, {uρ(2), uρ(3)}, . . . , {uρ(k−1), uρ(k)}),i.e. they search the “path” Pρ by going through u1, . . . , uk using the ordering given byρ. As the only connection between Hρ and Hρ′ is through the vertices in U and theseform a clique, they can search the Hρ independently.

It remains to show that k− 1 cops do not have a cop-monotone or a robber-monotonestrategy on Gk. We can assume that the cops are only playing on the vertices inu1, · · · , uk

as otherwise they need at least k cops to clear a subdivided k-clique.Suppose the cops start by occupying all but one vertex ui in U . Then in each Hρ,

the clique P ρρ(i) is still contaminated. Furthermore, in the next step the cops have to

remove a cop from a vertex uj . But then, there is a permutation ρ such that ρ(i) andρ(j) are consecutive numbers and thus in Hρ the subdivided clique P ρ

ρ(j) becomes

recontaminated. This shows that the strategy is not robber-monotone. As P ρρ(j) can only

be cleared again by playing on vj the strategy for the cops can not be cop-monotone.This concludes the proof.

Considering again the example above exhibiting non-monotone strategies for the cops,the main source for non-monotonicity appears to be that while clearing some parts ofthe graph, the cops accidentally and unintentionally clear other parts of the graph also– which later on they have to allow to be recontaminated. For instance, in the exam-ple above, while clearing a sub-graph Hρ they also clear parts of other sub-graphs Hρ′

but in the wrong order. If we gave the cops the power to choose which vertices in theneighbourhood of a cop they really want to dominate, then they could easily searchthe graphs Gk with a robber- and cop-monotone strategy. We call this selective mono-tonicity. It seems conceivable, thus, that such selective strategies are always sufficient,i.e. whenever k cops can win in any form, they can do so with a selective monotonestrategy. Such a result would be extremely interesting as it would imply a linear up-per bound for the length of minimal winning strategies for the cop player. This hope isdashed, though, by the following theorem.

Page 325: Graph-Theoretic Concepts in Computer Science

Distance d-Domination Games 315

Theorem 4.3. There exists a graph G with ds(G) = 2 but 3 cops are needed for anyselective monotone winning strategy.

Proof. The graph G is shown in Figure 1 b). Here, solid lines represent actual edgeswhereas a dashed line such as between 3 and S3 indicates that there is an edge between3 and every vertex in S3.

Now, ds(G) = 2 as witnessed by the following two strategies: S1 :=({3, 2}, {2, 1},

{1, 0}, {0, 1′}, {1′, 2′}, {2′, 3′}) and S2 :=({3′, 2′}, {2′, 1′}, {1′, 0}, {0, 1}, {1, 2},

{2, 3}). Note that both strategies are not robber monotone. For instance, in S1 the ver-tices in S1 are recontaminated in the step from {2, 1} to {1, 0} and similarly in the sym-metric strategy S2. Further, observe that in order for these strategies to work, at eachstep all neighbours of every vertex occupied by a cop need to be dominated. Hence,none of the two strategies can be turned into a selective monotone strategy.

We claim that there is no selective monotone strategy with only two cops. For thesake of contradiction let S be a selective monotone winning strategy with two copsusing a minimal number of steps. We first show that S cannot use any vertex other thanthose in X := {3, 2, 1, 0, 1′, 2′, 3′}. For, if v ∈ Si or v ∈ Pi is occupied by a cop thenat the first step where this cop is lifted from v, v will be recontaminated unless it isdominated by the other cop. Hence, placing a cop on v either can be avoided, as v isdominated anyway, or it leads to non-monotonicity.

Thus, a selective monotone strategy with two cops essentially searches the path3, 2, 1, 0, 1′, 2′, 3′. However, it is easily seen that a path of length 7 can be searchedin only two ways by two cops using a monotone strategy: left to right or right to left. Iffollows that the only possible strategies are S1 or S2 and neither is selective monotone.This yields the contradiction.

As argued above, an important aspect of monotonicity for a variant of graph search-ing games is that in this way a bound on the maximal number of steps in a strategyis obtained. As domination games are strongly non-monotone, no such bound can beachieved using this approach. In Corollary 5.3 below we show that there exist graphssuch that the number of steps needed by a strategy in the domination game is exponen-tial in the size of the graph and thus cannot be bounded bounded by a polynomial.

5 Complexity of Domination Games

In this section we study the complexity of deciding whether k cops have a (monotone)winning strategy in the domination game on a graph G. We measure the complexity ofthis problem in different ways – classically and in the context of parametrised complex-ity. Let DOMINATION SEARCH be the problem of deciding for a given graph G andk ∈ N whether k cops have a winning strategy on G. In [7], Fomin et al. study thisproblem and show that it is NP-hard.

Theorem 5.1 ( [7]). DOMINATION SEARCH is NP-hard.

No upper bound for the complexity of the problem was given. We settle this problemby giving precise complexity bounds for DOMINATION SEARCH.

Page 326: Graph-Theoretic Concepts in Computer Science

316 S. Kreutzer and S. Ordyniak

Theorem 5.2. DOMINATION SEARCH is PSPACE-complete. More precisely, we showthat even deciding whether two cops have a winning strategy on a graph is PSPACE-complete.

In [7, Problem 7], Fomin et al. raise the question whether for every graph G there is awinning strategy of length O(n) using ds(G) cops in the invisible domination searchgame. As a consequence of the proof of the previous theorem we answer this questionnegatively by showing that there exist graphs on which the number of steps needed by astrategy in the domination game is at least exponential in the size of the graph and thuscan not be bounded bounded by a polynomial. Clearly, exponential length of strategiesis also the worst possible.

Corollary 5.3. There exists a family C of graphs such that two cops have a winningstrategy in the invisible domination game on each G ∈ C but any such strategy is atleast of exponential length, i.e. there is no polynomial p(n) so that the length of thesestrategies is bounded by p(|G|).We now consider the problem to decide for a given graph G whether k cops have amonotone winning strategy in the invisible domination game, where we consider cop-and selective-monotonicity. Clearly, as the length of monotone strategies is polynomi-ally bounded in the size of the graph, these problems are necessarily in NP. We againgive tight complexity bounds by showing that even deciding whether two (or three,respectively) cops have monotone winning strategies is NP-hard.

Theorem 5.4. Let G be a graph. Deciding whether two cops have a cop-monotonewinning strategy in the domination search game on G is NP-complete.

Theorem 5.5. Let G be a graph. Deciding whether three cops have a selective monotonewinning strategy in the domination game on G is NP-complete.

We do not know corresponding results for robber-monotone strategies and leave this asan open problem.

The previous results settle the classical complexity of the domination game problem.We now study the parametrised complexity of this problem. The parametrised domina-tion search problem p-DOMINATION SEARCH is defined as the problem, given a graphG and k ∈ N as input, to decide if k cops have a winning strategy in the invisibledomination game on G. We take k as the parameter. The problem is in the parametrisedcomplexity class XPif it can be solved in time |G|f(k) for some computable functionf : N → N. It is fixed-parameter tractable, or in FPT, if it can be solved in timef(k) · |G|c, for some c ∈ N and computable f : N→ N. The following is an immediateconsequence of Theorem 5.2, 5.4 and 5.5.

Corollary 5.6. p-DOMINATION SEARCH is not in XP. This holds true even for the cop-or selective monotone version of the problem.

The previous results establish fixed-parameter intractability for domination games.Hence, domination games are considerably more complex than standard cops and rob-ber games, which are NP-complete and fixed-parameter tractable. The latter followsfrom the parametrised tractability of tree-width and path-width and the monotonicity ofthe games.

Page 327: Graph-Theoretic Concepts in Computer Science

Distance d-Domination Games 317

We now turn to special cases where tractability can be obtained. A natural choice ofgraph classes where the problem might be easier are classes of bounded tree- or path-width. One is tempted to think that fixed-parameter tractability of domination searchon classes C of graphs of tree-width at most d could be established along the followinglines: given G ∈ C and k ∈ N, we first compute a tree-decomposition of G of widthd and then use dynamic programming to decide whether there is a winning strategy ofwidth k. This is the approach taken to show that the analogous questions for cops androbber games (visible and invisible) can be solved by linear time parametrised algo-rithms. Typically, one proceeds bottom-up along the tree-decomposition and for eachnode in the decomposition tree one computes a constant size data structure containinginformation about the sub-graph induced by the vertices in the sub-tree rooted at thisnode. For domination games, however, this approach fails as a vertex in a bag can bedominated by vertices not contained in this bag. The ways in which this happens canbe rather complex and hence a constant size data structure seems difficult to obtain. Itis still possible, though, that domination search is fpt on classes of bounded tree-widthand we leave this for future work.

We are, however, able to obtain parametrised algorithms for classes of graphs ofbounded degree (recall that the problem is already NP-hard on the class of graphs ofdegree at most 3).

Lemma 5.7. For d > 0 let Cd be the class of graphs of maximum degree at most d. Thenthe problem, given G ∈ Cd and k ∈ N, to decide whether k cops have a cop-monotonewinning strategy on G is fixed-parameter tractable with parameter d + k.

Furthermore, if k cops have a winning strategy on any G ∈ Cd, then at most dk + 1cops have a cop- and a selective-monotone winning strategy.

6 Games on Hypergraphs and Visible Robbers

In this section we briefly explore the relation between domination games and Robberand Marshal games on hypergraphs and comment on domination games with a visiblerobber.

Robber and Marshal games, with a visible robber, have been introduced in [9] asa game-theoretical approach to hypertree-width and have, since then, been studied in-tensively. Essentially, a Robber and Marshal game is a Cops and Robber game on ahypergraph where the robber occupies a vertex whereas each marshal (= cop) occupiesa hyperedge and blocks all vertices contained in it.

We will show next that every hypergraph game can be translated into a dominationgame – in the visible and the invisible case. There is a small difference between theRobber and Marshal game we use here and the original robber and marshal game in [9].In the original game the marshals slide along edges in the sense that if a marshal movesfrom hyperedge e to e′ then the vertices in e ∩ e′ remain blocked (an equivalent notionfor domination games could easily be defined). Here, we consider the variant of Robberand Marshal games where only the vertices in edges on which a marshal remains areblocked. It is easy to see that both variants are within a constant factor of each other.

Lemma 6.1. Let H be a hypergraph and k ≥ 1 be an integer. Then there exists a graphHdom

k+1 , such that k marshalls have a (marshal-/robber-monotone) winning strategy in

Page 328: Graph-Theoretic Concepts in Computer Science

318 S. Kreutzer and S. Ordyniak

the (visible) robber and marshals game on H , if and only if, k cops have a (cop-/robber-monotone) winning strategy in the (visible) domination game on Hdom

k+1 and Hdomk+1 can

be constructed from H in polynomial time.

The lemma allows us to translate Robber and Marshal games to domination games. Itfollows immediately from Lemma 6.2 below that there is no translation in the conversedirection.

So far, we have primarily considered domination games with an invisible robber.Here, we briefly summarise our knowledge of the visible case. Clearly, notions such asmonotonicity and the domination search number translate easily.

In [1], Adler showed that the visible robber and marshall game mentioned aboveis not robber-monotone. Together with Lemma 6.1, this implies that the visible dom-ination game is also not robber-monotone. However, the robber-monotone and non-monotone variant of the visible robber and marshall Game are within a constant factorof each other (see [2]). We show next that no such bound can be obtained for dominationgames.

Lemma 6.2. For every k > 2, there is a graph Gk such that 2 cops have a non-monotone but k cops are needed for a robber-monotone winning strategy in the visibledomination game on Gk.

Finally, we consider the complexity of visible domination games. In terms of classicalcomplexity, we can show the following.

Theorem 6.3. Let G be a graph. Deciding whether three cops have a selective monotonewinning strategy in the visible domination game on G is NP-complete.

It is easily seen that all visible game variants except for the selective monotone variantare in XP, as the current cop and robber position completely determine the current stateof the play and there are only nO(k) such positions. We show next that the problem isnot in FPTunless FPT=W[2].

As observed in [7], domination search is closely related to dominating sets in graphs.A dominating set of a graph G is a set X such that for all v ∈ V (G) either v ∈ X orthere is a u ∈ X such that {u, v} ∈ E(G). The domination number of G, denoted byγ(G), is the minimal size of a dominating set of G.

Lemma 6.4 ( [7]). Let G be a graph and H be the graph obtained from G by connect-ing every pair of non-adjacent vertices in G by a path of length three. Then γ(G) ≤ds(H) ≤ γ(G) + 1.

We establish a similar but exact correspondence using a slightly different construction.

Theorem 6.5. For all graphs G, there exists a graph G′ such that γ(G) + 1 = ds(G′)and G′ is constructable in polynomial time.

The theorem immediately gives a parametrised reduction from the dominating set prob-lem, parametrised by the size of the solution, to the domination search problem,parametrised by the number k of cops. The following result follows from the W[2]-hardness of the dominating set problem, where W[2]is a parametrised complexity classstrongly believed to be different from FPT.

Page 329: Graph-Theoretic Concepts in Computer Science

Distance d-Domination Games 319

Theorem 6.6. The problem p-DOMINATION SEARCH: “given a graph G and k ∈ N,with parameter k, decide whether k cops have a winning strategy in the (in-)visibledomination game on G” is W[2]-hard.

However, Lemma 5.7 also applies to the visible case and thus calculating the visibledomination search number for graphs of bounded degree is fixed-parameter tractable.

Acknowledgements. We are grateful to Fedor Fomin for bringing domination gamesto our attention and thereby stimulating the research reported in this paper and to FedorFomin, Paul Hunter and Paul Dorbec for valuable discussions on the subject.

References

1. Adler, I.: Marshals, monotone marshals, and hypertree-width. JGT 47(4), 275–296 (2004)2. Adler, I., Gottlob, G., Grohe, M.: Hypertree width and related hypergraph invariants. Journal

of Combinatorics 28(8), 2167–2181 (2007)3. Bodlaender, H.: A partial k-aboretum of graphs with bounded tree-width. TCS 209, 1–45

(1998)4. Bodlaender, H.L.: Treewidth: Algorithmic techniques and results. In: Privara, I., Ruzicka, P.

(eds.) MFCS 1997. LNCS, vol. 1295, pp. 19–36. Springer, Heidelberg (1997)5. Diestel, R.: Graph Theory, 3rd edn. Springer, Heidelberg (2005)6. Fedor, F., Thilikos, D.M.: An annotated bibliography on guaranteed graph searching.

TCS 399(3), 236–245 (2008)7. Fomin, F., Kratsch, D., Muller, H.: On the domination search number. Discrete Applied

Mathematics 127(3), 565–580 (2003)8. Franklin, M.K., Galil, Z., Yung, M.: Eavesdropping games: a graph-theoretic approach to

privacy in distributed systems. Journal of the ACM 47(2), 225–243 (2000)9. Gottlob, G., Leone, N., Scarcello, F.: Robbers, marshals, and guards: game theoretic and

logical characterizations of hypertree width. Journal of Computer and Systems Science 66(4),775–808 (2003)

10. Kirousis, L.M., Papadimitriou, C.H.: Searching and pebbling. TCS 47(3), 205–218 (1986)11. Kloks, T., Kratsch, D., Muller, H.: On the structure of graphs with bounded asteroidal num-

ber. Graphs and Combinatorics 17(2), 295–306 (2001)12. Seymour, P.D., Thomas, R.: Graph searching and a min-max theorem for tree-width. Journal

of Combinatorial Theory, Series B 58(1), 22–33 (1993)

Page 330: Graph-Theoretic Concepts in Computer Science

Cycles, Paths, Connectivity andDiameter in Distance Graphs

Lucia Draque Penso1, Dieter Rautenbach2, and Jayme Luiz Szwarcfiter3

1 Institut fur Theoretische Informatik, Technische Universitat Ilmenau, Postfach100565, D-98684 Ilmenau, Germany

[email protected] Institut fur Mathematik, Technische Universitat Ilmenau, Postfach 100565,

D-98684 Ilmenau, [email protected]

3 Universidade Federal do Rio de Janeiro, Instituto de Matematica, NCE andCOPPE, Caixa Postal 2324, 20001-970 Rio de Janeiro, RJ, Brasil

[email protected]

Abstract. For n ∈ N and D ⊆ N, the distance graph P Dn has vertex set

{0, 1, . . . , n−1} and edge set {ij | 0 ≤ i, j ≤ n−1, |j− i| ∈ D}. The classof distance graphs generalizes the important and very well-studied classof circulant graphs which have been proposed for numerous applicationsconcerning networks, distributed systems and chip design.

We prove that the class of circulant graphs coincides with the classof regular distance graphs. Extending some of the fundamental resultsconcerning circulant graphs, we study the existence of long cycles andpaths in distance graphs and analyse the computational complexity ofproblems related to their connectivity and diameter.

Keywords: Circulant graph; distance graph; multiple loop networks;connectivity; diameter; Hamiltonian cycle; Hamiltonian path.

1 Introduction

Circulant graphs form an important and very well-studied class of graph [1, 12,13, 16, 18]. They are Cayley graphs of cyclic groups and have been proposed fornumerous applications such as local area computer networks, large area com-munication networks, parallel processing architectures, distributed computing,and VLSI design. Their connectivity and diameter [2, 1, 12, 13], cycle and pathstructure, and further graph-theoretical properties [3, 11, 22] have been studiedin great detail. Polynomial time algorithms for isomorphism testing and recog-nition of circulant graphs have been long-standing open problems which werecompletely solved only recently [5, 8, 17].

For n ∈ N and D ⊆ N, the circulant graph CDn has vertex set [0, n − 1] =

{0, 1, . . . , n− 1} and the neighbourhood NCDn

(i) of a vertex i ∈ [0, n− 1] in CDn

is given by

NCDn

(i) = {(i + d) mod n | d ∈ D} ∪ {(i− d) mod n | d ∈ D}.

C. Paul and M. Habib (Eds.): WG 2009, LNCS 5911, pp. 320–328, 2010.c© Springer-Verlag Berlin Heidelberg 2010

Page 331: Graph-Theoretic Concepts in Computer Science

Cycles, Paths, Connectivity and Diameter in Distance Graphs 321

Clearly, we may assume max(D) ≤ n2 for every circulant graph CD

n .Our goal here is to extend some of the fundamental results concerning circu-

lant graphs to the similarly defined yet more general class of distance graphs:For n ∈ N and D ⊆ N, the distance graph PD

n has vertex set [0, n− 1] and

NP Dn

(i) = {i + d | d ∈ D and (i + d) ∈ [0, n− 1]}∪{i− d | d ∈ D and (i− d) ∈ [0, n− 1]}

for all i ∈ [0, n− 1]. Clearly, we may assume max(D) ≤ n− 1 for every distancegraph PD

n .Every distance graph PD

n is an induced subgraph of the circulant graphCD

n+max(D). More specifically, distance graphs are the subgraphs of sufficientlylarge circulant graphs induced by sets of consecutive vertices. Conversely, the fol-lowing simple observation shows that every circulant graph is in fact a distancegraph.

Proposition 1. A graph is a circulant graph if and only if it is a regular distancegraph.

Proof: Clearly, every circulant graph CDn is regular and isomorphic to the distance

graph PD′n for D′ = D ∪ {n− d | d ∈ D}.

Now let PDn be a regular distance graph. Let D = {d1, d2, . . . , dk} with d1 <

d2 < . . . < dk ≤ n − 1. Since the vertex 0 has exactly k neighbours D, PDn is

k-regular.Let i ∈ [1, k]. The vertex di−1 has exactly i−1 neighbours j with j < di−1.

Hence di − 1 has exactly k + 1 − i neighbours j with j > di − 1 which implies(di − 1) + dk+1−i ≤ n− 1. The vertex di has exactly i neighbours j with j < di.Hence di has exactly k− i neighbours j with j > di which implies di + dk+1−i >n− 1.

We obtain di + dk+1−i = n for every i ∈ [1, k] which immediately implies thatPD

n is isomorphic to the circulant graph CD′n for D′ = {d ∈ D | d ≤ n

2 }. �

Distance graphs lack the symmetry and algebraic interpretation of circulantgraphs and the algebraic methods used in [8,17] will not apply to them. In viewof Proposition 1, the recognition of distance graphs will be at least as difficult asthe recognition of circulant graphs. Originally motivated by coloring problemsfor infinite distance graphs studied by Eggleton, Erdos, and Skilton [7], mostresearch on distance graphs focused on colorings (cf. eg. [6, 14, 21]).

One of the most fundamental results for circulant graphs is the followingbeautiful equivalence.

Theorem 1 (Boesch and Tindell [2], Burkard and Sandholzer [4],Garfinkel [9]). For n ∈ N and a finite set D ⊆ N, the following statementsare equivalent.

(i) CDn is connected.

(ii) The greatest common divisor gcd({n}∪D) of the integers in {n}∪D equals 1.

Page 332: Graph-Theoretic Concepts in Computer Science

322 L.D. Penso, D. Rautenbach, and J.L. Szwarcfiter

(iii) CDn has a Hamiltonian cycle.

Our contributions split into two parts. In the first part, we establish an analogueof the above equivalence for distance graphs. While connectivity and hamiltonic-ity of circulants are equivalent to a simple necessary gcd-condition, we provethat a similar condition for distance graphs only ensures the existence of a largecomponent and a long cycle. We also discuss consequences and variants of ourresult. In the second part, we study the complexity of various connectivity anddistance problems for distance graphs. Whereas deciding the connectivity of cir-culants only requires a simple gcd-computation, several related problems becomehard for distance graphs.

2 Cycles and Paths in Distance Graphs

We immediately proceed to our main result in this section. The residue of aninteger n ∈ Z modulo d ∈ N will be denoted by n mod d.

Theorem 2. For a finite set D ⊆ N, the following statements are equivalent.

(i) There is a constant c1(D) such that for every n ∈ N, the distance graphPD

n has a component of order at least n− c1(D).(ii) gcd(D) = 1.(iii) There is a constant c2(D) such that for every n ∈ N, the distance graph

PDn has a cycle of order at least n− c2(D).

Proof (i)⇒ (ii): Let n be such that n is even and n > 2c1(D). By (i), more thanhalf the vertices are in the same component of PD

n . By the pigeonhole principle,there is some i ∈ [0, n − 2] such that the two vertices i and i + 1 are in thesame component of PD

n . This implies that there is a path in PDn from i to i + 1.

Hence 1 is an integral linear combination of the elements in D. It is a well-knownconsequence of the Euclidean algorithm that this is equivalent to (ii).

(ii)⇒ (iii): The essential idea in order to obtain a cycle which contains almost allvertices of PD

n is to use increasing and decreasing paths which only use edges uvsuch that v−u is one fixed element d∗ of D. Because the vertices on these pathsalways remain in the same residue class modulo d∗, such paths can be overlayedwithout intersecting. In order to connect these paths to a cycle, we use shortpaths which are close to 0 or n−1 and whose end vertices are in different residueclasses modulo d∗. In this way the cycle can collect all vertices of PD

n in somemiddle section and only misses vertices close to 0 or n − 1 in terms of D (cf.Figure 1).

Due to space limitations, we will only discuss the case that max(D) is evenin detail.

In view of the constant c2(D) in (iii), we may tacitly assume in the followingthat n is sufficiently large in terms of D.

Let dmax = max(D) and D− = D \ {dmax}. Since gcd(D) = 1, 1 is anintegral linear combination of the elements of D. Hence there are integers nd

Page 333: Graph-Theoretic Concepts in Computer Science

Cycles, Paths, Connectivity and Diameter in Distance Graphs 323

Q1

Q2

Q3

Q4

P1

P3

i′1 i1

i′3 i3

i0i2

i4

P2

P ′

Fig. 1.

for d ∈ D− such that 1 =

(∑

d∈D−ndd

)

mod dmax. This implies the existence

of a path P : v0v1 . . . vk in PDn such that vi − vi−1 ∈ D− for all i ∈ [1, k] and

{vi mod dmax | i ∈ [0, k]} = [0, dmax − 1], i.e. P is a monotonously increasingpath which only uses edges uv with v−u ∈ D− and contains a vertex from everyresidue class modulo dmax.

We assume that P is chosen so as to be shortest possible. This implies thatthe residues modulo dmax of the vertices v0 and vk appear exactly once onP . Let r1, r2, . . . , rdmax denote the residues modulo dmax in the order in whichthey appear for the first time when traversing P from v0 to vl. Clearly, r1 =v0 mod dmax, r2 = v1 mod dmax, and rdmax = vk mod dmax. Furthermore, Pis the concatenation of (dmax − 1) edge-disjoint paths P = P1P2 . . . Pdmax−1

such that for i ∈ [1, dmax − 1], the path Pi begins at the smallest vertex vj

on P with ri = vj mod dmax and ends at the smallest vertex vj′ on P withri+1 = vj′ mod dmax; let li = vj′ − vj for these indices. By the choice of P ,for i ∈ [1, dmax − 1], all internal vertices of Pi have residues modulo dmax in{rj | 2 ≤ j ≤ i− 1}. Let l = l1 + l2 + . . . + ldmax−1. Note that l = vk − v0.

We now describe a long cycle C in PDn . The general structure of C is illustrated

in Figure 1. For simplicity we will first assume that dmax is even.Let i0 be the smallest integer at least (dmax + l2)+ (dmax + l4)+ . . .+(dmax +

ldmax−2)+(dmax+l) of residue r1 modulo dmax. Furthermore, let i′1 be the largestinteger at most (n− 1)− l1− (dmax + l3)− (dmax + l5)− . . .− (dmax + ldmax−1) ofresidue r1 modulo dmax. (Note that i0 has to be chosen large enough in order tofit the paths P2, P4, . . . , Pdmax−2 and a path P ′ of length at most l - all startingat vertices with a specified residue - within [0, i0] as illustrated in Figure 1. Asimilar reasoning motivates the choice of i′1.)

We start C with an increasing path Q1 only using edges uv with v−u = dmax

which begins at i0 and ends at i′1. We continue C with P1 shifted by a multipleof dmax such that it begins at i′1 and ends at a vertex i1.

Page 334: Graph-Theoretic Concepts in Computer Science

324 L.D. Penso, D. Rautenbach, and J.L. Szwarcfiter

For j from 1 up to dmax2 − 1, we proceed as follows: We assume that we have

already constructed C until the end of a shifted path P2j−1 which ends at avertex i2j−1. We continue C with a decreasing path Q2j which only uses edgesuv with v−u = dmax and ends at the largest integer i2j at most i2j−2− l2j withresidue r2j modulo dmax. We continue C with P2j shifted by a multiple of dmax

such that it begins at i2j . We continue C with an increasing path Q2j+1 whichonly uses edges uv with v − u = dmax and ends at the smallest integer i′2j+1 atleast i2j−1 with residue r2j+1 modulo dmax. We continue C with P2j+1 shiftedby a multiple of dmax such that it begins at i′2j+1 and ends at a vertex i2j+1. Atthis point, we increase j until it reaches dmax

2 − 1.To complete C, we may assume now that we have already constructed C until

the end of the shifted path Pdmax−1 which ends at a vertex idmax−1. We continueC with a decreasing path Qdmax which only uses edges uv with v−u = dmax andends at the largest integer idmax at most idmax−2 − l with residue rdmax modulodmax.

Let P ′ : u0u1 . . . uk′ be a path in PDn such that u0 = idmax , ui − ui−1 ∈ D−

for all i ∈ [1, k′], r1 = uk′ mod dmax, and l′ = uk′ − u0 is minimum possible.Clearly, l′ ≤ l. Furthermore, no internal vertex of P ′ has residue rmax modulodmax. We continue C with P ′. Finally, we complete C with an increasing pathwhich only uses edges uv with v − u = dmax, begins at uk′ and ends at i0.

At this point we have completely described C as the concatenation of paths.Clearly, the choices of i0 and i′1 imply that C never leaves [0, n− 1], i.e. C is infact a closed walk within PD

n . In order to show that C is a cycle, it remains toprove that it visits no vertex twice. This follows easily from the facts that

– the vertices on Qi all have residue ri modulo dmax for all i ∈ [1, dmax],– the end vertices of the shifted paths Pi are the first vertices on C - traversed

as constructed above - which have residue ri+1 modulo dmax for all i ∈[1, dmax − 1],

– all internal vertices of Pi have residues modulo dmax in {rj | 2 ≤ j ≤ i− 1}for all i ∈ [1, dmax − 1], and

– no internal vertex of P ′ has residue rmax modulo dmax.

Since C contains all vertices between i0 and i′1, it misses at most 2dmax + l1 +(dmax + l2) + . . . + (dmax + ldmax−1) + (dmax + l) = dmax(dmax + 1) + 2l manyvertices of PD

n . Since this expression is bounded in terms of D, the proof of (iii)in the case that dmax is even is complete.

In the case that dmax is odd a very similar construction with a small modifi-cation yields a long cycle.

(iii) ⇒ (i): Since this implication is trivial, the proof is complete. �

We add some comments concerning Theorem 2.It is easy to see that a distance graph PD

n with gcd(D) = 1 and n ≥2 max(D)+ 1 is actually connected. Therefore, the constant c1(D) in (i) of The-orem 2 can be eliminated for sufficiently large n. For (iii) in Theorem 2, a similar

Page 335: Graph-Theoretic Concepts in Computer Science

Cycles, Paths, Connectivity and Diameter in Distance Graphs 325

change is not possible, i.e. no lower bound on the order n would imply that PDn

has a Hamiltonian cycle. If n as well as all elements of D are odd for instance,then PD

n is bipartite and every cycle misses at least one vertex. In this sense,Theorem 2 is best-possible.

As observed in the proof of Theorem 2, there are integersnd for d ∈ D− with 1 =(∑

d∈D−(nd mod dmax) d

)

mod dmax. Repeating the path corresponding to the last

sum dmax − 1 times yields a monotonously increasing path which contains ver-tices of all residues modulo dmax. This implies l ≤ (dmax− 1)

d∈D−(nd mod dmax)

d ≤ O(d3max|D|

)for the value l considered in the proof of Theorem 2 and yields

the estimate c2(D) = O(max(D)2 + l

)= O

(max(D)3|D|).

Theorem 2 (iii) trivially implies the existence of a path of order at leastn − c2(D) which traverses [0, n − 1] several times back and forth just like thecycle does. We believe that there is also always a path containing almost allvertices of PD

n which is essentially monotonic, i.e. it traverses [0, n − 1] once.The following conjecture makes this precise.

Conjecture 1. For a finite set D ⊆ N, the following statements are equivalent.

(i) gcd(D) = 1.(ii) There are two constants c3(D) and c4(D) such that for every n ∈ N, the

distance graph PDn has a path u0u1 . . . ul of order at least n − c3(D) such

that uj > ui for all 0 ≤ i, j ≤ l with j − i ≥ c4(D).

A simple modification of the construction used in the proof of Theorem 2 impliesthe following weak version of Conjecture 1.

Theorem 3. If D ⊆ N is a finite set with gcd(D) = 1 and ε > 0, then thereare constants c5(D, ε) and c6(D, ε) such that for every n ∈ N, the distance graphPD

n has a path u0u1 . . . ul of order at least (1− ε)n− c5(D, ε) such that uj > ui

for all 0 ≤ i, j ≤ l with j − i ≥ c6(D, ε).

Note that Conjecture 1 is trivial, if D contains only one element. If D containsexactly two elements, then Conjecture 1 easily follows from the following result.

Proposition 2. If d1, d2 ∈ N are such that d1 > d2 and gcd({d1, d2}) = 1, thenP{d1,d2}d1+d2+1 has a Hamiltonian path which begins at 0 and ends at d1 + d2.

3 Connectivity and Diameter in Distance Graphs

The most fundamental connectivity problem for distance graphs is the following.

Connectivity of PDn

Instance: n ∈ N and D ⊆ N.Question: Is PD

n connected?

We have not been able to determine the complexity of Connectivity of PDn

and pose the following conjecture.

Page 336: Graph-Theoretic Concepts in Computer Science

326 L.D. Penso, D. Rautenbach, and J.L. Szwarcfiter

Conjecture 2. Connectivity of PDn is NP-hard.

Clearly, PDn is connected if and only if for every i ∈ [0, n − 2], there is a path

in PDn from i to i + 1. Equivalently, for every i ∈ [0, n − 2], there are integers

x1, x2, . . . , xl such that

|xi| ∈ D for all i ∈ [1, l], (1)

1 =l∑

j=1

xj , and (2)

i +k∑

j=1

xj ∈ [0, n− 1] for all k ∈ [0, l]. (3)

It is a well-known consequence of the Euclidean Algorithm that 1 is an integrallinear combination of the elements of D if and only if gcd(D) = 1. Hence theexistence of integers xi which satisfy (1) and (2) can be decided in polynomialtime. Unfortunately, these integers are by far not unique. Furthermore, givenintegers xi which satisfy (1) and (2), deciding the existence of an ordering ofthem which satisfies (3) is in general a hard problem as we show next.

Bounded Partial Sums

Instance: x0, x1, x2, . . . , xl ∈ Z and n ∈ N.Question: Is there a permutation π ∈ Sl such that

x0 +k∑

j=1

xπ(j) ∈ [0, n− 1] for all k ∈ [0, l]?

Proposition 3. Bounded Partial Sums is NP-complete.

Proof: Clearly, Bounded Partial Sums is in NP. We will reduce the classicalNP-complete problem Partition to Bounded Partial Sums. In order to re-late to the preceding discussion we will reduce to instances of Bounded Partial

Sums which satisfy (2). Let x1, x2, . . . , xl−2 ∈ N be an instance of Partition.

Let X =l−2∑

i=1

xi.

Let x0 = 0, xl−1 = −X , xl = −X + 1, and n = X + 1. It is easy to see thatthe instance x1, x2, . . . , xl−2 of Partition is “yes”-instance if and only if theinstance of Bounded Partial Sums defined by x0, 2x1, 2x2, . . . , 2xl−2, xl−1, xl

and n is a “yes”-instance. This completes the proof. �

Clearly, if |D| = 1, then PDn is connected if and only if D = {1}. Already

for |D| = 2, the following characterization of the pairs (n, D) for which PDn is

connected is not simple.

Theorem 4. Let n, d1, d2 ∈ N be such that d1 < d2. For i ∈ [0, d1 − 1], letri = (id2) mod d1 and si = (n−1−ri) mod d1. Furthermore, for i∗ ∈ [1, d1−1],let

d+i∗ = max {ri | i ∈ [0, i∗ − 1]} and

d−i∗ = max{s−i mod d1

| i ∈ [0, d1 − i∗ − 1]}

.

Page 337: Graph-Theoretic Concepts in Computer Science

Cycles, Paths, Connectivity and Diameter in Distance Graphs 327

Finally, let d∗ = maxi∗∈[1,d1−1]

min{d+i∗ , d

−i∗}.

P{d1,d2}n is connected if and only if gcd({d1, d2}) = 1 and d∗ + d2 ≤ n− 1.

While deciding connectivity is easy for circulant graphs, the exact calculationand minimization of the diameter of CD

n are difficult and well-studied problemseven for the case |D| = 2 [1,12,13]. Many of the general upper and lower boundson the diameter of circulant graphs easily generalize to distance graphs. Thearguments used by Wong and Coppersmith [23] to obtain their classical estimates(cf. Theorems 4.6 and 4.7 in [12]) imply

diam(PD

n

) ≥ 12

(|D|!n)1

|D| − |D| and

diam(P{1,d,...,dk−1}dk

)≤ k(d− 1).

For our final hardness result, we consider the following decision problem whichclosely relates to the diameter of distance graphs.

Short Path in PDn

Instance: n ∈ N, D ⊆ N and l ∈ N.Question: Is there some u ∈ [0, n− 2] such that PD

n contains a path oflength at most l between u and u + 1?

The hardness of Bounded Partial Sums implies that an encoding of a cer-tificate for a “yes”-instance of Short Path in PD

n which can be checked inpolynomial time would most likely have to use at least Ω (l) bits which wouldnot be polynomially bounded in the encoding length of the triple (n, D, l).

The construction used in the proof of the following result is inspired by vanEmde Boas’s proof [20] that Weak Partition is NP-complete.

Theorem 5. Short Path in PDn is NP-hard.

As a final remark, we note that the existence of a monotonic path between twovertices of PD

n is equivalent to the feasibility of an integer linear program in |D|dimensions which can be decided in polynomial time for bounded |D| [15].

References

1. Bermond, J.-C., Comellas, F., Hsu, D.F.: Distributed Loop Computer Networks:A Survey. J. of Parallel and Distributed Computing 24, 2–10 (1985)

2. Boesch, F., Tindell, R.: Circulants and their connectivities. J. Graph Theory 8,487–499 (1984)

3. Brimkov, V.E., Barneva, R.P., Klette, R., Straight, J.: Efficient computation of thelovasz theta function for a class of circulant graphs. In: Hromkovic, J., Nagl, M.,Westfechtel, B. (eds.) WG 2004. LNCS, vol. 3353, pp. 285–295. Springer, Heidel-berg (2004)

4. Burkard, R.E., Sandholzer, W.: Efficiently solvable special cases of bottleneck trav-elling salesman problems. Discrete Appl. Math. 32, 61–76 (1991)

Page 338: Graph-Theoretic Concepts in Computer Science

328 L.D. Penso, D. Rautenbach, and J.L. Szwarcfiter

5. Cohen, J., Fraigniaud, P., Gavoille, C.: Recognizing Bipartite Incident-Graphs ofCirculant Digraphs. In: Widmayer, P., Neyer, G., Eidenbenz, S. (eds.) WG 1999.LNCS, vol. 1665, pp. 215–227. Springer, Heidelberg (1999)

6. Deuber, W., Zhu, X.: The chromatic number of distance graphs. DiscreteMath. 165/166, 195–204 (1997)

7. Eggleton, R.B., Erdos, P., Skilton, D.K.: Coloring the real line. J. Combin. TheorySer. B 39, 86–100 (1985)

8. Evdokimov, S.A., Ponomarenko, I.N.: Circulant graphs: recognizing and isomor-phism testing in polynomial time (English. Russian original). St. Petersbg. Math.J. 15, 813–835 (2004); translation from Algebra Anal. 15, 1–34 (2003)

9. Garfinkel, R.S.: Minimizing wallpaper waste, part I: A class of traveling salesmanproblems. Oper. Res. 25, 741–751 (1977)

10. Gauyacq, G., Micheneau, C., Raspaud, A.: Routing in Recursive Circulant Graphs:Edge Forwarding Index and Hamiltonian Decomposition. In: Hromkovic, J.,Sykora, O. (eds.) WG 1998. LNCS, vol. 1517, pp. 227–241. Springer, Heidelberg(1998)

11. Golin, M.J., Leung, Y.-C.: Unhooking Circulant Graphs: A Combinatorial Methodfor Counting Spanning Trees and Other Parameters. In: Hromkovic, J., Nagl, M.,Westfechtel, B. (eds.) WG 2004. LNCS, vol. 3353, pp. 296–307. Springer, Heidel-berg (2004)

12. Hwang, F.K.: A complementary survey on double-loop networks. Theoret. Comput.Sci. 263, 211–229 (2001)

13. Hwang, F.K.: A survey on multi-loop networks. Theoret. Comput. Sci. 299, 107–121(2003)

14. Kemnitz, A., Marangio, M.: Colorings and list colorings of integer distance graphs.Congr. Numerantium 151, 75–84 (2001)

15. Lenstra, H.W.: Integer programming with a fixed number of variables. Mathematicsof Operations Research 8, 538–548 (1983)

16. Liu, M.T.: Distributed Loop Computer Networks. Advances in Computers, vol. 17,pp. 163–221. Academic Press, New York (1981)

17. Muzychuk, M.: A solution of the isomorphism problem for circulant graphs. Proc.Lond. Math. Soc., III. Ser. 88, 1–41 (2004)

18. Raghavendra, C.S., Sylvester, J.A.: A survey of multi-connected loop topologiesfor local computer networks. Comput. Network ISDN Syst. 11, 29–42 (1986)

19. van Dorne, E.A.: Connectivity of circulant graphs. J. Graph Theory 10, 9–14 (1986)20. van Emde Boas, P.: Another NP-complete partition problem and the complexity

of computing short vectors in a lattice, Technical Report 81-04, MathematischInstituut, Amsterdam, Netherlands (1981)

21. Voigt, M.: Colouring of distance graphs. Ars Combin. 52, 3–12 (1999)22. Wanka, R.: Any Load-Balancing Regimen for Evolving Tree Computations on Cir-

culant Graphs Is Asymptotically Optimal. In: Kucera, L. (ed.) WG 2002. LNCS,vol. 2573, pp. 413–420. Springer, Heidelberg (2002)

23. Wong, C.K., Coppersmith, D.: A combinatorial problem related to multimodememory organizations. J. ACM 21, 392–402 (1974)

Page 339: Graph-Theoretic Concepts in Computer Science

Smallest Odd Holes in Claw-Free Graphs(Extended Abstract)

Shimon Shrem1, Michal Stern2, and Martin Charles Golumbic1

1 Caesarea Rothschild Institute and Department of Computer Science,University of Haifa

2 The Academic College of Tel-Aviv Yaffo

Abstract. In this paper, we give general structure properties of a small-est odd hole in a claw-free graph that lead to a polynomial time algo-rithm. The algorithm is based on a modified BFS we call Γ -BFS. For agraph G with n vertices and m edges, the time complexity of the algo-rithm is O(nm2). The algorithm is very easy to implement. We concludethe paper with a suggestion for an extension of our approach in order todetect an odd hole in a general graph.

Keywords: claw-free graphs, triangle-free graphs, odd holes, holes, poly-nomial time algorithms.

1 Introduction

Throughout this paper we consider simple finite undirected graphs with n ver-tices and m edges, no loops and no multiple edges.

Let G be a graph and let v0, v1, . . . , vk−1 be a sequence of k distinct verticessuch that there is an edge from vi to v(i+1) mod k (for all i = 0, . . . , k−1), and noother edge between any two of these vertices; we say that this is a chordless cycleon k vertices. A hole is a chordless cycle on five or more vertices; an antihole isthe complement of a hole. The chordless cycle of length k is denoted by Ck; inparticular, C5 is the chordless cycle on 5 vertices. A graph G is Ck-free, for anyk, when it does not contain Ck as an induced subgraph.

The chromatic number of a graph G, denoted by χ(G), is the minimum num-ber of colors needed to color the vertices of G in such a way that no two adjacentvertices receive the same color. Clearly, χ(G) is bounded from below by the sizeof a largest clique in G, denoted by ω(G). In 1960, Berge introduced the notionof a perfect graph. A graph G is perfect if for every induced subgraph H of G,χ(H) = ω(H).

It is easy to see that odd holes and odd antiholes are not perfect. Berge[1] conjectured that these are the only minimal imperfect graphs, i.e., a graphis perfect if and only if it does not contain an odd hole nor an odd antihole.When we say that a graph G contains a graph H , we mean as an inducedsubgraph. Berge’s conjecture was known as the Strong Perfect Graph Conjecture(SPGC), which was proved by Chudnovsky et al.[3]. Thus, efficient algorithms fordetecting induced holes or antiholes on an odd number of vertices will imply fast

C. Paul and M. Habib (Eds.): WG 2009, LNCS 5911, pp. 329–340, 2010.c© Springer-Verlag Berlin Heidelberg 2010

Page 340: Graph-Theoretic Concepts in Computer Science

330 S. Shrem, M. Stern, and M.C. Golumbic

recognition of perfect graphs; the currently fastest algorithms for these problemsrun in O(n9) time [4,7].

Chvatal and Sbihi [6] showed a polynomial-time algorithm to recognize claw-free perfect graphs. The algorithm is based on a decomposition theorem of thestructure of these graphs.

Nikolopoulos and Palios [13] presented two algorithms, one for the detectionof holes and another for the detection of antiholes in arbitrary graphs. Bothalgorithms run in O(n+m2) time and require O(nm) space. Thus, they providea solution to the open problem posed by Hayward, Spinrad and Sritharan in [12].They generalized their approach so that, for a fixed constant k ≥ 5, they obtainan O(nk−1)-time algorithm for the detection of a hole (antihole, respectively)on at least k vertices. Additionally, they describe a different approach to detectantiholes on graphs that do not contain chordless cycles on 5 vertices in O(n+m2)time requiring O(n + m) space. Again, for a fixed constant k ≥ 6, the approachcan be extended to yield O(nk−2)-time and O(n2)-space algorithms for detectingholes (antiholes, respectively) on at least k vertices in graphs which do notcontain holes (antiholes, respectively) on k − 1 vertices.

The problem of determining whether a given graph on n vertices and m edgescontains a chordless cycle of k or more vertices, for some fixed value of k ≥ 4, wasoriginally solved in O(nk) time (Hayward [11]). Spinrad [16] reduced the timecomplexity of the problem to O(nk−3M), where M � n2.376 is the time requiredto multiply two n× n matrices. Note that the problem of determining whethera graph contains a chordless cycle of four or more vertices, i.e., the well-knownchordal graph recognition problem, can be solved in O(n + m) time [9,14,18].

Holes and antiholes have been extensively studied in many different contextsin algorithmic graph theory. A typical example is that of the weakly chordalgraphs (also known as weakly triangulated graphs) [9,10], which contain neitherholes nor antiholes.

The algorithms of Hayward [11] and Spinrad [16] can be used for the recogni-tion of weakly chordal graphs in O(n5) and O(n4.376) time, respectively. Furtherprogress on the weakly chordal graph recognition problem includes the O(n4) timeand O(nm) space algorithm of Spinrad and Sritharan [17], and the O(m2) time andO(n + m) space algorithms of Hayward, Spinrad and Sritharan [12] and of Berry,Bordat and Heggernes [2]. It is interesting to note that the algorithm of Haywardet al. [12] produces a hole or an antihole certificate whenever the given graph isnot weakly chordal. In the same paper, the authors posed as an open problem thedesigning of an O(n4) algorithm to find a hole in an arbitrary graph.

The detection of odd length holes and antiholes appears to be a much more dif-ficult problem, see also [15]. It is this area which we address in this paper. In thispaper, we present an algorithm to detect a smallest odd hole in claw-free graphs.

2 Preliminaries

Let G = (V, E) be a simple finite undirected graph with no loops and no multipleedges. The length of a path is the number of its edges. We denote a subpath

Page 341: Graph-Theoretic Concepts in Computer Science

Smallest Odd Holes in Claw-Free Graphs 331

pipi+1 . . . pj of a path P by Pi,j . The chordless cycle of length k is denoted byCk. A hole is a chordless cycle of five or more vertices. The hole of length k isalso denoted by Hk.

From now on, when we use the phrase hole, we will assume that its vertices areordered clockwise. Let H = u0u1 . . . uk−1u0 be a hole in a graph G with verticesordered clockwise. The arc Ai,j is the path going around clockwise from ui touj, i.e., Ai,j is the path uiui+1ui+2 . . . uj and Aj,i is the path ujuj+1uj+2 . . . ui.Let H be an odd hole, then with respect to ui and uj, the path with the shorterlength among Ai,j and Aj,i is called the short arc and the path with the longerlength is called the long arc. An arc Ai,i of length 0 is called a trivial arc. Let(ui, ui+1), (uj , uj+1) ∈ E(H) we define the arcs between (ui, ui+1) and (uj , uj+1)to be Ai+1,j and Aj+1,i. Furthermore, if H is an odd hole then, with respect to(i, i + 1) and (j, j + 1), H contains one arc with shorter length, called the shortarc and the path with the longer length is called the long arc. An arc Ai,i oflength 0 is called a trivial arc.

A claw is the graph consisting of vertices w, x, y, z and only the edges (w, x),(w, y), (w, z). Seymour and Chudnovsky [5] have found a complete description ofclaw-free graphs. They prove that all claw-free graphs are constructed startingfrom line graphs, circular interval graphs, subgraphs of the Schlafli graph, anda few other basic graphs, by piecing them together in prescribed ways.

3 Tents

Definition 1. Let H be a hole in a graph G. A vertex v is called a tent of H ifv has four consecutive neighbors on H. Two tents v and w are called isomorphictents if they share the same neighbors on H.

Property 2. Let H be a hole in a (claw,H5)-free graph G, let v /∈ V (H) andlet n be the number of neighbors of v on H. Then:

1. Either n = 0 or 2 ≤ n ≤ 4.2. If n = 2 (n = 3) then the neighbors of v on H lie consecutively on a P2 (P3).3. If n = 4 and H is a smallest odd hole in G, then the neighbors of v on H lie

consecutively on a P4.

Corollary 3. Let H be a smallest odd hole in a (claw,H5)-free graph G, letv /∈ V (H), v has neighbors on H and let n be the number of neighbors of v onH. Then the neighbors of v on H lie consecutively on a Pn, 2 ≤ n ≤ 4.

Lemma 4. Let H be a smallest odd hole in a (claw,H5)-free graph G, and let t1and t2 be tents of H. Then all the neighbors of t1 and t2 on H lie consecutivelyon at most a P6.

Corollary 5. Let H be a smallest odd hole in a (claw,H5)-free graph G. Thenall the tents of H have at least two common neighbors on H, and H has at mostthree tents that are pairwise non-isomorphic.

Page 342: Graph-Theoretic Concepts in Computer Science

332 S. Shrem, M. Stern, and M.C. Golumbic

4 Edge-Path with Respect to a Hole

In this section we lay the foundations of the paper. First we define and charac-terize an edge-path with respect to a hole (edge-path in short) and the corre-sponding arc of an edge-path. Then we conclude that there are only two typesof edge-paths.

Definition 6. Let H = H2r+1 = u0u1 . . . u2ru0 be an odd hole in a graph Gand let α = (ui, ui+1), β = (uj , uj+1). W.l.o.g., from now on we may assumethat Ai+1,j is the short arc between α and β on H and Aj+1,i is the long arcbetween α and β on H. We say that a path P = p0p1 . . . pl−1pl is an edge-pathwith respect to H of length l from a source α to a target β if all the followingconditions are satisfied:

1. P is a simple chordless path.2. |P | ≤ |Ai+1,j | < |Aj+1,i|.3. p0 is one of ui, ui+1 and pl is one of uj , uj+1, such that:

If p0 = ui+1 then (ui, px) /∈ E(G) for every 1 ≤ x ≤ l.If p0 = ui then (ui+1, px) /∈ E(G) for every 1 ≤ x ≤ l.If pl = uj then (uj+1, py) /∈ E(G) for every 0 ≤ y ≤ l− 1.If pl = uj+1 then (uj , py) /∈ E(G) for every 0 ≤ y ≤ l− 1.

4. Let P ′ ⊆ P be the set of the inner vertices of P that have neighbors onH, then P ′ has neighbors only on the long arc between α and β or P ′ hasneighbors only on the short arc between α and β, but not on both.

5. From all the paths that satisfy 1-4, we choose P to be with minimal length.

Definition 7. Let H be a hole in a graph G. Let P = p0p1 . . . pl be an edge-pathwith respect to H from a source α = (ui, ui+1) to a target β = (uj , uj+1). Wesay that an arc A between α and β is the corresponding arc of P on H, denotedby AP , if the neighbors of P1,l−1 on H lie on A. The other arc between α and βon H is denoted by AP .

Property 8. Let H = H2r+1 = u0u1 . . . u2ru0 be a smallest odd hole in a graphG. Let P = p0p1 . . . pl be an edge-path with respect to H from a source α =(ui, ui+1) to a target β = (uj , uj+1). Then:

1. P does not start at p0 = ui and end at pl = uj.2. P does not start at p0 = ui+1 and end at pl = uj+1.3. There can be only the following two types of edge-paths with respect to H

between α and β:Type 1 The edge-path starts at p0 = ui+1 and ends at pl = uj. The neigh-

bors of P1,l−1 on H lie on the short arc between α and β.Type 2 The edge-path starts at p0 = ui and ends at pl = uj+1. The neigh-

bors of P1,l−1 on H lie on the long arc between α and β.

Page 343: Graph-Theoretic Concepts in Computer Science

Smallest Odd Holes in Claw-Free Graphs 333

Fig. 1. Two types of edge-paths

In Figure 1 there are examples of edge paths. In Type 1 there are two edge-paths withthe same length. One of them is the short arc between α and β. The length of theedge-path of Type 2 is smaller than the length of the long arc. In order to detect anodd hole, we need to avoid ”walking” on edge paths shorter than the arcs.

5 Shortcuts of a Hole

This is the main theoretical section of the paper. Here we define a shortcut anda minimal shortcut of a hole. It can be prove that the length of a shortcut issmaller by 1 than its corresponding arc and we present important properties ofthe structure of a minimal shortcut. We conclude with Theorem 20, which is themain theorem of the paper. Furthermore, the theorem is the main foundation ofthe algorithm for detecting a smallest odd hole in a claw-free graph in followingsections.

Throughout this section we consider H = H2r+1 = u0u1 . . . u2ru0 to be asmallest odd hole in a (claw,H5)-free graph G.

Definition 9. Let S be an edge-path with respect to H from a source α = (ui, ui+1)to a target β = (uj, uj+1). We say that S is a shortcut of H if |S| < |AS |. Fromnow on we consider S to be a shortcut of H from a α to β.

Note that, by Definition 6.2 |S| ≤ |Ai+1,j | < |Aj+1,i|.Definition 10. Consider the set of all shortcuts of H. We say that α ∈ E(G)has no shortcut if there is no shortcut of H such that α is the source. We saythat α has no shortcut of Type i, i = 1, 2, if there is no shortcut of Type i of Hsuch that α is the source.

Definition 11. Let S be a shortcut of H from a source α = (ui, ui+1) to atarget β = (uj , uj+1). We say that S′ is a minimal shortcut obtained from S ifthe following conditions hold:1. S′ is a shortcut of H (not necessarily from α to β). 2. S′ contains a minimumnumber of vertices from S. 3. Only the two end points of S′ are in V(H).

Note that, in the trivial case S′ = S. In Figure 2 on page 334 the minimalshortcuts are in bold and with the following details. (1) |S| = 5, |AS | = 6,

Page 344: Graph-Theoretic Concepts in Computer Science

334 S. Shrem, M. Stern, and M.C. Golumbic

Fig. 2. Minimal Shortcuts

S′ = ui−1s2s3uj+2 is a minimal shortcut of H from (uj+1, uj+2) to (ui−1, ui) oflength 3 and |Aj+2,i−1| = 4. (2) |S| = 4, |AS | = 5, S′ = s0s1uj−2 is a minimalshortcut of H from (ui, ui+1) to (uj−2, uj−1) of length 2 and |Ai+1,j−2| = 3.

Property 12. For any shortcut S = s0s1s2 of H, i.e., |S| = 2, S is a minimalshortcut of H, |AS | = 3, i.e., s1 is a tent of H.

Theorem 13. 1. For any shortcut S = s0s1s2 of H, |S| = |AS | − 1 and |S| ≤r − 1.

2. If S is of Type 2, then |S| = |AS | = r − 1.

It is clear that if a hole does not have a minimal shortcut, it does not have ashortcut. Recall that we denote by S a shortcut of H from a source α = (ui, ui+1)to a target β = (uj, uj+1). From now on, we consider S′ = s′0 . . . s′l to be aminimal shortcut of H obtained from S.

Theorem 14. If |S′| ≥ 3, then:

1. Each one of s′1 and s′l−1 has exactly three neighbors on H.2. s′l−2 and s′l−1 have only one common neighbor on H.3. s′1 and s′2 have only one common neighbor on H.

Theorem 15. If |S′| ≥ 4, then every s′k ∈ S′, 2 ≤ k ≤ l − 2, has exactly twoneighbors on H.

Now we introduce the definition of a shortcut substitution. A shortcut substitu-tion defines a hole with a tent. In particular, by substituting the correspondingarc of a shortcut with a shortcut substitution we get a hole with a tent.

Definition 16. Let S′ = s′0 . . . s′l be a minimal shortcut of a hole H from asource α = (ui, ui+1) to a target β = (uj , uj+1) such that |S′| ≥ 3. Let H1 be thehole induced as follows:

1. If S′ is of Type 1 then H1 = (V (H)\{ui+4 . . . uj−1})⋃{s′2 . . . s′l−1}.

2. If S′ is of Type 2 then H1 = (V (H)\{uj+2 . . . ui−3})⋃{s′2 . . . s′l−1}.

We say that H1 is obtained from H through a shortcut substitution.

Page 345: Graph-Theoretic Concepts in Computer Science

Smallest Odd Holes in Claw-Free Graphs 335

Fig. 3. Shortcut substitutionsThe length of the new short arc between α and β (in bold) equals to the length of

AS′ . Note that s′1 is a tent of H1.

Note that, s′1 is a tent of H1 since by Theorem 14, s′1 has exactly three neighborson H and these three together with s′2 are the neighbors of s′1 on H1. Moreover,|H | = |H1| and α, β ⊂ H, H1 (See Figure 3 on page 335).

Lemma 17. Let t1 and t2 be tents of H, such that the neighbors of t1 and t2 onH lie on a P6. Let α = (ui, ui+1) ∈ E(H), such that ui and ui+1 are commonneighbors of t1 and t2. Then α has no shortcut of H.

Lemma 18. Let t1 and t2 be tents of H, such that the neighbors of t1 and t2lie on a P5. Then there is a smallest odd hole H∗ and an edge γ ∈ E(H∗), suchthat γ has no shortcut of H∗.

Lemma 19. Let t be a tent of H, then there is a smallest odd hole H∗ and anedge γ ∈ E(H∗), such that γ has no shortcut of H∗.

Theorem 20. Let H = H2r+1 = u0u1 . . . u2ru0 be a smallest odd hole in a(claw,H5)-free graph G. Then there is a smallest odd hole H∗ and an edge γ ∈E(H∗), such that γ has no shortcut of H∗.

6 Γ -BFS

The general idea of the detection algorithm of an odd hole is to start a traversalof the graph from an edge and ”walk” only on edge-paths.

The Gallai forcing graph Γ G of a graph G = (V, E), denoted by Γ G, isthe graph with vertex set V (Γ G) = E(G) and two vertices α = (v1, v2), β =(v3, v4) ∈ V (Γ G) are connected in E(Γ G) iff either v1 = v4 and (v2, v3) /∈ E(G)or v2 = v3 and (v1, v4) /∈ E(G), see [8,9].

Definition 21. Let α = (v1, v2) ∈ V (Γ ). We define the elements of the vertexα to be v1 and v2.

Property 22. Γ G preserves the holes of G, that is, if G contains a hole H oflength k then Γ G contains a hole HΓ of length k such that the vertices of HΓ

are the edges of H.

However, the opposite does not hold. There can be a hole in Γ G whose corre-sponding edges of G do not form a hole. In [8], Gallai describes the list of inducedsubgraphs that create a hole in Γ G.

Page 346: Graph-Theoretic Concepts in Computer Science

336 S. Shrem, M. Stern, and M.C. Golumbic

6.1 The Algorithm

A Γ -BFS is a partial BFS on Γ G, which uses the structure of Γ G to discoverand explore only some of the vertices of Γ G (the edges of G). We keep trackof the discovery time of the vertices of G and the vertices of Γ G. This helps usto discover paths in G with special properties. The Γ -BFS starts from a sourceα = (v1, v2) ∈ V (Γ G). The definition of Γ -BFS is given in Algorithm 1 on page336.

Given a graph Γ G and a distinguished source vertex α, Γ -BFS systematicallyexplores Γ G to “reveal” some of the vertices of Γ G and ignores other verticesof Γ G. In Γ -BFS of Γ G, a newly discovered vertex ϕ is first tested for certaincriteria to hold, and only if it passes the criteria it is marked “revealed” andadded to the queue. Otherwise, ϕ is “ignored” and never explored.

Algorithm 1. Γ -BFSInput: A graph G, α = (v1, v2) ∈ E(G)

procedure Γ -BFS(G, α)1

compute Γ G = (V, E)2

forall v ∈ V (G) do3

d[v]←∞4

forall γ ∈ V (Γ G) do5

d[γ]←∞ ; p[γ]← NIL6

d[α]← 0 ; d[v1]← 0 ; d[v2]← 07

enqueue (α, Q)8

while Q is not empty do9

ψ ← dequeue(Q)10

forall Neighbors ϕ = (v4, v5) of ψ = (v3, v4) do11

if d[ϕ] =∞ then12

d[ϕ]← d[ψ] + 113

p[ϕ]← ψ14

if d[v5] ≥ d[ϕ] then15

d[v5]← d[ϕ]16

if d[v4] = d[ψ] then17

enqueue(ϕ, Q)18

end procedure19

Definition 23. Let ψ = (v3, v4) ∈ V (Γ G) be the vertex that is now dequeued inthe main loop of Γ -BFS. Let ϕ = (v4, v5) ∈ V (Γ G) be a neighbor of ψ on Γ ,such that d[ϕ] =∞.

1. We say that ϕ is discovered by ψ.2. We say that v5 ∈ V (G) is discovered by ϕ if d[v5] = ∞. We call ϕ the

discoverer of v5.

Page 347: Graph-Theoretic Concepts in Computer Science

Smallest Odd Holes in Claw-Free Graphs 337

3. We say that ϕ is revealed by ψ if ϕ is added to the queue, i.e., ϕ is discoveredby ψ, d[v5] ≥ d[ϕ] and d[v4] = d[ψ].

4. We say that ϕ is ignored by ψ if ϕ is not added to the queue, i.e., ϕ isdiscovered by ψ and d[v5] < d[ϕ] or d[v4] < d[ψ].

5. The discovered time of the source α = (v1, v2) is 0 and the discovered timeof v1, v2 is 0, i.e., d[α] = d[v1] = d[v2] = 0.

6. The discovered time of ϕ, is the discovered time of ψ plus one, i.e., d[ϕ]=d[ψ] + 1. The discovered time of v5 is the discovered time of ϕ, where ϕ isthe discoverer of v5, i.e., d[v5] = d[ϕ] = d[ψ] + 1.

The Γ -BFS procedure introduced above maintains several data structures. Theparent of ϕ ∈ V (Γ G) is stored in the variable p[ϕ]. The discovered time, i.e., thedistance from the source α ∈ V (Γ G) to a vertex ϕ ∈ V (Γ G) computed bythe algorithm, is stored in d[ϕ]. The discovered time in G, i.e., the distance fromthe source α ∈ V (Γ G) to a vertex v ∈ V (G) computed by the algorithm, is storedin d[v]. The algorithm also uses a first-in-first-out queue Q to manage the vertices.

6.2 Complexity

Let G be a graph with n vertices and m edges and let ψ = (v3, v4) ∈ E(G).There are at most n vertices which are either neighbors of v3 and not neighborsof v4 or neighbors of v4 and not neighbors of v3. Therefore, ψ = (v3, v4) has atmost n neighbors on Γ G. Thus Γ G has m vertices and at most nm edges.

The loop at lines 3–4 is performed for every vertex v ∈ V (G), therefore, runsin O(n). The computation of Γ G runs in O(|V (Γ G)|+ |E(Γ G)|) = O(m+nm) =O(nm). The loop at lines 5–7 is performed for every vertex γ ∈ V (Γ G), thusruns in O(m). The main loop of the algorithm is at lines 10–19. The outer loopgoes as long as Q is not empty, hence, runs in O(m). The inner loop is performedfor every neighbor ϕ of ψ, thus runs in O(n). Therefore, the main loop runs inO(nm). Thus, Algorithm 1 runs in O(nm) time.

7 Γ -Path

In order to detect an odd hole in a claw-free graph G, first we define and charac-terize the paths that are detected by the Γ -BFS of Γ G, and their interpretationon the edges of G.

Definition 24. Let G be a graph, let α = (u, p0), β = (pl, v) ∈ E(G) and letP = p0p1 . . . pl be a path in G, such that α, β, (pi, pi+1) ∈ V (Γ G), for every0 ≤ i ≤ l− 1. We say that P is a Γ -path of G from a source α to a target β ifthere is a Γ -BFS on Γ G that reveals P , i.e., all the following hold:

1. starts from a source α.2. α = (u, p0) discovers and reveals (p0, p1).3. (pi, pi+1) discovers and reveals (pi+1, pi+2) for every 0 ≤ i ≤ l − 2.4. (pl−1, pl) discovers and reveals (pl, v) = β.

Page 348: Graph-Theoretic Concepts in Computer Science

338 S. Shrem, M. Stern, and M.C. Golumbic

We say that P starts at p0 and ends at pl. The length of P is l, the number ofedges of P .

Theorem 25. Let H = H2r+1 = u0u1 . . . u2ru0 be a smallest odd hole in a(claw,H5)-free graph G. Let P = p0p1 . . . pl be a Γ -path from a source α =(ui, ui+1) to a target β = (uj, uj+1). Then, P is an edge-path with respect to H.

8 Detection of an Odd Hole

8.1 The Algorithm

Our approach for detecting a smallest odd hole in a claw-free graph G, is tostart a Γ -BFS from all α ∈ V (Γ G). If G contains an odd hole then the outputof Algorithm 2 is the length of the smallest odd hole; if G is odd hole-free thenthe output is “infinity”.

Algorithm 2. Smallest Odd Hole Detection in a Claw-Free GraphInput: A claw-free graph G.Output: The size of the smallest odd hole in G, if one exists.

procedure OddHoleDetection(G)1

minSizeOddHole ← ∞2

forall α ∈ V (ΓG) do3

localMin ← ∞4

Start a Γ -BFS from α5

if after ψ is removed from the queue, ψ has neighbor ϕ such that6

d[ψ] = d[ϕ] thenlocalMin ← 2d[ψ] + 17

stop Γ -BFS from α8

if localMin < minSizeOddHole then9

minSizeOddHole← localMin10

return minSizeOddHole.11

end procedure12

Theorem 26. Let G be a claw-free graph. G contains an odd hole H = H2r+1

iff Algorithm 2 yields 2r + 1.

Algorithm 2 can be easily augmented so that it provides a certificate wheneverit decides the input graph G contains an odd hole.

8.2 Complexity

Let G be a graph with n vertices and m edges. Note that, there is an obviousrecognition algorithm for a claw-free graph, with running time O(n4). The com-plexity of Γ -BFS is O(nm). The main loop at lines 3–10 is performed for everyvertex α ∈ V (Γ G), thus runs in O(m). Thus, Algorithm 2 runs in O(nm2) time.

Page 349: Graph-Theoretic Concepts in Computer Science

Smallest Odd Holes in Claw-Free Graphs 339

9 Further Research

The problems we solve in this paper together with the work that has been donebefore, raise more questions on the subject introduced here. We summarize someof the questions below.(1) An interesting problem is to give a better recognition algorithm for claw-freeperfect graphs.(2) Can we use Γ -BFS to detect holes and antiholes with better complexity?(3) Define Γ G

2 and characterize the odd holes in Γ G2 ? Furthermore, generalize

Γ G and Γ G2 to get a definition for Γ G

n , and characterize the odd holes in Γ Gn .

(4) In general graphs, can we find a smallest odd hole without a shortcut?

Acknowledgments

We would like to thank Maria Chudnovsky for fruitful discussions. Furthermore,we owe our gratitude to Irith Hartman and Dror Rawitz.

References

1. Berge, C.: Farbung von Graphen deren samtliche bzw. deren ungerade Kreisestarr sind, Wiss. Zeitschrift, Mathematisch-Naturwissenschaftliche Reihe, Martin-Luther-Univ. Halle-Wittenberg, pp. 114–115 (1961)

2. Berry, A., Bordat, J.P., Heggerens, P.: Recognizing weakly triangulated graphs byedge separability. Nordic J. Computing 7, 164–177 (2000)

3. Chudnovsky, M., Robertson, N., Seymour, P.D., Thomas, R.: The strong perfectgraph theorem. Ann. of Math. 164(1), 51–229 (2006)

4. Chudnovsky, M., Cornuejols, G., Liu, X., Seymour, P., Vuskovic, K.: RecognizingBerge Graphs. Combinatorica 25(2), 143–186 (2005)

5. Chudnovsky, M., Seymour, P.D.: The structure of claw-free graphs. In: Surveys inCombinatorics. London Math Soc. Lecture Note Series, vol. 327 (2005)

6. Chvatal, V., Sbihi, N.: Recognizing claw-free perfect graphs. Journal of Combina-torial Theory Series A 44(3), 154–176 (1987)

7. Cornuejols, G., Liu, X., Vuskovic, K.: A polynomial algorithm for recognizingperfect graphs. In: Proc. 44th IEEE Symp. on Foundations of Computer Science(FOCS 2003), pp. 20–27 (2003)

8. Gallai, T.: Transitiv orientierbare Graphen. Acta Math. Acad Sci. Hungar. 18,25–66 (1967)

9. Golumbic, M.C.: Algorithmic graph theory and perfect graphs. Annals of DiscreteMathematics, vol. 57. Elsevier, Amsterdam (2004)

10. Hayward, R.B.: Weakly triangulated graphs. J. Comb. Theory Ser. B 39, 200–208(1985)

11. Hayward, R.B.: Two classes of perfect graphs, PhD Thesis, School of ComputerScience, McGill University (1987)

12. Hayward, R.B., Spinrad, J., Sritharan, R.: Weakly chordal graph algorithms viahandles. In: Proc. 11th ACM-SIAM Symp. on Discrete Algorithms (SODA 2000),pp. 42–49 (2000)

13. Nikolopoulos, S.D., Palios, L.: Holes and antihole detection in graphs. In: Proc.15th ACM-SIAM Sympos. Discrete Algorithms, pp. 843–852 (2004)

Page 350: Graph-Theoretic Concepts in Computer Science

340 S. Shrem, M. Stern, and M.C. Golumbic

14. Rose, D.J., Tarjan, R.E., Lueker, G.S.: Algorithmic aspects of vertex eliminationon graphs. SIAM J. Computing 5, 266–283 (1976)

15. Shrem, S.: Odd hole-free Graphs, M.Sc. thesis, Department of Computer Sci-ence, University of Haifa, February 27 (2006), http://digitool.haifa.ac.il/R/?func=dbin-jump-full&object id=175621&local base=GEN01

16. Spinrad, J.P.: Finding large holes. Inform. Process. Letters 39, 227–229 (1991)17. Spinrad, J.P., Sritharan, R.: Algorithms for weakly triangulated graphs. Discrete

Applied Math. 59, 181–191 (1995)18. Tarjan, R.E., Yannakakis, M.: Simple linear-time algorithms to test chordality of

graphs, test acyclicity of hypergraphs, and selectively reduce acyclic hypergraphs.SIAM J. Computing 13, 566–579 (1984)

Page 351: Graph-Theoretic Concepts in Computer Science

Finding Induced Paths of Given Parityin Claw-Free Graphs�

Pim van ’t Hof1, Marcin Kaminski2, and Daniel Paulusma1

1 Department of Computer Science, University of Durham,Science Laboratories, South Road, Durham DH1 3LE, England

{pim.vanthof,daniel.paulusma}@durham.ac.uk2 Computer Science Department, Universite Libre de Bruxelles,

Boulevard du Triomphe CP212, B-1050 Brussels, [email protected]

Abstract. The Parity Path problem is to decide if a given graph Gcontains both an odd length and an even length induced path betweentwo specified vertices s and t. In the related problems Odd Induced

Path and Even Induced Path, the goal is to determine whether aninduced path of odd, respectively even, length between two specifiedvertices exists. Although all three problems are NP-complete in general,we show that they can be solved in O(n5) time for the class of claw-freegraphs. Two vertices s and t form an even pair in G if every induced pathfrom s to t in G has even length. Our results imply that the problem ofdeciding if two specified vertices of a claw-free graph form an even pair,as well as the problem of deciding if a given claw-free graph has an evenpair, can be solved in O(n5) time and O(n7) time, respectively. We alsoshow that we can decide in O(n7) time whether a claw-free graph has aninduced cycle of given parity through a specified vertex.

1 Introduction

Finding a shortest path, a maximum stable set or a hamiltonian cycle in a graphare just a few examples from the wide spectrum of problems dealing with findinga subgraph (or induced subgraph) with some particular property. In this con-text, simplest subgraphs, such as paths, trees and cycles, with some prescribedproperty are often studied. The following problem has been extensively studiedin the context of perfect graphs. Here, the length of a path refers to its numberof edges, and a path is said to be odd (respectively even) it has odd (respectivelyeven) length.

Parity Path

Instance: A graph G and two vertices s, t of G.Question: Does there exist both an odd and even induced path from s to t in G?

� This work has been supported by EPSRC (EP/D053633/1) and the Actions deRecherche Concertees (ARC) fund of the Communaute francaise de Belgique.

C. Paul and M. Habib (Eds.): WG 2009, LNCS 5911, pp. 341–352, 2010.c© Springer-Verlag Berlin Heidelberg 2010

Page 352: Graph-Theoretic Concepts in Computer Science

342 P. van ’t Hof, M. Kaminski, and D. Paulusma

We focus on the closely related problem of deciding whether there exists aninduced path of given parity between a pair of vertices. In particular, we studythe following two problems.

Odd Induced Path

Instance: A graph G and two vertices s, t of G.Question: Does there exist an odd induced path from s to t in G?

Even Induced Path

Instance: A graph G and two vertices s, t of G.Question: Does there exist an even induced path from s to t in G?

The Odd Induced Path problem was shown to be NP-complete by Bienstock[6]. Consequently, the Even Induced Path problem and the Parity Path

problem are NP-complete as well. Several authors however have identified anumber of graph classes that admit polynomial-time algorithms for these prob-lems. Below we survey those results, as well as results on related problems, beforestating our contribution. Throughout the paper, we use n and m to denote thenumber of vertices and the number of edges of the input graph, respectively.

ODD PATH and EVEN PATH. In the Odd Path and Even Path problemsthe task is to find a (not necessarily induced) path of given parity betweena specified pair of vertices. These problems were considered by LaPaugh andPapadimitriou [20]. They mention an O(n3) algorithm for solving both problemsdue to Edmonds, using a reduction to matching, and propose a faster one ofO(m) time complexity. Their algorithm also finds a shortest (not necessarilyinduced) path of given parity between two vertices in O(m) time, even in aweighted graph. Interestingly, as they also show in their paper, the problem offinding a directed path of given parity is NP-complete for directed graphs. Arkin,Papadimitriou and Yannakakis [1] generalized the result of [20] and designed alinear-time algorithm deciding if all (not necessarily induced) paths between twospecified vertices are of length p mod q, for fixed integers p and q.

EVEN PAIR. First interest in induced paths of given parity comes from thetheory of perfect graphs. Two non-adjacent vertices are called an even pair ifevery induced path between them is even. The Even Pair problem is to de-cide if a given pair of vertices forms an even pair. The Even Pair problem isco-NP-complete due to Bienstock [6], as is the problem of deciding if a graphcontains an even pair. The interest in even pairs was sparked by an observationof Fonlupt and Uhry [17]: if a graph is perfect and contains an even pair, thenthe graph obtained by identifying the vertices that form the even pair is alsoperfect. Later Meyniel showed that minimal non-perfect graphs contain no evenpair [23]. Those two facts triggered a series of theoretical and algorithmic resultswhich are surveyed in [14] and its updated version [15].

There is some evidence that perfect graphs without an even pair can be gen-erated by performing a small number of composition operations on some basicgraphs. Using such a structural result could then lead to a combinatorial algo-rithm for coloring perfect graphs. Indeed, for coloring perfect graphs using at

Page 353: Graph-Theoretic Concepts in Computer Science

Finding Induced Paths of Given Parity in Claw-Free Graphs 343

most three colors this approach turned out to be successful, as was shown byChudnovsky and Seymour in [10]. Linhares Sales and Maffray [22] study evenpairs in order to give characterizations of claw-free graphs that are strict quasi-parity and perfectly contractile, respectively.

PARITY PATH and GROUP PATH. Arikati, in a series of papers withdifferent coauthors, developed polynomial-time algorithms for the Parity Path

problem in different classes of graphs. Chordal graphs are considered in [2], wherethe authors present a linear-time algorithm for the Group Path problem, ageneralization of the Odd Induced Path problem. In the Group Path problemthe edges of the input graph are weighted with elements of some group G. Theproblem is to find an induced path of given weight between two specified vertices,where the weight of a path is defined as the product of the weights of the edges ofthe path. They present an O(|G|m+n) algorithm for the Group Path problemon chordal graphs using a perfect elimination ordering.

The topic of [4] is Parity Path on circular-arc graphs. The authors show howto reduce the problem to interval graphs by recursively applying a set of reduc-tions. Since interval graphs are chordal, the algorithm of [2] can be used to obtainthe solution. This way they obtain a polynomial-time algorithm for circular-arcgraphs. In [26] polynomial-time algorithms for the Parity Path problem oncomparability and cocomparability graphs, and a linear-time algorithm for per-mutation graphs are given. A polynomial-time algorithm for Parity Path onperfectly orientable graphs is presented in [3]. Sampaio and Sales [25] obtain apolynomial-time algorithm for planar perfect graphs. The authors of [16] char-acterize even and odd pairs in comparability and P4-comparability graphs andgive polynomial-time algorithms for the Parity Path problem in those classes.Hoang and Le [18] show that Parity Path can be solved in polynomial timefor the class of 2-split graphs.

Note that a set F of vertices of a line graph G = L(H) form an odd (re-spectively even) induced path in G if and only if the set of edges correspondingto F form an even (respectively odd) path in the preimage graph H of G. Itis well-known that the preimage graph of a line graph can be found in polyno-mial time [24]. Combining these two facts with the polynomial-time algorithm forfinding (not necessarily induced) paths of given parity in [20] yields a polynomial-time algorithm for solving the Parity Path problem for the class of line graphs(cf. [28]).

Our Results. Our interest in the Odd Induced Path problem was in partstirred by studying Bienstock’s NP-completeness reduction in [6]. He builds agraph out of a 3-Sat formula and shows that the formula is satisfiable if andonly if there exists an odd induced path between a certain pair of vertices.This is also shown to be equivalent to the existence of two disjoint inducedpaths (with no edges between the two paths) between certain pairs of verticesin the construction. Finding such two paths is then NP-hard in general but hasbeen proved solvable in polynomial time for claw-free graphs [21]. A naturalquestion to ask is whether the Odd Induced Path problem can also be solved

Page 354: Graph-Theoretic Concepts in Computer Science

344 P. van ’t Hof, M. Kaminski, and D. Paulusma

in polynomial time for this class of graphs. In this paper, we answer this questionin the affirmative by presenting an algorithm that solves both the Odd Induced

Path problem and the Even Induced Path problem in O(n5) time for the classof claw-free graphs. This implies that the Even Pair problem can be solved inO(n5) time for claw-free graphs.

As we saw earlier in this section, the Parity Path problem has been exten-sively studied in different graph classes. However, a polynomial-time algorithmfor claw-free graphs has never been proposed; somewhat surprising, since claw-free graphs form a large and important class containing, e.g., the class of linegraphs and the class of complements of triangle-free graphs. Our O(n5) algo-rithm for solving the Odd Induced Path and Even Induced Path problemsfor claw-free graphs immediately implies that we can solve the Parity Path

problem for claw-free graphs in O(n5) time, thus generalizing the aforementionedpolynomial-time result on line graphs.

Apart from the Odd Induced Path problem, Bienstock [6] mentioned twomore NP-complete problems in the abstract of his paper. The first one is to decidewhether a graph has an odd hole passing through a given vertex. The secondone is to decide whether a graph has an odd induced path between every pairof vertices. We show that our polynomial-time algorithm for the Odd Induced

Path problem implies that both these problems are solvable in O(n7) time whenrestricted to the class of claw-free graphs. As a result the problem of decidingwhether or not a claw-free graph contains an even pair can be solved in O(n7)time.

Our paper is organized as follows. In Section 2 we state our terminologyand discuss some results on claw-free perfect graphs. In Section 3 we show howto solve the Odd Induced Path and Even Induced Path problem in O(n5)time for claw-free graphs. There, we also show the other results mentioned above.Section 4 contains the conclusions and mentions some open problems.

2 Preliminaries

All graphs in this paper are undirected, finite, and have no loops or multipleedges. Let G be a graph. We refer to the vertex set and edge set of G by V (G) andE(G), respectively. The neighborhood of a vertex v in G is denoted by NG(v) ={y ∈ V (G) | xy ∈ E(G)}. A claw is the graph ({x, a, b, c}, {xa, xb, xc}), wherevertex x is called the center of the claw. For any set S ⊆ V (G), we write G[S]to denote the subgraph of G induced by S. A hole is an induced cycle of lengthat least 4, and an antihole is the complement of a hole. We say that a hole isodd (respectively even) if it has an odd (respectively even) number of edges. Anantihole is called odd (respectively even) if its complement is an odd (respectivelyeven) hole. The chromatic number of a graph is the smallest number of colorsneeded to color its vertices in such a way that no two adjacent vertices receive thesame color. A graph G is perfect if for every induced subgraph H the chromaticnumber of H equals the size of a largest clique in H . A graph is called Bergeif it does not contain an odd hole or an odd antihole. A little over 40 years

Page 355: Graph-Theoretic Concepts in Computer Science

Finding Induced Paths of Given Parity in Claw-Free Graphs 345

after Berge [5] conjectured that a graph is perfect if and only if it is Berge,Chudnovsky et al. [8] confirmed his intuition by proving the following theorem.

Theorem 1 (Strong Perfect Graph Theorem, [8]). A graph is perfect ifand only if it contains no odd hole and no odd antihole.

Shortly afterwards, Chudnovsky et al. [7] presented an O(n9) algorithm for rec-ognizing perfect graphs. We need such an algorithm as a subroutine in the al-gorithm presented in Section 3. We will not use their algorithm, because forclaw-free perfect graphs a faster recognition algorithm exists, namely the algo-rithm of Chvatal and Sbihi [11]. Chvatal and Sbihi did not explicitly state thetime complexity of their recognition algorithm. Theorem 2 shows it is O(n4). Wepostpone the required running time analysis to the journal version of our paper.

Theorem 2 ([11]). It is possible to decide in O(n4) time whether or not aclaw-free graph is perfect.

The proof of the following corollary is also postponed to the journal version.

Corollary 1. Let G be a claw-free graph. It is possible to find an odd hole or anodd antihole of G, or conclude that such a graph does not exist, in O(n5) time.

3 Finding Induced Paths of Given Parity

We start by giving an outline of our algorithm that solves the Odd Induced

Path problem in O(n5) time for claw-free graphs.

Algorithm solving Odd Induced Path for claw-free graphs

Input : claw-free graph G, vertices s and t of GOutput : YES if G contains an odd induced path from s to t

NO otherwise

Preprocess G to obtain graph G′′

Step 1: add edges to make s and t simplicialStep 2: delete irrelevant vertices

Test whether or not G′′ is perfect

If G′′ is not perfect, output YESIf G′′ is perfect, find a shortest path P from s to t

If P is odd, output YESIf P is even, define graph G∗ := (V (G′′) ∪ {x}, E(G′′) ∪ {sx, tx})Test whether or not G∗ is perfect

If G∗ is not perfect, output YESIf G∗ is perfect, output NO

Page 356: Graph-Theoretic Concepts in Computer Science

346 P. van ’t Hof, M. Kaminski, and D. Paulusma

As shown in the outline, we first preprocess the input graph G in order toobtain a new graph G′′ with certain desirable properties. This preprocessingprocedure is described in Section 3.1. We then distinguish two cases, dependingon whether or not G′′ is perfect. The case that G′′ is not perfect is discussed inSection 3.2, while Section 3.3 deals with the case that G′′ is perfect. In Section 3.4we prove correctness of our algorithm and show that its time complexity isO(n5).We also explain in Section 3.4 how our algorithm can be slightly modified in sucha way that it also solves the Even Induced Path problem for claw-free graphsin O(n5) time.

3.1 Preprocessing the Input Graph G

Let G be a claw-free graph and let s and t be two vertices of G. Note that wemay without loss of generality assume that G is connected and that s and t arenot adjacent. We make these assumptions throughout the paper.

Step 1. We add an edge between each pair of non-adjacent neighbors of s, andwe do the same for each pair of non-adjacent neighbors of t. Then in the resultinggraph G′, both s and t are simplicial vertices, i.e., vertices whose neighborhoodform a clique in G′. In general, adding edges is not a claw-freeness preservingoperation. However, the following lemma states that we do not create claws inStep 1. We postpone the straightforward proof to the journal version of thispaper.

Lemma 1. The graph G′ is claw-free.

Step 2. We “clean” G′ by repeatedly deleting irrelevant vertices. A vertex v ∈V (G′) is called irrelevant (for vertices s and t) if v does not lie on any inducedpath from s to t, and we say that G′ is clean if none of its vertices is irrelevant.Let G′′ denote the graph obtained from G′ by repeatedly deleting vertices thatare irrelevant. Note that G′′ is claw-free, as G′′ is an induced subgraph of G′.

We now show that we can perform Step 2 in polynomial time by showing thatwe can identify irrelevant vertices in polynomial time. In general, the problemof deciding whether a vertex is irrelevant is NP-complete. This follows from aresult by Derhy and Picouleau [13], who prove that the following problem isNP-complete for the class of graphs of maximum degree at most 3.

Three-in-a-Path

Instance: A graph G and three vertices v1, v2, v3 of G.Question: Does there exist an induced path of G containing v1, v2 and v3?

Chudnovsky and Seymour [9] study the following closely related problem.

Three-in-a-Tree

Instance: A graph G and three vertices v1, v2, v3 of G.Question: Does there exist an induced tree of G containing v1, v2 and v3?

Theorem 3 ([9]). The Three-in-a-Tree problem can be solved in O(n4) time,and a desired tree can be found in O(n4) time in case one exists.

Page 357: Graph-Theoretic Concepts in Computer Science

Finding Induced Paths of Given Parity in Claw-Free Graphs 347

Observe that the Three-in-a-Path problem is equivalent to the Three-in-a-

Tree problem for the class of claw-free graphs, since every induced tree in aclaw-free graph is an induced path. This, together with Theorem 3, implies thefollowing result.

Lemma 2. The problem of deciding whether a vertex v of a claw-free graph Gis irrelevant for two simplicial vertices s and t of G can be solved in O(n4) time.

After preprocessing the input graph G we have obtained a graph G′′ that satisfiesthe following three conditions: (1) G′′ is claw-free; (2) both s and t are simplicialvertices of G′′; and (3) G′′ is clean for s and t. The following lemma impliesthat solving the Odd Induced Path problem for G is equivalent to solving theproblem for G′′. The lemma also shows that the entire preprocessing procedurecan be performed in O(n5) time. The proof of the lemma is postponed to thejournal version of this paper.

Lemma 3. Every induced path from s to t in G′′ is also an induced path froms to t in G, and vice versa. Moreover, G′′ can be obtained from G in O(n5)time. ��We now distinguish two cases, depending on whether or not G′′ is perfect.

3.2 G′′ Is Not Perfect

Suppose G′′ is not perfect. Then G′′ contains an odd hole or an odd antiholeby virtue of the Strong Perfect Graph Theorem. We consider odd antiholes andodd holes in Lemma 4 and Lemma 5, respectively. The length of an antihole isthe number of edges in its complement.

Lemma 4. Let H be a connected claw-free graph. If H contains a simplicialvertex, then H does not contain an odd antihole of length more than 5.

Proof. Let s be a simplicial vertex of a connected claw-free graph H . For contra-diction, suppose H contains an odd antihole X such that X = x1x2 . . . x2k+1x1

is an odd induced cycle with k ≥ 3. Vertex s does not belong to X , since s issimplicial. Let P be an induced path from s to a vertex of X such that |V (P )|is minimum. Note that such a path P exists since H is connected. Without lossof generality assume that V (P ) ∩ V (X) = {x1}.

Let s′ be the neighbor of x1 on P . We claim that s′ is adjacent to at mostone vertex of {xi, xi+1} for 1 ≤ i ≤ 2k. If s′ = s, this claim immediately followsfrom the assumption that s is simplicial and the fact that xi and xi+1 are notadjacent. Suppose s′ = s, and let s′′ be the neighbor of s′ on P not equal tox1. Note that s′′ is not adjacent to any vertex of X due to the minimality of|V (P )|. Vertex s′ cannot be adjacent to both xi and xi+1, since then the set{s′, s′′, xi, xi+1} induces a claw in H with center s′. Hence s′ is adjacent to atmost one vertex of {xi, xi+1} for 1 ≤ i ≤ 2k.

Note that vertex s′ is adjacent to at least one vertex of {xi, xi+1} for 3 ≤ i ≤2k − 1, as otherwise {x1, s

′, xi, xi+1} induces a claw in H with center x1. This,

Page 358: Graph-Theoretic Concepts in Computer Science

348 P. van ’t Hof, M. Kaminski, and D. Paulusma

together with the fact that s′ is adjacent to at most one vertex of {xi, xi+1}for 1 ≤ i ≤ 2k, implies that s′ is adjacent to exactly one vertex of {x3, x2k}.Without loss of generality, assume that s′ is adjacent to x2k and not to x3. Sinces′ is adjacent to x1 and s′ is adjacent to at most one vertex of {xi, xi+1} for1 ≤ i ≤ 2k, s′ is not adjacent to x2. Note that x3 is adjacent to x2k, since k ≥ 3.But then {x2k, s′, x2, x3} induces a claw in H with center x2k. This contradictionfinishes the proof of Lemma 4. ��We point out that the arguments in the proof of Lemma 4 can also be used toprove that every odd antihole X of a connected claw-free graph H is dominating,i.e., every vertex of H either belongs to X or has a neighbor in X .

Lemma 5. Let H be a connected claw-free graph that is clean for two simplicialvertices s and t. If H contains an odd hole, then there exists both an odd and aneven induced path from s to t.

Proof. Let C be an odd hole of H . Let P be an induced path from s to a vertexp of C and let Q be an induced path from t to a vertex q of C, such that there isno edge in H connecting a vertex in P [V (P ) \ {p}] to a vertex in Q[V (Q) \ {q}]and such that |V (P )|+ |V (Q)| is minimum. Note that such paths P and Q existsince H is clean and connected. Let s′ be the neighbor of p on P , and let t′ bethe neighbor of q on Q; we note that possibly s′ = s and t′ = t.

Claim 1. Both s′ and t′ are adjacent to exactly two adjacent vertices of C.

Suppose p is the only vertex of C that is adjacent to s′. Let p− (respectivelyp+) denote the neighbor of p on C when we traverse C in counter-clockwise(respectively clockwise) order. The set {p, p−, p+, s′} induces a claw in H withcenter p, contradicting the claw-freeness of H . Hence s′ must be adjacent to atleast one vertex of {p−, p+}. Suppose there exists a set D ⊆ V (C) such that|D| ≥ 3 and s′ is adjacent to every vertex in D. Since C is an induced cycle,we know that D contains two vertices d1 and d2 that are not adjacent. Since sis simplicial and therefore does not have two non-adjacent neighbors, we musthave s′ = s. Let s′′ = p be a neighbor of s′ on P ; possibly s′′ = s. Vertex s′′

is not adjacent to any vertex of C due to the minimality of |V (P )| + |V (Q)|,which means the set {s′, d1, d2, s

′′} induces a claw in H with center s′. Thiscontradiction finishes the proof of Claim 1 for vertex s′. By symmetry the claimalso holds for vertex t′.

We assume, without loss of generality, that NH(s′) ∩ V (C) = {p, p+} andNH(t′) ∩ V (C) = {q, q+}. We distinguish three cases.

Suppose |{p, p+} ∩ {q, q+}| = 0. Since C is an odd hole, the induced paths′p+−→C qt′ and the induced path s′p

←−C q+t′ have different parity. Hence there

exists both an odd and an even induced path from s to t in H .Suppose |{p, p+} ∩ {q, q+}| = 1. Without loss of generality, suppose p+ = q.

Then the path s′qt′ is an even induced path from s′ to t′, and the path s′p←−C q+t′ is

an odd induced path from s′ to t′. Since by definition there is no edge connectinga vertex in P [V (P ) \ {p}] to a vertex in Q[V (Q) \ {q}], this means there existsboth an odd and an even induced path from s to t in H .

Page 359: Graph-Theoretic Concepts in Computer Science

Finding Induced Paths of Given Parity in Claw-Free Graphs 349

Suppose |{p, p+}∩{q, q+}| = 2. By Claim 1, neither s′ nor t′ is adjacent to p−.Since s′ and t′ are not adjacent by the choice of P and Q, the set {p, p−, s′, t′}induces a claw in H with center p. This contradiction finishes the proof ofLemma 5. ��Recall that G′′ is not perfect and has two simplicial vertices s and t. This,together with Lemma 4 and Lemma 5, implies that G′′ contains both an oddand an even induced path from s to t. We now show that we can also find suchpaths in O(n5) time.

Lemma 6. If G′′ is not perfect, then it is possible to find both an odd and aneven induced path from s to t in G′′ in O(n5) time.

Proof. Since G′′ has two simplicial vertices s and t, G′′ does not contain an oddantihole of length more than 5 by Lemma 4. Since an odd antihole of length5 is also an odd hole of length 5, G′′ contains an odd hole by virtue of theStrong Perfect Graph Theorem. We can find such a hole C in O(n5) time byCorollary 1. Let c be any vertex of C, and let P be an induced path in G′′ froms to t containing c. Note that such a path P exists since G′′ is clean for s and t.We can find P in O(n4) time as a result Theorem 3. It is clear from the proofof Lemma 5 that we can use P to find both an odd and an even induced pathfrom s to t in G′′. ��

3.3 G′′ Is Perfect

Suppose G′′ is perfect. In the concluding remarks of their paper, Corneil andFonlupt [12] pointed out that a polynomial-time recognition algorithm for per-fect graphs implies a polynomial-time algorithm for the Parity Path problemfor the class of perfect graphs. Interestingly, the arguments they used to provethis implication were already mentioned by Hsu [19] in the paper in which heintroduced the Parity Path problem. Using their arguments, we can prove thefollowing lemma.

Lemma 7. If G′′ is perfect, then it is possible to find an odd induced path froms to t in G′′, or conclude that such a path does not exist, in O(n5) time.

Proof. Let P be a shortest path from s to t in G′′. If P has odd length, thenwe are done. Suppose P has even length. Let G∗ be the graph obtained from Gby adding a vertex x and edges sx and tx. Note that the graph G∗ is claw-free,since s and t are simplicial vertices of G′′. We determine whether or not G∗ isperfect, which we can do in O(n4) time by Theorem 2. If G∗ is perfect, thenG∗ does not contain an odd hole or an odd antihole by virtue of the StrongPerfect Graph Theorem. This means that all induced paths from s to t mustbe even, so we conclude that there does not exist an odd induced path from sto t. Suppose G∗ is not perfect. Then G∗ must contain an odd hole or an oddantihole, and vertex x must be in this odd hole or odd antihole since G is perfect.Since x has degree two, G∗ cannot contain an odd antihole. Hence G∗ contains

Page 360: Graph-Theoretic Concepts in Computer Science

350 P. van ’t Hof, M. Kaminski, and D. Paulusma

an odd hole. We can find an odd hole C of G∗ in O(n5) time by Corollary 1. Thegraph obtained from C by removing vertex x is an odd induced path from s to tin G′′. ��

3.4 Finding Induced Paths of Given Parity from s to t in G

We are now ready to prove the main result of this section.

Theorem 4. Both the Odd Induced Path problem and the Even Induced

Path problem can be solved in O(n5) time for the class of claw-free graphs.Moreover, an induced path from s to t of given parity can be found in O(n5), ifone exists.

Proof. Let G be a claw-free graph, and let s and t be two vertices of G. Recallthat we may without loss of generality assume that G is connected and that s andt are not adjacent. We preprocess G in O(n5) time as described in Section 3.1,thus obtaining a graph G′′. Recall that G′′ is claw-free, that s and t are simplicialvertices in G′′, and that G′′ is clean for s and t. We test whether or not G′′ isperfect, which we can do in O(n4) time by Theorem 2. Below we show that wecan find an induced path of given parity from s to t in G′′, or conclude that sucha path does not exist, in O(n5) time. Lemma 3 implies that this suffices to proveTheorem 4.

If G′′ is not perfect, then we can find both an odd and an even induced pathfrom s to t in G′′ in O(n5) time by Lemma 6. If G′′ is perfect, then we can findan odd induced path from s to t in G′′, or conclude that such a path does notexist, in O(n5) time by Lemma 7. In order to find an even induced path from sto t, we define the graph G∗ as the graph obtained from G′′ by adding the edgest. It is easy to verify that adding the edge st creates neither a claw nor an oddantihole. Hence the arguments used in the proof of Lemma 7 can also be used tofind an even induced path from s to t in G′′, or conclude that such a path doesnot exist, in O(n5) time. ��Theorem 4 immediately implies the following.

Corollary 2. Both the Parity Path problem and the Even Pair problem canbe solved in O(n5) time for the class of claw-free graphs.

Bienstock [6] proved that the problem of deciding if a graph contains an oddinduced path between every pair of vertices, as well as the problem of deciding ifa graph has an odd hole through a given vertex, is NP-complete. The followingtwo corollaries of Theorem 4, the proofs of which are postponed to the journalversion of this paper, imply that both problems can be solved in O(n7) timewhen restricted to the class of claw-free graphs.

Corollary 3. Deciding whether or not a claw-free graph has an even pair canbe done in O(n7) time.

Corollary 4. It is possible to find an odd hole passing through a prescribedvertex of a claw-free graph, or conclude that such a hole does not exist, in O(n7)time.

Page 361: Graph-Theoretic Concepts in Computer Science

Finding Induced Paths of Given Parity in Claw-Free Graphs 351

4 Conclusions and Open Problems

We have proved that both the Odd Induced Path problem and the Even

Induced Path problem, and consequently the Parity Path problem, can besolved in O(n5) time for the class of claw-free graphs. This implies that we candecide in O(n7) time whether a claw-free graphs contains a hole of given paritypassing through a given vertex. In the Shortest Odd Induced Path and theShortest Even Induced Path problem, the goal is to find a shortest inducedpath between two given vertices of odd and even length, respectively. Using thestructure of claw-free perfect graphs, we can show that these problems can besolved in O(n7) time for this class; the details are postponed to the journalversion of this paper. We conclude by mentioning some open problems. Doesthere exist a polynomial-time algorithm for the Shortest Odd Induced Path

and Shortest Even Induced Path problems for general claw-free graphs?And does there exist a polynomial-time algorithm for the Odd Induced Path

and Even Induced Path problems for the class of planar graphs?

Acknowledgements. The authors would like to thank Benjamin Leveque, LukeMathieson and Nicolas Trotignon for helpful suggestions.

References

1. Arkin, E.M., Papadimitriou, C.H., Yannakakis, M.: Modularity of cycles and pathsin graphs. Journal of the ACM 38(2), 255–274 (1991)

2. Arikati, S.R., Peled, U.N.: A linear algorithm for the group path problem on chordalgraphs. Discrete Applied Mathematics 44(1-3), 185–190 (1993)

3. Arikati, S.R., Peled, U.N.: A polynomial algorithm for the parity path problem onperfectly orientable graphs. Discrete Applied Mathematics 65(1), 5–20 (1996)

4. Arikati, S.R., Rangan, C.P., Manacher, G.K.: Efficient reduction for path problemson circular-arc graphs. BIT 31(2), 182–193 (1991)

5. Berge, C.: Farbung von Graphen, deren samtliche bzw. deren ungeradeKreise starr sind. Wissenschaftliche Zeitschrift der Martin-Luther-UniversitatHalle-Wittenberg, Mathematisch-Naturwissenschaftliche Reihe 10, 114 (1961) (inGerman)

6. Bienstock, D.: On the complexity of testing for odd holes and induced odd paths.Discrete Mathematics 90(1), 85–92 (1991)

7. Chudnovsky, M., Cornuejols, G., Liu, X., Seymour, P.D., Vuskovic, K.: RecognizingBerge Graphs. Combinatorica 25(2), 143–186 (2005)

8. Chudnovsky, M., Robertson, N., Seymour, P.D., Thomas, R.: The strong perfectgraph theorem. Annals of Mathematics 164, 51–229 (2006)

9. Chudnovsky, M., Seymour, P.D.: The three-in-a-tree problem. Combinatorica (toappear), manuscript, http://www.columbia.edu/~mc2775/threeinatree.pdf

10. Chudnovsky, M., Seymour, P.D.: Three-colourable perfect graphs without evenpairs (submitted for publication), manuscript,http://www.columbia.edu/~mc2775/K4evenpairs.ps

11. Chvatal, V., Sbihi, N.: Recognizing claw-free perfect graphs. Journal of Combina-torial Theory, Series B 44, 154–176 (1988)

Page 362: Graph-Theoretic Concepts in Computer Science

352 P. van ’t Hof, M. Kaminski, and D. Paulusma

12. Corneil, D.G., Fonlupt, J.: Stable set bonding in perfect graphs and parity graphs.Journal of Combinatorial Theory, Series B 59, 1–14 (1993)

13. Derhy, N., Picouleau, C.: Finding induced trees. Discrete Applied Mathemat-ics 157(17), 3552–3557 (2009)

14. Everett, H., de Figueiredo, C.M.H., Sales, C.L., Maffray, F., Porto, O., Reed, B.A.:Path parity and perfection. Discrete Mathematics 165-166, 233–252 (1997)

15. Everett, H., de Figueiredo, C.M.H., Linhares Sales, C., Maffray, F., Porto, O.,Reed, B.A.: In: Ramirez-Alfonsin, L., Reed, B.A. (eds.) Perfect Graphs, pp. 67–92.Wiley, Chichester (2001)

16. de Figueiredo, C.M.H., Gimbel, J.G., Mello, C.P., Szwarcfiter, J.L.: Even and oddpairs in comparability and in P4-comparability graphs. Discrete Applied Mathe-matics 91(1-3), 293–297 (1999)

17. Fonlupt, J., Uhry, J.P.: Transformations which preserve perfectness and H-perfectness of graphs. Annals of Discrete Mathematics 16, 83–85 (1982)

18. Hoang, C.T., Le, V.B.: Recognizing perfect 2-split graphs. SIAM Journal on Dis-crete Mathematics 13(1), 48–55 (2000)

19. Hsu, W.-L.: Recognizing planar perfect graphs. Journal of the ACM 34(2), 255–288(1987)

20. LaPaugh, A.S., Papadimitriou, C.H.: The even-path problem for graphs and di-graphs. Networks 14, 507–513 (1984)

21. Leveque, B., Lin, D.Y., Maffray, F., Trotignon, N.: Detecting induced subgraphs.Discrete Applied Mathematics 157(17), 3540–3551 (2009)

22. Linhares Sales, C., Maffray, F.: Even pairs in claw-free perfect graphs. Journal ofCombinatorial Theory, Series B 74, 169–191 (1998)

23. Meyniel, H.: A new property of critical imperfect graphs and some consequences.European Journal of Combinatorics 8, 313–316 (1987)

24. Roussopoulos, N.D.: A max {m,n} algorithm for determining the graph H from itsline graph G. Information Processing Letters 2, 108–112 (1973)

25. Sampaio, R.M., Sales, C.L.: On the complexity of finding even pairs in planarperfect graphs. In: Brazilian Symposium on Graphs, Algorithms and Combinatorics2001, Fortaleza. Electronic Notes in Discrete Mathematics, vol. 7, pp. 186–189(2001)

26. Satyan, C.R., Pandu Rangan, C.: The parity path problem on some subclasses ofperfect graphs. Discrete Applied Mathematics 68(3), 293–302 (1996)

27. Tarjan, R.E.: Decomposition by clique separators. Discrete Mathematics 55, 221–232 (1985)

28. Trotignon, N.: Graphes parfaits: Structure et algorithmes. PhD Thesis, UniversiteJoseph Fourier - Grenoble I (2004) (in French)

29. Whitesides, S.H.: A method for solving certain graph recognition and optimizationproblems, with applications to perfect graphs. Annals of Discrete Mathematics 21,281–297 (1984)

Page 363: Graph-Theoretic Concepts in Computer Science

Author Index

Averbouch, Ilia 33

Broersma, Hajo 44

Calinescu, Gruia 54Chechik, Shiri 66Crespelle, Christophe 77

Dvorak, Zdenek 17

Eppstein, David 1

Fellows, Michael R. 88Fernandes, Cristina G. 54Fernau, Henning 100Fomin, Fedor V. 44, 112

Gandhi, Rajiv 122Gaspers, Serge 100Golovach, Petr A. 133Golumbic, Martin Charles 329Greening Jr., Bradford 122Grigoriev, Alexander 143Grumbach, Stephane 154Guo, Jiong 88Gurski, Frank 166

Hagerup, Torben 178

Kaminski, Marcin 341Kammer, Frank 190Kanj, Iyad A. 88, 202Kante, Mamadou Moustapha 214Katz, Bastian 226Kaul, Hemanshu 54Kral’, Daniel 17Kratochvıl, Jan 133Kreutzer, Stephan 308

Le, Van Bang 238Li, Zhentao 250Lokshtanov, Daniel 112

MacGillivray, Gary 262Makowsky, Johann A. 33

Meister, Daniel 273Mertzios, George B. 285

Nguyen, Ngoc Tuy 238

Okamoto, Yoshio 296Ordyniak, Sebastian 308

Paulusma, Daniel 44, 341Peleg, David 66Pemmaraju, Sriram 122Penso, Lucia Draque 320

Raible, Daniel 100Raman, Rajiv 122Rao, Michael 214Raspaud, Andre 262Rautenbach, Dieter 320Rutter, Ignaz 226

Sau, Ignasi 250, 285Saurabh, Saket 112Shrem, Shimon 329Sitters, Rene 143Stern, Michal 329Suchy, Ondrej 133Swarts, Jacobus 262Szwarcfiter, Jayme Luiz 320

Telle, Jan Arne 273Tholey, Torsten 190Tittmann, Peter 33

Uehara, Ryuhei 296Uno, Takeaki 296

van ’t Hof, Pim 44, 341

Wanke, Egon 166Wiese, Andreas 202Woeginger, Gerhard 226Wu, Zhilin 154

Zaks, Shmuel 285Zhang, Fenghui 202


Recommended