100% found this document useful (1 vote)
2K views613 pages

Algorithms Data Structures 15th PDF

Uploaded by

Bonnier Nilss
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
2K views613 pages

Algorithms Data Structures 15th PDF

Uploaded by

Bonnier Nilss
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 613

Faith Ellen Antonina Kolokolova

Jrg-Rdiger Sack (Eds.)


LNCS 10389

Algorithms
and Data Structures
15th International Symposium, WADS 2017
St. John's, NL, Canada, July 31 August 2, 2017
Proceedings

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

Editorial Board
David Hutchison
Lancaster University, Lancaster, UK
Takeo Kanade
Carnegie Mellon University, Pittsburgh, PA, USA
Josef Kittler
University of Surrey, Guildford, UK
Jon M. Kleinberg
Cornell University, Ithaca, NY, USA
Friedemann Mattern
ETH Zrich, Zrich, Switzerland
John C. Mitchell
Stanford University, Stanford, CA, USA
Moni Naor
Weizmann Institute of Science, Rehovot, Israel
C. Pandu Rangan
Indian Institute of Technology, Madras, India
Bernhard Steffen
TU Dortmund University, Dortmund, Germany
Demetri Terzopoulos
University of California, Los Angeles, CA, USA
Doug Tygar
University of California, Berkeley, CA, USA
Gerhard Weikum
Max Planck Institute for Informatics, Saarbrcken, Germany
More information about this series at http://www.springer.com/series/7407
Faith Ellen Antonina Kolokolova

Jrg-Rdiger Sack (Eds.)

Algorithms
and Data Structures
15th International Symposium, WADS 2017
St. Johns, NL, Canada, July 31 August 2, 2017
Proceedings

123
Editors
Faith Ellen Jrg-Rdiger Sack
University of Toronto Carleton University
Toronto, ON Ottawa, ON
Canada Canada
Antonina Kolokolova
Memorial University of Newfoundland
St. Johns, NL
Canada

ISSN 0302-9743 ISSN 1611-3349 (electronic)


Lecture Notes in Computer Science
ISBN 978-3-319-62126-5 ISBN 978-3-319-62127-2 (eBook)
DOI 10.1007/978-3-319-62127-2

Library of Congress Control Number: 2017945725

LNCS Sublibrary: SL1 Theoretical Computer Science and General Issues

Springer International Publishing AG 2017


This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the
material is concerned, specically the rights of translation, reprinting, reuse of illustrations, recitation,
broadcasting, reproduction on microlms or in any other physical way, and transmission or information
storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now
known or hereafter developed.
The use of general descriptive names, registered names, trademarks, service marks, etc. in this publication
does not imply, even in the absence of a specic statement, that such names are exempt from the relevant
protective laws and regulations and therefore free for general use.
The publisher, the authors and the editors are safe to assume that the advice and information in this book are
believed to be true and accurate at the date of publication. Neither the publisher nor the authors or the editors
give a warranty, express or implied, with respect to the material contained herein or for any errors or
omissions that may have been made. The publisher remains neutral with regard to jurisdictional claims in
published maps and institutional afliations.

Printed on acid-free paper

This Springer imprint is published by Springer Nature


The registered company is Springer International Publishing AG
The registered company address is: Gewerbestrasse 11, 6330 Cham, Switzerland
Preface

This volume contains the papers presented at the 15th International Algorithms and
Data Structures Symposium (WADS 2017), which was held from July 31 to August 2,
2017, in St. Johns, Newfoundland, Canada. WADS, which alternates with the Scan-
dinavian Symposium and Workshops on Algorithm Theory, SWAT, is a forum for
researchers in the area of design and analysis of algorithms and data structures.
In response to the call for papers, 109 papers were submitted. From these sub-
missions, the Program Committee selected 49 papers for presentation at WADS 2017,
using a combination of online discussion in EasyChair and a one-day video conference.
In addition, invited lectures were given by Pankaj Agarwal (Duke University), Michael
Saks (Rutgers University), and Virginia Vassilevska Williams (MIT).
Special issues of papers selected from WADS 2017 are planned for two journals,
Algorithmica and Computational Geometry: Theory and Applications.
We gratefully acknowledge the support of the WADS 2017 sponsors: Memorial
University of Newfoundland, The Fields Institute for Research in Mathematical
Sciences, Elsevier, and Springer.

July 2017 Faith Ellen


Antonina Kolokolova
Jrg-Rdiger Sack
Organization

Conference Chair and Local Arrangements Chair


Antonina Kolokolova Memorial University of Newfoundland, Canada

Program Committee Co-chairs


Faith Ellen University of Toronto, Canada
Antonina Kolokolova Memorial University of Newfoundland, Canada
Jrg-Rdiger Sack Carleton University, Canada

Steering Committee
Frank Dehne Carleton University, Canada
Faith Ellen University of Toronto, Canada
Ian Munro University of Waterloo, Canada
Jrg-Rdiger Sack Carleton University, Canada
Roberto Tamassia Brown University, USA

Program Committee
Ittai Abraham VMware Research, Israel
Hee-Kap Ahn Pohang University of Science and Technology, Korea
Nina Amenta University of California, Davis, USA
Sayan Bhattacharya University of Warwick, UK
Therese Biedl University of Waterloo, Canada
Joan Boyar University of Southern Denmark, Denmark
Martin Dietzfelbinger Technische Universitt Ilmenau, Germany
Stephane Durocher University of Manitoba, Canada
Funda Ergun Indiana University, USA
Martn Farach-Colton Rutgers University, USA
Fedor Fomin University of Bergen, Norway
Travis Gagie Diego Portales University, Chile
Thore Husfeld IT University of Copenhagen, Denmark
and Lund University, Sweden
Michael Kerber Graz University of Technology, Austria
David Kirkpatrick University of British Columbia, Canada
Ramesh Krishnamurti Simon Fraser University, Canada
Kasper Green Larsen Aarhus University, Denmark
Vangelis Markakis Athens University of Economics and Business, Greece
Aleksandar Nikolov University of Toronto, Canada
Naomi Nishimura University of Waterloo, Canada
VIII Organization

Richard Peng Georgia Institute of Technology, USA


Seth Pettie University of Michigan, USA
Liam Roditty Bar-Ilan University, Israel
Sandeep Sen Indian Institute of Technology, Delhi, India
Monique Teillaud Inria Nancy-Grand Est, France
Takeshi Tokuyama Tohoku University, Japan
Virginia Vassilevska Massachusetts Institute of Technology, USA
Williams
Todd Wareham Memorial University of Newfoundland, Canada
Qin Zhang Indiana University Bloomington, USA

Additional Reviewers

Mohammad Ali Abam Olivier Devillers


Josh Alman Michael Dinitz
Spyros Angelopoulos Yago Diez Donoso
Esther Arkin Feodor Dragan
Martin Aumller Ran Duan
Franz Aurenhammer Charilaos Efthymiou
Mauricio Ayala-Rincon Eduard Eiben
Erfan Sadeqi Azer Matthias Englert
Sang Won Bae David Eppstein
Aritra Banik Leah Epstein
Gill Barequet William Evans
Djamal Belazzougui Rolf Fagerberg
Robert Benkoczi Lene Favrholdt
Binay Bhattacharya Andreas Emil Feldmann
Arijit Bishnu Yuval Filmus
Hans L. Bodlaender Johannes Fischer
Piotr Borowiecki Kyle Fox
Jean Cardinal Mathew Francis
Paz Carmi Jie Gao
Timothy M. Chan Daya Gaur
Steven Chaplick Ellen Gethner
Jiecao Chen Arijit Ghosh
Man Kwun Chiu Archontia Giannopoulou
Keerti Choudhary Petr Golovach
Nachshon Cohen Carsten Grimm
Vincent Cohen-Adda Allan Grnlund
Alexander Conway Martin Gro
Sren Dahlgaard Joachim Gudmundsson
Peter Damaschke Manoj Gupta
Syamantak Das Shalmoli Gupta
Mark de Berg Sariel Har-Peled
Jean-Lou De Carufel Meng He
Organization IX

Martin Hoefer Debajyoti Mondal


Chien-Chung Huang Gila Morgenstern
Thomas Hull Miguel A. Mosteiro
Ehsan Iranmanesh Wolfgang Mulzer
Mark Jerrum Ian Munro
Hossein Jowhari Nabil Mustafa
Stasys Jukna Petra Mutzel
Mark Keil Jesper Nederlof
Kamyar Khodamoradi Stefan Neumann
Elena Khramtcova Huy L. Nguyen
Philipp Kindermann Patrick Nicholson
Peter Kling Jesper Sindahl Nielsen
Chip Klostermeyer Arnur Nigmetov
Christian Knauer Nicolas Nisse
Mathias Bk Tejs Knudsen Jakob Nordstrm
Janne H. Korhonen Eunjin Oh
Matias Korman Yota Otachi
Daniel Kral John Owens
Stefan Kratsch Jeff M. Phillips
Ravishankar Krishnaswamy Rameshwar Pratap
Janardhan Kulkarni Sharath Raghvendra
Amit Kumar Benjamin Raichel
Woden Kusner Rajiv Raman
Jakub acki Mathias Rav
Kim Skak Larsen Saurabh Ray
Samuli Leppnen Jean-Florent Raymond
Jian Li Andr van Renssen
Pak Ching Li Marcel Roeloffzen
Yi Li Luis M.S. Russo
Bingkai Lin Yogish Sabharwal
Daniel Lokshtanov Sushant Sachdeva
Aaron Lowe Vera Sacristan
Anna Lubiw Toshiki Saitoh
Bin Ma Pawe Schmidt
Pasin Manurangsi Hannah Schreiber
Euripides Markou Oded Schwartz
Tyler Mayer Roy Schwartz
Saeed Mehrabi Akiyoshi Shioura
Moti Medina Rakesh Sinha
Victor Milenkovic Michiel Smid
Tillmann Miltzow Shay Solomon
Gopinath Misra Bettina Speckmann
Joseph Mitchell Abhinav Srivastav
Dieter Mitsche Frank Staals
Valia Mitsou Thomas Steinke
Reza Modarres Torstein Strmme
X Organization

Jan Arne Telle Josh Wang


Sharma V. Thankachan Sebastian Wild
Csaba Toth Ryan Williams
Meng-Tsung Tsai Steve Wismath
Charalampos Tsourakakis Prudence Wong
Ryuhei Uehara Christian Wulff-Nilsen
Seeun William Umboh Jie Xue
Birgit Vogtenhuber Sang Duk Yoon
Erik Waingarten Hamid Zarrabi-Zadeh
Di Wang Haoyu Zhang
Haitao Wang Yuan Zhou
Junxing Wang
Abstracts of Invited Lectures
Algorithms for Geometric Similarity:
Recent Developments

Pankaj K. Agarwal

Department of Computer Science, Duke University, Durham, USA


[email protected]

Abstract. A basic problem in classifying, or searching for similar objects, in a


large set of geometric objects is computing similarity between two objects.
There has been extensive work on computing geometric similarity between two
objects. In many applications, it is not sufcient to return a single similarity
score. Instead, a map between two objects that identies shared structures is
needed.
This talk discusses some recent work on computing maps between two or
more objects. The talk consists of three parts. The rst part focuses on com-
puting maps between two weighted point sets, say, distributions. The second
part is devoted to computing maps between a pair of trajectories. The third part
will briefly discuss computing Gromov-Hausdorff distance between two metric
spaces.

This work is supported in part by NSF under grants CCF-15-13816, CCF-15-46392, and IIS-14-08846,
by ARO grant W911NF-15-1-0408, and by grant 2012/229 from the U.S.-Israel Binational Science
Foundation.
How efciently can easy dynamic programs be
approximated?

Michael Saks

Department of Mathematics, Rutgers University, New Brunswick, USA


[email protected]

Abstract. In many of the simplest examples of dynamic programming, inputs of


size n are processed by constructing an n  n matrix, where each entry is
obtained by a simple function of a few entries above and to the left. This yields a
simple On2 algorithm for such problems. These algorithms naturally arise, for
example, in evaluating various distance measures between two strings, such as
LCS (longest common subsequence) distance, Edit Distance, Frechet Distance,
and Dynamic Time Warping Distance, and the i; j entry of the matrix gives the
desired measure between the length i prex of the rst string, and the length
j prex of the second. With few exceptions (such as the Longest Increasing
Subsequence (LIS) problem where the quadratic time algorithm has been
improved to On logn), these quadratic time dynamic programming algo-
rithms remain essentially the fastest exact algorithms (except for no1 factor
improvements). This phenomenon has been the focus of much recent research in
ne grain complexity, and it has been shown that for many such problems,
reducing the running time to On2e would contradict the Strong Exponential
Time Hypothesis (e.g., Bringmann [7], Abboud, Backurs and Williams [2],
Backurs and Indyk [6] and Bringmann and Kunnermann [8].)
If we are willing to accept a good approximation (rather than the exact
answer), then there is much less evidence that quadratic complexity is needed.
Bringmann [7] proved that the Strong Exponential Hypothesis implies that truly
subquadratic algorithms cannot achieve approximation factors arbitrarily close
to 1. Abboud and Backurs [1] provided complexity theoretic evidence that truly
subquadratic deterministic algorithms cannot achieve approximation factors
arbitrarily close to 1 for edit distance and LCS-distance.
If we allow randomized algorithms, it is quite possible that problems such as
edit distance and LCS distance have constant factor approximation algorithms
that are signicantly faster than quadratic. Andoni, Krauthgamer and Onak [4]
gave a nearly linear time algorithm that achieves a polylogarithmic approxi-
mation to edit distance. For certain special cases of LCS-distance, arbitrarily
good additive en error approximation algorithms are known that are substan-
tially faster than the best exact algorithms. For the LIS Problem, Saks and
Seshadhri [11] (following the work of Ailon, Chazelle, Comandur and Liu [3]
and Parnas, Ron and Rubinfeld [10]) developed such an additive approximation

Supported by Simons Foundation Award 332622.


How efciently can easy dynamic programs be approximated? XV

whose running time is only polylogarithmic in the length of the input. For the
special case of LCS-distance between two permutations of f1; . . .; ng (Ulam
Distance), Naumovitz, Saks and Seshadhri [9] (following earlier work of
Andoni and Nguyen [5]) obtained such an additive approximation running in
~ pn.
time O

References
1. Abboud, A., Backurs, A.: Towards hardness of approximation for polynomial time prob-
lems. In: Conference on Innovations in Theoretical Computer Science (ITCS) (2017)
2. Abboud, A., Backurs, A., Williams, V.V.: Quadratic-Time Hardness of LCS and other
Sequence Similarity Measures. CoRR, abs/1501.07053 (2015)
3. Ailon, N., Chazelle, B., Comandur, S., Liu, D.: Estimating the distance to a monotone
function. Random Struct. Algorithms 31, 371383 (2017)
4. Andoni, A., Krauthgamer, R., Onak, K.: Polylogarithmic approximation for edit distance and
the asymmetric query complexity. In: IEEE Symposium on Foundations of Computer
Science (FOCS), pp. 377386 (2010)
5. Andoni, A., Nguyen, H.L.: Near-optimal sublinear time algorithms for Ulam distance. In:
Proceedings of the 21st Symposium on Discrete Algorithms (SODA), pp. 7686 (2010)
6. Backurs, A., Indyk, P.: Edit distance cannot be computed in strongly subquadratic time
(unless SETH is false). In: Proceedings of the Forty-Seventh Annual ACM on Symposium
on Theory of Computing (STOC), pp. 5158 (2015)
7. Bringmann, K.: Why walking the dog takes time: Frechet distance has no strongly sub-
quadratic algorithms unless SETH fails. CoRR, abs/1404.1448 (2014)
8. Bringmann, K., Kunnemann, M.: Quadratic conditional lower bounds for string problems
and dynamic time warping. In: Proceedings of the 56th Annual IEEE Symposium on
Foundations of Computer Science (FOCS), pp. 7997 (2015)
9. Naumovitz, T., Saks, M., Seshadhri, C.: Accurate and nearly optimal sublinear approxi-
mations to Ulam distance. In: SIAM-ACM Symposium on Discrete Algorithms, pp. 2012
2031 (2017)
10. Parnas, M., Ron, D., Rubinfeld, R.: Tolerant property testing and distance approximation.
J. Comput. Syst. Sci. 6, 10121042 (2006)
11. Saks, M., Seshadhri, C.: Estimating the longest increasing sequence in polylogarithmic time.
SIAM J. Comput. 46(2), 774823 (2017)
Fine-Grained Complexity of Problems in P

Virginia Vassilevska Williams

Computer Science and Articial Intelligence Laboratory,


Massachusetts Institute of Technology, Cambridge, USA
[email protected]

Abstract. A central goal of algorithmic research is to determine how fast


computational problems can be solved in the worst case. Theorems from
complexity theory state that there are problems that, on inputs of size n, can be
solved in tn time but not in tn1e time for e [ 0. The main challenge is to
determine where in this hierarchy various natural and important problems lie.
Throughout the years, many ingenious algorithmic techniques have been
developed and applied to obtain blazingly fast algorithms for many problems.
Nevertheless, for many other central problems, the best known running times are
essentially those of their classical algorithms from the 1950s and 1960s.
Unconditional lower bounds seem very difcult to obtain, and so practically
all known time lower bounds are conditional. For years, the main tool for
proving hardness of computational problems have been NP-hardness reductions,
basing hardness on P 6 NP. However, when we care about the exact running
time (as opposed to merely polynomial vs non-polynomial), NP-hardness is not
applicable, especially if the problem is already solvable in polynomial time. In
recent years, a new theory has been developed, based on ne-grained reduc-
tions that focus on exact running times. Mimicking NP-hardness, the approach
is to (1) select a key problem X that is conjectured to require essentially tn
time for some t, and (2) reduce X in a ne-grained way to many important
problems. This approach has led to the discovery of many meaningful rela-
tionships between problems, and even sometimes to equivalence classes.
The main key problems used to base hardness on have been: the 3SUM
problem, the CNF-SAT problem (based on the Strong Exponential Time
Hypothesis (SETH)) and the All Pairs Shortest Paths Problem. Research on
SETH-based lower bounds has flourished in particular in recent years showing
that the classical algorithms are optimal for problems such as Approximate
Diameter, Edit Distance, Frechet Distance, Longest Common Subsequence,
many dynamic graph problems, etc.
In this talk I will give an overview of the current progress in this area of
study, and will highlight some exciting new developments.

Supported by an NSF CAREER Award, NSF Grants CCF-1417238, CCF-1528078 and CCF-1514339,
and BSF Grant BSF:2012338.
Contents

Covering Segments with Unit Squares . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1


Ankush Acharyya, Subhas C. Nandy, Supantha Pandit, and Sasanka Roy

Replica Placement on Bounded Treewidth Graphs. . . . . . . . . . . . . . . . . . . . 13


Anshul Aggarwal, Venkatesan T. Chakaravarthy, Neelima Gupta,
Yogish Sabharwal, Sachin Sharma, and Sonika Thakral

Fast Exact Algorithms for Survivable Network Design


with Uniform Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Akanksha Agrawal, Pranabendu Misra, Fahad Panolan,
and Saket Saurabh

The Complexity of Tree Partitioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37


Zhao An, Qilong Feng, Iyad Kanj, and Ge Xia

Effectiveness of Local Search for Art Gallery Problems . . . . . . . . . . . . . . . . 49


Sayan Bandyapadhyay and Aniket Basu Roy

Parameterized Complexity of Geometric Covering Problems


Having Conflicts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Aritra Banik, Fahad Panolan, Venkatesh Raman, Vibha Sahlot,
and Saket Saurabh

Obedient Plane Drawings for Disk Intersection Graphs . . . . . . . . . . . . . . . . 73


Bahareh Banyassady, Michael Hoffmann, Boris Klemz,
Maarten Lffler, and Tillmann Miltzow

d-Greedy t-spanner . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Gali Bar-On and Paz Carmi

Dynamic Graph Coloring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97


Luis Barba, Jean Cardinal, Matias Korman, Stefan Langerman,
Andr van Renssen, Marcel Roeloffzen, and Sander Verdonschot

Universal Hinge Patterns for Folding Strips Efficiently


into Any Grid Polyhedron . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Nadia M. Benbernou, Erik D. Demaine, Martin L. Demaine,
and Anna Lubiw

An Optimal XP Algorithm for Hamiltonian Cycle on Graphs


of Bounded Clique-width . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
Benjamin Bergougnoux, Mamadou Moustapha Kant,
and O-Joung Kwon
XVIII Contents

Improved Algorithms for Computing k-Sink on Dynamic


Flow Path Networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
Binay Bhattacharya, Mordecai J. Golin, Yuya Higashikawa,
Tsunehiko Kameda, and Naoki Katoh

A 2-Approximation for the Height of Maximal Outerplanar


Graph Drawings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
Therese Biedl and Philippe Demontigny

Splitting B2 -VPG Graphs into Outer-string and Co-comparability Graphs . . . . 157


Therese Biedl and Martin Derka

A Deterministic Algorithm for Online Steiner Tree Leasing . . . . . . . . . . . . . 169


Marcin Bienkowski, Artur Kraska, and Pawe Schmidt

The I/O Complexity of Strassens Matrix Multiplication


with Recomputation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
Gianfranco Bilardi and Lorenzo De Stefani

Maximum Plane Trees in Multipartite Geometric Graphs . . . . . . . . . . . . . . . 193


Ahmad Biniaz, Prosenjit Bose, Kimberly Crosbie, Jean-Lou De Carufel,
David Eppstein, Anil Maheshwari, and Michiel Smid

Local Routing in Spanners Based on WSPDs . . . . . . . . . . . . . . . . . . . . . . . 205


Prosenjit Bose, Jean-Lou De Carufel, Vida Dujmovi,
and Frdrik Paradis

Relaxing the Irrevocability Requirement for Online Graph Algorithms . . . . . . 217


Joan Boyar, Lene M. Favrholdt, Michal Kotrbk, and Kim S. Larsen

Approximating Small Balanced Vertex Separators in Almost Linear Time . . . 229


Sebastian Brandt and Roger Wattenhofer

Balanced Line Separators of Unit Disk Graphs . . . . . . . . . . . . . . . . . . . . . . 241


Paz Carmi, Man Kwun Chiu, Matthew J. Katz, Matias Korman,
Yoshio Okamoto, Andr van Renssen, Marcel Roeloffzen,
Taichi Shiitada, and Shakhar Smorodinsky

All-Pairs Shortest Paths in Geometric Intersection Graphs . . . . . . . . . . . . . . 253


Timothy M. Chan and Dimitrios Skrepetos

The Complexity of Drawing Graphs on Few Lines and Few Planes. . . . . . . . 265
Steven Chaplick, Krzysztof Fleszar, Fabian Lipp, Alexander Ravsky,
Oleg Verbitsky, and Alexander Wolff

Modular Circulation and Applications to Traffic Management. . . . . . . . . . . . 277


Philip Dasler and David M. Mount
Contents XIX

The Homogeneous Broadcast Problem in Narrow and Wide Strips . . . . . . . . 289


Mark de Berg, Hans L. Bodlaender, and Sndor Kisfaludi-Bak

Minimizing the Continuous Diameter when Augmenting


a Tree with a Shortcut . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
Jean-Lou De Carufel, Carsten Grimm, Stefan Schirra, and Michiel Smid

Inapproximability of the Standard Pebble Game


and Hard to Pebble Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
Erik D. Demaine and Quanquan C. Liu

Capacitated Center Problems with Two-Sided Bounds and Outliers . . . . . . . . 325


Hu Ding, Lunjia Hu, Lingxiao Huang, and Jian Li

Faster Randomized Worst-Case Update Time for Dynamic Subgraph


Connectivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337
Ran Duan and Le Zhang

Improved Distance Sensitivity Oracles via Tree Partitioning . . . . . . . . . . . . . 349


Ran Duan and Tianyi Zhang

Delta-Fast Tries: Local Searches in Bounded Universes


with Linear Space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361
Marcel Ehrhardt and Wolfgang Mulzer

Split Packing: Packing Circles into Triangles with Optimal Worst-Case


Density . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373
Sndor P. Fekete, Sebastian Morr, and Christian Scheffer

Fast and Compact Planar Embeddings . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385


Leo Ferres, Jos Fuentes, Travis Gagie, Meng He,
and Gonzalo Navarro

When Can Graph Hyperbolicity be Computed in Linear Time?. . . . . . . . . . . 397


Till Fluschnik, Christian Komusiewicz, George B. Mertzios,
Andr Nichterlein, Rolf Niedermeier, and Nimrod Talmon

Optimal Query Time for Encoding Range Majority . . . . . . . . . . . . . . . . . . . 409


Pawe Gawrychowski and Patrick K. Nicholson

Conditional Lower Bounds for Space/Time Tradeoffs . . . . . . . . . . . . . . . . . 421


Isaac Goldstein, Tsvi Kopelowitz, Moshe Lewenstein, and Ely Porat

Posimodular Function Optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437


Magns M. Halldrsson, Toshimasa Ishii, Kazuhisa Makino,
and Kenjiro Takazawa
XX Contents

How to Play Hot and Cold on a Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449


Herman Haverkort, David Kbel, Elmar Langetepe,
and Barbara Schwarzwald

Faster Algorithm for Truth Discovery via Range Cover . . . . . . . . . . . . . . . . 461


Ziyun Huang, Hu Ding, and Jinhui Xu

Searching Edges in the Overlap of Two Plane Graphs . . . . . . . . . . . . . . . . . 473


John Iacono, Elena Khramtcova, and Stefan Langerman

Improved Average Complexity for Comparison-Based Sorting . . . . . . . . . . . 485


Kazuo Iwama and Junichi Teruyama

An EPTAS for Scheduling on Unrelated Machines


of Few Different Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 497
Klaus Jansen and Marten Maack

A Polynomial Kernel for Distance-Hereditary Vertex Deletion . . . . . . . . . . . 509


Eun Jung Kim and O-joung Kwon

Busy Time Scheduling on a Bounded Number of Machines


(Extended Abstract). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 521
Frederic Koehler and Samir Khuller

Algorithms for Covering Multiple Barriers . . . . . . . . . . . . . . . . . . . . . . . . . 533


Shimin Li and Haitao Wang

An Improved Algorithm for Diameter-Optimally Augmenting


Paths in a Metric Space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 545
Haitao Wang

Covering Uncertain Points in a Tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 557


Haitao Wang and Jingru Zhang

Stochastic Closest-pair Problem and Most-likely Nearest-neighbor


Search in Tree Spaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 569
Jie Xue and Yuan Li

On the Expected Diameter, Width, and Complexity of a Stochastic


Convex-hull . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 581
Jie Xue, Yuan Li, and Ravi Janardan

Author Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 593


Covering Segments with Unit Squares

Ankush Acharyya, Subhas C. Nandy, Supantha Pandit, and Sasanka Roy

Indian Statistical Institute, Kolkata, India

Abstract. We study several variations of line segment covering problem


with axis-parallel unit squares in the plane. Given a set S of n line seg-
ments, the objective is to nd the minimum number of axis-parallel unit
squares which cover at least one end-point of each segment. The varia-
tions depend on the orientation and length of the input segments. We
prove some of these problems to be NP-complete, and give constant factor
approximation algorithms for those problems. For the general version of
the problem, where the segments are of arbitrary length and orientation,
and the squares are given as input, we propose a factor 16 approxima-
tion result based on multilevel linear programming relaxation technique.
This technique may be of independent interest for solving some other
problems. We also show that our problems have connections with the
problems studied by Arkin et al. [2] on conict-free covering problem.
Our NP-completeness results hold for more simplied types of objects
than those of Arkin et al. [2].

Keywords: Segment cover, unit square, NP-hardness, linear program-


ming, approximation algorithms, PTAS.

1 Introduction

In this paper, we study dierent interesting variations of line segment covering


problem. Here, a set S = {s1 , s2 , . . . , sn } of line segments in IR2 is given. An
axis-parallel square t is said to cover a line segment s S if t contains at least
one end-point of s. We deal with two classes of covering problem: i) continuous,
and ii) discrete.
Continuous Covering Segments by Unit Squares (CCSUS ):
Given a set S of segments in the plane, the goal is to nd a smallest set T of
unit squares which covers all the segments in S.
Discrete Covering Segments by Unit Squares (DCSUS ): Given
a set S of segments and a set T of unit squares in the plane, the goal is to nd
a subset T  T of minimum cardinality which can cover all the segments in S.
The motivation of studying this problem comes from an applications to net-
work security [9]. Here, a set of physical devices is deployed over a geographical
area. These devices communicate with each other through physical links. The
objective is to check the security of the network by placing minimum number
of devices which can sense at least one end point of every link. This problem

Springer International Publishing AG 2017 1


F. Ellen et al. (Eds.): WADS 2017, LNCS 10389, pp. 112, 2017.
DOI: 10.1007/978-3-319-62127-2_1
2 A. Acharyya et al.

can be modelled as line segment covering problem, where the links can be
interpreted as straight-line segments and the objects can be interpreted as unit
squares. In [9], several other applications are also stated.
We study the following variations of covering problem for line segments which
are classied depending upon their lengths and orientations.
Continuous Covering

 CCSUS-H1-US: Horizontal unit segments inside a unit height strip.


 CCSUS-H1: Horizontal unit segments.
 CCSUS-HV1: Horizontal and vertical unit segments.
 CCSUS-ARB: Segments with arbitrary length and orientation.

Discrete Covering

 DCSUS-ARB: Segments with arbitrary length and orientation.

We dene some terminologies and denitions used in this paper. We use seg-
ment to denote a line segment, and unit square to denote an axis-parallel unit
square. For a given non-vertical segment s, we dene l(s) and r(s) to be its left
and right end-points. For a vertical segment s, l(s) and r(s) are dened to be the
end-points of s with highest and lowest y-coordinates respectively. The center
of a square t is the point of intersection of its two diagonals. We use t(a, b) to
denote a square whose center is at the point a and whose side length is b.

Denition 1. Two segments in S are said to be independent if no unit square


can cover both the segments. A subset S  S is an independent set if every
pair of segments in S  is independent. A subset S  S of segments is a maximal
independent set if for any s S \ S  , S  {s} is not an independent set.

Known results: Arkin et al. [2] studied a related problem the conict-free
covering . Given a set P of n color classes, where each color class contains exactly
two points, the goal is to nd a set of conict-free objects of minimum cardinality
which covers at least one point from each color class. An object is said to be
conict-free if it contains at most one point from each color class. Arkin et al.
[1, 2] showed that, both discrete and continuous versions of conict-free covering
problem are NP-complete where the points are on a real line and objects are
intervals of arbitrary length. These results are also valid for covering arbitrary
length segments on a line with unit intervals. They provided 2- and 4-factor
approximation algorithms for the continuous and discrete versions of conict-
free covering problem with arbitrary length intervals respectively. If the points
of the same color class are either vertically or horizontally unit separated, then
they proved that the continuous version of the conict-free covering problem with
axis-parallel unit squares is NP-complete, and proposed a factor 6 approximation
algorithm. Finally, they remarked the existence of a polynomial time dynamic
programming based algorithm for the continuous version of conict-free covering
problem with unit intervals where the points are on a real line and each pair of
Covering Segments with Unit Squares 3

same color points is unit separated. Recently, Kobylkin [9] studied the problem
of covering the edges of a given straight line embedding of a planar graph by
minimum number of unit disks, where an edge is said to be covered by a disk if
any point on that edge lies inside that disk. He proved NP-completeness results
for some special graphs. A similar study is made in [10], where a set of line
segments is given, the objective is to cover these segments with minimum number
of unit disks, where the covering of a segment by a disk is dened as in [9]. For
continuous version of the problem, they proposed a PTAS where the segments
are non-intersecting. For the discrete version, they showed that the problem is
APX-hard.
Our contributions: In Section 2, we show that the CCSUS-H1 problem is NP-
complete, and propose an O(n log n) time factor 3 approximation algorithm for
the CCSUS-HV1 problem. This improves the factor 6 approximation result of
Arkin et al. [2] while keeping the time complexity unchanged. We also provide
a PTAS for CCSUS-HV1 problem. For the CCSUS-ARB problem, we give an
O(n log n) time factor 6 approximation algorithm. In Section 3, give a polynomial
time factor 16 approximation algorithm for the DCSUS-ARB problem.

2 Continuous covering

In this version, the segments are given, and the objective is to place minimum
number of unit squares for covering at least one end-point of all the segments.

2.1 CCSUS-H1-US problem

Let S be a set of n horizontal unit segments inside a unit height horizontal strip.
Start with an empty set T  . Sort the segments in S from left to right with respect
to their right end-points. Repeat the following steps until all segments of S are
processed. In each step, select the left-most segment s among the uncovered
segments in S. Add a unit square t T  which is inside the strip aligning its
left boundary at r(s). Mark all the segments that are covered by t as processed.
Finally, return T  as the output. Thus, we have an O(n log n) time algorithm for
the CCSUS-H1-US problem.

2.2 CCSUS-H1 problem

We prove that CCSUS-H1 is NP-complete by using a reduction from the recti-


linear version of planar 3 SAT (RPSAT(3)) problem [8]. We also propose an
O(n log n)-time 2-approximation algorithm for this problem.
RPSAT(3) [8]: Given a 3 SAT instance with n variables and m clauses,
where the variables are positioned on a horizontal line and each clause containing
3 literals is formed with three vertical and one horizontal line segment. Each
clause is connected with its three variables either from above or from below such
4 A. Acharyya et al.

that no two line segments corresponding to two dierent clauses intersect. The
objective is to nd a satisfying assignment of . See Figure 1(a) for an instance
of RPSAT(3) problem. Here the solid (resp. dotted) vertical segment attached to
the horizontal line of a clause represents that the corresponding variable appears
as a positive (resp. negative) literal in that clause.

(a) (b)

(c)

Fig. 1. (a) RPSAT(3) representation. (b) Connection of a cycle and a chain. (c) Cycle
gadget for a variable xi .

We now describe the construction of an instance I of CCSUS-H1 problem from


an instance of RPSAT(3) problem. Let {x1 , x2 , . . . , xn } be n variables and
{C1 , C2 , . . . , Cm } be m clauses of . We describe the construction for the clauses
connecting to the variables from above. A similar construction can be done for
the clauses connecting to the variables from below.
Let d be the maximum number of vertical segments connected to every variable
from dierent clauses either from above or from below. Let, = 4d + 3. Each
variable gadget for xi may consist of a cycle and at most 2d chains. The cycle
consists of 2 unit horizontal segments {si1 , si2 , . . . , si2 } in two sides of a (dotted)
horizontal line (see Figure 1(c)). The segments {si1 , si2 , . . . , si } are above the
horizontal line and the segments {si+1 , si+2 , . . . , si2 } are below the horizontal
line. The chains correspond to the vertical segments connecting a variable xi
with the clauses containing it. There are three types of chains: (i) , (ii)
, and (iii) (see Figure 1(a)). The gadget corresponding to three types
of chains are shown in Figures 2(a), 2(b), and 2(c) respectively. The chains are
connected to the cycle, and together it forms a chain of big-cycle (see Figure
1(b)). It needs to be mentioned that the number of segments is not xed for every
chain, even for similar chains of dierent clauses. Note that, at the joining point
(to construct a big-cycle) we slightly perturb two unit segments little upward.
Covering Segments with Unit Squares 5

(a) (b)

(c) (d)

Fig. 2. Gadget for (a) type (i) chain, (b) type (ii) chain (c) type (iii) chain, and (d)
Demonstration of clause-segment s corresponding to the clause C = (xi xj xk );
shaded portions in (a), (b), (c) represent the connection of s with the variables in C .

Let 0, 1, 2, . . . , ( d) be the left to right order of the vertical segments


corresponding to the clauses which are connected to the gadget corresponding to
the variable xi . Consider the -th clause C in this order. If xi is a positive literal,
then the segments si3+4 and si3+4+1 are perturbed (moved upward as shown
using upward arrow in Figures 2(a), 2(b), 2(c)) to connect the corresponding
chain of C with the cycle of variable xi . Otherwise, if xi is a negative literal,
then the segments si3+4+1 and si3+4+2 are perturbed.
Note that, the squares are not given as a part of the input. In Figures 1(c), 2(a),
2(b), and 2(c) a possible set of unit squares are also depicted. Each square can
cover exactly two segments. Therefore, we have the following observation:

Observation 1 Exactly half of the squares (either all empty or all shaded) can
cover all the segments in the big-cycle corresponding to the variable xi . This
solution represents the truth value (empty for true and shaded for false) of the
corresponding variable xi .

Further, for the clause C , we take a single unit horizontal segment s that
connects the chain corresponding to three variables. This is referred to as a
clause-segment. The placement of s is shown in Figure 2(d). Note that, in
order to maintain the alternating empty and shaded vertical layers in a variable
6 A. Acharyya et al.

gadget we may need to reduce the distance between two consecutive vertical
layers of squares. But, the segments are placed suciently apart so that no
unit square can cover more than two segments from a variable gadget. As the
number of segments (Q) considering all variable gadgets, is even, we need exactly
Q
2 squares to cover them. Now, if a clause C is satisable then at least one square
connected to s will be chosen, and hence s will be covered; if C is not satisable
then the square adjacent to s of each variable chain will not be chosen in the
solution, and hence we need one more square to cover s (see Figure 2(d)). Thus,
we have the following result.

Lemma 1. The given RPSAT(3) formula is satisable if the number N of


squares needed to cover all the unit segments in the construction is exactly
N0 = 12 ( i=1 Qi ), where Qi is the number of squares in the big-cycle correspond-
n

ing to the gadget of variable xi . If the formula is not satisable then N > N0 ,

Clearly, (i) CCSUS-H1 problem is in NP, and (ii) number of squares and seg-
ments used in the reduction is polynomial in the the size of RPSAT(3) problem.

Theorem 1. CCSUS-H1 is NP-complete.

Approximation algorithm Let S be a set of n unit horizontal segments on


the plane. We rst partition the entire region into a set of  disjoint unit height
horizontal strips H1 , H2 , . . . , H . Let Si S be the set of segments in the strip
Hi , for i = 1, . . . , . Clearly, (i) Si Sj = , for i = j, and (ii) any unit square
cannot cover two segments, one from Si and the other from Sj where j i 2,
for i = 1, . . . ,  2, and j = 3, . . . , .
We calculate minimum number of unit squares covering Si using the algorithm
in Section 2.1. Let Qi be the set of squares returned by our algorithm. Let
Qodd = {Q1 Q3 . . .} and Qeven = {Q2 Q4 . . .} be the optimum solutions
for the segments in odd and even numbered strips respectively. We have Qodd
Qeven = , and we report Q = Qodd Qeven . Let OP T be a minimum sized
set of unit squares covering S. Now, |OP T | max(|Qodd |, |Qeven |). Thus, |Q| =
|Qodd | + |Qeven | 2|OP T |. Since Si Sj = for i = j, and computing Qi needs
O(|Si | log |Si |) time, the overall running time of the algorithm is O(n log n).

Theorem 2. A 2-factor approximation solution for the CCSUS-H1 problem can


be computed in O(n log n) time.

2.3 CCSUS-HV1 problem

Here, we have both horizontal and vertical segments in S which are of unit length.
An easy way to get a factor 4 approximation algorithm for this problem is as fol-
lows. Let S = SH SV , where SH and SV are the sets of horizontal and vertical
unit segments respectively. By Theorem 2, we already have a factor 2 approxima-
tion algorithm for covering the members in SH (resp. SV ). If QH and QV be the
Covering Segments with Unit Squares 7

(a) (b)

Fig. 3. (a) Placement of unit squares for a horizontal and vertical unit segment s.

set of squares returned by our algorithm for covering SH and SV respectively,


and OP TH and OP TV be the optimum solution for SH and SV respectively,
then |QH | + |QV | 2|OP TH | + 2|OP TV | 4|OP T |, where OP T be the overall
optimum solution for SH SV (since |OP T | max(|OP TH |, |OP TV |)).
We now propose a factor 3 approximation algorithm for this problem using a
sweep-line technique. During the execution of the algorithm, we maintain a set
of segments LB such that no two members in LB can be covered by one unit
square. Elements in LB form an independent set. For each segment in S we
maintain a f lag variable; its value is 1 or 0 depending on whether it is covered
or not by the chosen set of squares corresponding to the members in LB. We
also maintain a range tree T with the end-points of the members in S. Each
element in T has a pointer to the corresponding element in S.
Let OU T P U T be a set containing the chosen squares to cover the members in
LB. Initially, we set OU T P U T = . We sort the unit segments in S from top
to bottom with respect to their r(.) values. Next, we consider the elements in S
in order. For each segment s S, if its f lag bit is 0, then (i) if s is horizontal
then we dene three unit squares {t1 , t2 , t3 } (see Figure 3(a)), and (ii) if s is
vertical then we dene two unit squares {t1 , t2 } (see Figure 3(b)). Store s in LB
and the generated squares are put in OU T P U T , and for each newly generated
squares t, we search in the range tree T to identify the members in S covered
by t. The f lag bit of s and those members in S covered by t are set to 1. The
process continues until the ag bit of all the members in S are set to 1.

Theorem 3. The proposed algorithm produces a 3-factor approximation result


for the CHSUS-HV1 problem in O(n log n) time using O(n log n) space.

Polynomial time approximation scheme We propose a PTAS for the CCSUS-


HV1 problem using the shifting strategy of Hochbaum and Maass [7]. We are
given a set S of n horizontal and vertical unit segments. Enclose the segments
inside a integer length square box B; partition B into vertical strips of width
1, and also partition B into horizontal strips of height 1. We choose a constant
k Z+ , and dene a k-strip consisting of at most k consecutive strips. Now,
we dene the concept of shifts. We have k dierent shifts in the vertical di-
rection. Each vertical shift consists of some disjoint k-strips. In the i-th shift
(i = 0, 1, . . . , k 1), the rst k-strip consists of i unit vertical strips at extreme
8 A. Acharyya et al.

left, and then onwards each k-strip is formed with k consecutive unit vertical
strips except the last k-strip which may contain lesser than k vertical strips.
Similarly, k shifts are dened in horizontal direction. Now consider shift(i, j)
as the i-th vertical shift and j-th horizontal shift. This splits the box B into
rectangular cells of size at most k k. The following observation is important
to analyze the complexity of our algorithm.

Observation 2 There exists an optimal solution that contains squares such that
two boundaries of each square is attached to an end-point(s) of some segments.
2
Lemma 2. Finding a feasible solution for each shif t(i, j) requires O(n2k ) time.

In our algorithm, for each shif t(i, j) we calculate optimal solution in each cell
and combine them to get a feasible solution. Finally, return the minimum among
these k 2 feasible solutions.
Let OP T be an optimum set of unit squares covering S, and Q be a feasible so-
lution returned by our algorithm described above. Following the proof technique
of Lemma 2.1 of [7], we can prove the following theorem.

Theorem 4. |Q| (1 + k1 )2 |OP T | and the running time of the above algorithm
2
is O(k 2 n2k ).

2.4 CCSUS-ARB problem

Here, we rst design a 8-approximation algorithm for CCSUS-ARB problem as


follows. Next, we improve the approximation factor to 6.

Observation 3 Let s1 and s2 be two segments in S. If neither of the squares


t(l(s1 ), 2) and t(r(s1 ), 2) covers s2 , then s1 and s2 are independent.

Here also we start with an empty set OU T P U T and LB, and each segment in S
is attached with a ag bit. We maintain a range tree T with the end-points of the
members in S. Each time, an arbitrary segment s S with f lag(s) = 0 is chosen,
and inserted in LB. Its ag bit is set to 1. Insert four unit squares {t1 , t2 , t3 , t4 }
which fully cover the square t(l(s), 2) and four unit squares {t1 , t2 , t3 , t4 } which
fully cover the square t(r(s), 2) in OU T P U T . Remove all the segments in S that
are covered by {t1 , t2 , t3 , t4 , t1 , t2 , t3 , t4 } by performing range searching in T as
stated in Section 2.3. The end-points of the deleted segments are also deleted
from T . This process is repeated until all the members in S are agged. Finally,
return the set OU T P U T . Observation 3 suggests the following result.

Lemma 3. The above algorithm for CCSUS-ARB problem runs in O(n log n)
time, and the produced solution is factor 8 approximation of the optimal solution.

We now improve the approximation factor to 6 using a sweep-line technique


introduced in Biniaz et al. [4]. We sort the segments in S with respect to their
Covering Segments with Unit Squares 9

left end-points1 , and process the elements in S in order. When an element s S


is processed, if f lag(s) = 0 then we put six squares, two of them covering the
1 2 rectangle t1 = right-half of t(l(s), 2) and four of them covering the 2 2
square t2 = t(r(s), 2). We also identify the segments in S that are covered by t1
and t2 , and their ag bit is set to 1. Thus, we have the following result:
Theorem 5. The above algorithm for the CCSUS-ARB problem produces a fac-
tor 6 approximation result in O(n log n) time.

3 Discrete covering: DCSUS-ARB problem


In this section, we give a 16 factor approximation algorithm for DCSUS-ARB
problem. We use the following problem to solve the DCSUS-ARB problem.
DCPUS Problem: Given a point set P in IR2 and a set T of unit squares, nd
a subset of T of minimum cardinality to cover all the points in P .
For an ILP Zw , the corresponding LP is denoted by Zw . We denote OP TwI and
OP TwF as the value of the optimal solution for Zw and Zw respectively.
Lemma 4. If there exists an LP-based factor approximation algorithm for the
DCPUS problem, then there exists a LP-based factor 2 approximation result for
the DCSUS-ARB problem.

Proof. Let T1 T (resp. T2 T ) be the set of all squares which cover the left
(resp. right) end-points of the segments in S. Consider binary variable xi for
each square ti T1 , and yj for each square tj T2 . Create an ILP as follows.

 
Z0 : min xi + yj
i|ti T1 j|tj T2
 
s.t. xi + yj 1 k | sk S; xi , yj {0, 1} i | ti T1 & j | tj T2
i|l(sk )ti T1 j|r(sk )tj T2

In the solution of Z0 , xi = 1 or 0 (resp. yj = 1 or 0) depending on whether the


square ti T1 (resp. tj T2 ) is in an optimal solution or not. We solve the
corresponding LP , Z0 . Create two partitions: S1 S with those segments sk
such that i|l(sk )ti T1 xi 1/2, and S2 S with those segments s for which

j|r(s )tj T2 yi 1/2. Now, consider the following two ILP s Z1 and Z2 .

 
Z1 : min xi Z2 : min yj
i|ti T1 j|tj T2
 
s.t. xi 1, k | sk S1 s.t. yj 1, k | sk S2
i|l(sk )ti T1 j|r(sk )tj T2

xi {0, 1} i | ti T1 yj {0, 1} j | tj T 2
1
The left end-point of a vertical segment is dened as its top end-point.
10 A. Acharyya et al.

By an analysis identical to Gaur et al. [6], we conclude that OP T1F + OP T2F


2OP T0F 2OP T0I .

Observe that, both the ILP s, Z1 and Z2 are the problems of covering points by
unit squares. We consider the problem Z1 , and use a multilevel LP relaxation
(see Theorem 6 stated below) to have a factor 8 approximation algorithm for the
DCPUS problem. It consists of 3 steps of LP relaxations. In each step, we use
linear programming to partition the considered points into two disjoint subsets,
and nally we reach to the Restricted-Point-Cover problem, as follows.
Restricted-Point-Cover : Given a point set P in IR2 above the x-axis and
a set R of unit width (x-span) rectangles such that bottom boundary of each
rectangle in R coincides with x-axis, nd a subset of R of minimum size to cover
all the points in P .

Lemma 5. For the standard ILP formulation of the Restricted-Point-Cover


I F
problem ZRP C , if OP TRP C and OP TRP C are the optimum solutions of ZRP C
C 2OP TRP C .
I F
and its LP-relaxation respectively, then OP TRP

C OP TRP C
I F
In Section 3.2 of [3], Bansal and Pruhs showed that OP TRP
for some positive constant for a more generic version of this problem. In our
simplied case 2 for the proof of Lemma 5).
Chan et al. [5] proposed an O(1)-approximation algorithm for the DCPUS prob-
lem using quasi-uniform sampling. Thus using Lemma 4, we have an O(1) ap-
proximation for our DCSUS-ARB problem. However, the following theorem says
that one can get a factor 8 approximation algorithm for the DCPUS problem.

Theorem 6. For the standard ILP formulation of the DCPUS problem Z1 with
a set of points P1 and a set of unit squares T1 , if OP T1I and OP T1F are the op-
timum solutions of Z1 and its LP-relaxation respectively, then OP T1I 8OP T1F .

Proof. It consists of three steps as follows:


Step 1: Divide the plane into unit strips by drawing horizontal lines. No unit
square in T1 can intersect more than one line. Partition T1 into two sets T11 and
T12 , where T11 (resp. T12 ) consists of all squares which intersect even (resp. odd)
indexed lines. Dene binary variables xi for ti T11 and yj for tj T12 . Then,
Z1 is equivalent to the following ILP .

 
Z1 : min xi + yj
i|ti T11 j|tj T12
 
s.t. xi + yj 1 p P1 ; xi , yj {0, 1} i | ti T11 & j | tj T12
i|pti T11 j|ptj T12

create two subsets P11 , P12 P1 . P11 consists of those points


We solve Z1 . Now,
p P1 such that i|pti T11 xi 1/2, and P12 consists of those points p P1 for

which j|ptj T12 yi 1/2. Again consider two ILP s, Z11 and Z12 as follows.
Covering Segments with Unit Squares 11

 
Z11 : min xi Z12 : min yj
i|ti T11 j|tj T12
 
s.t. xi 1, p P11 s.t. yj 1, p P12
i|pti T11 j|ptj T12

xi {0, 1} i | ti T11 yj {0, 1} j | tj T12


By an analysis identical to Gaur et al. [6], we have OP T11 F
+ OP T12F
2OP T1F .
Step 2: In step 1, there are two ILP s, Z11 and Z12 corresponding to Z1 . Observe
that, Z11 (resp. Z12 ) is the problem of covering the points of P11 P1 (resp.
P12 P1 ) by those unit squares which intersect even (resp. odd) indexed lines.
Now, focus our attention on Z11 . Since the subset of points covered by the squares
intersected by two dierent even indexed lines i and j (i = j) are disjoint, we
can split Z11 into dierent ILPs corresponding to each even indexed line, which
can be independently solved.
Consider Z11 corresponding to the line  ( is even). Let P11
be the set of points

which are to be covered by the set of squares T11 , intersected by  . We split

P11 into disjoint sets P111 and P112 ; P111 (resp. P112 ) are the set of points which

are above (resp. below)  . The objective is to cover the members of P111 (resp.

P112 ) by minimum number of squares. Thus, the ILP Z11 can be written as,


Z11 : min xi

i|ti T11


s.t. xi 1 p P111 , and xi 1 p P112

i|pti T11 i|pti T11

xi {0, 1} i | ti T11

Again, since the sets P111 and P112 are disjoint, we may consider the following

two ILP s, Z111 and Z112 as follows.
 
Z111 : min xi Z112 : min xi

i|ti T11 i|ti T11


s.t. xi 1 p P111 s.t. xi 1 p P112

i|pti T11 i|pti T11

xi {0, 1} i | ti T11 xi {0, 1} i | ti T11
 be an optimal fractional solution of Z11 . Clearly, x
Let x  satises all the con-
F F
straints in both Z111 and Z112 . Also, it is observe that OP T111 OP T11 and
F F F F F
OP T112 OP T11 . Combining, we conclude that OP T111 +OP T112 2OP T11 .
A similar equation can be shown for Z12 as follows: OP T121
F F
+OP T122 F
2OP T12 .
Finally, we have the following four equations,
12 A. Acharyya et al.
 F  F  F
1. OP T111 + even OP T112 2 even OP T11 2OP T11
F
,
 even F  F  F
odd OP T122 2 odd OP T12 2OP T12 ,
F
2. odd OP T121 +

Step 3: In this step we apply Lemma 5 independently on each of Z111 , Z112 , where
is even, and Z121 , Z122 where is odd to get the following four equations.
I F I F
(i) OP T111 2OP T111 , (ii) OP T112 2OP T112 ,
I F I F
(iii) OP T121 2OP T121 , (iv) OP T122 2OP T122 .

Now combining all the inequalities of Step 3, we have


 I  I  I  I
even OP T111 +
 even OP T112 + odd OP T121 + odd OP T122 
F  F  F  F
2 even OP T 111 + even OP T 112 + odd OP T121 + odd OP T 122
8 OP T0I , by applying the inequalities in Steps 3, 2 and 1 in this order.

Lemma 4 and Theorem 6 lead to the following theorem.

Theorem 7. There exists a factor 16 approximation algorithm for DCSUS-


ARB problem that runs in polynomial time.

References
1. E. M. Arkin, A. Banik, P. Carmi, G. Citovsky, M. J. Katz, J. S. B. Mitchell, and
M. Simakov. Choice is hard. In ISAAC, pages 318328, 2015.
2. E. M. Arkin, A. Banik, P. Carmi, G. Citovsky, M. J. Katz, J. S. B. Mitchell, and
M. Simakov. Conict-free covering. In CCCG, 2015.
3. N. Bansal and K. Pruhs. The geometry of scheduling. SIAM J. Comput.,
43(5):16841698, 2014.
4. A. Biniaz, P. Liu, A. Maheshwari, and M. Smid. Approximation algorithms for the
unit disk cover problem in 2D and 3D. Computational Geometry, 60:818, 2016.
5. T. M. Chan, E. Grant, J. Konemann and M. Sharpe. Weighted capacited, priority,
and geometric set cover via improved quasi-uniform sampling In SODA, Pages
15761585, 2012.
6. D. R. Gaur, T. Ibaraki, and R. Krishnamurti. Constant ratio approximation algo-
rithms for the rectangle stabbing problem and the rectilinear partitioning problem.
Journal of Algorithms, 43(1):138152, 2002.
7. D. S. Hochbaum and W. Maass. Approximation schemes for covering and packing
problems in image processing and VLSI. J. ACM, 32(1):130136, January 1985.
8. D. E. Knuth and A. Raghunathan. The problem of compatible representatives.
SIAM Journal on Discrete Mathematics, 5(3):422427, 1992.
9. K. Kobylkin. Computational complexity of guarding of proximity graphs. CoRR,
abs/1605.00313, 2016.
10. R. R. Madireddy and A. Mudgal. Stabbing line segments with disks and related
problems. In CCCG, 2016.
Replica Placement on Bounded Treewidth
Graphs

Anshul Aggarwal1 , Venkatesan T. Chakaravarthy2 , Neelima Gupta1 , Yogish


Sabharwal2 , Sachin Sharma1 , and Sonika Thakral1
1
University of Delhi, India [email protected], [email protected]
2
IBM Research, India {vechakra,ysabharwal}@in.ibm.com

Abstract. We consider the replica placement problem: given a graph


and a set of clients, place replicas on a minimum set of nodes of the
graph to serve all the clients; each client is associated with a request and
maximum distance that it can travel to get served; there is a maximum
limit (capacity) on the amount of request a replica can serve. The prob-
lem falls under the general framework of capacitated set cover. It admits
an O(log n)-approximation and it is NP-hard to approximate within a
factor of o(log n). We study the problem in terms of the treewidth t of
the graph and present an O(t)-approximation algorithm.

1 Introduction
We study a form of capacitated set cover problem [5] called replica placement
(RP) that nds applications in settings such as data distribution by internet
service providers (ISPs) and video on demand service delivery (e.g., [6, 8]). In
this problem, we are given a graph representing a network of servers and a set
of clients. The clients are connected to the network by attaching each client to
a specic server. The clients need access to a database. We wish to serve the
clients by placing replicas (copies) of the database on a selected set of servers
and clients. While the selected clients get served by the dedicated replicas (i.e.,
cached copies) placed on themselves, we serve the other clients by assigning
them to the replicas on the servers. The assignments must be done taking into
account Quality of Service (QoS) and capacity constraints. The QoS constraint
stipulates a maximum distance between each client and the replica serving it.
The clients may have dierent demands (the volume of database requests they
make) and the capacity constraint species the maximum demand that a replica
can handle. The objective is to minimize the number of replicas opened. The
problem can be formally dened as follows.
Problem Denition (RP): The input consists of a graph G = (V, E), a set
of clients A and a capacity W . Each client a is attached to a node u V, denoted
att(a). For each client a A, the input species a request r(a) and a distance
dmax (a). For a client a A and a node u V, let d(a, u) denote the length
of the shortest path between u and att(a), the node to which a is attached

Corresponding author

Springer International Publishing AG 2017 13


F. Ellen et al. (Eds.): WADS 2017, LNCS 10389, pp. 1324, 2017.
DOI: 10.1007/978-3-319-62127-2_2
14 A. Aggarwal et al.

- the length is measured by the number of edges and we take d(a, u) = 0, if


u = att(a). We say that a client a A can access a node u V, if d(a, u)
is at most dmax (a). A feasible solution consists of two parts: (i) it identies a
subset of nodes S V where a replica is placed at each node in S; (ii) for each
client a A, it either opens a dedicated replica at a itself for serving the clients
request or assigns the request to the replica at some node u S accessible to
a. The solution must satisfy the constraint that for each node u S, the sum
of requests assigned to the replica at u does not exceed W . The cost of the
solution is the number of replicas opened, i.e., cardinality of S plus the number
of dedicated replicas opened at the clients. The goal is to compute a solution
of minimum cost. In order to ensure feasibility, without loss of generality, we
assume r(a) W , a A.

The RP problem falls under the framework of the capacitated set cover prob-
lem, the generalization of the classical set cover problem wherein each set is
associated with a capacity specifying the number of elements it can cover. The
latter problem is known to have an O(log n)-approximation algorithm [5]. Using
the above result, we can derive an O(log n)-approximation algorithm for the RP
problem as well. On the other hand, we can easily reduce the classical dominat-
ing set problem to RP: given a graph representing an instance of the dominating
set problem, we create a new client for each vertex and attach it to the vertex;
then, we set dmax () = 1 for all the clients and W = . Since it is NP-hard to
approximate the dominating set problem within a factor of o(log n) [7], by the
above reduction, we get the same hardness result for the RP problem as well.
The RP problem is NP-hard even on the highly restricted special case where
the graph is simply a path, as can be seen via the following reduction from the
bin packing problem. Given K bins of capacity W and a set of items of sizes
s1 , s2 , . . . , sn , for each item i, we create a client a with demand r(a) = si . We
then construct a path of nodes of length K and attach all the clients to one end
of the path and take W to be the capacity of the nodes.
Prior Results: Prior work has studied a variant of the RP problem where
the network is a directed acyclic graph (DAG), and a client a can access a node
u only if there is a directed path from a to u of the length at most dmax (a).
Under this setting, Benoit et al. [3] considered the special case of rooted trees
and presented a greedy algorithm with an approximation ratio of O(), where
is the maximum degree of the tree. For the same problem, Arora et al. [2]
(overlapping set of authors) devised a constant factor approximation algorithm
via LP rounding.
Progress has been made on generalizing the above result to the case of
bounded treewidth DAGs. Recall that treewidth [4] is a classical parameter
used for measuring how close a given graph is to being a tree. For a DAG,
the treewidth refers to the treewidth t of the underlying undirected graph. No-
tice that the reduction from the bin-packing problem shows that the problem is
NP-hard even for trees (i.e., t = 1) and rules out the possibility of designing an
exact algorithm running in time nO(t) (say via dynamic programming) or FPT
algorithms with parameter t.
Replica Placement on Bounded Treewidth Graphs 15

Arora et al. [1] made progress towards handling DAGs of bounded treewidth
and designed an algorithm for the case of bounded-degree, bounded-treewidth
graphs. Their algorithm achieves an approximation ratio of O( + t), where
is the maximum degree and t is the treewidth of the DAG. Their result also ex-
tends for networks comprising of bounded-degree bounded-treewidth subgraphs
connected in a tree like fashion.
Our Result and Discussion: We study the RP problem on undirected
graphs of bounded treewidth. Our main result is an O(t)-approximation algo-
rithm running in polynomial time (the polynomial is independent of t and the
approximation guarantee). In contrast to prior work, the approximation ratio
depends only on the treewidth and is independent of parameters such as the
maximum degree.
Our algorithm is based on rounding solutions to a natural LP formulation, as
in the case of prior work [2, 1]. However, the prior algorithms exploit the acyclic
nature of the graphs and the bounded degree assumption to transform a given
LP solution to a solution wherein each client is assigned to at most two replicas.
In other words, they reduce the problem to a capacitated vertex cover setting,
for which constant factor rounding algorithms are known [10].
The above reduction does not extend to the case of general bounded treewidth
graphs. Our algorithm is based on an entirely dierent approach. We introduce
the notion of clustered solutions, wherein the partially open nodes are grouped
into clusters and each client gets served only within a cluster. We show how
to transform a given LP solution to a new solution in which a partially-open
node participates in at most (t + 1) clusters. This allows us to derive an overall
approximation ratio O(t). The notion of clustered solutions may be applicable
in other capacitated set cover settings as well.
Other Related Work: The RP problem falls under the framework of the
capacitated set cover problem (CSC), which admits an O(log n)-approximation
[5]. Two versions of the CSC problem have been studied: soft capacity and hard
capacity settings. Our work falls under the more challenging hard capacity set-
ting, wherein a set can be picked at most once. The capacitated versions of the
vertex cover problem (e.g., [10]) and dominating set problem (e.g., [9]) have also
been studied. Our result applies to the capacitated dominating problem with
uniform capacities and yields O(t)-approximation.
Full Version: Due to space constraints, some of the proofs and details of
analysis could not be included in this version. A full version of the paper is
available as an Arxiv preprint (https://arxiv.org/abs/1705.00145).

2 Overview of the Algorithm

Our O(t)-approximation algorithm is based on rounding solution to a natural LP


formulation. In this section, we present an outline of the algorithm highlighting
its main features, deferring a detailed description to subsequent sections. We
assume that the input includes a decomposition T of treewidth t of the input
network G = (V, E).
16 A. Aggarwal et al.

LP Formulation: For each node u V, we introduce a variable y(u) to


represent the extent to which a replica is opened at u and similarly, for each
client a A, we add a variable y(a) to represent the extent to which a dedicated
replica is opened at a itself. For each client a A and each node u V accessible
to a, we use a variable x(a, u) to represent the extent to which a is assigned to
u. For a client a A and a node u V, we use the shorthand a u to mean
that a can access u.
 
min y(a) + y(u)
aA uV

y(a) + x(a, u) 1 for all a A (1)
uV : au

x(a, u) r(a) y(u) W for all u V (2)
aA : au
x(a, u) y(u) for all a A and u V with a u (3)
0 y(u), y(a) 1 for all u V and a A (4)

Constraint (3) stipulates that a client a cannot be serviced at a node u for an


amount exceeding the extent to which u is open. For an LP solution = x, y,
let cost() denote the objective value of .
The following simple notations will be useful in our discussion. With respect
to an LP solution , we classify the nodes into three categories based on the
extent to which they are open. A node u is said to be fully-open, if y(u) = 1;
partially-open, if 0 < y(u) < 1; and fully-closed, if y(u) = 0. A client a is said to
be assigned to a node u, if x(a, u) > 0. For a set of nodes U , let y(U ) denote the
extent to which the vertices in U are open, i.e., y(U ) = uU y(u).
Outline: The major part of the rounding procedure involves transforming
a given LP solution in = xin , yin  into an integrally open solution: wherein
which each node u V is either fully open or closed. Such a solution diers
from an integral solution as a client may be assigned to multiple nodes (possibly
to its own dedicated replica as well). We address the issue easily via a cycle
cancellation procedure to get an integral solution.
The procedure for obtaining an integrally open solution works in two stages.
First it transforms the input solution into a clustered solution, which is then
transformed into an integrally open solution. The notion of clustered solution
lies at the heart of the rounding algorithm. Intuitively, in a clustered solution,
the set of partially open (and closed) nodes are partitioned into a collection of
clusters C and the clients can be partitioned into a set of corresponding groups
satisfying three useful properties, as discussed below.
Let = x, y be an LP solution. It will be convenient to express the three
properties using the notion of linkage: we say that a node u is linked to a node
v, if there exists a client a assigned to both u and v. For constants and , the
solution is said to be (, )-clustered, if the set of partially-open nodes can be
partitioned into a collection of clusters, C = {C1 , C2 , . . . , Ck } (for some k), such
that the the following properties are true:
Replica Placement on Bounded Treewidth Graphs 17

(a) (b)

Fig. 1. (a) Illustration for clustered solution. Three clusters are shown C1 , C2 and C3 ,
open to an extent of 0.4, 0.4 and 0.5; the clusters are linked to the sets of fully-open
nodes {v1 , v2 , v4 }, {v1 , v2 , v3 , v4 }, and {v2 , v4 , v5 , v6 }. The solution is (0.5, 4)-clustered.
(b) Illustration for regions. The gure shows an example tree decomposition. The bags
lled solidly represent already identied boundary bags. All checkered bags belong to
the region headed by P .

Localization: assignments from clients to the partially-open nodes is local-


ized, i.e., two partially-open nodes are linked only if they belong to the same
cluster.
Distributivity: assignments from the clients to fully-open nodes are restricted,
i.e., for any Cj , there are at most  fully-open nodes that are linked to the
nodes in Cj .
Bounded opening: clusters are tiny, i.e., the total extent to which any cluster
is open is at most , i.e., y(Cj ) < .
Figure 1 (a) provides an illustration. In the rst stage of the rounding algorithm,
we transform the input solution in into an (, t + 1)-clustered solution with the
additional guarantee that the number of clusters is at most a constant factor of
cost(in ), where [0, 1/2] is a tunable parameter. The lemma below species
the transformation performed by the rst stage.

Lemma 1. Fix any constant 1/2. Any LP solution can be transformed


into a (, t + 1)-clustered solution  such that cost(  ) is at most 2 + 6(t +
1)cost()/. Furthermore, the number of clusters is at most 3 + 8 cost()/.

At a high level, the lemma is proved by considering the tree decomposition


T of the input graph G = (V, E) and performing a bottom-up traversal that
identies a suitable set of boundary bags. We use these boundary bags to split
the tree into a set of disjoint regions and create one cluster per region. We
then fully open the nodes in the boundary bags and transfer assignments from
the nodes that stay partially-open to these fully-open nodes. The transfer of
assignments is performed in such a manner that clusters get localized and have
distributivity of (t+1). By carefully selecting the boundary bags, we shall enforce
that each cluster is open to an extent of only and that the number of clusters
is also bounded. The proof is discussed in Section 3.
The goal of the second stage is to transform a (1/4, t + 1)-clustered solution
(obtained from Lemma 1) into an integrally open solution. At a high level, the
18 A. Aggarwal et al.

localization property allows us to independently process each cluster C C


and its corresponding group of clients A. The clients in A are assigned to a
set of fully-open nodes, say F . For each node u F , we identify a suitable
node v C called the consort of u C and fully open v. Then the idea is
to transfer assignments from the non-consort nodes to the nodes in F and their
consorts in such a manner that at the end, no client is assigned to the non-consort
nodes. This allows us to fully close the non-consort nodes. The localization and
bounded opening properties facilitate the above maneuver. On the other hand,
the distributivity property ensures that F is at most (t + 1). This means that
we fully open at most (t + 1) consorts per cluster. Thus, overall increase in cost
is at most (t + 1)|C|. Since |C| is guaranteed to be linear in cost(in ), we get an
O(t) approximation factor.
Lemma 2. Let = x, y be a (1/4, t + 1)-clustered solution via a collection
of clusters C. The solution can be transformed into an integrally open solution
 = x , y   such that cost(  ) 2 cost() + 2(t + 1)|C|.
Once we obtain an integrally open solution, it can be transformed to an inte-
gral solution by applying a cycle cancellation strategy, as given by the following
lemma.
Lemma 3. Any integrally open solution = x, y can be transformed to an
integral solution  = x , y   such that cost(  ) 4 cost().
We can transform any input LP solution in into an integral solution out by
applying the above three transformations leading to the following main result of
the paper: the RP problem admits on O(t)-approximation poly-time algorithm.

3 Clustered Solutions: Proof of Lemma 1


The goal is to transform a given solution into an (, t+1)-clustered solution with
the properties claimed in the lemma. The idea is to select a set of partially-open
or closed nodes and open them fully, and then transfer assignments from the
other partially-open nodes to them in such a manner that the partially-open
nodes get partitioned into clusters satisfying the three properties of clustered
solutions. An issue in executing the above plan is that the capacity at a newly
opened node may be exceeded during the transfer. We circumvent the issue by
rst performing a pre-processing step called de-capacitation.

3.1 De-capacitation
Consider an LP solution = x, y and let u be a partially-open or closed node.
The clients that can access u might have been assigned to other partially-open
nodes under . We call the node u de-capacitated, if even when all the above
assignments are transferred to u, the capacity at u is not exceeded; meaning,
 
x(a, v) < W,
au v: av vPO
Replica Placement on Bounded Treewidth Graphs 19

For each partially-open node v (considered in an arbitrary order)


For each client a that can access both u and v (considered
 in an arbitrary order)
Compute capacity available at u: cap(u) = W bA : bu x(b, u) r(b)
If cap(u)= 0 exit the procedure

cap(u)
= min x(a, v), r(a)
Increment x(a, u) by and decrement x(a, v) by .

Fig. 2. Pulling procedure for a given partially-open or closed node u.

where PO is the set of partially-open nodes under (including u). The solution
is said to be de-capacitated, if all the partially-open and the closed nodes are
de-capacitated.
The preprocessing step transforms the input solution into a de-capacitated
solution by performing a pulling procedure on the partially-open and closed
nodes. Given a partially-open or closed node u, the procedure transfers assign-
ments from other partially-open nodes to u, as long as the capacity at u is not
violated. The procedure is shown in Figure 2, which we make use of in other
components of the algorithm as well.

Lemma 4. Any LP solution = x, y can be transformed into a de-capacitated


solution  = x , y   such that cost(  ) 2 cost().

Proof. We consider the partially-open and closed nodes, and process them in
an arbitrary order, as follows. Let u be a partially-open or closed node. Hy-
pothetically, consider applying the pulling procedure on u. The procedure may
terminate in one of two ways: (i) it exits mid-way because of reaching the ca-
pacity limit; (ii) the process executes in its entirety. In the former case, we fully
open u and perform the pulling procedure on u. In the latter case, the node u
is de-capacitated and so, we leave it as partially-open or closed, without per-
forming the pulling procedure. It is clear that the above method produces a
de-capacitated solution  . We next analyze the cost of  . Let s be the num-
ber of partially-open or closed nodes converted to be fully-open. Apart from
these conversions, the method does not alter the cost and  so, cost(  ) is at most
s + cost(). Let the total amount of requests be rtot = aA r(a). The extra
cost s is at most rtot /W , since any newly opened node is lled to its capacity.
Due to the capacity constraints, the input solution must also incur a cost of
at least rtot /W . It follows that cost(  ) is at most 2 cost().

3.2 Clustering

Given Lemma 4, assume that we have a de-capacitated solution = x, y.


We next discuss how to transform into an (, t + 1)-clustered solution. The
transformation would perform a bottom-up traversal of the tree decomposition
and identify a set of partially-open or closed nodes. It would then fully open
20 A. Aggarwal et al.

them and perform the pulling procedure on these nodes. The advantage is that
the above nodes are de-capacitated and so, the pulling procedure would run to its
entirety (without having to exit mid-way because of reaching capacity limits).
As a consequence, the linkage between the nodes gets restricted, leading to a
clustered solution. Below we rst describe the transformation and then present
an analysis.
Transformation: Consider the given tree decomposition T . We select an
arbitrary bag of T and make it the root. A bag P is said to be an ancestor of a
bag Q, if P lies on the path connecting Q and the root; in this case, Q is called a
descendant of P . We consider P to be both an ancestor and descendant of itself.
A node u may occur in multiple bags; among these bags the one closest to the
root is called the anchor of u and it is denoted anchor(u). A region in T refers
to any set of contiguous bags (i.e., the set of bags induce a connected sub-tree).
In transforming into a clustered solution, we shall encounter three types
of nodes and it will be convenient to color them as red, blue and brown. To
start with, all the fully-open nodes are colored red and the remaining nodes
(partially-open nodes and closed nodes) are colored blue. The idea is to carefully
select a set of blue nodes, fully-open them and perform the pulling procedure on
these nodes; these nodes are then colored brown. Thus, while the blue nodes are
partially-open or closed, the red and the brown nodes are fully-open, with the
brown and blue nodes being de-capacitated.
The transformation identies two kinds of nodes to be colored brown: helpers
and boundary nodes. We say that a red node u V is proper, if it has at least
one neighbor v V which is a blue node. For each such proper red node u, we
arbitrarily select one such blue neighbor v V and declare it to be the helper
of u. Multiple red nodes are allowed to share the same helper. Once the helpers
have been identied, we color them all brown. The boundary brown nodes are
selected via a more involved bottom-up traversal of T that works by identifying
a set B of bags, called the boundary bags. To start with, B is initialized to be
the empty set. We arrange the bags in T in any bottom-up order (i.e., a bag
gets listed only after all its children are listed) and then iteratively process each
bag P as per the above order. Consider a bag P . We dene the region headed
by P , denoted Region(P ), to be the set of bags Q such that Q is a descendant
of P , but not the descendant of any bag already in B. See Figure 1 (b) for an
illustration. A blue node u is said to be active at P , if it occurs in some bag
included in Region(P ). Let active(P ) denote the set of blue nodes active at P .
We declare P to be a boundary bag and add it to B under three scenarios: (i) P
is the root bag. (ii) P is the anchor of some red node.(iii) the extent to which
the nodes in active(P ) are open is at least , i.e., uactive(P ) y(u) . If
P is identied as a boundary bag, then we select all the blue nodes appearing
in the bag and change their color to be brown. Once the bottom-up traversal
is completed, we have a set of brown nodes (helpers and boundary nodes). We
consider these nodes in any arbitrary order, open them fully, and perform the
pulling procedure on them. We take  to be the solution obtained by the above
process. This completes the construction of  . We note that a node may change
Replica Placement on Bounded Treewidth Graphs 21

its color from blue to brown in the above process, and the new color is to be
considered while determining the active sets thereafter. Notice that during the
whole process of the above transformation, the solution continues to remain
de-capacitated.
Analysis: We now show that  is an (, t + 1)-clustered solution. To start
with, we have a set of red nodes that are fully-open and a set of blue nodes that
are either partially-open or closed under . The red nodes do not change color
during the transformation. On the other hand, each blue node u becomes active
at some boundary bag P . If u occurs in the bag P , it changes its color to brown,
otherwise it stays blue. Thus, the transformation partitions the set of originally
blue nodes into a set of brown nodes and a set of nodes that stay blue. In the
following discussion, we shall use the term blue to refer to the nodes that stay
blue. With respect to the solution  , the red and brown nodes are fully-open,
whereas the blue nodes are partially-open or closed.
Recall that with respect to  , two nodes u and v are linked, if there is a
client a assigned to both u and v. In order to prove the properties of (, t + 1)-
clustering, we need to analyze the linkage information for the blue nodes. We
rst show that the blue nodes cannot be linked to brown nodes, by proving the
following stronger observation.

Proposition 1. If a client a A is assigned to a blue node u under  , then a


cannot access any brown node v.

Proposition 1 rules out the possibility of a blue node u being linked to any
brown node. Thus, u may be linked to a red node or another blue node. The
following lemma establishes a crucial property on the connectivity in these two
settings.

Lemma 5. (a) If two blue nodes u and v are linked under  , then there must
exist a path connecting u and v consisting of only blue nodes. (b) If a blue node
u is linked to a red node v under  , then there must exist a path p connecting u
and v such that barring v, the path consists of only blue nodes.

The transformation outputs a set of boundary bags B; let B denote the set
of non-boundary bags. If we treat the bags in B as cut-vertices and delete them
from T , the tree splits into a collection R of disjoint regions. Alternatively, these
regions can be identied in the following manner. For each bag P B and each
of its non-boundary child Q B, add the region headed by Q (Region(Q)) to
the collection R. Let the collection derived be R = {R1 , R2 , . . . , Rk }. It is easy
to see that R partitions B and that the regions in R are pairwise disconnected
(not connected by edges of the tree decomposition).
In order to show that  is an (, t + 1)-clustered solution, let us suitably
partition the set of blue nodes into a collection of clusters C. For each region Rj ,
let Cj be the set of partially-open nodes that occur in some bag of Rj . We take
C to be the collection {C1 , C2 , . . . , Ck }. It can be veried that the collection C
is a partitioning of the set of partially-open nodes. Based on Lemma 5 we can
establish the following result.
22 A. Aggarwal et al.

Lemma 6. The solution  is (, t + 1)-clustered.


We next analyze the cost of the solution  = x , y  . Let Red, Blue and
Brown denote the set of red, brown and blue nodes, respectively. We can see that
in constructing  the brown nodes are the only new nodes opened fully and
hence, cost(  ) cost() + |Brown|. We create a brown helper node for each red
node and furthermore, for each boundary bag P B, we convert all the blue
nodes in P to be brown and the number of blue nodes per bag is at most (t + 1).
Thus, the number of brown nodes is at most |Red| + (t + 1)|B|. A bag P is made
into a boundary bag under one of the three scenarios: (i) P is the root bag; (ii)
P is the anchor of some red node; (iii) the total extent to which the nodes in
active(P ) are open is at least . The number of boundary bags of the rst two
types are 1 + |Red| and those of the third type can be (1/) times the extent to
which the blue nodes are open, which is in turn, at most cost(). Using the above
arguments, we can show that |B| is at most 2 + |Red| + cost()/ and cost(  ) is
at most 2 + 3(t + 1)cost()/. The preprocessing step of de-capacitation incurs a
2-factor increase in cost. Taking this into account, we get the cost bound claimed
in the statement of Lemma 1.
As mentioned earlier, an issue with the collection C is that it may have
more clusters than the bound claimed in Lemma 1. The issue can be resolved
as follows. Consider each boundary bag P . All the non-boundary children of
P have a corresponding cluster in C and let CP denote the collection of these
clusters. We merge any two clusters C, C  from CP having y(C), y(C  ) /2.
The process is stopped when we cannot nd two such clusters.
It can be shown that the process of merging does not aect distributivity
and the total number of clusters in the transformed solution is at most 3 +
4cost()/. The preprocessing step of de-capacitation incurs a 2-factor increase
in cost. Taking this into account, we get the bound on number of clusters claimed
in the statement of Lemma 1.

4 Integrally Open Solution: Proof of Lemma 2


Our goal is to transform a given (1/4, t + 1)-clustered solution = x, y into
an integrally open solution  . We classify the clients into two groups, small and
large, based on the extent to which they are served by dedicated replicas: a client
a A said to be small, if y(a) 1/2, and it is said to be large otherwise. Let
As and Al denote the set of small and large clients, respectively.
We pre-process the solution by opening a dedicated replica at each large
client a and removing its assignments to the nodes (set y(a) = 1 and set x(a, u) =
0 for all nodes u accessible to a). We see that the transformation at most doubles
the cost and the solution remains (1/4, t + 1)-clustered.
Consider the pre-processed solution . Let C denote the set of clusters (of
the partially-open nodes) under . For each cluster C C, we shall fully open a
selected set of at most 2(t + 1) nodes and fully close rest of the nodes in it.
We now describe the processing for a cluster C C. Let A As denote the set
of clients assigned to the nodes in C. By the distributivity property, these clients
Replica Placement on Bounded Treewidth Graphs 23

are assigned to at most (t + 1) fully-open nodes, denoted F = {u1 , u2 , . . . , ut+1 }.


A client a A may be assigned to multiple nodes from F . In our procedure, it
would be convenient if each client is assigned to at most one node from F and
we obtain such a structure using the following transformation.

Proposition 2. Given a solution = x, y, a set of fully-open nodes F and a


set of clients A, we can obtain a solution  = x , y   such that each client a A
is assigned to at most one node from F . Furthermore, the transformation does
not alter the other assignments, i.e., for any node u V and any client a A,
if u  F or a  A, then x (a, u) = x(a, u). Moreover, cost(  ) cost() + |F |.

The above proposition is proved via a cycle cancellation procedure that trans-
fers assignments amongst the nodes in F . The procedure can ensure that, except
for at most |F | clients, every other client a A is assigned to at most one node
from F . We open dedicated replicas at the exceptional clients and this results in
an cost increase of at most |F |.
The proposition does not alter the other assignments and so, its output solu-
tion is also (1/4, t + 1)-clustered. Given the proposition and the pre-processing,
we can assume that = x, y is (1/4, t+1)-clustered wherein each client a A is
assigned to at most one node from F and that y(a) 1/2. For each node ui F ,
let Ai A denote the set of clients assigned to the node ui . The proposition
guarantees that these sets are disjoint.
For a node v and a client a, let load(a, v) denote the amount of load imposed
by a on v towards the capacity: load(a, v) = x(a, v)r(a). It will be convenient
to dene the notion over sets of clients and nodes. For a set of clients B and
a set of nodes U , let load(B, U )  denote the load imposed by the clients in
B on the nodes U : load(B, U ) = aB,vU :av x(a, v)r(a); when the sets are

singletons, we

 shall omit the curly braces. Similarly, for a subset C C, let
load(C ) = vC  load(v).
The intuition behind the remaining transformation is as follows. We shall
identify a suitable set of nodes L = {v1 , v2 , . . . , vt+1 } from C, with vi being called
the consort of ui in C, and fully open all these nodes. Then, we consider the non-
consort nodes C  = C L and for each i t+1, we transfer the load load(Ai , C  )
to the node ui . As a result, no clients are assigned to the non-consort nodes any
more and so, they can be fully closed. In order to execute the transfer, for each
i t+1, we create space in ui by pushing a load equivalent to load(Ai , C  ) from
ui to its (fully-opened) consort vi . The amount of load load(Ai , C  ) involved in
the transfer is very small: the bounded opening property ensures that y(C) <
1/4 and thus, load(Ai , C  ) < W/4. The fully-opened consort vi has enough
additional space to receive the load: y(vi ) 1/4 and so, load(A, vi ) W/4,
which means that if we fully open the consort, we get an additional space of
(3/4)W . However, an important issue is that a consort vi may not be accessible to
all the clients in Ai . Therefore, we need to carefully choose the consorts in such a
manner that each fully open node ui has enough load accessible to the consort vi
that can be pushed to vi . Towards this purpose, we dene the notion of pushable
load. For a node ui F and a node v C, let pushable(ui , v) denote the amount
24 A. Aggarwal et al.

of load on ui that is accessible to v: pushable(ui , v) = aAi :av x(a, ui )r(a).
We next show how to identify a suitable set of consorts such that the pushable
load is more than the load that we wish to transfer.
Lemma 7. We can nd a set of nodes L = {v1 , v2 , . . . , vt+1 } such that for all
i t + 1, pushable(ui , v) load(Ai , C  ).
We have shown that each node ui has a load of at least load(Ai , C  ) which
can be pushed to its consort vi . As observed earlier load(Ai , C  ) < W/4 and
load(Ai , vi ) W/4. Hence, when we fully open the consort, we get an additional
space of (3/4)W , which is sucient to receive the load from ui .
Given the above discussion, we iteratively consider each cluster Cj C and
perform the above transformation. This results in (t + 1) consorts from Cj being
fully-opened and all the other nodes in Cj being fully closed. At the end of
processing all the clusters, we get a solution in which each node either fully open
or fully close. For each cluster Cj , we incur an extra cost of at most (t + 1)
while applying Proposition 2, and an additional cost of (t + 1) for opening the
consorts. Thus, the cost increases by at most 2(t + 1)|C|.

References
1. S. Arora, V. Chakaravarthy, K. Gupta, N. Gupta, and Y. Sabharwal. Replica place-
ment on directed acyclic graphs. In V. Raman and S. Suresh, editors, Proceedings
of the 34th International Conference on Foundation of Software Technology and
Theoretical Computer Science (FSTTCS), pages 213225, 2014.
2. S. Arora, V. Chakaravarthy, N. Gupta, K. Mukherjee, and Y. Sabharwal. Replica
placement via capacitated vertex cover. In A. Seth and N. Vishnoi, editors, Proceed-
ings of the 33rd International Conference on Foundations of Software Technology
and Theoretical Computer Science (FSTTCS), pages 263274, 2013.
3. A. Benoit, H. Larcheveque, and P. Renaud-Goud. Optimal algorithms and approxi-
mation algorithms for replica placement with distance constraints in tree networks.
In Proceedings of the 26th IEEE International Parallel and Distributed Processing
Symposium (IPDPS), pages 10221033, 2012.
4. H. Bodlaender and A. Koster. Combinatorial optimization on graphs of bounded
treewidth. Computer Journal, 51(3):255269, 2008.
5. J. Chuzhoy and J. Naor. Covering problems with hard capacities. SIAM Journal
of Computing, 36(2):498515, 2006.
6. I. Cidon, S. Kutten, and R. Soer. Optimal allocation of electronic content. Com-
puter Networks, 40:205218, 2002.
7. U. Feige. A threshold of ln n for approximating set cover. Journal of the ACM,
45(4):634652, 1998.
8. K. Kalpakis, K. Dasgupta, and O. Wolfson. Optimal placement of replicas in trees
with read, write, and storage costs. IEEE Transactions on Parallel and Distributed
Systems, 12:628637, 2001.
9. M. Kao, H. Chen, and D. Lee. Capacitated domination: Problem complexity and
approximation algorithms. Algorithmica, 72(1):143, 2015.
10. B. Saha and S. Khuller. Set cover revisited: Hypergraph cover with hard capacities.
In A. Czumaj, K. Mehlhorn, A. Pitts, and R. Wattenhofer, editors, Proceedings
of the 39th International Colloquium on Automata, Languages, and Programming
(ICALP), volume 7391 of LNCS, pages 762773. Springer, 2012.
Fast Exact Algorithms for Survivable Network
Design with Uniform Requirements 

Akanksha Agrawal1 , Pranabendu Misra1 , Fahad Panolan1 , and Saket


Saurabh1,2
1
Department of Informatics, University of Bergen, Norway.
{Akanksha.Agrawal|Pranabendu.Misra|Fahad.Panolan}@uib.no
2
The Institute of Mathematical Sciences, HBNI, Chennai, India. [email protected]

Abstract. We design exact algorithms for the following two problems


in survivable network design: (i) designing a minimum cost network with
a desired value of edge connectivity, which is called Minimum Weight
-connected Spanning Subgraph and (ii) augmenting a given net-
work to a desired value of edge connectivity at a minimum cost which is
called Minimum Weight -connectivity Augmentation. Many well
known problems such as Minimum Spanning Tree, Hamiltonian Cy-
cle, Minimum 2-Edge Connected Spanning Subgraph and Min-
imum Equivalent Digraph reduce to these problems in polynomial
time. It is easy to see that a minimum solution to these problems con-
tains at most 2(n1) edges. Using this fact one can design a brute-force
algorithm which runs in time 2O(n(log n+log ) . However no better algo-
rithms were known. In this paper, we give the rst single exponential time
algorithm for these problems, i.e. running in time 2O(n) , for both undi-
rected and directed networks. Our results are obtained via well known
characterizations of -connected graphs, their connections to linear ma-
troids and the recently developed technique of dynamic programming
with representative sets.

1 Introduction
The survivable network design problem involves designing a cost eective com-
munication network that can survive equipment failures. The failure may be
caused by any number of things such as a hardware or software breakage, human
error or a broken link between two network components. Designing a network
which satises certain connectivity constraints, or augmenting a given network
to a certain connectivity are important and well studied problems in network
design. In terms of graph theory these problems correspond to nding a spanning
subgraph of a graph which satises given connectivity constraints and, augment-
ing the given graph with additional edges so that it satises the given constraints,
respectively. Designing a minimum cost network which connects all the nodes,
is the well-known Minimum Spanning Tree(MST) problem. However such a

Supported by Parameterized Approximation ERC Starting Grant 306992 and
Rigorous Theory of Preprocessing ERC Advanced Investigator Grant 267959.

Springer International Publishing AG 2017 25


F. Ellen et al. (Eds.): WADS 2017, LNCS 10389, pp. 2536, 2017.
DOI: 10.1007/978-3-319-62127-2_3
26 A. Agrawal et al.

network fails on the failure of a single link. This leads to the question of design-
ing a minimum cost network which can survive one or more link failures. Such a
network must be -connected, in order to survive 1 link failures (we use the
term -connected to represent -edge connected). This problem is NP-hard (for
2), and a 2-approximation algorithm is known [19]. In the special case when
the weights are 1 or , i.e. we wish to nd a minimum spanning -connected
2
subgraph, a 1 + +1 approximation may be obtained in polynomial time [6]. The
above results also hold in the case of directed graphs. The case of = 1 for
digraphs, known as Minimum Strong Spanning Subgraph(MSSS), is NP-
hard as it is a generalization of the Hamiltonian Cycle. Further, the Minimum
Equivalent Graph(MEG) problem reduces to it in polynomial time.
Adding a minimum number of edges to make the graph satisfy certain con-
nectivity constrains is known as minimum augmentation problem. Minimum
augmentation nd application in designing survivable networks [12, 16] and in
data security [14, 17]. Watanabe and Nakamura [25] gave a polynomial time algo-
rithm for solving the -edge connectivity augmentation in an undirected graph,
where we want to add minimum number of edges to the graph to make it -edge
connected. Frank gave a polynomial time algorithm for the same problem in
directed graphs [11]. However in the weighted case, or when the augmenting set
must be a subset of a given set of links, the problem becomes NP-Hard problem.
Even the restricted case of augmenting the edge connectivity of a graph from
1 to remains NP-hard [1]. A 2-approximation may be obtained for these
problems, by choosing a suitable weight function and applying the algorithm of
[19]. We refer to [1, 4, 18, 20] for more details, other related problems and further
applications. A few results are also known in the frameworks of parameterized
complexity and exact exponential time algorithms. Marx and Vegh gave an FPT
algorithm for computing a minimum cost set of at most k links, which augments
the connectivity of an undirected graph from 1 to [22]. Basavaraju et al.
[2] improved the running time of this algorithm and, also gave an algorithm for
another variant of this problem. Bang-Jensen and Gutin [1, Chapter 12] obtain
an FPT algorithm for a variant of MSSS in unweighted graphs. The rst exact
algorithms for MEG and MSSS, running in time O(2O(m) nO(1) ), where m is
the number of edges in the graph, were given in by Moyles and Thompson [23] in
1969. Only recently, Fomin et al. [10] gave the rst single-exponential algorithm
for MEG and MSSS, i.e. with a running time of 2O(n) . For the special case of
Hamiltonian Cycle, a O(2n ) time algorithm is known [15, 3] for digraphs from
1960s. It was recently improved to O(1.657n ) for undirected graphs [5], and to
O(1.888n ) for bipartite digraphs [9] (but these are randomized algorithms). For
other results and more details we refer to Chapter 12 of [1].
In this paper we consider the problem of designing an exact algorithm for
nding a minimum weight spanning subgraph of a given -connected (di)graph.
Minimum Weight -connected Spanning Subgraph
Input: A graph G (or digraph D), and a weight function w on the edges(or
the arcs).
Output: A minimum weight spanning -connected subgraph.
Fast Exact Algorithms for Survivable Network Design with Uniform Requirements 27

One can observe that such a subgraph contains at most (n1) edges (2(n1)
arcs for digraphs). Hence a solution can be obtained by enumerating all possible
subgraphs with at most these many edges and testing if it is -connected. How-
ever such an algorithm will take 2O(n(log n+log )) time. One may try a more
clever approach, by using the observation that we can enumerate all possible
minimal -connected graphs in 2O(n) time. Then we test if any of these graph
is isomorphic to a subgraph of the input graph. However, subgraph isomorphism
requires 2n(log n+log ) unless the Exponential Time Hypothesis fails [7]. In this
paper, we give the rst single exponential algorithm for this problem that runs
in time 2O(n) . As a corollary, we also obtain single exponential time algorithm
for the minimum weight connectivity augmentation problem.
Minimum Weight -connectivity Augmentation
Input: A graph G (or a digraph D), a set of links L V V (ordered pairs
in case of digraphs), and a weight function w : L N.
Output: A minimum weight subset L of L such that G L (or D L) is
-connected

Our Methods and Results. We extend the algorithm of Fomin et al. for nding a
Minimum equivalent Graph [10], to solve Minimum weight - Connected
sub-digraph, exploiting the structural properties of -connected (di)graphs. A
digraph D is -connected if and only if for some r V (D), there is a collection
I of arc disjoint in-branchings rooted at r and a collection O of arc disjoint
out-branchings rooted at r. Then computing a I and a O with the largest pos-
sible intersection yields a minimum weight -connected spanning sub-digraph.
We show that the solution can be embedded in a linear matroid of rank O(n),
and then compute the solution by a dynamic programming algorithm with rep-
resentative sets over this matroid.
Theorem 1. Let D be a -edge connected digraph on n vertices and w : A(D)
N. Then we can nd a min-weight -edge connected subgraph of D in 2O(n) time.
For the case of undirected graphs, no equivalent characterization is known. How-
ever, we obtain a characterization by converting the graph to a digraph with
labels on the arcs, corresponding to the undirected edges. Then computing a
solution that minimizes the number of labels used, gives the following theorem.
Theorem 2. Let G be a -edge connected graph on n vertices and w : E(G)
N. Then we can nd a min-weight -edge connected subgraph of G in 2O(n)
time.
For the problem of augmenting a network to a given connectivity requirement,
at a minimum cost, we obtain the following results by applying the previous
theorems with suitably chosen weight functions.
Theorem 3. Let D be a digraph (or a graph) on n vertices, L V (D) V (D)
be a collection of links with weight function w : L N. For any integer , we can
nd a min-weight L L such that D = (V (D), A(D) L ) is -edge connected,
in time 2O(n) .
28 A. Agrawal et al.

Preliminaries. Due to space constraints, standard denitions, notations related


graphs and matroids have been omitted from this extended abstract. These pre-
liminaries and other results on matriods and representative sets, may be found
in [8, 10]. We only mention the following. We say that a family S = {S1 , . . . , St }
of subsets of a universe U is a p-family if each set in S has cardinality at most
p. For two families S1 and S2 of a universe U , dene S1 S2 = {Si Sj |
Si S1 , Sj S2 and Si Sj = }. We use to denote the exponent of matrix
multiplication.

Denition 1 (Min/Max q-Representative Family [8, 10, 21]). Given a


matroid M = (E, I), a p-family B of E and a non-negative weight function
w : B N. We say that B B is a min (max) q-representative for B if for
every set Y E of size at most q, if there is a set X B, such that X Y =
and X Y I, then there is a set X B such that X
Y = , X Y I and

w(X) w(X) (w(X) w(X)). If B B is a min (max) q-representative for B
then we denote it by B qminrep B (B qmaxrep B).

Theorem 4 ([8, 10]). Let M = (E, I) be a linear matroid of rank k = p +


q, and matrix AM be a representation of M over a eld F. Also, let B =
{B1 , B2 , . . . , Bt } be a p-family of independent sets in E and w : B N be a
non-negative weight function. Then, there exists B qminrep B (B qmaxrep B) of


q q
size at most p+q p . Moreover, B minrep B (B maxrep B) can be computed in

p+q
p+q 1
at most O( p tp + t p ) operations over F.

2 Directed Graphs
In this section, we give a single exponential exact algorithm, that is of running
time 2O(n) , for computing a minimum weight spanning -connected subgraph of
a connected n-vertex digraph. We rst consider the unweighted version of the
problem and it will be clear that the same algorithm works for weighted version
as well. In a digraph D, we dene OutD (v) = {(v, w) A(D)} and InD (v) =
{(u, v) A(D)} to be the set of out-edges and in-edges of v, respectively. We
begin with the following characterization of -connectivity in digraphs.

Lemma 1 (3 ). Let D be a digraph. Then D is -connected if and only if for


any r V (D), there is a collection of arc disjoint in-branchings rooted at r,
and a collection of arc disjoint out-branchings rooted at r.

Let D be the input to our algorithm, which is a -connected digraph on n


vertices. Let us x a vertex r V (D). By Lemma 1, any minimal -connected
subgraph of D is a union of a collection I of arc disjoint in-branchings and a
collection O of arc disjoint out-branchings which are all rooted at vertex r.
The following lemma relates the size of such a minimal subgraph to the number
of arcs which appear in both I and O and it follows easily from Lemma 1. Here,
3
Proof of the results marked () are omitted due to space constraints.
Fast Exact Algorithms for Survivable Network Design with Uniform Requirements 29

A(I) denotes the set of arcs which are present in some I I and A(O) denotes
the set of arcs which are present in some O O.

Lemma 2. Let D be a -connected digraph, r be a vertex in V (D) and 


[(n 2)]. Then a subdigraph D  with at most 2(n 1)  arcs, is a minimal
-connected spanning subdigraph of D if and only if D  is a union of a collection
I of arc disjoint in-branchings rooted at r, and a collection O of arc disjoint
out-branchings rooted at r such that |A(I) A(O)|  (i.e. they have at least 
common arcs).

By Lemma 2, a minimum connected subgraph of D is I O, where O =


{O1 , O2 , . . . O } is a collection of arc disjoint out-branchings rooted at r, I =
{I1 , I2 , . . . I } is a collection of arc disjoint in-branchings rooted at r, and
A(O) A(I) is maximized. To explain the concept of the algorithm let us assume
that the number of arcs in a minimum connected spanning subdigraph D is
2(n 1)  and let A(D ) = A(O) A(I), where O = {O1 , O2 , . . . O } is a
collection of arc disjoint out-branchings rooted at r and I = {I1 , I2 , . . . I }
is a collection of arc disjoint in-branchings rooted at r. Note that |A(O)
A(I)| = . The rst step of our algorithm is to construct the set A(O) A(I),
and then, given the intersection, we can construct O and I in polynomial time.
Observe that A(O) and A(I) can intersect in at most (n 2) arcs. The main
idea is to enumerate a subset of potential candidates for the intersection, via
dynamic programming. But note that there could be as many as nO(n) such
candidates, and enumerating them all will violate the claimed running time. So
we try a dierent approach. We rst observe that the arcs in a solution, O I,
can be embedded into a linear matroid of rank O(n). Then we prove that, it
is enough to keep a representative family of the partial solutions in the dynamic
programming table. Since, the size of the representative family is bounded by
2O(n) , our algorithm runs in the claimed running time.
Let us delve into the details of the algorithm. Let Dr be the digraph obtained
from D after removing the arcs in OutD (r). Similarly, let Dr+ be the digraph
obtained from D after removing the arcs in InD (r). Observe that the arc sets of
Dr and Dr+ can be partitioned as follows. A(Dr ) = vV (Dr ) OutDr (v) and

A(Dr+ ) = vV (Dr+ ) InDr+ (v). We construct a pair of matroids corresponding
to each of the in-branching in I and each of the out-branching in O. For
each in-branching Ii I, we have a matroid MiI,1 = (EI,1 i
, II,1
i
) which is a
i
graphic matroid in D and EI,1 is a copy of the arc set of D. And similarly,
for each out-branching Oi O, we have a matroid MiO,1 = (EO,1 i
, IO,1
i
) which
i
is a graphic matroid in D and EO,1 is again a copy of the arc set of D. Note
that the rank of these graphic matroids is n 1. Next, for each Ii , we dene
matroid MiI,2 = (EI,2 i
, II,2
i
) which is a partition matroid where EI,2 i
is a copy

of the arc set of Dr and II,2 = {X | X EI,2 , |X OutDr (v)| 1, for all v
i i

V (Dr )} 4 . Since OutDr (r) = and |V (Dr )| = n, we have that the rank of
4
We slightly abuse notation for the sake of clarity, as strictly speaking X and
OutDG
r (v) are disjoint, since they are subsets of two dierent copies of the arc set.
30 A. Agrawal et al.

these partition matroids, MiI,2 , i [], is n 1. Similarly, for each Oi , we dene


MiO,2 = (EO,2i
, IO,2
i
) as the partition matroid, where EO,2 i
is a copy of the arc
set of Dr and IO,2 = {X | X EO,2 , |X InDr+ (v)| 1, for all v V (Dr+ )}
+ i i

Since InDr+ (r) = and V (Dr+ ) = n, we have that the rank of these partition
matroids, MiO,2 , i [], is n 1. We dene two uniform matroids MI and
MO of rank (n 1), corresponding to I and O, on the ground sets EI and
EO , respectively, where Ei and EO are copies of the arc set of D. We dene
matroid M = (E, I) as the direct sum of MI , MO , MiI,j , MiO,j , for i [] and
 
j {1, 2}. That is, M = i[],j{1,2} (M i
I,j M i
O,j ) MI MO Since the
rank of MiI,j , MiO,j where i [] and j {1, 2}, are n 1 each, and rank of MI
and MO is (n 1), we have that the rank of M is 6(n 1). We briey discuss
the representation of these matroids. The matroids MiI,1 , MiO,1 for i [] are
graphic matroids, which are representable over any eld of size at least 2. The
matroids MiI,2 , MiO,1 are partition matroids with partition size 1, and therefore
they are representable over any eld of at least 2 as well. Finally, the two uniform
matroids, MI and MO , are representable over any eld with at least |A(D)| + 1
elements. Hence, at the start of our algorithm, we choose a representation of all
these matroids over a eld F of size at least |A(D)| + 1. So M is representable
over any eld of size at least |A(D)| + 1 (see [8, 10]).
For an arc e A(D) not incident to r there are 4 + 2 copies of it in M.
Let eiJ,j denotes its copy in EJ,j i
, where i [], j {1, 2} and J {I, O}.
An arc incident to r has only 3 + 2 copies in M. For an arc e InD (r) we
i i i
will denote its copies in EI,1 , EO,1 , EI,2 by eiI,1 , eiO,1 , eiI,2 , and similarly for an
arc e OutD (r) we will denote its copies in EI,1 i i
, EO,1 i
, EO,2 by eiI,1 , eiO,1 , eiO,2 .
And nally, for any arc e A(D), let eI and eO denote its copies in EI and
EO , respectively. For e A(D) \ OutD (r) and i [], let SI,e i
= {eiI,1 , eiI,2 }.
Similarly for e A(D) \ InD (r), i [], let SO,e = {eO,1 , eO,2 }. Let Se =
i i i
 j 
(i=1 SI,e
i
) (j=1 SO,e ) {eI , eO }. For X I, let AX denote the set of arcs
e A(D) such that Se X = .

Observation 1 (i) Let I be an in-branching in D rooted at r. Then for any


i [], {eiI,1 | e A(I)} is a basis in MiI,1 and {eiI,2 | e A(I)} is a basis
in MiI,2 . And conversely, let X and Y be basis of MiI,1 and MiI,2 , respectively,
such that AX = AY . Then AX is an in-branching rooted at r in D.
(ii) Similarly, let O be an out-branching in D. Then for any i [], {eiO,1 | e
A(O)} is a basis in MiO,1 and {eiO,2 | e A(O)} is a basis in MiO,2 . And
conversely, let X and Y be basis of MiO,1 and MiO,2 , respectively, such that
AX = AY . Then AX is an out-branching rooted at r in D.

Observe that any arc e A(D) can belong to at most one in-branching in I
and at most one out-branching in O, because both I and O are collection of arc
disjoint subgraphs of D. Because of Observation 1, if we consider that each Ii I
is embedded into MiI,1 and MiI,2 and each Oi O is embedded into MiO,1 and
MiO,2 , then we obtain an independent set Z  of rank 4(n 1) corresponding
Fast Exact Algorithms for Survivable Network Design with Uniform Requirements 31

to I O in the matroid M. Further, since the collection I is arc disjoint, {eI |


e A(I)} is a basis of MI . And similarly, {eO | e A(O)} is a basis of MO .
Therefore, Z = Z  {eI | e A(I)} {eO | e A(O)} is a basis of M. Now
observe that, each arc in the intersection I O has six copies in the independent
set Z. The remaining arcs in I O have only three copies each, and this includes
any arc which is incident on r. Now, we dene a function : I A(D) {0, 1},
where for W I and e A(D), (W, e) = 1 if and only if exactly one of the
following holds. Either, W Se = . Or, {eI , eO } W and there exists t, t []
t
t
such that SI,e W and SO,e W . And for each i [] \ {t} and j [] \ {t },
j
i
SI,e W = and SO,e W = . Using function we dene the following collection
of independent sets of M. B 6 = {W  | W I, |W | = 6, e A(D) (W, e) = 1}
By the denitions of , I and O, eA(O)A(I) Se is an independent set of M,
which is contained in B 6 . In fact, for the optimal value of , the collection B 6
contains all possible candidates for the intersection of O and I , where O and
I are collections of arc disjoint in-branchings and arc disjoint out-branchings
which form an optimum solution. Our goal is to nd one such candidate partial
solution from B 6 . We are now ready to state the following lemma which shows
that a representative family of B 6 always contains a candidate partial solution
which can be extended to a complete solution.

Lemma 3. Let D be a -connected digraph on n vertices, r V (D) and 


[(n 2)]. There exists a -connected spanning subdigraph D  of D with at
most 2(n 1)  arcs if and only if, there exists T B 6 nrep6 B 6 , where



n = 6(n 1), such that D has arc disjoint in-branchings containing AT and
arc disjoint out-branchings containing AT , which are all rooted at r.

Proof. In the forward direction consider a -connected spanning subdigraph D


of D with at most 2(n 1)  arcs. By Lemma 2, D is union of a collection
I = {I1 , I2 , . . . , I } of arc disjoint in-branchings rooted at r, and a collection
O = {O1 , O2 , . . . , O } of arc disjoint out-branchings rooted at r such that |A(I)
A(O)| . By Observation 1, for all i [], {eiI,1 | e A(Ii )} is a basis in MiI,1
and {eiI,2 | e A(Ii )} is a basis in MiI,2 . Similarly, by Observation 1, for all
i [], {eiO,1 | e A(Oi )} is a basis in MiO,1 and {eiO,2 | e A(Oi )} is a basis in
MiO,2 . Further {eI | e A(I)} and {eO | e A(O)} are bases of MI and MO ,
respectively. Hence the set ZD = {eiI,1 , eiI,2 | e A(Ii ), i []} {eiO,1 , eiO,2 |
e A(Oi ), i []} {eI | e A(I)} {eO | e A(O)} is an independent
set in M. Since |ZD | = 6(n 1), ZD is actually a basis in M. Consider
T A(I)A(O) with exactly  arcs. Let T  = {eiI,1 , eiI,2 | e T Ii , for some i
[]} {eiO,1 , eiO,2 | e T Oi , for some i []} {eI , eO | e T }. Note that T 
is a set of six copies of the  arcs that are common to a pair of an in-branching in
I and an out-branching in O. Therefore, by the denition of B 6 , T  B 6 . Then,
by the denition of representative family, there exists T B 6 nrep6 B 6 , such


that Z = (ZD \ T  ) T is an independent set in M. Note that |Z| = 6(n 1),


and hence it is a basis in M. Also note that AT AZ .
32 A. Agrawal et al.

Claim. 1 () (i) For any i [] and e A(D), either {eiI,1 , eiI,2 } Z or


{eiI,1 , eiI,2 } Z = . And further for every e A(D) such that eiI,1 Z for
some i [], Z also contains eI . Similarly, for any i [] and e A(D), either
{eiO,1 , eiO,2 } Z or {eiO,1 , eiO,2 } Z = , and further, for every e A(D) such
that eiO,1 Z for some i [], Z also contains eO .
(ii) And for any i, j [], i = j, either {ei , ei } Z = or {ej , ej }
I,1 I,2 I,1 I,2
Z = . Similarly, for any i, j [], i = j, either {eiO,1 , eiO,2 } Z = or
{eiO,1 , eiO,2 } Z = .

Since Z is a basis in M, for any i [], j {1, 2} and k {I, O}, we have
that Z Ek,j
i i = Z E i
is a basis in Mik,j (see [8, 10]). For each i [], let X 1 I,1
and X i = Z E i . By Claim 1, A  i = A  i and hence, by Observation 1,
2 I,2 X1 X2
I i = A  i forms an in-branching rooted at r. Because of Claim 1, {I i | i } are
X1
pairwise arc disjoint as I i I j = for every i = j []. Further AT is covered
in arc disjoint in-branchings {AIi,1 | i }, as T EI,j
i
X i for j {1, 2}. By
j
similar arguments we can show that there exist a collection {O i | i []} of
out-branchings rooted at r containing AT . The reverse direction of the lemma
follows from Lemma 2.

Lemma 4. Let D be a connected digraph on n vertices and  [(n 2)].


In time 2O(n) we can compute B 6 nrep6 B 6 such that |B 6 | n6 . Here


n = 6(n 1).
Proof. We give an algorithm via dynamic programming. Let D be an array of size
 + 1. For i {0, 1, . . . , } the entry D[i] will store the family B 6i nrep6i B 6i . We


will ll the entries in array D according to the increasing order of index i, i.e. from
0, 1, . . . , . For i = 0, we have B 0 = {}. Let W = {{eI , eO , eiI,1 , eiI,2 , ejO,1 , ejO,2 } |
i, j [], e A(D)} and note that |W| = 2 m, where m = |A(D)|. Given that
we have lled all the entries D[i ], where i < i + 1, we ll the entry D[i + 1] at
step i + 1 as follows. Let F 6(i+1) = (B 6i W) I.
n 6(i+1)
Claim. 2 () F 6(i+1) rep B 6(i+1) , for all i {0, 1, . . .  1}
Now the entry for D[i+1] is F 6(i+1) which is n 6(i+1) representative family
for F 6(i+1) , and it is computed as follows. By Theorem 4 we have that |B 6i |

n  6(i+1)


6i , Hence it follows that |F | 2 m n6i and moreover, we can compute

 n 6(i+1)
F 6(i+1) in time O(2 mn n6i ). We use Theorem 4 to compute F 6(i+1) rep

n
n
F 6(i+1) of size at most 6(i+1) . This step can be done in time O( 6(i+1) tp +

n 1

t 6(i+1) ), where t = |F 6(i+1) | = 2 m 6i . We know from Claim 2 that
n

n 6(i+1)
F 6(i+1) rep B 6(i+1) . Therefore by the transitive property of representative
n 6(i+1) 6(i+1)
sets [8, 10], we have B 6(i+1) = F 6(i+1) rep B . Finally, we assign the
family B 6(i+1)
to D[i + 1]. This completes the description of the algorithm and
Fast Exact Algorithms for Survivable Network Design with Uniform Requirements 33

its correctness. Now, since  n /6, we can bound the total running time of this

 
n
n 1  2
n
algorithm as O i=1 i 6(i+1) + 6(i+1) m 6i 2O(n) .

We have the following algorithm for computing I and O given A(I) A(O).
This algorithm extends a given set of arcs to an minimum weight collection of
arc disjoint out-branchings. This is a simple corollary of [24, Theorem 53.10]
and it also follows from the results of Gabow [13].

Lemma 5 (). Let D be a digraph and w be a weight function on the arcs.


For any subset X of arcs of D, a vertex r and an integer , we can nd a
minimum weight collection O of arc disjoint out-branchings rooted at r, such
that X A(O), if it exists, in polynomial time.

Theorem 5. Let D be a edge connected digraph on n vertices. Then we can


nd a minimum edge connected subgraph of D in 2O(n) time.

Proof. Let n = 6(n 1). We x an arbitrary r V (D) and for each choice
of , the cardinality of |A(I) A(O)|, we attempt to construct a solution. By
Lemma 3 we know that there exists a -connected spanning subdigraph D of
D with at most 2(n 1)  arcs if and only if there exists T B 6 nrep6 B 6 ,



where n = 6(n 1), such that D has a collection I = {I1 , I2 , . . . , I } of arc
disjoint in-branchings rooted at r and a collection O = {O1 , O2 , . . . , O } of arc
disjoint out-branchings rooted at r such that AT A(I) A(O). Using Lemma 4
we compute B 6l nrep6 B 6 in time 2O(n) , and for every F B 6 we check if


AF can be extended to a collection of arc disjoint out-branchings rooted at


r and a collection of arc disjoint in-branchings rooted at r, using Lemma 5.
Since  (n 2), the running time of the algorithm is bounded by 2O(n) .

An similar algorithm can be obtained for the weighted version of the problem
using the notion of weighted representative sets, thus proving Theorem 1.

3 Undirected Graphs

In this section, we give an algorithm for computing a minimum -connected sub-


graph of an undirected graph G. As before, we only consider the unweighted ver-
sion of the problem. While there is no equivalent characterization of -connected
graphs as there was in the case of digraphs, we show that we can obtain a charac-
terization by converting the graph to a digraph with labels on the arcs. Then, as
in the previous section, we embed the solutions in a linear matroid and compute
them by a dynamic programming algorithm with representative families. Let
DG be the digraph with V (DG ) = V (G) and for each edge e = (u, v) E(G),
we have two arcs ae = (u, v) and ae = (v, u) in A(DG ). We label the arcs ae
and ae by the edge e, which is called the type of these arcs. For X A(DG ) let
Typ(X) = {e E(G) | ae X or ae X}. The following two lemmata relate
-connected subgraphs of G with collections of out-branchings in DG .
34 A. Agrawal et al.

Lemma 6 (). Let G be an undirected graph and DG be the digraph constructed


from G as described above. Then G is -connected if and only if for any r
V (DG ), there are arc disjoint out-branchings rooted at r in DG .
By Lemma 6 we know that G is -connected if and only if for any r V (D),
there is a collection O of arc disjoint out-branchings rooted at r in DG . Given
a collection of out-branchings, we can obtain a -connected subgraph of G with
at most (n 1) edges. For an edge e E(G) which is not incident on r, the
two arcs corresponding to it in DG may appear in two distinct out-branchings of
O, but for an edge e incident on r in G, only the corresponding outgoing arc of
r may appear in O. Since there are (n 1) arcs in total that appear in O and
at least of those are incident on r, the number of edges of G such that both
the arcs corresponding to it appear in O is upper bounded by (n2) 2 . So any
(n2)
minimal -connected subgraph of G has (n 1)  edges where  [ 2 ].
Lemma 7 (). Let G be an undirected -connected graph on n vertices and
 [ (n2)
2 ]. G has a -connected subgraph G with at most (n 1) 
edges if and only if for any r V (DG ), DG has arc disjoint out-branchings
O = {O1 , O2 , . . . , O } rooted at r such that |Typ(A(O))| (n 1) .
By Lemma 7, a collection O of out-branchings rooted at some vertex r,
that minimizes |Typ(A(O))| corresponds to a minimum -connected subgraph
of G. In the rest of this section, we design an algorithm that nds a collection
of arc disjoint out-branchings O in DG such that |Typ(A(O))| is minimized.
The rst step of our algorithm is to compute the set of edges of G such that
both the arcs corresponding to it appear in the collection O, and then we can
r
extend this to a full solution in polynomial time. Fix a vertex r. Let DG denote
the digraph obtained from DG by removing the arcs in InDG (r). Observe that
r r
A(DG ) can be partitioned as follows. A(DG ) = vV (Dr ) InDGr (v) We construct
G
a pair of a graphic matroid and a partition matroid, corresponding to each of
the out-branching that we want to nd. For each i [], we dene a matroid
Mi1 = (Ai1 , I1i ) which is a graphic matroid of DG r
whose ground set Ai1 is a copy
of the arc set A(DG ). Similarly, for each i [] we dene matroid Mi2 = (Ai2 , I2i ),
r

which is a partition matroid on the ground set Ai2 , which is a copy of the arc
set A(DG r
), such that the following holds. I2i = {I | I Ai2 , |I InDG r (v)|

1, for all v V (DG r


)} Next, let MO be a uniform matroid of rank (n 1)
r
on the ground set AO where AO is also a copy of A(DG ). Finally, we dene
the matroid  M = (A M , I) as the
 direct sum of M O and M 1 , M2 , for i [],
i i

i.e. M = i[] (M1 M2 ) MO . Note that the rank of this matroid is


i i

3(n 1) and it is representable over any eld of size at least |A(DG r


)| + 1. For
an arc a A(DG ), we denote its copies in A1 , A2 and AO by a1 , ai2 and aO
r i i i

respectively. For a collection O of out-branchings in DG r


, by A(O) we denote
the set of arcs which is present in some  O O. For X I, by AX we denote the
set of arcs a A(DG r
) such that X i=1 {ai1 , ai2 } = . For e E(G) and i [],


we let Sei = {(ae )i1 , (ae )i2 , (ae )i1 , (ae )i2 } and Se = {(ae )O , (ae )O } i
i=1 Se . We
dene a function : I E(G) {0, 1}, where for W I, e E(G), (W, e) = 1
Fast Exact Algorithms for Survivable Network Design with Uniform Requirements 35

if and only if exactly one of the following holds. Either W Se = ; or, there exists
t, t [], t = t , such that, (i) (ae )O , (ae )O W , (ii) Set W = {(ae )t1 , (ae )t2 },
  
(iii) Set W = {(ae )t1 , (ae )t2 }, and (iv) i [] \ {t, t }, Sei W = . Now
for each  [(n 2)/2], we dene the following set. B 6 = {W | W
I, |W | = 6 and e E(G), (W, e) = 1} Observe that for every W B 6 ,
|Typ(AW )| =  and, ae AW if and only if ae AW . Therefore, any set in
this collection corresponds to a potential candidate for the subset of arcs which
appear in exactly two out-branchings in O. The following lemma, relates the
computation of out-branchings minimizing types and representative sets.

Lemma 8 (). Let G be a -connected undirected graph on n vertices, DG its


corresponding digraph and  [ (n2)
2 ]. Let n = 3(n 1). Then there exists
a set O of out-branchings rooted at r, with |Typ(A(O))| (n 1)  in DG if
of
and only if there exists T B 6 nrep6 B 6 , such that DG has a collection O



out-branchings rooted at r, AT A(O) and |Typ(O)| (n 1) . Further,


we can compute B 6 n 6 B 6 such that |B 6 | n in time 2O(n) .

rep 6

Finally, Lemmata 5, 7 and 8 give us the following theorem. As before, this


theorem can be extended to prove Theorem 2.
Theorem 6 (). Let G be a edge connected graph on n vertices. Then we can
nd a minimum edge connected subgraph of G in 2O(n) time.

4 Augmentation Problems
The algorithms for Minimum Weight -connected Spanning Subgraph
may be used to solve instances of Minimum Weight -connectivity Aug-
mentation as well. Given an instance (D, L, w, ) of the augmentation problem,
we construct an instance (D , w , ) of Minimum Weight -connected Span-
ning Subgraph, where D = D L and w is a weight function that gives a
weight 0 to arcs in A(D) and it is w for the arcs from L. It is easy to see that
the solution returned by our algorithm contains a minimum weight augmenting
set. A similar approach works for undirected graphs as well, proving Theorem 3.

References
1. Bang-Jensen, J., Gutin, G.Z.: Digraphs: theory, algorithms and applications.
Springer Science & Business Media (2008)
2. Basavaraju, M., Fomin, F.V., Golovach, P., Misra, P., Ramanujan, M., Saurabh,
S.: Parameterized algorithms to preserve connectivity. In: Automata, Languages,
and Programming, pp. 800811. Springer (2014)
3. Bellman, R.: Dynamic programming treatment of the travelling salesman problem.
Journal of the ACM (JACM) 9(1), 6163 (1962)
4. Berman, P., Dasgupta, B., Karpinski, M.: Approximating transitive reductions
for directed networks. In: Proceedings of the 11th International Symposium on
Algorithms and Data Structures. pp. 7485. Springer-Verlag (2009)
36 A. Agrawal et al.

5. Bjorklund, A.: Determinant sums for undirected hamiltonicity. SIAM Journal on


Computing 43(1), 280299 (2014)
6. Cheriyan, J., Thurimella, R.: Approximating minimum-size k-connected spanning
subgraphs via matching. SIAM Journal on Computing 30(2), 528560 (2000)
7. Cygan, M., Fomin, F.V., Golovnev, A., Kulikov, A.S., Mihajlin, I., Pachocki, J.,
Socala, A.: Tight bounds for graph homomorphism and subgraph isomorphism. In:
Proceedings of the Twenty-Seventh Annual ACM-SIAM Symposium on Discrete
Algorithms, SODA 2016, Arlington, VA, USA, January 10-12, 2016. pp. 16431649
(2016)
8. Cygan, M., Fomin, F.V., Kowalik, L., Lokshtanov, D., Marx, D., Pilipczuk, M.,
Pilipczuk, M., Saurabh, S.: Parameterized Algorithms. Springer (2015)
9. Cygan, M., Kratsch, S., Nederlof, J.: Fast hamiltonicity checking via bases of per-
fect matchings. In: Proceedings of the forty-fth annual ACM Symposium on The-
ory of Computing. pp. 301310. ACM (2013)
10. Fomin, F.V., Lokshtanov, D., Panolan, F., Saurabh, S.: Ecient computation of
representative families with applications in parameterized and exact algorithms. J.
ACM 63(4), 29:129:60 (Sep 2016), http://doi.acm.org/10.1145/2886094
11. Frank, A.: Augmenting graphs to meet edge-connectivity requirements. SIAM
Journal on Discrete Mathematics 5(1), 2553 (1992)
12. Frank, H., Chou, W.: Connectivity considerations in the design of survivable net-
works. Circuit Theory, IEEE Transactions on 17(4), 486490 (1970)
13. Gabow, H.N.: A matroid approach to nding edge connectivity and packing ar-
borescences. Journal of Computer and System Sciences 50(2), 259273 (1995)
14. Guseld, D.: A graph theoretic approach to statistical data security. SIAM Journal
on Computing 17(3), 552571 (1988)
15. Held, M., Karp, R.M.: A dynamic programming approach to sequencing problems.
Journal of the Society for Industrial and Applied Mathematics 10(1), 196210
(1962)
16. Jain, S., Gopal, K.: On network augmentation. Reliability, IEEE Transactions on
35(5), 541543 (1986)
17. Kao, M.Y.: Data security equals graph connectivity. SIAM Journal on Discrete
Mathematics 9(1), 87100 (1996)
18. Khuller, S.: Approximation algorithms for nding highly connected subgraphs.
Vertex 2, 2 (1997)
19. Khuller, S., Vishkin, U.: Biconnectivity approximations and graph carvings. Jour-
nal of the ACM (JACM) 41(2), 214235 (1994)
20. Kortsarz, G., Nutov, Z.: Approximating minimum cost connectivity problems. In:
Dagstuhl Seminar Proceedings. Schloss Dagstuhl-Leibniz-Zentrum fur Informatik
(2010)
21. Marx, D.: A parameterized view on matroid optimization problems. Theor. Com-
put. Sci. 410(44), 44714479 (2009), http://dx.doi.org/10.1016/j.tcs.2009.07.027
22. Marx, D., Vegh, L.A.: Fixed-parameter algorithms for minimum-cost edge-
connectivity augmentation. ACM Transactions on Algorithms (TALG) 11(4), 27
(2015)
23. Moyles, D.M., Thompson, G.L.: An algorithm for nding a minimum equivalent
graph of a digraph. Journal of the ACM (JACM) 16(3), 455460 (1969)
24. Schrijver, A.: Combinatorial optimization: polyhedra and eciency, vol. 24.
Springer Science & Business Media (2003)
25. Watanabe, T., Narita, T., Nakamura, A.: 3-edge-connectivity augmentation prob-
lems. In: Circuits and Systems, 1989., IEEE International Symposium on. pp.
335338. IEEE (1989)
The Complexity of Tree Partitioning

Zhao An1 Qilong Feng1 Iyad Kanj2 Ge Xia3


1
School of Information Science and Engineering, Central South University, China.
[email protected], [email protected]
2
School of Computing, DePaul University, Chicago, IL. [email protected]
3
Dept. of Computer Science, Lafayette College, Easton, PA. [email protected]

Abstract. Given a tree T on n vertices, and k, b, s1 , . . . , sb N, the


Tree Partitioning problem asks if at most k edges can be removed
from T so that the resulting components can be grouped into b groups
such that the number of vertices in group i is si , for i = 1, . . . , b. The
case when s1 = = sb = n/b, referred to as the Balanced Tree
Partitioning problem, was shown to be N P-complete for trees of max-
imum degree at most 5, and the complexity of the problem for trees of
maximum degree 4 and 3 was posed as an open question. The parame-
terized complexity of Balanced Tree Partitioning was also posed as
an open question in another work.
In this paper, we answer both open questions negatively. We show that
Balanced Tree Partitioning (and hence, Tree Partitioning) is
N P-complete for trees of maximum degree 3, thus closing the door on
the complexity of Balanced Tree Partitioning, as the simple case
when T is a path is in P. In terms of the parameterized complexity of
the problems, we show that both Balanced Tree Partitioning and
Tree Partitioning are W [1]-complete. Finally, using a compact repre-
sentation of the solution space for an instance of the problem, we present
a dynamic programming algorithm for Tree Partitioning (and hence,
for Balanced Tree Partitioning) that runs in subexponential-time
2O( n) , adding a natural problem to the list of problems that can be
solved in subexponential time.

1 Introduction
Problem Denition and Motivation. We consider the Tree Partition-
ing problem dened as follows:

Tree Partitioning
Given: A tree T ; k, b, s1 , . . . , sb N
Parameter: k
Question: Does there exist a subset E  E(T ) of at most k edges such that
the components of T E  can be grouped into b groups, where group i contains
si vertices, for i = 1, . . . , b?
The special case of the problem when s1 = = sb = |V (T )|/b is referred to
as Balanced Tree Partitioning.

Springer International Publishing AG 2017 37


F. Ellen et al. (Eds.): WADS 2017, LNCS 10389, pp. 3748, 2017.
DOI: 10.1007/978-3-319-62127-2_4
38 Z. An et al.

The two problems are special cases of the Balanced Graph Partitioning
problem, which has applications in the areas of parallel computing [3], computer
vision [3], VLSI circuit design [4], route planning [8], and image processing [22].
The special case of Balanced Graph Partitioning, corresponding to b =
2, is the well-known N P-complete problem Bisection [16]. The Balanced
Graph Partitioning problem has received a lot of attention from the area of
approximation theory (for instance, see [2, 12, 21]). Moreover, the complexity
and the approximability of the problem restricted to special graph classes, such
as grids, trees, and bounded degree trees [1214, 20], have been studied.

Our Results. We study the complexity and the parameterized complexity of


Tree Partitioning and Balanced Tree Partitioning, and design subex-
ponential time algorithms for these problems. Our results are:

(A) We prove that Balanced Tree Partitioning, and hence Tree Parti-
tioning, is N P-complete for trees with maximum degree at most 3. This
answers an open question in [13] about the complexity of Balanced Tree
Partitioning for trees of maximum degree 4 and 3, after they had shown
the N P-completeness of the problem for trees of maximum degree at most
5. This also closes the door on the complexity of these problems on trees, as
the simple case when the tree is a path is in P.
(B) We prove that both Tree Partitioning and Balanced Tree Parti-
tioning are W [1]-hard. This answers an open question in [23]. We also prove
the membership of the problems in the class W [1], using the characterization
of W [1] given by Chen et al. [7].
(C) We present an exact subexponential-time algorithm for Tree Partition-
ing, and hence for Balanced Tree Partitioning, that runs in time
2O( n) , where n is the number of vertices in the tree.

For the lack of space, many details and proofs in this paper have been omitted,
and can found in [1].

Related Work and Our Contributions. Feldmann and Foschini [13] stud-
ied Balanced Tree Partitioning. They showed that the problem is N P-
complete for trees of maximum degree at most 5, and left the question about
the complexity of the problem for maximum degree 4 and 3 open. Whereas the
reduction used in the current paper to prove the N P-hardness of Balanced
Tree Partitioning on trees of maximum degree at most 3 starts from the
same problem (3-Partition) as in [13], and is inspired by their construction,
the reduction in this paper is much more involved in terms of the gadgets em-
ployed and the correctness proofs.
Bevern et al. [23] showed that the parameterized complexity of Balanced
Graph Partitioning is W [1]-hard when parameterized by the combined pa-
rameters (k, ), where k is (an upper bound on) the cut size, and is (an upper
bound on) the number of resulting components after the cut. It was observed
in [23], however, that the employed FPT -reduction yields graphs of unbounded
The Complexity of Tree Partitioning 39

treewidth, which motivated the authors to ask about the parameterized com-
plexity of the problem for graphs of bounded treewidth, and in particular for
trees. We answer their question by showing that the problem is W [1]-complete.
Bevern et al. [23] also showed that Balanced Graph Partitioning is
W [1]-hard on forests by a reduction from the Unary Bin Packing problem,
which was shown to be W [1]-hard in [18]. We note that the disconnectedness of
the forest is crucial to their reduction, as they represent each number x in an
instance of Bin Packing as a separate path of x vertices. For Balanced Tree
Partitioning, in contrast to Unary Bin Packing (and hence, to Balanced
Graph Partitioning on forests), the diculty is not in grouping the compo-
nents into groups (bins) because enumerating all possible distributions of k + 1
components (resulting from cutting k edges) into b k + 1 groups can be done
in FPT -time; the diculty, however, stems from not knowing which tree edges
to cut. The FPT -reduction we use to show the W [1]-hardness is substantially
dierent from both of those in [18, 23], even though we use the idea of non-
averaging sets in our constructiona well-studied notion in the literature (e.g.,
see [5]), which was used for the W [1]-hardness result of Unary Bin Packing
in [18].
Many results in the literature have shown that certain N P-hard graph prob-
lems are solvable in subexponential time. Some of these rely on topological
properties of the underlying graph that guarantee the existence of a balanced
graph-separator of sub-linear size, which can then be exploited in a divide-and-
conquer approach (e.g., see [6, 9]). There are certain problems on restricted
graph classes that resist such approaches due to the the problem specications;
designing subexponential-time algorithms for such problems usually requires ex-
ploiting certain properties of the solution itself, in addition to properties of the
graph class (see [15, 19] for such recent results). In the case of Tree Parti-
tioning and Balanced Tree Partitioning, since every tree has a balanced
separator consisting of a single vertex, yet the two problems remain N P-hard
on trees, clearly a divide-and-conquer approach based solely on balanced sep-
arators does not yield subexponential-time algorithms for these problems. To
design subexponential-time algorithms for them, we rely on the observation that
the number of possible partitions of an integer n N is subexponential in n; this
allows for
a compact representation of all solutions using a solution space of
size 2O( n) , enabling a dynamic programming approach that solves the problems
within the same time upper bound.

Terminologies. We refer the reader to [10, 11] for more information about
graph theory and parameterized complexity.
Let T be a rooted tree. For an edge e = uv in T such that u is the parent of
v, by the subtree of T below e we mean the subtree Tv of T rooted at v. For two
edges e, e in T , e is said to be below e if e in an edge of the subtree of T below
e . A nice binary tree T is dened recursively as follows. If |V (T )| 1 then T
is a nice binary tree. If V (T ) > 1, then T is nice if (1) each of the left-subtree
and right-subtree of T is nice and (2) the sizes of the left-subtree and the right-
subtree dier by at most 1. For any n N, there is a nice binary tree of order
40 Z. An et al.

n. A star S is a tree consisting of a single vertex r, referred to as the root of


the star, attached to degree-1 vertices, referred to each as a star-leaf; we refer
to an edge between r and a leaf in S as a star-edge; we refer to a subtree of S
containing r as a substar of S.
A solution P to an instance (T, k, b, s1 , . . . , sb ) of Tree Partitioning is a
pair (EP , P ), where EP is a set of k edges in T , and P is an assignment that
maps the connected components in T EP into b groups so that the total number
of vertices assigned to group i is si , for i [b]. We call a connected component
in T EP a P -component, and denote by CP the set of all P -components.
By a cut in a tree T we mean the removal of an edge from T . A solution
P = (EP , P ) to (T, k, b, s1 , . . . , sb ) cuts an edge e in T if e EP . Let T  be a
subtree of T such that P cuts at least one edge in T  . By a lowest P -component
in T  we mean a subtree T  below an edge e of T  such that T  is a P -component
(i.e., P does not cut any edge below e in T  ).
The restriction of Tree Partitioning to instances in which s1 = = sb =
|T |/b is denoted Balanced Tree Partitioning; an instance of Balanced
Tree Partitioning is a triplet (T, k, b). The restriction of Tree Partition-
ing and Balanced Tree Partitioning to trees of maximum degree at most 3
are denoted Degree-3 Tree Partitioning and Balanced Degree-3 Tree
Partitioning, respectively. For  1 N, we write [] for the set {1, . . . , }.

2 N P-completeness

In this section, we show that Balanced Degree-3 Tree Partitioning, and


hence Degree-3 Tree Partitioning, is N P-complete. Without loss of gener-
ality, we will consider the version of Balanced Degree-3 Tree Partitioning
in which we ask for a cut of size exactly k, as opposed to at most k; it is easy to
see that the two problems are polynomial-time reducible to one another.
To prove that Balanced Degree-3 Tree Partitioning is N P-hard, we
will show that the strong N P-hard problem 3-Partition [16] is polynomial-
time reducible to it. Our reduction is inspired by the construction of Feldmann
and Foschini [13]. Whereas the construction in [13] uses gadgets such that each
consists of ve chains joined at a vertex, the construction in this paper uses
gadgets consisting of nearly-complete binary trees, that are referred to as nice
binary trees. The idea behind using nice binary trees is that we can combine
them to construct a degree-3 tree in which the cuts must happen at specic
edges in order to produce components of certain sizes.
An instance of the 3-Partition problem consists of an integer s > 0 and
a collection S = a1 , . . . , a3k  of 3k positive integers, where each ai satises
s/4 < ai < s/2, for i [3k]. The problem is to decide whether S can be
partitioned into k groups S1 , . . . , Sk , each of cardinality 3, such that the sum
of the elements in each Si is s, for i [k]. By pre-processing the instance of
3k
3-Partition, we can assume that i=1 ai = k s, and that s is divisible by 4.
For the reduction, we construct a degree-3 tree T as follows. For each ai S,
we create a binary tree Ti , whose left subtree Li is a nice binary tree of size ai ,
The Complexity of Tree Partitioning 41

and whose right subtree Ri is a nice binary tree of size s 2. We denote by Ril
and Rir the left and right subtrees of Ri , respectively. Let H = (p1 , . . . , p3k ) be a
path on 3k vertices. The tree T is constructed by adding an edge between each
pi in H and the root of Ti , for i [3k]. See Figure 1 for illustration. It is clear
from the construction that T is a degree-3 tree of 4k s vertices, since each Ti has
size ai + s 1 and P has 3k vertices. We will show that (S, s) is a yes-instance of
3-Partition if and only if the instance I = (T, 6k 1, b = 4k) is a yes-instance
of Balanced Degree-3 Tree Partitioning.

3k

p1 H pi p3k

Li Ri
 
a1 ai Ril Rir a3k
  
s s s s
2
-1 2
-2 s s 2
-1 2
-2
2
-1 2
-2
T1 Ti T3k
Fig. 1. Illustration of the construction of the tree T .

Note that the size of T is 4k s, and hence, if the vertices in T can be grouped
into 4k groups of equal size, then each group must contain s vertices. From the
aforementioned statement, it follows that at least one cut is required in each tree
Ti because the size of each Ti is ai + s 1 > s.
Suppose that the instance I has a solution P that cuts 6k 1 edges in T .

Lemma 1. For i [3k], Ri is not a P -component in CP and Ti does not contain


a lowest P -component of size less than s/4.

Lemma 2. For i [3k], Li is the only P -component contained in Ti , and the


subtree of T induced by (V (Ti ) V (Li )) {pi } is a P -component of size s.

Proof. Since |Ti | > s, any Ti must contain at least one P -component. Since
CP has 6k P -components, at least one of the 3k Ti s contains at most one P -
component, because otherwise the P -components containing vertices in H are
not accounted for. Therefore, at least one Ti contains exactly one P -component
C, which must be a lowest P -component in Ti . By Lemma 1, C = Ri and
|C| s/4, and hence C cannot be any proper subtree of Li , Ril , or Ril . This
leaves Li , Ril , and Ril as the only possible choices for C.
Suppose that C = Ril . After removing C, the partial-Ti , denoted Ti , has
size s 1 + ai (s/2 1) = s/2 + ai , and contains no P -components. Let D
be the set of vertices that are not in Ti , and are in the same group as Ti .
Observe that for any j = i, j [3k], if a vertex in Lj is in D then all vertices
42 Z. An et al.

in Lj are in D. This is true because, by Lemma 1, all vertices in Lj belong


to the same P -component; otherwise Lj would have a lowest P -component of
size less than s/4. This means that the P -component containing Ti has size
|Ti | + |D| s/2 + ai + aj > s. Therefore, D does not include any vertex in Lj .
Similarly, D does not include any vertex in Rjl or Rjr . It follows that D consists
only of vertices in H, the roots of the Ti s, and the roots of the Ri s, i [3k].
However, there are only 9k such vertices, which means |D| 9k and hence the
P -component containing Ti has size |Ti | + |D| s/2 + ai + 9k < s. The last
inequality is true because ai s/2 18k, for i [k].
Therefore, C = Ril . By a similar argument, C = Rir . It follows that C = Li .
After Li is removed, the resulting partial-Ti along with pi in H induces a subtree
Ci of size exactly s, and hence must be a P -component by itself.
After both Li and Ci are removed, there are (3k 1)-many Ti s and 6k 2 P -
components remaining in T . Thus, there is at least one Tj containing exactly one
P -component. By the same argument above, the only P -component contained
in Tj is Lj . Repeating this argument 3k times in total proves the lemma.

Lemma 2 shows that, in a solution P of (T, 6k 1, 4k), each of L1 , . . . , L3k is


a P -component, and the remaining part of each of the 3k Ti s is a P -component
whose size is s. Based on this, the theorem below easily follows:

Theorem 1. Balanced Degree-3 Tree Partitioning is N P-complete.

3 W [1]-completeness
To show that Tree Partitioning is W [1]-hard (membership in W [1] is shown
using a characterization of W [1] given in [7]), we give a xed-parameter tractable
reduction (FPT -reduction) from the k-Multi-Colored Clique problem (k-
MCC), which is W [1]-complete ([11]), and is dened as follows: Given a graph
M = (V (M ), E(M )) and a proper k-coloring of the vertices f : V (M ) C,
where C = {1, 2, ..., k} and each color class has the same cardinality, decide
whether there exists a clique Q V (M ) of size k such that, u, v Q, f (u) =
f (v). For i [k], we dene Ci = {v M | f (v) = i} to be the color class
consisting of all vertices whose color is i. Let n = |Ci |, i [k], and let N = k n.
We label the vertices in Ci arbitrarily as v1i , . . . , vni . We rst introduce some
terminologies.
For a nite set X N and  Z+ , we say that X is -non-averaging if for
any  numbers x1 , . . . , x X, and for any number x X, the following holds:
if x1 + + x =  x then x1 = = x = x.
Let X = {x1 , . . . , xn } be a (k 1)-non-averaging set. It is known that we can
construct such a set X such that each element xi X, i [n], is polynomial in n
(for instance, see [5]). Jensen et al. [18] showed that a (k1)-non-averaging set of
cardinality n, in which each number is at most k 2 n2 n4 , can be constructed   in
polynomial time in n; we will assume that X is such a set. Let k  = k + k2 , and
let z = k 2 n5 . Choose 2k numbers b1 , . . . , bk , c1 , . . . , ck N such that bj = k 2j z
for j [k], and cj = k 2(k+j) z for j [k]. Observe that each number in the
The Complexity of Tree Partitioning 43

sequence b1 , . . . , bk , c1 , . . . , ck is equal to the preceding number multiplied by


k 2 , and that the smallest number b1 in this sequence is k 2 z k 4 n5 . For
 
each j, j  [k], j < j  , we choose a number cjj = ck k 2((j1)kj(j1)/2+j j) .
That is, each number in the sequence c21 , . . . , ck1 , c32 , . . . , ck2 , . . . , ckk1 is equal to
the preceding one multiplied by k 2 , and the smallest number c21 in this sequence
is equal to k 2 ck .
We construct a tree T rooted at a vertex r as follows. For a vertex vij ,
i [n], j [k], we correspond a vertex-gadget (for vertex vij ) that is a star Svj
i
with cj (k 1)bj (k 1)xi 1 leaves, and hence with cj (k 1)bj (k 1)xi
vertices; we label the root of the star rvj , and add the edge rrvj to T . See Figure 2
i i

for illustration. For each edge e in M between two vertices vij and vpq , i, p
[n], j, q [k], j < q, we create two stars Sv j and Sv pq , with bj +xi 1 and bq +xp 1
i
leaves, respectively, and of roots rv j and rv pq , respectively. We introduce a star Se
i
with root re and cqj 1 leaves, and connect re to rv j and rv pq to form a tree Te with
i
root re that we call an edge-gadget (for edge e). We connect re to r. See Figure 3
for illustration. Note that the number of vertices in Te that are not in Sv j Sv pq is
i
exactly cqj . Finally, we create k  +1 copies of a star Sf ix consisting of ckk1 +k  +1
many vertices, and connect the root r of T to the root of each of these copies.
This completes the construction of T . Let t = |T |. We dene the reduction from
k-Multi-Colored Clique to Tree Partitioning to be the map that takes
an instance I = (M, f) of k-Multi-Colored Clique and produces the instance
I  = (T, k  , b = k + k2 , c1 , . . . , ck , c21 , . . . , ck1 , c32 , . . . , ck2 . . . , ckk1 , t ), where k  =
  k 
k + 3 k2 and t = t j=1 cj j,q[k],j<q cqj . Clearly, this reduction is an
FPT -reduction. Next, we describe the intuition behind this reduction.

r
 Se

re

 
Svj
i
Sv j
i
Sv q
p 
rv j rv q
i p cqj 1


  
 

cj (k 1)bj (k 1)xi 1 bj + xi 1 bq + xp 1

Fig. 2. Illustration of the vertex- Fig. 3. Illustration of the edge-gadget for e =


gadget for vij . vij vpq .
44 Z. An et al.

Each number cj , j [k], chosen above, will serve as a signature for class
Cj , in the sense that it will ensure that in any solution to the instance, a vertex-
gadget corresponding to a vertex in class Cj is cut and placed in the group

of size cj . Each number cjj , j, j  [k], j < j  , will serve as a signature for
the class-pair (Cj , Cj  ), in the sense it will ensure that in a solution exactly one
edge-gadget corresponding to an edge e between classes Cj and Cj is cut and

the star Se is placed in the group whose size is cjj . Each number bj , j [k], will
serve as a signature for any edge such that one of its endpoints is in Cj (i.e.,
a signature for an arbitrary vertex in Cj ), ensuring that in a solution, k 1 of
these edges are cut. Finally, the choice of the xi s, for i [n], to be elements of
a (k 1)-non-averaging set, will ensure that all the edges cut that are incident
to vertices in the same class Cj , j [k], are incident to the same vertex in Cj .
Next, we prove the correctness of the reduction. One direction is easy:
Lemma 3. If (M, f ) is a yes-instance of k-Multi-Colored Clique then I 
is a yes-instance of Tree Partitioning.
To prove the converse,
  let P = (EP , P ) be a solution to the instance
I  = (T, k  , b = k + k2 , c1 , . . . , ck , c21 , . . . , ck1 , c32 , . . . , ck2 . . . , ckk1 , t ) of Tree Par-
titioning. Let Gj , j [k], denote the group of size cj , Gqj , j, q [k], j < q,
denote the group of size cqj , and Grest denote the group of size t . We have:
 
Lemma 4. There is a solution P that cuts exactly k  = k + 3 k2 edges from T
as follows. For each j [k], P cuts exactly one edge between the root r of T and
the root of a vertex-gadget corresponding to a vertex in color class Cj ; moreover,
P assigns the resulting vertex-gadget to group Gj . For each j, q [k], j < q, P
cuts exactly 3 edges from one edge-gadget Te , corresponding to an edge e between
a vertex vij , i [n], in color classes Cj , and a vertex vpq , p [n], in color class
Cq ; those 3 edges are the edges rre , re rv j , and re rv pq , where re is the root of star
i
Se in Te , and rv j , rv pq are the roots of stars Sv j , Sv pq in Te , respectively; moreover,
i i
P assigns Se to group Gqj .
Lemma 5. If I  is a yes-instance of Tree Partitioning then (M, f ) is a yes-
instance of k-MCC.

kBy Lemma 4, we can assume that I has a solution P = (EP , P ) that cuts
Proof.
k+3 2 edges, and that satises the properties in the lemma. Let rrvi1 , . . . , rrvik ,
1 k
i1 , . . . , ik [n], be the edges between the root r of T and the roots of the
vertex-gadgets Svi1 , . . . , Svik that P cuts. We claim that the set of vertices Q =
1 1
{vi11 , . . . , vikk } induce a multi-colored clique in M . To show that, it suces to show
 
that each of the k2 edges rre cut by P , between r and the root of an edge-gadget
Te , where e = vij vpq , i, p [n], p, q [k], p < q, satises that vij , vpq Q.
Consider an arbitrary group Gj , j [k]. The size of Gj is cj , and by Lemma 4,
P assigns the star Svj of size cj (k 1)bj (k 1)xij to Gj . Each star Se is
ij

assigned to some group Gqp whose size is exactly |Se |. Therefore, each group Gj
The Complexity of Tree Partitioning 45

contains a vertex-gadget and some of the stars S  j , i [n], j  [k]. Observe


vi
that group Gj , j < k, cannot contain a star S  j such that j  > j because the
vi
size of such a star is at least bj  > k 2 bj , and hence the size of such a star plus
the size of Svj would exceed the size of Gj . Since there are exactly k 1 stars,
ij

of the form Sv k contained in edge-gadgets corresponding to edges incident to



class Ck , it follows that all these stars must be assigned by P to group Gk .
Moreover, no other star Sv j , j < k, can be assigned to Gk , as the size of such a

star would be at least b1 > (k 1)xi for any i [n]; hence, Gk would contain
vertex gadget Svik of size ck (k 1)bk (k 1)xik , plus k 1 stars Sv k of total
k
size greater than (k 1)bk , plus a star of size at least b1 > (k 1)xik , and the
size of Gk would exceed ck .
Similarly, all the k 1 stars of the form Sv k1 contained in edge-gadgets

corresponding to edges incident to class Ck1 are assigned to group Gk1 , and
following this argument, we obtain that for each j [k], the (k 1) stars of
the form Sv j must be assigned to group Gj . We claim that all these stars must

correspond to the same vertex vijj . Observe that this will prove that Q is a clique,
 
since it will imply that each vertex in Q is incident to exactly k 1 of the k2
many edges between the color classes.
Let Sv j , . . . , Sv j be the k 1 stars placed in Gj . The sizes of these stars
i i
1 k1
are bj + xi1 , . . . , bj + xik1 , respectively. The size cj of Gj is equal to the sum of
the sizes of these k 1 stars, plus that of Svj . Therefore: cj = cj (k 1)b
ij

(k 1)xij + (k 1)b + xi1 + + xik1 , and hence, (k 1) xij = xi1 + + xik1 .


Since the set X is (k 1)-non-averaging, it follows that xij = xi1 = = xik1 ,
and hence, the (k 1) stars Sv j must correspond to vertex vijj .

Theorem 2. Tree Partitioning and Balanced Tree Partitioning are


W [1]-complete.

4 Subexponential-time Algorithms
+
 n Z . A partition of n is a collection X of positive integers such that
Let
xX x = n. Let p(n) denote the total number of (distinct) partitions of n.

It is well known that p(n) = 2O( n) [17]. It follows  that the total number
of
partitions of all integers n , where 0 < n n, is 0<n n p(n ) = 2O( n) .
Let L be a list of numbers in N that are not necessarily distinct. We denote
by L(i) the ith number in L, and by Li the sublist of L consisting of the rst i
numbers. The length of L, denoted |L|, is the number of elements in L.
Let (T, k, b, s1 , . . . , sb ) be an instance of Tree Partitioning. Let n = |T |.
Consider a partial assignment of n n vertices of T to the b groups, with the
possibility of some groups being empty. Since the groups are indistinguishable,
such an assignment corresponds to a partition of the n vertices into at most b
46 Z. An et al.

parts, and can be represented by a sorted list L of b numbers in N whose sum


is n , where L(i) n for i [b], is the number of vertices assigned to group
i; we call such a representation of the groups, under a partial assignment, a
size representation, denoted as -representation. Note that the zeroes in a -
representation appear at the beginning. Since each -representation corresponds
uniquely to a partition of a number n n prexed by less than b nzeroes, it
follows that the total number of -representations is n 2O( n) = 2O( n) .
Let X, Y, Z be three lists of the same length. We write X = Y Z if there is
a list Y  obtained via a permutation of the numbers in Y , and a list Z  obtained
via a permutation of the numbers in Z, such that X(i) = Y  (i) + Z  (i), for every
i [|X|]; that is, in the context when the lists are -representations, X = Y Z
if each group-size in X can be obtained, in a one-to-one fashion, by adding a
group-size in Y to a group-size in Z (including group-sizes zero). We have:

Proposition 1. There is a subroutine


Check-Realizability(X, Y, Z) that de-
termines if X = Y Z in time 2O( n) .

Let (T, k, b, s1 , . . . , sb ) be an instance of Tree Partitioning. The key ob-


servation that leads to a subexponential-time algorithm is that the b groups are
indistinguishable. Therefore, all assignments of the n vertices in T to the b groups
can be compactly represented by lists of numbers, where each list corresponds
to a partition of n into b parts. This simple, yet crucial, observation allows for a
compact representation of all solutions using a solution space of size 2O( n) .
Suppose that T is rooted at an arbitrary vertex r. The algorithm uses dy-
namic programming, starting from the leaves of T , and climbing T up to its root
r. At each vertex v in T , we construct a table v that contains the following
information. For each -representation X, for each k  = 0, . . . , n, and for each
s [n], v (k  , X, s) is true if and only if there is a cut C of k  edges in Tv
such that the component Pv containing v in Tv C has size s (note that this
component, so far, is still attached to the rest of the tree above v), and such
that there is an assignment to the components in Tv C Pv to the b groups
whose -representation is X; otherwise, v (k  , X, s) is false. If v (k  , X, s) is
true, we store a witness that realizes such a partial solution. To compute v ,
we consider the children of v one by one. After a child ui of v is considered, we
have computed a partial table i containing partial solutions up to child ui ; this
is done by considering the two possibilities of whether or not the edge vui is in
the cut C. Although the above may seem like we are enumerating all possibilities
for the edges between v and its children to be cut or not, the crucial ingredient
for this approach to achieve the desired running time is that the table v at
vertex vcan
be computed based on the tables corresponding to the children of
v in 2O( n) time. This analysis works similarly to iterative compression, as the
table i is a compressed table, storing 2O( n) many entries.
Suppose that the algorithm is at vertex v whose children are u1 , . . . , ud ,
and that the tables u1 , . . . , ud associated with u1 , . . . , ud , respectively, have
been constructed. To compute v , we iterate through the edges vu1 , . . . , vud .
Let Tp , for p [d], be the subtree of T rooted at v that is induced by the
The Complexity of Tree Partitioning 47
p
vertex-set ( j=1 V (Tuj )) {v}. Consider edge vui , and assume inductively, that
a table i1 has been computed (based on tables u1 , . . . , ui1 ) that contains
the following information. For each k  = 0, . . . , n, for each s [n], and for each
-representation X, i1 (k  , X, s) is true if and only if there is a cut C of k 
edges in Ti1 , with s being the size of the component Pv containing v in Ti1 C,
and an assignment to the components in Ti1 C Pv that realizes X. After
considering vui , we will compute a table i such that, for each k  = 0, . . . , n, for
each s [n], and for each -representation X, i (k  , X, s) is true if and only
if there is a cut C of k  edges in Ti , with s being the size of the component Pv
containing v in Ti C, and an assignment to the components in Ti C Pv that
realizes X. We explain how the Boolean value i (k  , X, s) is computed, and omit
how the witness is stored. After we are done computing d , we set v = d .
To compute i , we compute two tables i and i+ , and set i = i i .
Table i contains the solutions that can be obtained by cutting edge uvi , and
i+ contains those that can be obtained by not cutting edge vui .
1. To compute i , we enumerate each possible triplet (k  , X, s), where k  =
0, . . . , n, s [n], and X is a -representation. Fix such a triplet (k  , X, s). To com-
pute i (k  , X, s), we iterate through every entry in ui containing (kui , Y, sui )
and every entry of i1 containing (ki1 , Z, si1 ) such that k  = kui + ki1 + 1
(because 1 more cut is introduced, corresponding to the edge vui ), and s = si1
because the component Pui containing ui of size sui becomes a separate compo-
nent after vui is cut. Since Pui becomes a separate component, it will be placed
into one of the groups, and hence, it contributes its size to one of the numbers
in the -representation X. We enumerate each number in X as the number that
Pui contributes to. For each number j in X satisfying j |Pui |, we subtract
|Pui | from j in X to obtain a new -representation X  from X, and then call
Check-Realizability(X  , Y, Z); i (k  , X, s) is true i for some number j in
X, Check-Realizability(X  , Y, Z) returns true.
2. To compute i+ , we enumerate each triplet (k  , X, s), where k  = 0, . . . , n,
s [n], and X is a -representation. Fix such a triplet (k  , X, s). To compute
i+ (k  , X, s), we iterate through every entry in ui containing (kui , Y, sui ), and
every entry in i1 containing (ki1 , Z, si1 ), such that k  = kui + ki1 , and s =
sui +si1 (because sui is attached to v). We call Check-Realizability(X, Y, Z),
and set i+ (k  , X, s) to true i Check-Realizability(X, Y, Z) returns true.

Theorem 3. The dynamic programming algorithm described above


solves Tree
Partitioning and Balanced Tree Partitioning in time 2O( n) .

Bibliography

[1] Z. An, Q. Feng, I. Kanj, and G. Xia. The Complexity of Tree Partitioning.
Available at http://arxiv.org/abs/1704.05896.
[2] K. Andreev and H. Rcke. Balanced graph partitioning. Theory of Com-
puting Systems, 39(6):929939, 2006.
48 Z. An et al.

[3] P. Arbenz, G. van Lenthe, U. Mennel, R. Mller, and M. Sala. Multi-level


-nite element analysis for human bone structures. In PARA 2006, pages
240250, 2006.
[4] S. Bhatt and F. Leighton. A framework for solving VLSI graph layout
problems. Journal of Computer and System Sciences, 28(2):300343, 1984.
[5] . Boscznay. On the lower estimation of non-averaging sets. Acta Mathe-
matica Hungariga, 53(1-1):155157, 1989.
[6] J. Chen, I. Kanj, L. Perkovic, E. Sedgwick, and G. Xia. Genus characterizes
the complexity of certain graph problems: Some tight results. Journal of
Computer and System Sciences, 73(6):892907, 2007.
[7] Y. Chen, J. Flum, and M. Grohe. Machine-based methods in parameterized
complexity theory. Theoretical Computer Science, 339(2-3):167199, 2005.
[8] D. Delling, A. Goldberg, T. Pajor, and R. Werneck. Customizable route
planning. In SEA 2011, pages 376387, 2011.
[9] E. Demaine, F. Fomin, M. Hajiaghayi, and D. Thilikos. Subexponential pa-
rameterized algorithms on bounded-genus graphs and H-minor-free graphs.
J. ACM, 52:866893, 2005.
[10] Reinhard Diestel. Graph Theory, 4th Edition. Springer, 2012.
[11] R. Downey and M. Fellows. Fundamentals of Parameterized Complexity.
Springer, New York, 2013.
[12] A. Feldmann. Balanced partitions of grids and related graphs, 2012. Ph.D.
thesis, ETH, Zurich, Switzerland.
[13] A. Feldmann and L. Foschini. Balanced partitions of trees and applications.
Algorithmica, 71(2):354376, 2015.
[14] A. Feldmann and P. Widmayer. An O(n4 ) time algorithm to compute the
bisection width of solid grid graphs. Algorithmica, 71(1):181200, 2015.
[15] F. Fomin, S. Kolay, D. Lokshtanov, F. Panolan, and S. Saurabh. Subexpo-
nential algorithms for rectilinear steiner tree and arborescence problems. In
SoCG 2016, pages 39:139:15, 2016.
[16] M. Garey and D. Johnson. Computers and Intractability: A Guide to the
Theory of NP-Completeness. W. H. Freeman, New York, 1979.
[17] G. Hardy and S. Ramanujan. Asymptotic formulae in combinatory analysis.
Proceedings of the London Mathematical Society, 17(2):75115, 1918.
[18] K. Jansen, S. Kratsch, D. Marx, and I. Schlotter. Bin packing with
xed number of bins revisited. Journal of Computer and System Sciences,
79(1):3949, 2013.
[19] P. Klein and D. Marx. A subexponential parameterized algorithm for subset
TSP on planar graphs. In SODA 2014, pages 18121830, 2014.
[20] R. MacGregor. On partitioning a graph: a theoretical and empirical study,
1978. Ph.D. thesis, University of California at Berkeley, California, USA.
[21] H. Rcke and R. Stotz. Improved approximation algorithms for balanced
partitioning problems. In STACS 2016, pages 58:158:14, 2016.
[22] J. Shi and J. Malik. Normalized cuts and image segmentation. IEEE Trans-
actions on Pattern Analysis and Machine Intelligence, 22(8):888905, 2000.
[23] R. van Bevern, A. Feldmann, M. Sorge, and O. Such. On the parame-
terized complexity of computing balanced partitions in graphs. Theory of
Computing Systems, 57(1):135, 2015.
Eectiveness of Local Search for Art Gallery
Problems

Sayan Bandyapadhyay1 and Aniket Basu Roy2


1
Computer Science, University of Iowa, Iowa City, USA
2
Computer Science and Automation, Indian Institute of Science, Bangalore, India
[email protected], [email protected]

Abstract. We study the variant of the art gallery problem where we


are given an orthogonal polygon P (possibly with holes) and we want to
guard it with the minimum number of sliding cameras. A sliding camera
travels back and forth along an orthogonal line segment s in P and a
point p in P is said to be visible to the segment s if the perpendicular
from p onto s lies in P . Our objective is to compute a set containing the
minimum number of sliding cameras (orthogonal segments) such that
every point in P is visible to some sliding camera. We study the following
two variants of this problem: Minimum Sliding Cameras problem, where
the cameras can slide along either horizontal or vertical segments in P ,
and Minimum Horizontal Sliding Cameras problem, where the cameras
are restricted to slide along horizontal segments only. In this work, we
design local search PTASes for these two problems improving over the
existing constant factor approximation algorithms. We note that in the
rst problem, the polygons are not allowed to contain holes. In fact, there
is a family of polygons with holes for which the performance of our local
search algorithm is arbitrarily bad.

1 Introduction

Local search is a popular technique for designing time and cost ecient approx-
imation algorithms. It has a long history in combinatorial optimization and has
proved to be very eective for achieving near-optimum solutions. The use of this
technique in geometric approximation is relatively new, but has resulted in im-
proved approximation for metric and geometric versions of many combinatorial
problems. In fact, this technique has been used in this domain to achieve several
breakthrough results.
In this article, we restrict ourselves to the works based on local search in
geometric approximation. One of the rst results of local search for the problems
in metric space is a 3+ approximation algorithm for k-median due to Arya et al.
[1]. An arguably simplied analysis was later given by Gupta and Tangwongsan
[15]. Building on the work of Arya et al., Kanungo et al. [16] have designed a
9 + approximation algorithm for k-means. In a celebrated work Mustafa and

The author has been supported by NSF under Grant CCF-1615845.

Springer International Publishing AG 2017 49


F. Ellen et al. (Eds.): WADS 2017, LNCS 10389, pp. 4960, 2017.
DOI: 10.1007/978-3-319-62127-2_5
50 S. Bandyapadhyay and A. Basu Roy

Ray [20] designed the rst PTASes for the Hitting Set problem for a wide class
of geometric range spaces. Around the same time Chan and Har-Peled [7] gave
PTASes for Maximum Independent Set problem of geometric objects including
fat objects and pseudodisks in the plane. Cohen-Addad and Mathieu [8] have
shown the eectiveness of local search for achieving PTASes for facility location
type problems. In a recent breakthrough, Cohen-Addad et al. [9] and Friggstad et
al. [13] have independently designed the rst PTAS for k-means which was a long
standing open problem. Very recently, Govindarajan et al. [14] have obtained the
rst PTASes for the Set Cover and Dominating Set problems for non-piercing
regions. See also [2, 3, 4, 5] for related work on local search.
In this paper, we consider art gallery problems and design PTASes using local
search proving the eectiveness of this technique for a new family of problems.

1.1 Art Gallery Problems


In the classical art gallery problem, we are given a polygon P (possibly with
holes), and the goal is to determine the number of guards (points) needed that
can see all parts of P . A guard can see the portion of the polygon not obstructed
by the polygon boundary, considering the boundary to be opaque. Over the
years dierent variants of the problem have been studied based on the shape
of the polygon, the type of guards employed, and the notion of visibility. The
polygons can be of specic type like orthogonal3 , monotone etc. Guards can be
stationary or mobile. In case of stationary guards, either one can place the guards
anywhere inside the polygon (point guards) or restrict them only to the vertices
of the polygon (vertex guards). The notion of mobile guards was introduced by
Toussaint [21], where each guard can travel to and fro along a segment inside
the polygon, and every point in the polygon must be seen by at least one guard
at some point of time along its path. If the notion of visibility is altered, it gives
rise to a lot of other variants like k-transmitters [22], multi-guarding [18] etc.
One such variant is called sliding cameras, where the polygon is considered to
be orthogonal. A sliding camera is a mobile guard that can move back and forth
along an orthogonal (or axis-parallel) segment. In the following, we formally
dene this notion.
Denition 1 (Sliding Camera). Given an orthogonal polygon P , any orthog-
onal (horizontal or vertical) segment contained in P is called a sliding camera. If
the corresponding segment is horizontal (resp. vertical), then the sliding camera
is horizontal (resp. vertical). A sliding camera s can guard a point p P if there
is a point q s such that the segment pq is perpendicular to s and is contained
in P . A set S of sliding cameras can guard the polygon P , if for every point
p P , there is a sliding camera in S that can guard p.
In this article, we study the following two problems involving sliding cameras.
Denition 2 (Minimum Horizontal Sliding Cameras Problem (MHSC)).
Given an orthogonal polygon P , compute a set S containing the minimum num-
ber of horizontal sliding cameras, that can guard P .
3
A polygon is said to be orthogonal if all of its sides are axis-parallel.
Effectiveness of Local Search for Art Gallery Problems 51

Denition 3 (Minimum Sliding Cameras Problem (MSC)). Given an


orthogonal polygon P , compute a set S containing the minimum number of
sliding cameras, that can guard P .
The MSC and MHSC problems were introduced by Katz and Morgenstern
[17]. They showed that if P is simple (has no holes), MHSC can be solved in
polynomial time. For monotone P , they obtain a polynomial time 2 approxima-
tion for MSC. Later for this special case, de Berg et al. [10] gave a linear time
exact algorithm. MHSC and MSC both are known to be N P -hard for polygons
with holes [6, 11]. Recently, Biedl et al. [6] have given the rst constant factor
approximation algorithms for MHSC and MSC for polygons possibly with holes.
Currently, this is the best known approximation factor for both problems.

1.2 Related Work


The art gallery problem is related to the 1.5D Terrain Guarding problem. In the
latter problem, the input is a terrain T consisting of an x-monotone polygonal
chain, and we need to guard the terrain T by choosing the minimum number of
point guards on it. The discrete version of the problem comes with two nite sets
G, X T and one needs to compute the minimum sized subset G G such that
G guards X. A local search framework similar to the ones in [7, 20] was used by
Krohn et al. [19] to give a PTAS for the discrete version of the problem. Building
on this result, Friedrichs et al. [12] gave a PTAS for the continuous version. Also
note that the collection of problems considered in the local search framework of
[2] includes problems on guarding polygons and terrains with limited visibility
and appropriate shallowness assumption.

1.3 Our Results and Techniques


In this article, we use a standard local search framework to obtain PTASes
for the MHSC and MSC problems. In fact, we give PTASes for certain hitting
set problems involving segments that yield the PTASes for MHSC and MSC.
We note, that we get a PTAS for MHSC even in the case where the polygon
contains holes. However, we get the PTAS for MSC only if the polygon is simple
(has no holes). In fact, one can show that in case of MSC where the polygon
contains holes, the performance of local search can be arbitrarily bad. Our main
contribution is the design of two planar graph embedding schemes which are used
to prove the planarity of certain graphs. In Section 2 we dene some notations
and describe the local search framework that we use. In Section 3 and 4 we use
the framework for MHSC and MSC, respectively, and prove that the framework
yields PTASes for both problems. Due to lack of space, many proofs are omitted
which can be found in the full version of the paper.

2 Preliminaries
Consider the orthogonal polygon P in the MSC or MHSC problem. An orthog-
onal segment s P is called canonical if (i) s is an extension of a side of P ,
52 S. Bandyapadhyay and A. Basu Roy

and (ii) s is maximal in terms of length, i.e., there is no other segment in P that
strictly contains it. We note that the endpoints of a canonical segment lie on the
boundary of P . Also the number of canonical segments is at most the number
of sides of P . It is not hard to see that there exists a canonical segment s for
any segment s P , such that s can guard all the points in P guarded by s.
Henceforth, for any solution S of MHSC or MSC, without loss of generality we
assume that S consists of only canonical segments. Obviously, for MHSC, any
solution consists of only horizontal canonical segments.

2.1 The Local Search Framework

Now we describe a local search framework similar to the ones in [7, 20] for
designing and analyzing local search algorithms. In the following sections we will
apply this framework to get near optimum approximations for MHSC and MSC.
We note that this framework is applicable for discrete optimization problems,
where given a set S, the goal is to nd an optimum subset S  S that is feasible.
Notably, not every subset S  S is a feasible solution. Moreover, there is an
initial feasible solution that can be found in polynomial time, and given any
S  S, one can decide the feasibility of S  in polynomial time. We note that
for MHSC (resp. MSC), S is the nite set of all horizontal (resp. horizontal and
vertical) canonical segments, which is a feasible solution. Let n = |S|. Fix > 0.
As we deal with only minimization problems in this article, the local search
algorithm we consider is the following.

Local Search Algorithm. Choose a parameter k. Start with some feasible


solution A. At each iteration, search for A A and C S \ A such that
|A | k, |C| < |A |, and (A \ A ) C is a feasible solution. If such A and C
exist, update A to (A \ A ) C and reiterate. Otherwise, return A.
As we shoot for a (1 + ) approximation we set k := c/ 2 for some constant
c. From the above discussion, it is not hard to see that the running time of the
algorithm is polynomial. A feasible solution A is said to be local optimum if there
is no A A and C S \ A such that |A | k, |C| < |A |, and (A \ A ) C is
a feasible solution. Note that the local search algorithm always returns a local
optimum solution. Let R and B be an optimum solution and the local search
solution, respectively. For simplicity, we assume that R B = . Otherwise, one
can remove the common elements R B from both R and B, and perform a
similar analysis. As we remove the same number of elements from both R and
B the approximation ratio of the original instance is at most the approximation
ratio of the restricted one. Now we state the conditions required for the local
search algorithm to be a PTAS.

Theorem 1. [7, 20]. Consider a minimization problem . Suppose there exists


a planar bipartite graph H=(R B, E), that satises the local exchange property:
For any subset B B, (B \ B  ) N (B  ) is a feasible solution. Then the Local
Search Algorithm is a PTAS. Here N (B  ) is the set of neighbors of B  in H.
Effectiveness of Local Search for Art Gallery Problems 53

3 The MHSC Problem


Instead of directly working with MHSC we consider the following Orthogonal
Segment Covering (OSC) problem: Given a nite set H of non-intersecting hor-
izontal segments and a nite set V of vertical segments in the plane, nd a
minimum cardinality set S H such that any segment in V is intersected by S.
From the work due to Biedl et al. [6] we have the following theorem.
Theorem 2. [6] MHSC reduces to the Orthogonal Segment Covering problem.
In particular, an approximation for the Orthogonal Segment Covering problem
yields an approximation for MHSC.
We note that the non-intersecting assumption of the horizontal segments
comes from the fact that we consider only the canonical horizontal segments in
MHSC to guard P which are non-intersecting. Biedl et al. [6] gave a constant
approximation for OSC which implies a constant approximation for MHSC. We
use the local search framework to obtain a PTAS for OSC; by Theorem 2 we
obtain a PTAS for MHSC as well.
Let L be the local search solution and G be an optimum solution. We show
that there exists a planar bipartite graph H=(G L, E) that satises the local
exchange property; by Theorem 1 the local search algorithm is a PTAS for
OSC. As mentioned before, we can assume WLOG that L G = . For any
two intersecting vertical segment v and horizontal segment h, let I(h, v) be the
intersection point.
Construction of H. Initially the set of vertices of H consists of the intersection
points of the segments in L G V and the endpoints of the segments in L G.
We rst join the vertices on any horizontal segment using edges. In particular, for
any segment h LG, let {p1 , . . . , pt } be the vertices in H corresponding to h in
increasing order of their x-coordinates. For each 1 i t 1, draw a horizontal
edge between pi and pi+1 . Then we join the consecutive horizontal segments.
Formally, for any two segments h1 L and h2 G, if h1 and h2 intersect a
segment v of V, and h3 L G \ {h1 , h2 } such that I(h3 , v) is on the segment
joining I(h1 , v) and I(h2 , v), draw a vertical edge between I(h1 , v) and I(h2 , v).
For any segment h L G, contract all the vertices in H corresponding to h
into a single vertex. The modied graph is the desired graph H.
It is obvious that before the contractions, H is a planar graph, as it is a
subgraph of the graph corresponding to the arrangement of the segments in
L G V. Now note that the segments in L G are non-intersecting. Thus
there is a 1-1 correspondence between the vertices in nal H and the segments
in L G. Furthermore, any edge in H is between a vertex corresponding to a
segment in L and a vertex corresponding to a segment in G. As planar graphs
are closed under contraction of edges, H is planar.
Observation 4. H = (G L, E) is a planar bipartite graph.
Observation 5. For any segments h1 , h2 , v such that h1 L, h2 G, v V, if
there is an edge in H between I(h1 , v) and I(h2 , v) before the contractions, then
there is an edge corresponding to h1 and h2 in the nal graph H.
54 S. Bandyapadhyay and A. Basu Roy

Lemma 3. H = (G L, E) satises the local exchange property.

Proof. It is sucient to show that for any v V, there exist h1 L and h2 G


such that h1 and h2 intersect v, and there is an edge between h1 and h2 in
H. Consider any v V. Also consider the subset of segments S L G that
intersect v. Then S must contain two segments h1 , h2 such that h1 L, h2 G
and h3 such that I(h3 , v) is on the segment joining I(h1 , v) and I(h2 , v). Thus
there must be an edge in H before the contractions between I(h1 , v) and I(h2 , v).
From Observation 5 it follows that there is an edge in H between h1 and h2 which
completes the proof.

We conclude this section with the following theorem.

Theorem 4. There exists a local search PTAS for the MHSC problem, where
the input polygon may or may not contain holes.

4 The MSC Problem

We use the local search framework to get a PTAS for MSC problem assuming P
does not contain any holes. In fact, one can construct a family of polygons with
holes for which our local search scheme performs very poorly (see full paper).
We start the local search algorithm with the set of canonical segments. Now
consider the local search solution L and an optimum solution R. Then we have
the following lemma which will be useful later.

Lemma 5. Consider the local search solution L and an optimum solution R.


There is a local optimum solution B such that |B| = |L|, and for every point
p P , there exists segments b B and r R both of which guard p and either
of the following is true.

1. b and r are both horizontal or both vertical.


2. One of b and r is horizontal and the other is vertical, and r b = .

Henceforth, we consider the local optimum solution B in Lemma 5 and show


that |B| (1 + )|R|. As |L| = |B| the local search algorithm is a PTAS. Like
before, WLOG we can assume that B R = . We will show the existence of a
bipartite planar graph G(R B) that satises the local exchange property.
Denote the arrangement of a set of segments S by A(S). Consider the edges
and the vertices of A(S). One can visualize these edges and vertices as a plane
graph and dene its connected components accordingly. Now consider any such
component C and let S  be the subset of segments of S corresponding to C. We
dene the closure of C (denoted by closure(C)) as the union of the points on
the segments in S  and the points in the bounded cells of A(S  ). Dene H(S)
as the union of the closures of the components in A(S), i.e., H(S) := CA(S)
closure(C)). Also dene H(S) as the union of the boundaries of the closures in
H(S) (see Figure 1b). Later, we will prove the following theorem.
Effectiveness of Local Search for Art Gallery Problems 55

(a) (b)

Y

(c) (d)

Fig. 1: (a) A connected component of the arrangement. (b) The boundary of the
closure of the component. (c) A horizontal segment X and a vertical segment
Y (bolded). The two slabs generated by taking the Minkowski sum of the two
segments with S , a square of side length . (d) The fattened boundary of the
closure.

Theorem 6. Given a set of canonical horizontal segments X and a set of canon-


ical vertical segments Y, one can construct a planar graph G(X Y) satisfying
the following properties.
1. The vertices in G(X Y) correspond to the segments in X Y.
2. For each Xi , Xj X , such that there exists a vertical segment v contained in
P that intersects Xi and Xj , and Xk X that intersects v and lies between
Xi and Xj , (Xi , Xj ) is in G(X Y).
3. For each Yi , Yj Y, such that there exists a horizontal segment h contained
in P that intersects Yi and Yj , and Yk Y that intersects h and lies between
Yi and Yj , (Yi , Yj ) is in G(X Y).
4. For each Xi X , and Yj Y, such that Xi Yj is on H(X Y), (Xi , Yj )
is in G(X Y).
We construct the planar graph G(R B) by applying Theorem 6 on the
horizontal and vertical segments of RB. We remove all the edges from G(RB)
that joins two segments of R or two segments of B making it bipartite for the
partition (R, B). The following lemma completes our claim that the local search
algorithm is a PTAS. The proof of the lemma partly follows from Lemma 5.
Lemma 7. G(R B) satises the local exchange property.

4.1 Graph Construction Algorithm


In this section, we prove Theorem 6. Given a set of horizontal segments X and a
set of vertical segments Y, we dene a graph G(X Y) on X Y. The construction
56 S. Bandyapadhyay and A. Basu Roy

is a bit involved and hence we describe it in a sequence of steps. After dening


the graph G(X Y) we show a planar embedding of this graph. First we dene
three graphs GX = (X , EX ), GY = (Y, EY ) and GX ,Y = (X Y, EX ,Y ) with
respect to the simple orthogonal polygon P . The edge set of G(X Y) is dened
to be the union of EX , EY , and EX ,Y .
A pair of horizontal segments Xi , Xj X are called consecutive if there
exists a vertical segment v contained in P that joins Xi and Xj , and there does
not exist Xk X that intersects v and lies between Xi and Xj . We add an
edge to EX between each pair of consecutive segments in X . If Xi and Xj are
consecutive but there does not exist a vertical segment in Y intersecting them,
then we call (Xi , Xj ) a soft edge. Likewise, we dene the consecutive segments
in Y, the graph GY = (Y, EY ) and the soft edges of GY . We make the following
claim.

Lemma 8. GX and GY are forests.

We assume that the arrangement A(X Y) of the segments in X Y has only


one connected component and later show how to remove this assumption. Then
for each pair Xi , Xj X , there is a chain of vertical and horizontal segments in
X Y that connects Xi and Xj . Thus by denition GX is also connected and
hence is a tree. Similarly, GY is a tree. We refer to the closure of the component
in A(X Y) by H and its boundary by H. Dene GX ,Y = (X Y, EX ,Y ) to be
the bipartite graph on X and Y, such that (X, Y ) EX ,Y i X Y H = .
We note that, by denition G(X Y) satises the four properties mentioned
in Theorem 6. Thus it is sucient to show that G(X Y) is planar, to which
we turn next. First we use the embedding of X Y to get an intermediate plane
graph H. Then we perform some planarity preserving operations on H to obtain
G(X Y). Hence we get a planar drawing of G(X Y), thus proving G(X Y)
is planar.
To construct the plane graph H we use the given embedding of the segments
in X Y. We consider the endpoints of the segments in X Y and the intersection
points of the segments in X Y to be the vertex points of H. We rst join the
vertices on any horizontal segment using edges. For any segment h X Y, let
{p1 , . . . , pt } be the vertices in H corresponding to h in increasing order of their
x-coordinates. For each 1 i t 1, draw a horizontal edge between pi and
pi+1 . Similarly, we join the vertices on any vertical segment using vertical edges
and call them the edges corresponding to that vertcal segment. It is not hard to
see that H is a plane graph. One can visualize H as a graph where each X X
is being represented by its left endpoint, and each Y Y is being represented by
the segment Y itself. Later we will contract the edges corresponding to Y Y to
represent them using points in the plane. Note that the edges of EY are already
present in H. Thus to get a drawing of G(X Y) we need to draw the edges
of EX and EX ,Y . In the remainder of the section, we will show the planarity
preserving operations on H that leads to the drawing of G(X Y). This will be
done in two stages. In the rst stage, we add some edges to H. In the second
stage, we contract several edges.
Effectiveness of Local Search for Art Gallery Problems 57

First, we x some notations. For every X X , denote its left (resp. right)
endpoint by (X) (resp. r(X)), and the set of vertical segments in Y intersecting
it by vert(X). Also, denote any non-empty intersection point X Y by p(X, Y ),
where X X and Y Y.
One can visualize H as a self-intersecting curve. For simplicity we will dis-
entangle it to get a simple closed curve. To this end, we consider the object
H = H S , which is the Minkowski-sum of H and a square S with side length
, where is an arbitrarily small positive quantity (see Figure 1c and 1d). This is
basically fattening the boundary H such that the boundary of H is a simple
closed curve. Also note that it fattens only towards the positive horizontal and
vertical axes. Let H be the boundary of H . Now for every p(X, Y ) H,
there exists at least one point on H among the following points p(X, Y ),
p(X, Y ) + (0, ), p(X, Y ) + (, 0), and p(X, Y ) + (, ). Refer to that point as
p (X, Y ). If multiple of these points exist on H , then choose one arbitrarily.
For convenience we use p (X, Y ) as a proxy for p(X, Y ) while adding edges
to H whose one endpoint is p(X, Y ). At the end we will use the original points
p(X, Y ). As the two points are arbitrarily close the latter conversion does not af-
fect the planarity. Hereafter, for any reference to a point p (X, Y ), we will assume
that p(X, Y ) H. Now note that the only edges that are needed to be drawn
are the edges in EX and EX ,Y . The endpoints of the edges in EX will be the left
endpoints of the segments in X . Also the endpoints of the edges in EX ,Y will be
the left endpoints of the segments in X and the intersection
 points
 p(X, Y ) for
X X and Y Y such that p(X, Y ) H. Let Q = X (X) X,Y p (X, Y ),
the set of endpoints of the edges we will draw. Note that all the points of Q are
on H .
We consider GX as a tree rooted at some segment Xr X . Later we will
use this tree structure to add edges to H in an inductive manner. We denote
the parent of a segment Xi with respect to GX by parent(Xi ). Let r(Xr ) =
(x , y  ). We cut open the closed curve H at (x , y  + ) such that the open
curve is homeomorphic to an interval M , where r(Xr ) gets mapped before (Xr ).
For simplicity, we denote the mapped points by their original notations. Thus
r(Xr ) < (Xr ) in M . Note that one can consider another homeomorphism to an
interval (the reection of M with respect to its middle point) so that (Xr ) <
r(Xr ). One can visualize M in a way such that H is disconnected at the point
(x , y  + ) and straightened out to get M . The way we have dened M it has the
following property: for any child Xi of Xr , if Xi lies above Xr , r(Xr ) < (Xr ) <
(Xi ) < r(Xi ) and if Xi lies below Xr , r(Xr ) < r(Xi ) < (Xi ) < (Xr ). Observe,
that the endpoints of M are not in Q and we already have an embedding of the
points of Q on the interval M . We use this embedding of the points to draw the
edges between them so that the edges do not cross each other.
For any edge (a, b) EX EX ,Y , (a, b) is called an edge corresponding to a
segment X of GX if either a or b is X, and the other endpoint is not parent(X).
For any subtree, we call all the edges corresponding to its nodes as its corre-
sponding edges. Now we proceed towards the inductive process of addition of
edges. For that we need to dene a concept called zone for every segment Xi of
58 S. Bandyapadhyay and A. Basu Roy

4
s4 t4
6
1

2 t2 s2
3 t3 s3

Fig. 2: The bolded curves corresponding to the children (2, 3, 4) of 1 are mapped to
the corresponding zones in M . si and ti are the respective left and right endpoint
of the zone of i for i = 2, 3, 4.

GX , which is basically a sub-interval of M . We will ensure that the endpoints of


the edges corresponding to Xi lies in its zone. The structure of H or M ensures
that the zones have many useful properties, which we will exploit heavily.
For the root segment Xr , zone(Xr ) is dened to be the entire interval M .
For any other Xi X , let Y and Yr be the leftmost and the rightmost ver-
tical segment in vert(Xi ) vert(parent(Xi )), respectively. If Xi lies above its
parent, then zone(Xi ) = [p(Xi , Y ), p(Xi , Yr ) + (, 0)]. Otherwise, zone(Xi ) =
[p(Xi , Yr ) + (, ), p(Xi , Y ) + (0, )]. See Figure 2. Now we have the following
observation.
Observation 6. The following statements are true regarding zones.
1. zone(Xi ) zone(parent(Xi )) for every Xi X .
2. For any segment X X , Y Y, p (X, Y ) and (X) lies outside zone(Xj ),
where Xj is a child of X.
3. The endpoints of the edges corresponding to a segment X X lie within the
zone of X. Moreover, for all edge corresponding to the subtree rooted at X,
both of the endpoints lie on the same side of (X).
4. The zones of the segments corresponding to the children of X are pairwise
disjoint.
In the following lemma, we show the rst stage of our construction, where
the edges are drawn without crossing.

Lemma 9. Given the plane graph H as dened before, the edges of EX and
EX ,Y can be drawn in a non-crossing manner.

Proof. We note that the edges of EX EX ,Y are drawn outside of the closed
curve H . Thus they do not cross the edges of H as the latter edges lie inside
H . Consider the set Q of the endpoints of the edges to be drawn. We use the
Effectiveness of Local Search for Art Gallery Problems 59

embedding of the points of Q on M for drawing edges between them. As M is


homeomorphic to the open curve we obtain by cutting open H this lemma
follows. Now we give an explicit construction of a drawing of the edges. In each
step, we draw the edges corresponding to a subtree of GX rooted at some node
X, given the drawings corresponding to the subtrees rooted at the children of
X. In the base case, we draw the edges corresponding to the leaves of GX . Note
that each leaf is corresponding to a segment X X . The only edges we draw
corresponding to X are of the form ((X), p (X, Y )), and hence it is easy to see
that these edges can be drawn without any crossing.
Now consider any non-leaf node X. By induction we already have a crossing-
free drawing corresponding to the subtree rooted at any child of X. From state-
ments (1) and (3) of Observation 6 it follows that the endpoints of the edges
in this drawing must lie within the zone of the child. As zones of the children
are disjoint by statement (4) of the same Observation, we get a crossing-free
drawing with respect to the children of X. Thus the only additional edges we
need to draw have (X) as an endpoint. The other endpoint could be l(Xi ) for
a child Xi of X or p (X, Y ) for (X, Y ) EX ,Y . Now l(X) and p (X, Y ) do not
belong to the zone of any child of X by statement (4) of Observation 6. Also
by statement (3) of the same observation, both of the endpoints of any existing
edge corresponding to the subtree rooted at a child Xj of X lie on the same
side of l(Xj ). Hence all the additional edges can be drawn without crossing any
existing edge.
Now we begin the second stage of planarity preserving operations, i.e. the
edge contractions. We contract (p(X, Y ), r(X)) for every X X where Y is the
rightmost vertical segment among the ones intersecting X. After this for every
Y Y we contract every edge subdividing Y such that a single point remains
at the end corresponding to Y . Thus for every Y , there exists a unique vertex
point. Hence, by construction all the properties in Theorem 6 are satised.
One can extend the construction for the case when A(X Y) has more than
one components. We conclude this section with the following theorem.

Theorem 10. There exists a local search PTAS for the MSC problem, where
the input polygon does not contain holes.

Acknowledgments
We would like to thank the anonymous referees, Abhiruk Lahiri, and Kasturi
Varadarajan for their valuable comments, which have helped us improve the
presentation of the paper.

References
[1] V. Arya, N. Garg, R. Khandekar, A. Meyerson, K. Munagala, and V. Pandit.
Local search heuristics for k-median and facility location problems. SIAM
J. Comput., 33(3):544562, 2004.
60 S. Bandyapadhyay and A. Basu Roy

[2] R. Aschner, M. J. Katz, G. Morgenstern, and Y. Yuditsky. Approximation


schemes for covering and packing. In WALCOM 2013., pages 89100.
[3] P. Ashok, A. Basu Roy, and S. Govindarajan. Local search strikes again: PTAS
for variants of geometric covering and packing. In COCOON, 2017.
[4] S. Bandyapadhyay and K. R. Varadarajan. On variants of k-means cluster-
ing. In SoCG 2016,, pages 14:114:15, 2016.
[5] V. V. S. P. Bhattiprolu and S. Har-Peled. Separating a voronoi diagram via
local search. In SoCG 2016,, pages 18:118:16, 2016.
[6] T. C. Biedl, T. M. Chan, S. Lee, S. Mehrabi, F. Montecchiani, and
H. Vosoughpour. On guarding orthogonal polygons with sliding cameras.
CoRR, abs/1604.07099, 2016.
[7] T. M. Chan and S. Har-Peled. Approximation algorithms for maximum
independent set of pseudo-disks. DCG, 48(2):373392, 2012.
[8] V. Cohen-Addad and C. Mathieu. Eectiveness of local search for geometric
optimization. In SoCG 2015,, pages 329343, 2015.
[9] V. Cohen-Addad, P. N. Klein, and C. Mathieu. Local search yields approx-
imation schemes for k-means and k-median in euclidean and minor-free
metrics. In FOCS 2016, pages 353364, 2016.
[10] M. de Berg, S. Durocher, and S. Mehrabi. Guarding monotone art galleries
with sliding cameras in linear time. In COCOA 2014, pages 113125, 2014.
[11] S. Durocher and S. Mehrabi. Guarding orthogonal art galleries using sliding
cameras: Algorithmic and hardness results. In MFCS, pages 314324, 2013.
[12] S. Friedrichs, M. Hemmer, J. King, and C. Schmidt. The continuous 1.5d
terrain guarding problem: Discretization, optimal solutions, and PTAS.
JoCG, 7(1):256284, 2016.
[13] Z. Friggstad, M. Rezapour, and M. R. Salavatipour. Local search yields a
PTAS for k-means in doubling metrics. In FOCS 2016, pages 365374.
[14] S. Govindarajan, R. Raman, S. Ray, and A. Basu Roy. Packing and covering
with non-piercing regions. In ESA 2016, pages 47:147:17, 2016.
[15] A. Gupta and K. Tangwongsan. Simpler analyses of local search algorithms
for facility location. CoRR, abs/0809.2554, 2008.
[16] T. Kanungo, D. M. Mount, N. S. Netanyahu, C. D. Piatko, R. Silverman,
and A. Y. Wu. A local search approximation algorithm for k-means clus-
tering. Comput. Geom., 28(2-3):89112, 2004.
[17] M. J. Katz and G. Morgenstern. Guarding orthogonal art galleries with
sliding cameras. Int. J. Comput. Geometry Appl., 21(2):241250, 2011.
[18] D. G. Kirkpatrick. An o(lg lg opt)-approximation algorithm for multi-
guarding galleries. DCG, 53(2):327343, 2015.
[19] E. Krohn, M. Gibson, G. Kanade, and K. Varadarajan. Guarding terrains
via local search. Journal of Computational Geometry, 5(1):168178, 2014.
[20] N. H. Mustafa and S. Ray. Improved results on geometric hitting set prob-
lems. Discrete & Computational Geometry, 44(4):883895, 2010.
[21] J. ORourke. Art Gallery Theorems and Algorithms. Oxford University
Press, Inc., New York, NY, USA, 1987. ISBN 0-19-503965-3.
[22] J. ORourke. Computational geometry column 52. SIGACT News, 43(1):
8285, Mar. 2012. ISSN 0163-5700.
Parameterized Complexity of Geometric
Covering Problems Having Conicts 

Aritra Banik1 , Fahad Panolan2 , Venkatesh Raman3 , Vibha Sahlot1 , and Saket
Saurabh3
1
Indian Institute of Technology, Jodhpur, India.
{aritrabanik|sahlotvibha}@gmail.com
2
Department of Informatics, University of Bergen, Norway.
[email protected]
3
The Institute of Mathematical Sciences, HBNI, Chennai, India.
{vraman|saket}@imsc.res.in

Abstract. The input for the Geometric Coverage problem consists


of a pair = (P, R), where P is a set of points in Rd and R is a set
of subsets of P dened by the intersection of P with some geometric
objects in Rd . These coverage problems form special instances of the
Set Cover problem which is notoriously hard in several paradigms
including approximation and parameterized complexity. Motivated by
what are called choice problems in geometry, we consider a variation of the
Geometric Coverage problem where there are conicts on the covering
objects that precludes some objects from being part of the solution if
some others are in the solution.
As our rst contribution, we propose two natural models in which the
conict relations are given: (a) by a graph on the covering objects, and
(b) by a representable matroid on the covering objects. We consider the
parameterized complexity of the problem based on the structure of the
conict relation. Our main result is that as long as the conict graph has
bounded arboricity (that includes all the families of intersection graphs
of low density objects in low dimensional Euclidean space), there is a
parameterized reduction to the problem without conicts on the covering
objects. This is achieved through a randomization-derandomization trick.
As a consequence, we have the following results when the conict graph
has bounded arboricity.
If the Geometric Coverage problem is xed parameter tractable
(FPT), then so is the conict free version.
If the Geometric Coverage problem admits a factor -approximation,
then the conict free version admits a factor -approximation algo-
rithm running in FPT time.
As a corollary to our main result we get a plethora of approximation
algorithms running in FPT time. Our other results include an FPT algo-
rithm and a W[1]-hardness proof for the conict-free version of Covering
Points by Intervals. The FPT algorithm is for the case when the con-
icts are given by a representable matroid, and the W[1]-hardness result

Supported by Parameterized Approximation, ERC Starting Grant 306992, and
Rigorous Theory of Preprocessing, ERC Advanced Investigator Grant 267959.

Springer International Publishing AG 2017 61


F. Ellen et al. (Eds.): WADS 2017, LNCS 10389, pp. 6172, 2017.
DOI: 10.1007/978-3-319-62127-2_6
62 A. Banik et al.

is for all the families of conict graphs for which the Independent Set
problem is W[1]-hard.

1 Introduction, Motivation, Model and Our Results


There are many real life geometric covering problems, for which there exist
additional constrains that need to be enforced. In this paper, we attempt to
address these problems and hope that this will initiate a new line of research
directed at bridging the gap between theory and practice.
To dene our model of covering with conicts, we start by dening the classic
covering problem. The input to a covering problem consists of a universe U of size
n, a family F of size m of subsets of U and a positive integer k. Our objective is
to check whether there exists a subfamily F  F of size at most k satisfying
some desired properties. If F  is required to contain all the elements of U , then
it corresponds to the classical Set Cover problem and F  is called a set cover.
The Set Cover problem is part of Karps 21 NP-complete problems [11].
We begin the development with a conict free problem already studied,
Conflict Free Interval Covering, introduced in [1,2,3]. Let P be a set of
points on the x-axis, and let I = {I1 , . . . , Im } be a set of intervals on the x-axis.
Furthermore, let C = {C1 , C2 , . . . , C } denote a set of color classes, where each
color class Ci consists of a pair of intervals from I. Moreover, for any pair of
integers i, j (1 i < j ), Ci Cj = . We term C a matching family. For a
set of intervals Q I, Q is conict free if Q contains at most one interval from
each color class, i.e. 1i |Q Ci | 1. Finally, for an interval I = [a, b] and a
point c on x-axis, we say I covers p if and only if a c b. Now we are ready to
dene the problem formally.
Rainbow Covering
Input: A set of points P on the x-axis, a set of intervals I = {I1 , . . . , Im } on
the x-axis and a matching family C = {C1 , C2 , . . . , C }.
Question: Does there exist a conict free subset Q of intervals which covers
all the points in P ?
Our rst goal is to dene a model in which we can express much more
generalized version of conicts beyond the matching family of conict graphs.
To dene our model we revisit Set Cover, as the model is best dened in
the most general setting. Recall that the input to a Set Cover consists of a
universe U of size n, a family F of subsets of U of size m. A natural way to
model conict is by using graphs. Formally stated, we have a graph CGF , on the
vertex set F and there is an edge between two sets Fi , Fj F if Fi and Fj are in
conict. We call CGF a conict graph. Observe that in the Rainbow Covering
problem, the family C would corresponds to CGC with degree at most one. That
is, edges of CGC form a matching. And the question of nding a conict free
subset Q of intervals covering all the points in P becomes a problem of nding a
set Q of intervals that covers all the points in P and CGC [Q] is an independent
set. The set cover F  such that CGF [F  ] is an independent set will be called
conict free set cover.
Parameterized Complexity of Geometric Covering Problems Having Conflicts 63

Our Contributions. In this paper we study the following problems in geo-


metric settings in the realm of Parameterized Complexity. For more details about
parameterized complexity we refer to monographs [4].
Graphical Conflict Free Set Cover (Graphical CF-SC)
Input: A universe U of size n, a family F of size m of subsets of U , a conict
graph CGF and a positive integer k.
Parameter: k
Question: Does there exist a set cover F  F of size at most k such that
CGF [F  ] is an independent set?
Let (A, B)-Set Cover denote a restriction of Set Cover, where every
instance (U, F, k) of Set Cover satises the property that U A and F B.
For example in this setting, Covering Points by Intervals corresponds to
(A, B)-Set Cover where A is the set of points on x-axis and B is the set of
intervals on x-axis. Given (A, B)-Set Cover, the corresponding Graphical
CF-SC corresponds to (A, B)-Graphical CF-SC.
Observe that Graphical CF-SC becomes Set Cover if CGF is an indepen-
dent set. As the general Set Cover is hard in the parameterized framework, to
design an FPT algorithm for Graphical CF-SC, it is important that the base
Set Cover problem is FPT. This restricts us to (A, B)-Set Cover which are
either FPT or polynomial time solvable. If we are seeking FPT approximation
algorithms then we can also restrict ourselves to (A, B)-Set Cover which has
either polynomial time approximation scheme (PTAS), constant factor approxi-
mation algorithm or FPT approximation algorithms, even if the problem is not
in FPT. For example (A, B)-Set Cover, where A is set of points in R2 and B is
a set of unit discs in R2 is known to be W[1] hard [14] but admits a PTAS [10].
We will call (A, B)-Set Cover tractable if it admits one of the following: a
polynomial time algorithm, an FPT algorithm, an (E)PTAS, a constant factor
approximation algorithm, an FPT approximation algorithm.
The next natural question is if we restrict ourselves to tractable (A, B)-Set
Cover, can an arbitrary conict graph CGF yield tractable algorithms for the
conict-free versions of (A, B)-Set Cover? To formalize this question, let G
denote a family of graphs. Then, the question is for which family of graphs G, does
(A, B)-Graphical CF-SC admit an FPT algorithm or an FPT approximation
algorithm when CGF belongs to G. For example, if G is the family of cliques,
then even Graphical CF-SC trivially becomes polynomial time solvable when
CGF belongs to this family of cliques.
A problem that will be central to our study is the following. Let P and I
denote a set of points and a set of intervals on the x-axis, respectively.
(P, I )-Graphical CF-SC Parameter: k
Input: A set of points P P, a set of intervals I = {I1 , . . . , Im } I , a
conict graph CGI and a positive integer k.
Question: Does there exist a conict free set cover of size at most k?
In (P, I )-Graphical CF-SC, when CGI belongs to the family of matchings
then the problem becomes Parameterized Rainbow Covering. This problem
64 A. Banik et al.

was studied in [1] and shown to be NP-complete. In fact, even if we do not care
about the size of the conict free set cover we seek, just the decision version of a
conict free set cover set is the same as Rainbow Covering, which is known to
be NP-complete. Thus, seeking a conict free set cover can transform a problem
from being tractable to intractable.
In order to restrict the family of graphs to which a conict graph belongs, we
need to dene the notion of arboricity. The arboricity of an undirected graph is the
minimum number of forests into which its edges can be partitioned. A graph G is
said to have arboricity d if the edges of G can be partitioned into at most d forests.
Let Gd denote the family of graphs of arboricity d. This family includes the family
of intersection graphs of low density objects in low dimensional Euclidean space
as explained in [8,9]. Specically, this includes planar graphs, graphs excluding a
xed graph as a minor, graphs of bounded expansion, and graphs of bounded
degeneracy. Har-Peled and Quanrud [8,9] showed that low-density geometric
objects form a subclass of the class of graphs that have polynomial expansion,
which in turn, is contained in the class of graphs of bounded arboricity. Thus,
our restriction of the family of conict graphs to a family of graphs of bounded
arboricity covers a large class of low-density geometric objects.

Theorem 1. Let (A, B)-Set Cover be tractable and let Gd be the family of
graphs of arboricity d. Then, the corresponding (A, B)-Graphical CF-SC is
also tractable if CGF belongs to Gd . In particular we obtain following results
when CGF belongs to Gd :
If (A, B)-Set Cover admits an FPT algorithm with running time (k)nO(1) ,
then (A, B)-Graphical CF-SC admits an FPT algorithm with running time
2O(dk) (k) nO(1) .
If (A, B)-Set Cover admits a factor -approximation running in time
nO(1) then (A, B)-Graphical CF-SC admits a factor -FPT-approximation
algorithm running in time 2O(dk) nO(1) .

The proof of Theorem 1 is essentially a black-box reduction to the non-conict


version of the problem. Thus, Theorem 1 covers a number of conict-free version of
many fundamental geometric coverage problems as illustrated in Table 1. In light
of Theorem 1, it is natural to ask whether or not, these problems admit polynomial
time approximation algorithms. Unfortunately, we cannot expect these problems
to admit even a factor o(n)-approximation algorithm. This is because for most
of these problems even deciding whether there exists a conict free solution, with
no restriction on the size of the solution, is NP-complete (for example Rainbow
Covering is NP-complete [1]). Thus, having an o(n)-approximation algorithm
would imply a polynomial time algorithm for the decision version of the problem,
which we do not expect unless P=NP. Hence, the best we can expect for the
(A, B)-Graphical CF-SC problems is an FPT-approximation algorithm, as for
many of them we can neither have an FPT algorithm, nor a polynomial time
approximation algorithm.
We complement our algorithmic ndings by a hardness reduction. Let G
denote a family of graphs. Let G -Independent Set be the problem where the
Parameterized Complexity of Geometric Covering Problems Having Conflicts 65

(R2 , A)-SC Complexity of Complexity of


(R2 , A)-SC (R2 , A)-Graphical CF-SC
Disks/pseudo-disks PTAS -FPT approx., > 1
Fat triangles of same size O(1) O(1)-FPT approx.
Fat objects in R2 O(log OPT) O(log OPT)-FPT approx.
O(1) density objects in R2 PTAS -FPT approx., > 1

Objects with polylog density QPTAS 2O(k) nO(log n) time approx.,
> 1
Objects with density O(1) in Rd PTAS -FPT approx., > 1
(A, B)-Set Cover where every in- O(d log(dOPT)) O(d log(dOPT))-FPT ap-
stance (U, F ) has VC dimension d prox.
Point Guard Art Gallery O(log OPT) O(log OPT)-FPT approx.
Terrain Guarding PTAS -FPT approx., > 1
(P, I )-Set Cover Polynomial Time 2O(dk) nO(1) -FPT algorithm
Table 1. Corollaries of Theorem 1. Here (R2 , A)-Set Cover ((R2 , A)-SC) is a geometric
set cover problem where R2 is a set of points in the plane and the covering objects are
specied in the rst column. The conict graph for all the problems is Gd , family of
graphs of arboricity d, for some constant d. For the denitions of density and fatness
we refer to [8]. The entries in the second column give the approximation ratio of the
(R2 , A)-SC problem based on Theorem 1.

input is a graph G G and a positive integer k, and the objective is to decide


whether there is a set S of size at least k such that G[S] is an independent set.
Theorem 2. Let G denote a family of graphs such that G -Independent Set
is W[1]-hard. If CGI belongs to G , then (P, I )-Graphical CF-SC does not
admit an FPT algorithm, unless FPT =W[1].
The proof of Theorem 2 is a Turing reduction based on (n, k)-perfect hash
families [16] that takes time 2O(k) nO(1) . In fact, for any xed A and B, one
should be able to follow this proof and show W[1]-hardness for (A, B)-Graphical
CF-SC, where CGF belongs to a graph family G for which G -Independent
Set is W[1]-hard. Due to paucity of space the proof of Theorem 2 is deferred to
the full version of the paper.
Theorem 1 captures those families of conict graphs that are everywhere
sparse. However, the (A, B)-Graphical CF-SC problem is also tractable if the
conict graphs belong to the family of cliques. When the conict graph belongs to
a dense family of graphs, we design a general theorem using matroid machinery.
Let (U, F, k) be an instance of Set Cover. In the matroidal model of
representing conicts, we are given a matroid M = (E, J ), where the ground set
E = F, and J is a family of subsets of F satisfying all the three properties of a
matroid. In this paper we assume that M = (E, J ) is a linear or representable
matroid, and the corresponding linear representation is given as part of the input.
In the Rainbow Covering problem, let Q denote the family of conict free
subsets of intervals in I. One can dene a partition matroid on F such that
J = Q. Thus, the question of nding a conict free subset of intervals covering all
the points in P becomes a problem of nding an independent set in J that covers
66 A. Banik et al.

all the points in P . The Matroidal Conflict Free Set Cover problem
(Matroidal CF-SC, in short) is dened similarly to Graphical CF-SC. In
particular, the input consists of a linear matroid M = (F, J ) over the ground
set F such that the set cover F  J .
Theorem 3. (P, I )-Matroidal CF-SC is FPT for all representable matroids
M = (I, J ) dened over I. In fact, given a linear representation, the algorithm
runs in time 2k (n + m)O(1) . Here, is the exponent in the running time of
matrix multiplication.
A graph is called a cluster graph, if all its connected components are cliques.
Since cluster graphs can be captured by partition matroids, Theorem 3 implies
that (P, I )-Matroidal CF-SC is FPT if CGF is a cluster graph.
Notations. For t N, we use [t] as a shorthand for {1, 2, . . . , t}. A family of sets
A is called a p-family, if the cardinality of all the sets in A is p. Given two families
of sets A and B, we dene A B = {X Y | X A and Y B and X Y = }.
Given a graph G, V (G) and E(G) denote its vertex-set and edge-set, respectively.
We borrow notations from the book of Diestel [5] for graph-related notations.

2 FPT Algorithms
In this section we prove Theorems 1 and Theorem 3. The Proof of Theorem 1 is
based on a randomization scheme while the proof of Theorem 3 uses the idea of
ecient computation of representative families [6].

2.1 FPT Algorithms for Graphical CF-SC


Our algorithm for Theorem 1 is essentially a randomized reduction from (A, B)-
Graphical CF-SC to (A, B)-Set Cover, when the conict graph has bounded
arboricity. Towards this, we start with a forest decomposition of graphs of
bounded arboricity and then apply a randomized process to obtain an instance
of (A, B)-Set Cover. However, to design a deterministic algorithm we use the
construction of universal sets. For this, we will exploit the following denition
and theorem.
Denition 1 ([16]). An (n, t)-universal set F is a set of functions from {1, . . . , n}
to {0, 1}, such that for every subset S {1, . . . , n}, |S| = t, the set F |S =
{f |S | f F } is equal to the set 2S of all the functions from S to {0, 1}.
Theorem 4 ([16]). There is a deterministic algorithm with O(2t tO(log t) n log n)
run time that constructs an (n, t)-universal set F such that |F | = 2t tO(log t) log n.
Now we are ready to give the proof of Theorem 14
Proof (Proof of Theorem 1). Let (U, F, CGF , k) be an instance of (A, B)-
Graphical CF-SC, where CGF belongs to Gd . Our algorithm has the following
phases.
4
The idea used in the proof of Theorem 1 is inspired by a proof used in [13].
Parameterized Complexity of Geometric Covering Problems Having Conflicts 67

Decomposing CGF into Forests. We apply the known polynomial time


algorithm [7] to decompose the graph CGF into T1 , . . . , Td where Ti is a forest
d
in CGF and i=1 E(Ti ) = E(CGF ). Let vroot be a special vertex such that vroot
does not belong to V (CGF ) = F. Now for every Ti , and for every connected
component of Ti , we pick an arbitrary vertex and connect it to vroot . Now if
we look at the tree induced on V (Ti ) {vroot } then it is connected and we will
denote this tree by Ti . Furthermore, we will treat each Ti as a tree rooted at
vroot . This automatically denes parent-child relationship among the vertices of
Ti . This completes the partitioning of the edge set of CGF into forests.
Step 1: Randomized event and probability of success. Independently
color the vertices of CGF into blue and green uniformly at random. That is, we
color the vertices of CGF blue and green with probability 12 . Furthermore, we
color {vroot } to blue. Let F  be a conict free set cover of size at most k. We
consider the following event to be good.
Every vertex in F  is colored green and every parent of every vertex in
F  in every tree Ti is colored blue.
Let Sparent denote the set of parents of every vertex in F  in every tree Ti . Since,
we have at most d trees and the size of F  is upper bounded by k we have that
|Sparent | kd. We say that F  (Sparent ) is green (blue) to mean that every vertex
in F  (Sparent ) is colored green (blue). Thus,
Pr[good event happens] = Pr[F  is green Sparent is blue]
1
= Pr[F  is green] Pr[Sparent is blue] .
2k(d+1)
The second equality follows from the following fact. The set F  is an independent
set in CGF and Sparent NCGF (F  ) {vroot }. Thus, these sets are pairwise
disjoint and hence the events F  is colored green and Sparent is colored blue are
independent.
1
Step 2: A cleaning process. Let p = 2kd . Now we apply a cleaning procedure
so that we get a set Z such that CGF [Z] is an independent set in CGF and it
contains F  . Let B denote the set of vertices that have been colored blue. We start
by deleting every vertex in B. Now for every edge (f1 , f2 ) in CGF [V (CGF ) \ B],
we do as follows. We know that (f1 , f2 ) belongs to some tree Ti and thus either
f1 is a child of f2 or vice-versa. If f1 is a child then we delete f1 , otherwise
we delete f2 . Let the resulting set of vertices be Z. By construction Z is an
independent set in CGF . Next we show that F  Z with probability p/2k .
Clearly, with probability 21k we know that no vertex of F  is colored blue and
thus with probability 21k we know that F  V (CGF ) \ B. Observe that with
probability p, we have that all the parents of F  in any tree Ti have been colored
blue. Thus, a vertex x V (CGF ) \ B, colored green, can not belong to F  , if it
is a child of some vertex in some tree Ti after deleting the vertices of B. This
is the reason when we delete a vertex from an edge (f1 , f2 ), we delete the one
which is a child in some tree Ti . Thus, by deleting a vertex that is a child in
an edge (f1 , f2 ), we do not delete any vertex from F  . This implies that with
1
probability 2k(d+1) , we have that F  Z. This completes the proof.
68 A. Banik et al.

Solving the problem. Let Q be a parameterized algorithm for (A, B)-Set


Cover running in time (k) nO(1) . Recall that (U, F, CGF , k) is an instance of
(A, B)-Graphical CF-SC. Now to test whether there exists a conict free set
cover F  of size at most k, we run Q on (U, Z, k). If the algorithm return Yes,
we return the same for (A, B)-Graphical CF-SC. Else, we repeat the process
by randomly nding another Z by following Steps 1 and 2 and then running
the algorithm Q on the instance (U, Z , k) and returning the answer accordingly.
We repeat the process 2k(d+1) time. If we fail to detect whether (U, F, k, CGF )
is a Yes instance of (A, B)-Graphical CF-SC in 2k(d+1) rounds, then we return
that the given instance is a No instance. Thus, if (U, F, k, CGF ) is No instance of
(A, B)-Graphical CF-SC, then we always return No. However, if (U, F, k, CGF )
is a Yes instance of (A, B)-Graphical CF-SC then there exists a set F  , that is
a conict free set cover of size at most k. The probability that we will notqnd a

set Z containing F in q = 2 k(d+1)
rounds is upper bounded by 1 q 1e .
1

Thus, the probability that we will nd a set Z containing F  in q rounds is at


least 1 1e 12 . Thus, if the given instance is a Yes instance then the algorithm
succeeds with probability at least 12 . The running time of the algorithm is upper
bounded by (k) 2k(d+1) nO(1) .
Derandomizing the algorithm. Now to design our deterministic algorithm
all we will need to do is to replace the randomized coloring function with
a deterministic coloring function that colors the vertices in F  green and all
the vertices in Sparent to blue. To design such a coloring function we set t =
k(d + 1), and use Theorem 4 to construct an (n, t)-universal set F such that
|F | = 2t tO(log(t)) log n. The algorithm to construct F takes O(2t tO(log(t)) n log n).
Finally, to derandomize our algorithm, rather than randomly coloring vertices
with {blue, green}, we go through each function f in the family F and view the
vertices that have assigned 0 as blue and others as green. By the properties of
(n, t)-universal set we know that there exists a function f that correctly colors the
vertices in F  with 1 and every vertex in Sparent with 0. Thus, the set Zf we will
obtain by applying Step 2 will contain the set F  . After this the correctness of the
algorithm follows from the correctness of the algorithm Q. Thus, the running time
of the algorithm is upper bounded by (k)|F |nO(1) = (k)2k(d+1)+o(kd) nO(1) .
This completes the proof of the rst part.
Let S be a factor -approximation algorithm for (A, B)-Set Cover running
in time nO(1) . To obtain the desired FPT approximation algorithm with factor ,
we do as follows. We only give the deterministic version of the algorithm based on
the uses of universal sets. As before, let (U, F, CGF , k) be an instance of (A, B)-
Graphical CF-SC, where CGF , belongs to Gd . We again set t = k(d+1), and use
Theorem 4 to construct an (n, t)-universal set F such that |F | = 2t tO(log(t)) log n.
The algorithm to construct F takes O(2t tO(log(t)) n log n). We go through each
function f in the family F and view the vertices that have been assigned 0 as
blue and others as green. If there exists a conict free set cover F  of size at
most k, then by the properties of (n, t)-universal set we know that there exists
a function f that correctly color the vertices in F  with 1 and every vertex in
Sparent with 0. Thus, the set Zf we will obtain by applying Step 2, will contain
Parameterized Complexity of Geometric Covering Problems Having Conflicts 69

the set F  . Thus, to design the approximation algorithm, for every f F , we


rst construct Zf . And for each such Zf we run S on (U, Zf , k). This could
either return that there is No solution, or returns a solution F  which is a factor
-approximation to the instance (U, Zf , k). If for some f F , S returns F 
of size at most k when run on (U, Zf , k) then the algorithm returns F  . In all
other cases the algorithm returns that the given instance is a No instance. The
correctness of the algorithm follows from the properties of universal sets and
the correctness of the algorithm S . The running time of the algorithm is upper
bounded by: |F | Running time of S = 2k(d+1)+o(kd) nO(1) . This completes
the proof.

2.2 FPT Algorithm for (P, I )-Matroidal CF-SC


In this section we will design an FPT algorithm proving Theorem 3. Towards that
we need to dene some basic notions related to representative families and results
regarding their fast and ecient computation. For denitions related to matroids
and a broad overview of representative families we refer to [4, Chapter 12].
Denition 2 (q-Representative Family [15,4]). Given a matroid M = (E, J )
and a family S of subsets of E, we say that a subfamily S S is q-representative
for S if the following holds: for every set Y E of size at most q, if there is a
set X S disjoint from Y with X Y J , then there is a set X S disjoint
from Y with X Y J . If S S is q-representative for S we write S q S.
rep

Lemma 1 ([6]). Let M = (E, J ) be a matroid and S be a family of subsets of


E. If S  qrep S and S qrep S  , then S qrep S.
Lemma 2 ([12]). Let M = (E, J ) be a linear matroid of rank n and let S =
{S1 , . . . , St } be a p-family of independent sets. Let A be a n|E| matrix represent-
ing M over a eld F, where F = Fp or F is Q. 
Then there is a deterministic algo-


p+q 3 2
1

rithm computing S S of size np
q
in O p+q
tp n + t p+q (pn)1 +
rep p p q
O(1)
(n + |E|) operations over F.
Now we are ready to prove Theorem 3. Let (P, I, k, M = (I, J )) be an
instance of (P, I )-Matroidal CF-SC, where P is a set of points on the x-axis,
I = {I1 , . . . , Im } is a set of intervals on the x-axis and M = (I, J ) is a matroid
over the ground set I. The objective is to nd a set cover S I of size at most
k such that S J .
To design our algorithm for (P, I )-Matroidal CF-SC, we will use e-
cient computation of representative families applied on a dynamic programming
algorithm. Let P = {p1 , . . . , pn } denote the set of points sorted from left to right.
Next we introduce the notion of family of partial solutions. Let
  

P i = X  X I, X J , |X| k, X covers p1 , . . . , pi

denote the family of subsets of intervals of size at most k that covers rst i points
and are independent in the matroid M = (I, J ). Furthermore, for every j [k],
by P ij , we denote the subset of P i containing sets of size exactly j. Thus,
70 A. Banik et al.


k
Pi = P ij .
j=1

In this subsection whenever we talk about independent sets, these are independent
sets of the matroid M = (I, J ). Furthermore, we assume that we are given, AM ,
the linear representation of M . Without loss of generality we can assume that
AM is a n |I| matrix, where n |I|.
Observe that (P, I, k, M = (I, J )) is a Yes instance of (P, I )-Matroidal
CF-SC if and only if P n is non-empty. This implies that P n is non-empty if and
only if P n 0 P n is non-empty. We capture this into the following lemma.
rep

Lemma 3. Let (P, I, k, M = (I, J )) be an instance of (P, I )-Matroidal


CF-SC. Then, (P, I, k, M = (I, J )) is a Yes instance of (P, I )-Matroidal
n 0 P n is non-empty.
CF-SC if and only if P n is non-empty if and only if P rep

For an ease of presentation by P 0 , we denote the set {}. The next lemma
provides an ecient computation of the family P i 1k P i . In particular, for
rep
every 1 i n, we compute

k 
 
i =
P ij kj P ij .
P rep
j=1

Lemma 4. Let (P, I, k, M = (I, J )) be an instance of (P, I )-Matroidal


CF-SC. Then for every 1 i n, a collection of families P i 1k P i , of size
rep
O(1)
at most 2 |I| k can be found in time 2 (n + |I|)
k k
.

Proof. We describe a dynamic programming based algorithm. Let P = {p1 , . . . , pn }


denote the set of points sorted from left to right and D be a n + 1-sized array
indexed with {0, . . . , n}. The entry D[i] will store a family P i 1k P i . We ll
rep
the entries in the matrix D in the increasing order of index. For i = 0, D[i] = {}.
Let i {0, 1, . . . , n} and assume that we have lled all the entries until the row
i (i.e, D[i] will contain a family P i 1k P i ). For any interval I I, let I be
rep
the lowest index in [n] such that pI is covered by I. Let Zi+1 denote the set of
intervals I I that covers the point pi+1 . Now we compute

N i+1 = (D[I 1] {I}) J (1)
IZi+1

Notice that in the Equation 1, the union is taken over I Zi+1 . Since for any
I Zi+1 , I covers pi+1 , the value I 1 is strictly less than i + 1 and hence
Equation 1 is well dened. Let N (i+1)j denote the subset of N i+1 containing
subsets of size exactly j.

Claim. N i+1 1k
rep P
i+1
.
Parameterized Complexity of Geometric Covering Problems Having Conflicts 71

Proof. Let S P (i+1)j and Y be a set of size k j (which is essentially an


independent set of M ) such that S Y = and S Y J . We will show that
there exists a set S N (i+1) such that S Y = and S Y J . This will
imply the desired result.
Since S covers {p1 , . . . , pi+1 }, there is an interval J in S which covers pi+1 .
Since S covers {p1 , . . . , pi+1 } and J covers pi+1 , the set of intervals S  = S \ {J}
covers {p1 , . . . , pi+1 } \ {pJ , . . . , pi+1 } and J covers {pJ , . . . pi+1 }. Let Y  =
Y {J}. Notice that S  Y  = S Y J , |S  | = j 1, |Y  | = k j + 1 and S 
covers {p1 , . . . , pi+1 } \ {pJ , . . . , pi+1 }. This implies that S  P (J 1)(j1) and
by our assumption that D[J 1] contain P (J 1)(j1) kj+1 P (J 1)(j1) , we
rep
have that there exists S D[J 1] such that S Y  = and S Y  J . By

Equation 1, S {J} in N i+1 , because S {J} J . Now we set S = S {J}.


Observe that S Y = and S Y J . This completes the proof of the claim.

We ll the entry for D[i + 1] as follows.


k  
D[i + 1] = N (i+1)j kj N (i+1)j (2)
rep
j=1

In Equation 2, for every 1 j k, N (i+1)j denote the subset of N (i+1) containing


sets of size exactly j and N (i+1)j can be computed using Lemma 2. Lemma 1
and Claim 2.2 implies that D[i + 1] 1k rep P
i+1
.
Now we analyse the running time of the algorithm. Consider the time to
compute D[i + 1]. We already have computed the family corresponding to D[r] for
all r [i]. By Lemma 2, for any r [i] and j [k], the
subset of D[r] containing
sets of size exactly j is upper bounded by |I| k kj . Hence, the cardinality


of N (i+1)j is upper bounded by |I|2 n k kj . Thus, by Lemma 2, the time



to compute N (i+1)j kj N (i+1)j is bounded by k 2 + k (n + |I|)O(1) =
rep j j

k O(1)
(n + |I|) number of operation over the eld in which AM is given and
j

k

|N (i+1)j
| |I| k . Hence the total running time to compute D[i + 1] for any
j
i + 1 [n] is
k  
 k
(n + |I|)O(1) ) = 2k (n + |I|)O(1) .
j=1
j

By Lemma 2, the cardinality of D[i + 1] is bounded by,


k 
k  
(i+1)j | k
|D[i + 1]| = |N |I| k = 2k |I| k.
j=1 j=1
j

This completes the proof.


Theorem 3 follows from Lemmata 3 and 4. Now we explain an application of


Theorem 3. Consider the problem (P, I )-Graphical CF-SC, where CGI is a
cluster graph. Let (P, I, CGI , k) be an instance of (P, I )-Graphical CF-SC.
72 A. Banik et al.

Let C1 , . . . Ct be the connected components of CGI , where each Ci is a clique for


all i [t]. In any solution we are allowed to pick at most one vertex (an interval)
from Ci for any i [t]. This information can be encoded using a partition matroid
M = (I = V (C1 )  . . .  V (Ct ), J ) where any subset I  I is independent in M
if and only if |I  V (Ci )| 1 for any i [t]. Moreover, a linear representation of
a partition matroid can be found in polynomial time ([15, Proposition 3.5]). As
a result, by applying Theorem 3 and Proposition 3.5 of [15], we get the following
corollary.
Corollary 1. (P, I )-Graphical CF-SC, when CGI is a cluster graph, can
be solved in time 2k (n + |I|)O(1) .

References
1. Arkin, E.M., Banik, A., Carmi, P., Citovsky, G., Katz, M.J., Mitchell, J.S.B.,
Simakov, M.: Choice is hard. In: ISAAC. pp. 318328 (2015)
2. Arkin, E.M., Banik, A., Carmi, P., Citovsky, G., Katz, M.J., Mitchell, J.S.B.,
Simakov, M.: Conict-free covering. In: CCCG (2015)
3. Banik, A., Panolan, F., Raman, V., Sahlot, V.: Frechet distance between a line and
avatar point set. FSTTCS pp. 32:132:14 (2016)
4. Cygan, M., Fomin, F.V., Kowalik, L., Lokshtanov, D., Marx, D., Pilipczuk, M.,
Pilipczuk, M., Saurabh, S.: Parameterized algorithms. Springer (2015)
5. Diestel, R.: Graph Theory, 4th Edition, Graduate texts in mathematics, vol. 173.
Springer (2012)
6. Fomin, F.V., Lokshtanov, D., Panolan, F., Saurabh, S.: Ecient computation of
representative families with applications in parameterized and exact algorithms. J.
ACM 63(4), 29 (2016)
7. Gabow, H.N., Westermann, H.H.: Forests, frames, and games: Algorithms for
matroid sums and applications. Algorithmica 7(5&6), 465497 (1992)
8. Har-Peled, S., Quanrud, K.: Approximation algorithms for low-density graphs.
CoRR abs/1501.00721 (2015)
9. Har-Peled, S., Quanrud, K.: Approximation algorithms for polynomial-expansion
and low-density graphs. In: ESA. vol. 9294, pp. 717728. Springer (2015)
10. Hunt III, H.B., Marathe, M.V., Radhakrishnan, V., Ravi, S.S., Rosenkrantz, D.J.,
Stearns, R.E.: NC-approximation schemes for NP- and PSPACE-hard problems for
geometric graphs. J. Algorithms 26(2), 238274 (1998)
11. Karp, R.M.: Reducibility among combinatorial problems. In: Proceedings of a
symposium on the Complexity of Computer Computations. pp. 85103 (1972)
12. Lokshtanov, D., Misra, P., Panolan, F., Saurabh, S.: Deterministic truncation of
linear matroids. In: ICALP, Proceedings, Part I. vol. 9134, pp. 922934. Springer
(2015)
13. Lokshtanov, D., Panolan, F., Saurabh, S., Sharma, R., Zehavi, M.: Covering small
independent sets and separators with applications to parameterized algorithms.
ArXiv e-prints (May 2017)
14. Marx, D.: Parameterized complexity of independence and domination on geometric
graphs. In: IPEC, pp. 154165. Springer (2006)
15. Marx, D.: A parameterized view on matroid optimization problems. Theor. Comput.
Sci. 410(44), 44714479 (2009)
16. Naor, M., Schulman, J.L., Srinivasan, A.: Splitters and near-optimal derandomiza-
tion. In: FOCS. pp. 182191 (1995)
Obedient Plane Drawings for Disk Intersection Graphs

Bahareh Banyassady1, , Michael Hoffmann2 ,


Boris Klemz1 , Maarten Lofer3, , Tillmann Miltzow4,  
1
Institute of Computer Science, Freie Universitat Berlin, Germany
2
Department of Computer Science, ETH Zurich, Switzerland
3
Dept. of Computing and Information Sciences, Utrecht University, the Netherlands
4
Universite libre de Bruxelles (ULB), Brussels, Belgium

Abstract. Let D be a set of disks and G be the intersection graph of D. A


drawing of G is obedient to D if every vertex is placed in its corresponding disk.
We show that deciding whether a set of unit disks D has an obedient plane straight-
line drawing is N P-hard regardless of whether a combinatorial embedding is
prescribed or an arbitrary embedding is allowed. We thereby strengthen a result by
Evans et al., who show N P-hardness for disks with arbitrary radii in the arbitrary
embedding case. Our result for the arbitrary embedding case holds true even if G
is thinnish, that is, removing all triangles from G leaves only disjoint paths. This
contrasts another result by Evans et al. stating that the decision problem can be
solved in linear time if D is a set of unit disks and G is thin , that is, (1) the (graph)
distance between any two triangles is larger than 48 and (2) removal of all disks
within (graph) distance 8 of a triangle leaves only isolated paths. A path in a disk
intersection graph is isolated if for every pair A, B of disks that are adjacent along
the path, the convex hull of A B is intersected only by disks adjacent to A or B.
Our reduction can also guarantee the triangle separation property (1). This leaves
only a small gap between tractability and N P-hardness, tied to the path isolation
property (2) in the neighborhood of triangles. It is therefore natural to study the
impact of different restrictions on the structure of triangles. As a positive result, we
show that an obedient plane straight-line drawing is always possible if all triangles
in G are light and the disks are in general position (no three centers collinear). A
triangle in a disk intersection graph is light if all its vertices have degree at most
three or the common intersection of the three corresponding disks is empty. We
also provide an efcient drawing algorithm for that scenario.

1 Introduction
Disk intersection graphs have been long studied in mathematics and computer science
due to their wide range of applications in a variety of domains. They can be used
to model molecular bonds as well as the structure of the cosmic web, interference in
communication networks and social interactions in crowds. Finding planar realizations of

supported by DFG project MU/3501-2

supported by the Netherlands Organisation for Scientic Research (NWO) under project no.
639.021.123 and 614.001.504

supported by the ERC grant PARAMTIGHT: Parameterized complexity and the search for
tight complexity results, no. 280152

Springer International Publishing AG 2017 73


F. Ellen et al. (Eds.): WADS 2017, LNCS 10389, pp. 7384, 2017.
DOI: 10.1007/978-3-319-62127-2_7
74 B. Banyassady et al.

D G

(a)

Fig. 1: A set D of disks, the induced graph G, and an obedient plane straight-line drawing of G.

disk intersection graphs is an important tool to model sensor networks so as to translate


the network connectivity information into virtual coordinates [11]. The planar model
can help with topology extraction [10, 15] and enable geometric routing schemes [5, 12].
Rapidly increasing data collection rates call for efcient algorithms to run simulations.
But computational problems involving sets of disks are notoriously difcult to grasp: they
often lie in a transition zone between tractable and intractable classes of shapes. In this
paper, we investigate the computational complexity of one such problem: determining
whether a disk intersection graph admits an obedient plane straight-line drawing.
Disk-obedient Drawings. A set D of disks in the plane induces a graph G = (V, E),
called the disk intersection graph, which has a vertex for every disk in D and an edge
between two vertices whose (closed) disks intersect. A straight-line drawing of G is
an injective map : V R2 so that for every edge uv E the open line segment
(u)(v) is disjoint from (V ). A drawing is plane (also called an embedding) if the
edges do not intersect except at common endpoints. A drawing is obedient if every
vertex is contained in its corresponding disk. Disk-obedient drawings were introduced by
Evans et al. [8], who prove that recognizing whether G admits an obedient plane straight-
line drawing is N P-hard. This decision problem is called P LANAR D ISK O BEDIENCE
R ECOGNITION. The motivation to study disk-obedience stems from dealing with data
uncertainty [7, 13]. The problem is strongly related to Anchored Planar Graph Drawing
(AGD) (shown to be N P-hard by Angelini et al. [2]): Given a planar graph G and an
associated unit disk for each circle, produce a planar embedding of G such that each
vertex is contained in its disk. Our problem is different from AGD since for us, G itself
is dened by the disks. Keszegh et al. [9] also study a related problem of placing vertices
of a disk intersection graph inside their respective disks such that the resulting drawing
is C-oriented; however, the disks in [9] can only touch (their interiors are disjoint),
ensuring the drawing is always a plane embedding.
Results and Overview. In this paper we show that several natural restrictions of
P LANAR D ISK O BEDIENCE R ECOGNITION remain N P-hard: even when the disks
are unit disks (Section 2), and / or the combinatorial embedding of the graph is given
(Section 4), the problem is still hard. In the former case, our result holds true even if
removing all triangles leaves only disjoint paths and even if all triangles are far apart. This
creates an interesting contrast to results by Evans et al. [8]. Since it is unclear whether
the problem is in N P (see Section 5), our results indicate that the problem is indeed
very hard, and it is probably difcult to attack the general problem using a combinatorial
Obedient Plane Drawings for Disk Intersection Graphs 75

approach. On the positive side, we show that the problem can be solved efciently if the
degree of vertices belonging to ply-3 triangles (that is, the three corresponding disks have
a common intersection) is bounded by three (Section 3). In this result no assumption
concerning the uniformity of the disks radii is needed. Due to space restrictions, some
of the proofs are sketched or omitted in this short paper.
Notation. Throughout this paper disks are closed disks in the plane. Let D be a
set of disks, let G = (V, E) be the intersection graph of D and let be a straight-line
drawing of G. We use capital letters to denote disks and non-capital letters to denote
the corresponding vertices, e.g., the vertex corresponding to disk D D is d V .
We use the shorthand uv to denote the edge {u, v} E. Further, uvw refers to the
triangle composed of the edges uv, vw and wu. We identify vertices and edges with their
geometric representations, e.g., uv also refers to the line segment between the points
representing u and v in . We use int(D) to refer to the interior of a disk D D. The
ply of a point p R2 with respect to D is the cardinality |{D D | p D}|. The ply
of D is the maximum ply of any point p R2 with respect to D.
Planar Montone 3-Satisability. Let = (U , C) be a 3-S ATISFIABILITY (3SAT)
formula where U denotes the set of variables and C denotes the set of clauses. We call
the formula monotone if each clause c C is either positive or negative, that is, all
literals of c are positive or all literals of c are negative. Note that this is not the standard
notion of monotone Boolean formulas. Formula = (U , C) is planar if its variable
clause graph G = (U  C, E) is planar. The graph G is bipartite and every edge in E
is incident to both a clause vertex from C and a variable vertex from U . The edge {c, u}
is contained in E if and only if a literal of variable u U occurs in c C. In the decision
problem P LANAR M ONOTONE 3-S ATISFIABILITY we are given a planar and monotone
3SAT formula together with a monotone rectilinear representation R of the variable
clause graph of and we need to decide whether is satisable. The representation R
is a contact representation on an integer grid, see Figure 2a. In R the variables are
represented by horizontal line segments arranged on a line . The clauses are represented
by E-shapes. All positive clauses are placed above  and all negative clauses are placed
below . P LANAR M ONOTONE 3-S ATISFIABILITY is N P-complete [4].

2 Thinnish Unit Disk Intersection Graphs

Evans et al. [8] showed that P LANAR D ISK O BEDIENCE R ECOGNITION is N P-hard.
Further, they provide a polynomial time algorithm to recognize disk-obedience graphs
for the case that the respective disk intersection graph is thin and unit. A disk intersection
graph G is thin if (i) the graph distance between any two triangles of G is larger than 48
and (ii) removal of all disks within graph distance 8 of a triangle decomposes the graph
into isolated paths. A path is isolated if for any pair of adjacent disks A and B of the
path, the convex hull of A B is intersected only by disks adjacent to A or B.
In this section we strengthen the N P-hardness result by Evans et al. by showing that
P LANAR D ISK O BEDIENCE R ECOGNITION is N P-hard even for unit disks. Further,
we show that the path-isolation property of thin disk intersection graphs is essential to
make the problem tractable. This is implied by the fact that our result holds even for
disk intersection graphs that are thinnish, that is, removing all disks that belong to a
76 B. Banyassady et al.

c c
c c
1 1
s s
u1 u2 u5
v v v v v v v v v v
u3 u4 u5 s s
1 1
u1 u2 u3 u4 u5 s s s s s s
1 1 1 1 1 1
u3 u 4 u 5 c c
u2 u3 u5 c c
u1 u2 u5 c c
(a) (b) (c)

Fig. 2: (a) A monotone rectilinear representation. For the purposes of illustration, the line segments
representing variables and clauses are thickened and labeled. (b) Gadget layout mimicking the
monotone rectilinear representation from (a) in the proof of Theorem 1. The v-nodes are variable
gadgets, the c-nodes are clause gadgets, the s-nodes are splitter gadgets and the (1)-nodes are
inverter gadgets. The input of the splitter gadgets are marked with an arrow. The black polygonal
paths represent wires. (c) Gadget layout for the proof of Theorem 3

triangle decomposes the graph into disjoint paths (which are not necessarily isolated).
Being thinnish does not impose any distance or other geometric constraint on the set of
disks and its intersection graph. Nevertheless, our reduction also works if the distance
between any two triangles is lower bounded by some value. In particular, this implies
that spacial separation of triangles is not sufcient for tractability.

Theorem 1. P LANAR D ISK O BEDIENCE R ECOGNITION is N P-hard even under any


combination of the following restrictions: (1) all disks have the same radius (unit disks);
(2) the intersection graph of the disks is thinnish; (3) the graph distance between any
two triangles is lower bounded by some value that is polynomial in the number of disks.

Proof. We describe a polynomial-time reduction from P LANAR M ONOTONE 3-SAT.


Let = (U, C) be a planar monotone 3SAT formula where U is the set of variables and C
is the set of clauses. On an intuitive level our reduction works as follows. We introduce
ve different types of gadgets. A variable gadget is created for each variable of U . The
gadget has two combinatorial states that are used to encode the truth state of its variable.
Wire gadgets are used to propagate these states to other gadgets. In particular, we create
a clause gadget for each clause c C and use wires to propagate the truth states of the
variables occurring in c to the clause gadget of c. The purpose of the clause gadget is to
enforces that at least one of the literals of c is satised. In order to appropriately connect
the variables with the clauses we require two more gadgets. The splitter gadget splits
a wire into two wires and the inverter gadget inverts the state transported along a wire.
The gadgets are arranged according to the monotone rectilinear representation R for ,
see Figure 2b. We proceed by describing our gadgets in detail.
Variables, Wires and Inverters. For each variable vertex we create a variable
gadget as depicted in Figure 3a. Note how on the left side of the obedient plane straight-
line drawing of the disk intersection graph the vertices of the lower path belong to the
Obedient Plane Drawings for Disk Intersection Graphs 77

(a) (b)

Fig. 3: The variable gadget has two possible states: narrow and wide. It can also be used as an
inverter as either the wire to the left or to the right has to be in narrow position.

upper path of disks and vice versa. We say these paths are in a narrow position. On
the other hand, the paths on the right side are in a wide position: the upper path in the
obedient plane straight-line drawing of the disk intersection graph belongs to the upper
path of disks. By ipping the combinatorial embedding of the subgraph induced by the
edges incident to the triangle vertices of the gadget, we can allow the left paths to be
in wide position and the right path to be in narrow position; see Figure 3b. However,
observe that (i) without ipping the embedding it is not possible to switch between
the narrow and the wide positions and (ii) exactly one side has to be in narrow and the
other in wide position in order to avoid edge-crossings. We shall use these two states of
the variable gadget to encode the truth state of the corresponding variable. The parallel
paths of disks to either side of the triangle act as wires that propagate the state of the
variable gadget. Figure 4a illustrates the information propagation and shows that it is not
necessary that the disk centers of the two parallel paths are collinear. Thus, wires are
very exible structures that allow us to transmit the truth states of the variable gadgets to
other gadgets in our construction. Observe that our variable gadget can also be used as
an inverter. If the narrow state is propagated to the triangle from one side, the other side
is forced to propagate the wide state and vice versa.
Clauses. For each clause vertex we create a clause gadget as depicted in Figure 4b.
Each of the three sets of disks {R1 , R2 , ...}, {G1 , G2 , ...} and {B1 , B2 , ...} belong to
one wire. Note that if a wire is in narrow position, the position of the vertices of the
wire is essentially unique up to an arbitrarily small wiggle room. The clause gadget is
designed such that if all three of its wires are in narrow position the disk intersection
graph can not be drawn obediently. The reason for this is that the unique positions of
the vertices of the triangle r1 g1 b1 in the middle of the gadget enforce a crossing, see
Figure 4b. However, if at least one of the incident wires is in wide position and, thus,
at least one of u, v or w can be placed freely in its disk, then the gadget can be drawn
obediently.
Splitters. The nal gadget in our construction is the splitter gadget, see Figure 5a.
It works as follows. The three sets of disks {R1 , R2 , ...}, {G1 , G2 , ...} and {B1 , B2 , ...}
belong to three wires r, g, b respectively. We also created a disk O which almost com-
pletely overlaps with G2 . Without the disk O the gadget would contain a vertex of
degree 3 that is not part of a triangle. The disk O articially creates a triangle so that the
resulting disk intersection graph is thinnish. We refer to the wire b as the input of the
gadget and to the wires r and g as the outputs. If the input is narrow then both outputs
have to be wide due to the unique positions of the vertices in the narrow wires. However,
78 B. Banyassady et al.

b4
B3 B4
b3 B2
G2 R2
b2
B1
G4 R4
g2 g1 r1
b1 r2
g3 r3 r4
g4
g5 G1 R1 r5
G3 R3
(a) (b)

Fig. 4: (a) A curved wire that propagates the narrow position between the two disks with dashed
boundary. (b) The clause gadget.

if the input is wide, then any of the outputs can have any combination of states. For
instance, both can be narrow. For our reduction we shall always connect the two outputs
to inverters so that if the input of the splitter is narrow, then the inverted outputs are also
narrow.
Layout. Figure 2b illustrates how we layout and combine our gadgets. We mimic
the monotone rectilinear representation R for . We place the variable gadgets and
clause gadgets according to R. Consider a variable u U . From the variable gadget of u
one wire wt leads to the top; another wire wb leads to the bottom. If u occurs as a literal
only once in a positive clause, the top wire wt leads directly to the corresponding clause
gadget. Otherwise, it leads to the input of a splitter. As stated earlier, we connect the
outputs of the splitter to inverters. We split the resulting wires recursively until we have
created as many wires as there are literals of u in positive clauses. We call the created
wires the children of wt and wt is their origin. Similarly, the wire wb that leads from the
variable gadget of u to the bottom is connected to the negative clauses in which u occurs
and the resulting wires are the children of wb and wb is their origin. Further, we refer
to u as the variable of wt and wb . Note that while in some of our gadgets we require
very precise coordinates, the required precision does not depend on the input size. Thus,
the construction can be carried out in polynomial time.
Correctness. It remains to argue that our reduction is correct. Recall that if the input
of a splitter is narrow then the outputs are wide. Since we place inverters at the outputs of
each splitter it follows that all children of a narrow wire w are also narrow. Conversely,
if a wire connected to a clause gadget is wide then it is a child of a wide wire.
Assume there exists an obedient plane straight-line drawing of the disk intersection
graph of the set of disks we created. We create a satisfying truth assignment for . In
an obedient plane straight-line drawing, for each clause gadget c there is at least one
wire w connected to c that is wide; otherwise there is a crossing in the subdrawing of the
clause gadget. Consequently, the origin of w is wide as well. If c is positive, we set the
variable of w to true and if c is negative we set the variable of w to false. Thus, we have
created a truth assignment in which for each clause, there is at least one satised literal.
Note that it is not possible that we set a variable to both true and false since a wire can
Obedient Plane Drawings for Disk Intersection Graphs 79

B3
G1 B2
G3
b3 r1
b2

B1 b1
o g1
g3 g2 r1
g4
R2
b1
R1
r2
O R4
G2 r3
G4

g1
r4
g2 o R3
r5

(a)

Fig. 5: The splitter gadget.

only be the origin of either positive of negative clauses due to the fact that in a monotone
rectilinear representation all negative clauses are below and all positive clauses are above
the variable line.
Finally, assume that is satisable. For each variable u we orient its variable gadget
such that the wire that leads to the positive clauses is wide if and only if u is true. We
draw the splitter gadgets such that all children of wide wires are wide. Since every clause
has a satised literal, the corresponding clause gadget is connected to a wide wire and,
thus, can be drawn without introducing crossing.
Spacial Separation. Note that the splitter, variable, clause and inverter gadgets each
contain one triangle and recall that all gadgets are connected by wires, which do not
contain triangles. Thus, it is straightforward to ensure a minimum distance between any
two triangles by simply increasing the length of our wires accordingly.

3 Disk Intersection Graphs with Light Triangles


In Section 2 we give an N P-hardness proof for a very restricted class of instances of
P LANAR D ISK O BEDIENCE R ECOGNITION. A key ingredient of our reduction from
3SAT is a triangle in the middle of each variable gadget. The two truth states of the
gadget are encoded by the combinatorial embedding of the subgraph induced by edges
incident to the triangle vertices. It seems natural to study recognition of disk obedience
graphs where the degree of vertices in triangles and, thus, the number of combinatorial
80 B. Banyassady et al.

H C
c
h r R A pac pbc
x q p
l p a pab b
t
T B
L

(a) (b)

Fig. 6: (a) Every crossing between centered edges implies the existence of an arrow. (b) In a
centered drawing, every point in a ply-3 triangle abc belongs to one of the three disks.

embeddings for the triangle-induced subgraphs is bounded. This motivates the following
denition. Let D be a set of disks and G = (V, E) be the intersection graph of D. A
triangle abc of G is called light if deg(a), deg(b), deg(c) 3 or if A B C = . We
say that D is light if every triangle of G is light. In this section we show that for any
light set D of disks there always exists an obedient plane straight-line drawing of the
intersection graph of D. Note that we do not require the disks in D to have unit radius.
We begin by introducing some notations and by stating some helpful observations. A
set of disks is connected if the union of all disks is connected. A set D of disks is said
to be in general position if for any connected subset D D, |D | = 3 the disk centers
of D are non-collinear. Let G = (V, E) be the intersection graph of a set of disks D
and be a straight-line drawing of G. A vertex v V that is placed at its respective
disks center in is called centered. An edge e E between two centered vertices in
is called centered. The drawing is called centered if all vertices in V are centered. An
arrow (h, t, l, r) in a straight-line drawing of a graph G = (V, E) is a sequence of
vertices h, t, l, r V such that ht, hl, hr, lr E and such that ht and lr cross in , see
Figure 6a. We refer to h, t, l, r as the arrows head, tail, left and right vertex respectively.

Evans et al. [8] show that any set of disks with ply 2 in general position admits an
obedient plane straight-line drawing. We observe that with some minor adaptations, their
observation furthermore yields an explicit statement regarding the graph structure in
non-plane centered drawings. We restate their proof together with our modications
to show that every crossing between centered edges implies the existence of an arrow.
Furthermore, we strengthen this statement by showing that if the intersection point x of
the two edges is contained in the interior of one of the corresponding disks, then there
always is an arrow whose heads disk contains x in its interior.

Lemma 1. Let G = (V, E) be the disk intersection graph of a set of disks D in general
position. Let be a straight-line drawing of G. For any crossing in between centered
edges ab and cd there exists an arrow (h, t, l, r) where H L R lr = and either
(i) ht = ab and lr = cd, or (ii) ht = cd and lr = ab. Furthermore, if x = ab cd is
contained in the interior of at least one of A, B, C, D, then x int(H).
Obedient Plane Drawings for Disk Intersection Graphs 81

Next, we observe that if A B C = , then in a centered drawing any point in the


triangle abc is contained in one of the disks A, B or C.

Observation 1. Let D = {A, B, C} be a set of disks whose intersection graph G is the


triangle abc and let be a centered drawing of G. If the closed triangle abc contains a
point p AB C then any point q in the closed triangle abc is contained in AB C.

Our nal auxiliary result states that under certain conditions, the number of crossings
along one edge in a centered drawing is at most one.

Lemma 2. Let D be a light set of disks in general position and let G = (V, E) be the
intersection graph of D. Let be a straight-line drawing of G. Let (a, b, c, d) be an
arrow in where a, b, c, d are centered and A C D cd = . Then there exists no
centered edge other than ab that crosses cd in .

Proof Sketch. According to the denition of an arrow, we know that ab, cd, ac, ad E,
see Figure 7c (left). Assume that some centered edge f g = ab crosses cd. According
to Lemma 1, the intersection of f g and cd implies existence of an arrow A consisting
of c, d and two other vertices f and g, at least one of which has to be different from a
and b. Since acd is a light triangle in G and since A C D = , the degree of a, c, d
is bounded by 3. Due to deg(a) 3 the vertex a can not be connected to any vertex
other than b, c, d, which means that a cannot be an endpoint of the edge f g. Note that b
could be equal to f or g. We perform a case distinction regarding the containment of the
edges bc and bd in E.
First, assume that bc E and bd E, see Figure 7a (left). Because of the degree
restrictions for c and d, neither of them can be adjacent to a vertex different from a, b, c, d.
Thus, cd can not be the head-tail edge of A since the head of A is connected to f and
g. If cd is the left-right edge of A, then the head of A has to be b and without loss of
generality f is equal to b. Due to Lemma 1 we know that B C D = and, thus,
since bcd is light the degree of b is bounded by 3. However, this is a contradiction to the
fact that b is connected to g.
Now, assume that bc E and bd / E, see Figure 7b. Similar to the last case, the
degree restriction for c implies that c can not be adjacent to any vertex other than a, b, d.
This implies that c can not be the head of A and it can be the right or the left vertex
of A only if b is the head of A. In this case cd is the left-right edge of A and d has to
be connected to the head b of A, which contradicts bd / E. Thus, c can only be the tail
of A, and so d is the head. The head d is connected to f and g both of which have to
be different from a and b due to deg(a) 3 and due to bd / E respectively. This is a
contradiction to deg(d) 3.
We sketch the nal case. Assume bc / E and bd / E, see Figure 7c (left). Due to
degree restrictions we see that cd is the left-right edge of A and w.l.o.g. g = b is the
head. Head g can not be located inside triangle acd since this would imply an additional
crossing with ab, which contradicts degree restrictions. If g is exterior to acd and f is
interior, Observation 1 implies a contradiction to the degree bounds of a, c, d. If g and
f are exterior to acd, f g has to cross ad or ac, which implies the existence of another
arrow, again contradicting degree restrictions.

82 B. Banyassady et al.

a d d a d

a

c b c b c b
(a) (b)
a d d d e d e
 
a b
a
a b
c b c b c f c f
(c) (d)

Fig. 7: Removing crossing by moving vertices.

Theorem 2. Let D be a light set of disks in general position whose intersection graph
is G. Then G has a plane straight-line drawing obedient to D.
Proof. We describe an iterative approach that transforms a centered drawing of G into a
crossing-free drawing obedient to D. In each step we change the position of precisely
one, two or three vertices to remove one or two crossings. During the entire procedure,
each vertex is moved at most once. We maintain the following invariant: After and before
each step, all crossing edges are centered. We proceed by describing our algorithm. After
that we show that the invariant is maintained and, thus, that the algorithm is correct.
Algorithm. Let ab and cd be two centered edges that cross in a point x. By Lemma 1
there exists an arrow consisting of a, b, c, d, w.l.o.g. (a, b, c, d), where AC Dcd = ,
see Figure 7c (left). Note that this implies that the degree of a, c, d is bounded by 3
since D is light and since A C D = . In order to remove the crossing we move
some of a, b, c, d and we use a , b , c , d to denote the new postions of these vertices.
We distinguish two cases. First assume that x A B C D and x / int(A)
int(B) int(C) int(D), i.e. x is on the boundary of all four disks. In this case we
set a = x and we move vertices c, d by a distance R+ in the direction given by


the vector ba, see Figure 7a. Value should be chosen small enough such that c C,
d D and c d does not cross an edge ef , unless cd already crosses ef .


Now we consider the case that x is in the interior of at least one of A, B, C, D.


By Lemma 1 we can assume without loss of generality that x int(A). In order to


remove the crossing we move a in the direction given by the vector ab for distance
|ax| + < |ab|, see Figure 7c. The value R+ should be chosen small enough
such that a A and such that there is no crossing between a c or a d and any other
edge ef , unless ef also intersects cd. To shorten notation, we refer to this procedure
as removing the crossing by moving a to x, although technically a is close to x
but a = x. It remains to treat the special case that ab has a crossing with some additional
edge ef = cd. In this case, in addition to moving a to x, we move b to y = ab ef , see
Figure 7d. In the following paragraphs we will see that there exists at most one such
additional crossing edge ef and that e, f are distinct from c, d as illustrated.
Correctness. Clearly our invariant holds for the initial centered drawing. In order
to show that our invariant is maintained it sufces to show that none of the moved
Obedient Plane Drawings for Disk Intersection Graphs 83

vertices is incident to an edge that has a crossing. In our algorithm we considered two
main cases. In the rst case we moved vertices a, c and d, which formed a complete
graph with vertex b. Note that all these vertices have exactly degree three due to the
degree restrictions. Therefore none of them can be adjacent to a vertex different from
a, b, c, d. In the second case we moved vertex a, which is adjacent to exactly b, c and d
due the degree restriction on a. Therefore, in both cases the moved vertices can only be
incident to edges with crossing if there exists some edge ef = ab, cd that has a crossing
with ab or cd. According to Lemma 2 there is no edge that crosses cd except for ab.
Due to Lemma 1, if ef crosses ab, there exists an arrow A composed of the edge ef
and ab. According to Lemma 2, ab can not be the left-right edge of A. The degree of a
is bounded by 3 and, thus, a has to be the tail, b has to be the head and e, f have to be
the left and right vertex of A.
We perform a case distinction regarding the equivalence of e, f and c, d. First,
asumme that {e, f } = {c, d} and without loss of generality e = d and f = c. Then A
consists of a, b, c, d. Next, assume that exactly one of e, f is equal to one of c, d and
without loss of generality e = d and f = a, b, c, d. Then d is adjacent to a, c, b, f ,
which contradicts the degree bound for d. Finally assume that both e, f are distinct
from a, b, c, d. By Lemma 2, neither cd nor ef can have a crossing with any edge other
than ab. Hence, the situation looks like the one illustrated in Figure 7d. In this case, in
addition to moving a to x, we move b to y = ab ef as described above. Now, a b
does not have any crossing and, thus, a is not incident to an edge with a crossing. For
symmetric reasons, neither is b .

4 Embedded Unit Disk Intersection Graphs


In Section 2 we proved that P LANAR D ISK O BEDIENCE R ECOGNITION is N P-hard
even for disk intersection graphs that are unit and thinnish. In the reduction from 3SAT
used for the proof, the truth state of a variable gadget corresponds to the combinatorial
embedding of the respective subgraph. The N P-hardness proof by Evans et al. [8]
also establishes a correspondence between truth states and combinatorial embeddings.
This raises the question, whether N P-hardness holds if a combinatorial embedding
is prescribed. The following theorem answers this question in the afrmative. On a
high level, the proof idea is a reduction from P LANAR M ONOTONE 3-S ATISFIABILITY
similar to the one in the proof of Theorem 1. However, for the reduction in Theorem 3
we have to heavily rely on geometric arguments rather than combinatorial embeddings
to encode the truth states of variable and wire gadgets.

Theorem 3. P LANAR D ISK O BEDIENCE R ECOGNITION is N P-hard even for embed-


ded unit disk intersection graphs.

5 Remarks and Open Problems


Other Shapes. The notion of obedient drawings naturally extends to other shapes. The
reduction strategies used in the hardness proofs in this paper and the paper by Evans et
al. [8] seem to apply for several other shapes as well, e.g., for unit squares. This raises
84 B. Banyassady et al.

the interesting question whether a more general statement can be made that captures all
these hardness results at once.
NP-Membership. For many combinatorial problems, showing N P-membership is
an easy exercise. For disk-obedience the question turns out to be much more intricate.
A naive idea to show NP-membership would be to guess the coordinates of all vertices.
However, it is not obvious that there always exists a rational representation of bounded
precision. Indeed, there are several geometric problems where this approach is known to
fail. In some cases an explicit rational representation may require an exponential number
of bits, in others optimal solutions may require irrational coordinates, see [1,3,14]. Many
problems initially not known to lie in N P turned out to be R-complete. The complexity
class R captures all computational problems that are equivalent under polynomial time
reductions to the satisability of arbitrary polynomial equations and inequalities over
the reals, see [6, 14]. We leave it as an open problem to determine the relation of disk
obedient plane straight-line drawings with respect to N P and R.
Acknowledgments. This work was initiated during the Fixed-Parameter Computa-
tional Geometry Workshop at Lorentz Center, April 48, 2016. We thank the organizers
and all participants for the productive and positive atmosphere.

References
1. Abrahamsen, M., Adamaszek, A., Miltzow, T.: Irrational guards are sometimes needed. arXiv
preprint arXiv:1701.05475 (2017)
2. Angelini, P., Lozzo, G.D., Bartolomeo, M.D., Battista, G.D., Hong, S., Patrignani, M., Roselli,
V.: Anchored drawings of planar graphs. In: Graph Drawing. Lecture Notes in Computer
Science, vol. 8871, pp. 404415. Springer (2014)
3. Bajaj, C.: The algebraic degree of geometric optimization problems. Discrete & Computational
Geometry 3(2), 177191 (1988)
4. de Berg, M., Khosravi, A.: Optimal binary space partitions for segments in the plane. Int. J.
Comput. Geometry Appl. 22(3), 187206 (2012)
5. Bose, P., Morin, P., Stojmenovic, I., Urrutia, J.: Routing with guaranteed delivery in ad hoc
wireless networks. Wireless networks 7(6), 609616 (2001)
6. Cardinal, J.: Computational geometry column 62. SIGACT News 46(4), 6978 (2015)
7. Evans, W., Kirkpatrick, D., Lofer, M., Staals, F.: Minimizing co-location potential of moving
entities. SIAM J. Comput. 45(5), 18701893 (2016)
8. Evans, W.S., van Garderen, M., Lofer, M., Polishchuk, V.: Recognizing a DOG is hard, but
not when it is thin and unit. In: FUN 2016. pp. 16:116:12 (2016)
9. Keszegh, B., Pach, J., Palvolgyi, D.: Drawing planar graphs of bounded degree with few
slopes. SIAM Journal on Discrete Mathematics 27(2), 11711183 (2013)
10. Kroller, A., Fekete, S.P., Psterer, D., Fischer, S.: Deterministic boundary recognition and
topology extraction for large sensor networks. In: SoDA 2006. pp. 10001009 (2006)
11. Kuhn, F., Moscibroda, T., Wattenhofer, R.: Unit disk graph approximation. In: Proceedings of
the 2004 joint workshop on Foundations of mobile computing. pp. 1723. ACM (2004)
12. Kuhn, F., Wattenhofer, R., Zhang, Y., Zollinger, A.: Geometric ad-hoc routing: of theory and
practice. In: PoDC. pp. 6372 (2003)
13. Lofer, M.: Data Imprecision in Computational Geometry. Ph.D. thesis, Utrecht University
(2009)
14. Matousek, J.: Intersection graphs of segments and R. arXiv preprint arXiv:1406.2636 (2014)
15. Wang, Y., Gao, J., Mitchell, J.S.B.: Boundary recognition in sensor networks by topological
methods. In: MobiCom 2006. pp. 122133 (2006)

-Greedy t-spanner

Gali Bar-On and Paz Carmi

Department of Computer Science,


Ben-Gurion University of the Negev, Israel

Abstract. We introduce a new geometric spanner, -Greedy, whose con-


struction is based on a generalization of the known Path-Greedy and
Gap-Greedy spanners. The -Greedy spanner combines the most desir-
able properties of geometric spanners both in theory and in practice.
More specically, it has the same theoretical and practical properties as
the Path-Greedy spanner: a natural denition, small degree, linear num-
ber of edges, low weight, and strong (1 + )-spanner for every > 0. The
-Greedy algorithm is an improvement over the Path-Greedy algorithm
with respect to the number of shortest path queries and hence with re-
spect to its construction time. We show how to construct such a spanner
for a set of n points in the plane in O(n2 log n) time.
The -Greedy spanner has an additional parameter, , which indicates
how close it is to the Path-Greedy spanner on the account of the number
of shortest path queries. For = t the output spanner is identical to the
Path-Greedy spanner, while the number of shortest path queries is, in
practice, linear.
Finally, we show that for a set of n points placed independently at ran-
dom in a unit square the expected construction time of the -Greedy al-
gorithm is O(n log n). Our analysis indicates that the -Greedy spanner
gives the best results among the known spanners of expected O(n log n)
time for random point sets. Moreover, analysis implies that by setting
= t, the -Greedy algorithm provides a spanner identical to the Path-
Greedy spanner in expected O(n log n) time.

1 Introduction

Given a set P of points in the plane, a Euclidean t-spanner for P is an undirected


graph G, where there is a t-spanning path in G between any two points in P . A
path between points p and q is a t-spanning path if its length is at most t times
the Euclidean distance between p and q (i.e., t|pq|).
The most known algorithm for computing t-spanner is probably the Path-
Greedy spanner. Given a set P of n points in the plane, the Path-Greedy spanner
algorithm creates a t-spanner for P as follows.

It starts with a graph G having
a vertex set P , an empty edge set E and n2 pairs of distinct points sorted in
a non-decreasing order of their distances. Then, it adds an edge between p and

The research is partially supported by the Lynn and William Frankel Center for
Computer Science.

Springer International Publishing AG 2017 85


F. Ellen et al. (Eds.): WADS 2017, LNCS 10389, pp. 8596, 2017.
DOI: 10.1007/978-3-319-62127-2_8
86 G. Bar-On and P. Carmi

q to the set E if the length of the shortest path between p and q in G is more
than t|pq|, see Algorithm 1 for more details. It has been shown in [9, 8, 12, 11,
17, 21] that for every set of points, the Path-Greedy spanner has O(n) edges, a
bounded degree and total weight O(wt(M ST (P ))), where wt(M ST (P )) is the
weight of a minimum spanning tree of P . The main weakness of the Path-Greedy
algorithm is its time complexity the naive implementation

of the Path-Greedy
algorithm runs in near-cubic time. By performing n2 shortest path queries,
where each query uses Dijkstras shortest path algorithm, the time complexity
of the entire algorithm reaches O(n3 log n), where n is the number of points in
P . Therefore, researchers in this eld have been trying to improve the Path-
Greedy algorithm time complexity. For example, the Approximate-Greedy algo-
rithm generates a graph with the same theoretical properties as the Path-Greedy
spanner in O(n log n) time [13, 19]. However, in practice there is no correlation
between the expected and the unsatisfactory resulting spanner as shown in [15,
16]. Moreover, the algorithm is complicated and dicult to implement.
Another attempt to build a t-spanner more eciently is introduced in [14,
15]. This algorithm uses a matrix to store the length of the shortest path between
every two points. For each pair of points, it rst checks the matrix to see if there
is a t-spanning path between these points. In case the entry in the matrix for this
pair indicates that there is no t-spanning path, it performs a shortest path query
and updates the matrix. The authors in [15] have conjectured that the number
of performed shortest path queries is linear. This has been shown to be wrong
in [5], as the number of shortest path queries may be quadratic. In addition, Bose
et al. [5] have shown how to compute the Path-Greedy spanner in O(n2 log n)
time. The main idea of their algorithm is to compute a partial shortest path
and then extend it when needed. However, the drawback of this algorithm is
that it is complex and dicult to implement. In [1], Alewijnse et al. compute
the Path-Greedy spanner using linear space in O(n2 log2 n) time by utilizing the
Path-Greedy properties with respect to the Well Separated Pair Decomposition
(WSPD). In [2], Alewijnse et al. compute a t-spanner in O(n log2 n log2 log n)
expected time by using bucketing for short edges and by using WSPD for long
edges. Their algorithm is based on the assumption that the Path-Greedy spanner
consists of mostly short edges.
Additional eort has been put in developing algorithms for computing t-
spanner graphs, such as -Graph algorithm [10, 18], Sink spanner, Skip-List
spanner [3], and WSPD-based spanners [6, 7]. However, none of these algorithms
produces a t-spanner as good as the Path-Greedy spanner in all aspects: size,
weight and maximum degree, see [15, 16].
Therefore, our goal is to develop a simple and ecient algorithm that achieves
both the theoretical and practical properties of the Path-Greedy spanner. In this
paper we introduce the -Greedy algorithm that constructs such a spanner for
a set of n points in the plane in O(n2 log n) time. Moreover, we show that for
a set of n points placed independently at random in a unit square the expected
running time of the -Greedy algorithm is O(n log n).
-Greedy t-spanner 87

Algorithm 1 Path-Greedy(P, t)
Input: A set P of points in the plane and a constant t > 1
Output: A
t-spanner
G(V, E) for P
1: sort the n2 pairs of distinct points in non-decreasing order of their distances
and store them in list L
2: E
3: for (p, q) L consider pairs in increasing order do
4: length of the shortest path in G between p and q
5: if > t|pq| then
6: E := E |pq|
7: return G = (P, E)

2 -Greedy
In this section we describe the -Greedy algorithm (Section 2.1) for a given set
P of points in the plane, and two real numbers t and , such that 1 < t.
Then, in Section 2.2 we prove that the resulting graph is indeed a t-spanner with
bounded degree. Throughout this section we assume that < t (for example,
4
= t 5 or = 1+4t
5 ), except in Lemma 4, where we consider the case that = t.

2.1 Algorithm description


For each point p P we maintain a collection of cones Cp with the property
that for each point q P that lies in Cp there is a t-spanning path between p
and q in the current graph. The main idea of the -Greedy algorithm is to ensure
that two cones of a constant angle with apexes at p and q are added to Cp and
to Cq , respectively, each time the algorithm runs a shortest path query between
points p and q.
The algorithm starts with a graph G having a vertex set P , an empty edge
set, and an initially empty collection of cones Cp for each point p P . The
algorithm considers all pairs of distinct points of P in a non-decreasing order of
their distances. If p Cq or q Cp , then there is already a t-spanning path that
connects p and q in G, and there is no need to check this pair. Otherwise, let d
be the length of the shortest path that connects p and q in G divided by |pq|.

Let cp (, q) denote the cone with apex at p of angle , such that the ray pq is
its bisector. The decision whether to add the edge (p, q) to the edge set of G is
made according to the value of d. If d > , then we add the edge (p, q) to G, a
cone cp (2, q) to Cp , and a cone cq (2, p) to Cq , where = 4 arcsin( 12t ). If
d , then we do not add this edge to G, however, we add a cone cp (2, q) to
Cp and a cone cq (2, p) to Cq , where = 4 arcsin( d2t ).
In Algorithm 2, we give the pseudo-code description of the -Greedy algo-
rithm. In Figure 1, we illustrate a cone collection Cp of a point p and how it
is modied during the three scenarios of the algorithm. The gure contains the
point p, its collection Cp colored in gray, and three points v, u, and w, such
88 G. Bar-On and P. Carmi

that |pv| < |pu| < |pw|. Point v lies in Cp representing the rst case, where the
algorithm does not change the spanner and proceeds to the next pair without
performing a shortest path query. The algorithm runs a shortest path query be-
tween p and u, since u / Cp (for the purpose of illustration assume p / Cu ).
Figure 1(b) describes the second case of the algorithm, where the length of the
shortest path between p and u is at most |pu|. In this case the algorithm adds
a cone to Cp without updating the spanner. Figure 1(c) describes the third case
of the algorithm, where the length of the shortest path between p and w is more
than |pw|. In this case the algorithm adds a cone to Cp and the edge (p, w) to
the spanner.

Algorithm 2 -Greedy
Input: A set P of points in the plane and two real numbers t and s.t. 1 < t
Output: A
t-spanner
for P
1: sort the n2 pairs of distinct points in non-decreasing order of their distances
(breaking ties arbitrarily) and store them in list L
2: E /* E is the edge set */
3: Cp p P /* Cp is set of cones with apex at p */
4: G (P, E) /* G is the resulting t-spanner */
5: for (p, q) L consider pairs in increasing order do
6: if (p / Cq ) and (q / Cp ) then
7: d length of the shortest path in G between p and q divided |pq|
8: if d > then
9: E E {(p, q)}
10: d 1
1
11: 4 arcsin( d2t ) /* cos sin t
= d */

12: cp (2, q) cone of angle 2 with apex at p and bisector pq

13: cq (2, p) cone of angle 2 with apex at q and bisector qp
14: Cp Cp cp (2, q)
15: Cq Cq cq (2, p)
16: return G = (P, E)

u u u
v v v
w w w

p p p

(a) (b) (c)

Fig. 1. Illustration of the three scenarios of the -Greedy algorithm. (a) v Cp ;


/ Cp and d ; (c) w
(b) u / Cp and d > .
-Greedy t-spanner 89

2.2 Algorithm analysis


In this section we analyze several properties of the -Greedy algorithm, including
the spanning ratio and the degree of the resulting graph.
The following lemma is a generalization of Lemma 6.4.1. in [20].
Lemma 1. Let t, and be real numbers, such that 1 t and 0
4.
Let p, q, and r be points in the plane, such that
1. p = r,
2. |pr| |pq|,
1
, where is the angle rpq (i.e., rpq = 4 arcsin( 2t )).
t
3. cos sin

Then |pr| + t|rq| t|pq|.

Proof. Let r be the orthogonal projection of r onto segment pq. Then, |rr | =
|pr| sin , |pr | = |pr| cos , and |r q| = |pq| |pr |. Thus, |r q| = |pq| |pr| cos .
By the triangle inequality

|rq| |rr | + |r q|


|pr| sin + |pq| |pr| cos
= |pq| |pr|(cos sin ).

We have, |pr| + t|rq| |pr| + t(|pq| |pr|(cos sin ))


= t|pq| t|pr|(cos sin ) + |pr|
t|pq| t|pr|(cos sin ) + t(cos sin )|pr|
t|pq|.

Lemma 2. The number of shortest path queries performed by -Greedy algo-


1
rithm for each point is O( t/1 ).

Proof. Clearly, the number of shortest path queries performed for each point is
at most n 1. Thus, we may assume that t/ > 1 + 1/n. Consider a point p P
and let (p, q) and (p, r) be two pairs of points that -Greedy algorithm has run
shortest path queries for. Assume w.l.o.g. that the pair (p, r) has been considered
before the pair (p, q), i.e., |rp| |pq|. Let d be the length of the path computed
by the shortest path query for (p, r) divide by |pr|. If d , then the cone added
to the collection Cp has an angle of at least 4 arcsin( 2t ). Otherwise, the
algorithm adds the edge (p, r) to G and a new cone to the collection of cones Cp ,
where the angle of this cone is 4 arcsin( 12t ). Thus, after the shortest path
query performed for the pair (p, r), the collection Cp contains a cone cp (, r),
where is at least 2 2 arcsin( 2t ). The -Greedy algorithm performs a shortest
path query for (p, q) only if p / Cq and q / Cp . Thus, the angle rpq is at least

arcsin( ), and we have at most k = 2 shortest path queries for a point.


4 2t
90 G. Bar-On and P. Carmi

Let us consider the case where t > 1 and t 1. The equation =


4
1
arcsin( 2t ) implies that cos sin t
= . Then, we have

t t
0, 1 + , and 1.

2 1
Thus, we have k = O( t/1 ).

1
t

x1
Observation 1 For = t x , where x > 1 is a xed integer, the number of
x
shortest path queries performed by -Greedy algorithm for each point is O( t1 ).

Proof. As in Lemma 2, let us consider the case where t > 1 and t


1. Then,
we have
t t 1
0, 1 + , x1 1 + , t( x ) 1 + ,
(
t x )

t1
t (1 + )x , t 1 + x , and .
x
2x
Thus, we have k t1
x
= O( t1 ).


2
n log n
Observation 2 The running time of -Greedy algorithm is O( (t/1) 2 ).



Proof. The algorithm sorts the n2 pairs of distinct points in non-decreasing
order of their distances, this takes O(n2 log n) time. A shortest path query is
n
done by Dijkstras shortest path algorithm on a graph with O( t/1 ) edges and
n 1
takes O( t/1 +n log n) time. By Lemma 2 each point performs O( t/1 ) shortest
path queries. Therefore, we have that the running time of -Greedy algorithm is
n
O(( t/1 )2 log n).

Observation 3 The number of cones that each point has in its collection along
1
the algorithm is constant depending on t and (O( t/1 )).

Proof. As shown in Lemma 2, the number of shortest path queries for each point
1
is O( t/1 ). The subsequent step of a shortest path query is the addition of two
cones, meaning that for each point p the number of cones in the collection of
1
cones Cp is O( t/1 ).

Corollary 1. The additional space for each point p for the collection Cp is con-
stant.

Lemma 3. The output graph G = (P, E) of -Greedy algorithm (Algorithm 2)


is a t-spanner for P (for 1 < < t).

Proof. Let G = (P, E) be the output graph of the -Greedy algorithm. To prove
that G is a t-spanner for P we show that for every pair (p, q) P , there exists a
t-spanning path between them in G. We prove the above statement by induction
-Greedy t-spanner 91

on the rank of the distance |pq|, i.e., the place of (p, q) in a non-decreasing
distances order of all pairs of points in P .
Base case: Let (p, q) be the rst pair in the ordered list (i.e., the closest pair).
The edge (p, q) is added to E during the rst iteration of the loop in step 9 of
Algorithm 2, and thus there is a t-spanning path between p and q in G.
Induction hypothesis: For every pair (r, s) that appears before the pair (p, q)
in the ordered list, there is a t-spanning path between r and s in G.
The inductive step: Consider the pair (p, q). We prove that there is a t-
spanning path between p and q in G. If p / Cq and q / Cp , we check whether
there is a -spanning path in G between p and q. If there is a path which length
is at most |pq|, then |pq| t|pq|, meaning there is a t-spanning path between
p and q in G. If there is no path of length of at most |pq|, we add the edge (p, q)
to G, which forms a t-spanning path.
Consider that p Cq or q Cp , and assume w.l.o.g. that q Cp . Let (p, r)
be the edge handled in Step 5 in Algorithm 2 when the cone containing q has
been added to Cp (Step 12 in Algorithm 2). Notice that |pr| |pq|. Step 7 of
Algorithm 2 has computed the value d for the pair (p, r). In the algorithm there
are two scenarios depending on the value of d.
The rst scenario is when d > , then the algorithm has added the edge (p, r)
to G and a cone cp (, r) to Cp , where = 2( 4 arcsin( 12t )). Thus, the angle
between (p, q) and (p, r) is less than /2. Hence, |rq| < |pq| and by the induction
hypothesis there is a t-spanning path between r and q. Consider the shortest
path between p and q that goes through the edge (p, r). The length of this path
is at most |pr| + t|rq|. By Lemma 1, we have |pr| + t|rq| |pr| + t|rq| t|pq|
for = 1. Therefore, we have a t-spanning path between p and q.
The second scenario is when d , then the algorithm has added a cone
cp (, r) to Cp , where = 2( 4 arcsin( d2t )). Thus, the angle between (p, q)
and (p, r) is less than /2. Hence, |rq| < |pq| and by the induction hypothesis
there is a t-spanning path between r and q. Consider the shortest path between
p and q that goes through r. The length of this path is at most d|pr| + t|rq|. By
Lemma 1, we have d|pr| + t|rq| t|pq|. Therefore, we have a t-spanning path
between p and q.

Theorem 4. The -Greedy algorithm computes a t-spanner for a set of points
P with the same properties as the Path-Greedy t-spanner, such as degree and
n
weight, in O(( t/1 )2 log n) time.
Proof. Clearly, the degree of the -Greedy is at most the degree of the Path-
Greedy -spanner. The edges of the -Greedy spanner satisfy the -leap frog
property, thus, the weight of the -Greedy is as Path-Greedy t-spanner. Hence,
we can pick close to t, such that we will have the required bounds.

Lemma 4. If t = , the result of the -Greedy algorithm is identical to the result
of the Path-Greedy algorithm.
Proof. Assume towards contradiction that for t = the resulting graph of the
-Greedy algorithm, denoted as G = (P, E), diers from the result of the Path-
Greedy algorithm, denoted as G = (P, E  ). Assuming the same order of the
92 G. Bar-On and P. Carmi

sorted edges, let (p, q) be the rst edge that is dierent in G and G . Notice
that -Greedy algorithm decides to add the edge (p, q) to G when there is no
t-spanning path between p and q in G. Since until handling the edge (p, q) the
graphs G and G are identical, the Path-Greedy algorithm also decides to add
the edge (p, q) to G . Therefore, the only case we need to consider is (p, q) E 
and (p, q) / E. The -Greedy algorithm does not add an edge (p, q) to G in
two scenarios: (i) there is a t-spanning path between p and q in the current
graph G which contradicts that the Path-Greedy algorithm adds the edge
(p, q) to G ; (ii) p Cq or q Cp the -Greedy algorithm does not perform
a shortest path query between p and q. Assume w.l.o.g., q Cp , and let (p, r)
be the edge considered in Step 5 in Algorithm 2 when the cone containing q
has been added to Cp . The angle of the added cone is = 2 2 arcsin( d2t ),
where d is the length of the shortest path between p and r divided |pr|. Thus,
1
we have |pr| |pq| and cos sin d , where is the angle rpq. Then, by
t

Lemma 1, |pr| + t|rq| t|pq|, and since there is a path from p to r of length
at most |pr|, we have that there is t-spanning path between p and q in the
current graph. This is in contradiction to the assumption that the Path-Greedy
algorithm adds the edge (p, q) to E  .

3 -Greedy in Expected O(n log n) Time for Random Set

In this section we show how a small modication in the implementation im-


proves the running time of the -Greedy algorithm. This improvement yields
an expected O(n log n) time for random point sets. The rst modication is to
run the shortest path query between points p to q up to |pq|. That is, running
Dijkstras shortest path algorithm with source p and terminating as soon as the
minimum key in the priority queue is larger than |pq|.
Let P be a set of n points in the plane uniformly distributed in a unit
square. To prove that -Greedy algorithm computes a spanner for P in expected
O(n log n) time, we need to show that:

each point runs a constant number of shortest path queries follows from
Lemma 2;
the expected number of points visited in each query is constant The fact
that the points are randomly chosen uniformly in the unit square implies
that the expected number of points at distance of at most r from point p
is (r2 n). A shortest path query from a point p to a point q terminates
as soon as the minimum key in the priority queue exceeds |pq|, thus, it is
expected to visit O(n (|pq|)2 ) points.
By Lemma 2 the number of shortest path queries performed by the algorithm
1
for a point p is O( t/1 ). Each such query denes a cone with apex at p of
angle (t/ 1), such that no other shortest path query from p will be
1
performed to a point in this cone. By picking k = t/1 and r = kn , we
have that the expected number of points around each point in a distance of
1
r is (k 2 ) = ( (t/1) 2 ).
-Greedy t-spanner 93

Assume we partition the plane into k equal angle cones with apex at point p.
The probability that there exists a cone that does not contain a point from
2
the set of points of distance kn is at most k (1 k1 )k . Let Q be the set
of points that p computed a shortest path query to, and let q Q be the
farthest point in Q from p. Then, the expected Euclidean distance between
p and q is less than kn . Thus, the expected number of points visited by the
2 2 2
k
entire set of shortest path queries from a point is O( t/1 ) = O( (t) 3 );

the next pair to be processed can be obtained in expected O(log n) time


without sorting all pairs of distinct points Even-though this is quite
straight forward, for completeness we give a short description how this can
be done. Divide the unit square to n n grid cells of side length 1/n. A hash
table of size 3n is initialized, and for each non-empty grid cell (at most n
such cells) we map the points in it to the hash table. In addition, we maintain
a minimum heap Hp for each point p P (initially empty), and one main
minimum heap H that contains the top element of each Hp . Each heap Hp
contains a subset of the pairs that include p.
For each point p P , all the cells of distance at most kn from p are scanned
(using the hash table) to nd all the points in these cells, where k is a
parameter that we x later. All the points found in these cells are added to
Hp according to their Euclidean distance from p.
The heap H holds the relevant pairs in an increasing order, therefore the
pairs are extracted from the main heap H. After extracting the minimum
pair in H that belongs to a point p, we add to H the next minimum in
Hp . To insure the correctness of the heaps, when needed we increase the
distance to the scanned cells. Observe that there may be a pair (p, q) such
that |pq| < |rw|, where the pair (r, w) is the top pair in H. This can occur
only when the pair (p, q) has not been added to Hp nor Hq , and this happens
when p Cq or q Cp . However, in this case we do not need to consider the
pair (p, q).
Notice that the only cells that are not contained in Cp are scanned to add
more pairs to Hp . Thus, points that are in Cp are ignored.
2

Therefore, the total expected running time of the algorithm is O( (t) 3 n log n).

Since both t and t/ are constants bigger than one, the expected running time
of the -Greedy algorithm is O(n log n).
A very nice outcome of -Greedy algorithm and its analysis can be seen
when is equal to t. Assume that -Greedy algorithm (for = t) has computed
a shortest path query for two points p and q and the length of the received path
is d|pq|. If the probability that t/d > 1 + is low (e.g, less than 1/2), for some
constant > 0, then -Greedy algorithm computes the Path-Greedy spanner
with linear number of shortest path queries. Thus -Greedy algorithm computes
the Path-Greedy spanner for a point set uniformly distributed in a square in
expected O(n log n) time.
Not surprisingly our experiments have shown that this probability is indeed
low (less than 1/100), since most of the shortest path queries are performed on
94 G. Bar-On and P. Carmi

pairs of points placed close to each other (with respect to Euclidean distance),
and thus with a high probability their shortest path contains a constant number
of points. Moreover, it seems that for a real-life input this probably is low.
Thus, there is a very simple algorithm to compute the Path-Greedy spanner in
expected O(n2 log n) time for real-life inputs, based on the -Greedy algorithm
For real-life input we mean that our analysis suggests that in the current
computers precision (Memory) one cannot create an instance of points set with
more than 1000 points, where the Path-Greedy spanner based on the -Greedy
algorithm has more than O(n2 log n) constructing time.

4 Experimental Results
In this section we discuss the experimental results by considering the properties
of the graphs generated by dierent algorithms and the number of shortest path
queries performed during these algorithms. We have implemented the Path-
Greedy, -Greedy, Gap-Greedy, -Graph, Path-Greedy on -Graph algorithms.
The Path-Greedy on -graph t-spanner, rst computes a -graph t -spanner,
where t < t, and then runs the Path-Greedy t/t -spanner on this t -spanner. The
shortest path queries criteria is used for an absolute running time comparison
that is independent of the actual implementation. The known theoretical bounds
for the algorithms can be found in Table 1.
The experiments were performed on a set of 8000 points, with dierent values
of the parameter (between 1 and t). We have chosen to present the parameter
for the values t, t0.9 and t. This values do not have special properties, they
where chosen arbitrary to present the behavior of the spanner.
To avoid the eect of specic instances, we have run the algorithms several
times and taken the average of the results. However, in all the cases the dierence
between the values is negligible. Table 24 show the results of our experiments
for dierent values of t and . The columns of the weight (divided by wt(M ST ))
and the degree are rounded to integers, and the columns of the edges are rounded
to one digit after the decimal point (in k).
The implementation details and the results analysis appear in [4].

Acknowledgments We would like to thank Rachel Saban for implementing


the algorithms.

Weight
Algorithm Edges wt(M ST ) Degree Time
1
n
Path-Greedy O( t1 ) O(1) O( t1 ) O(n3 log n)
n
Gap-Greedy O( t1 ) O(log n) 1
O( t1 ) O(n log2 n)
n
-Graph O( ) O(n) O(n) O( n log n)
1 1
-Greedy n
O( t/1 ) O(1) O( t/1 ) O( t/1 n2 log n)

Table 1. Theoretical bounds of dierent t-spanner algorithms


-Greedy t-spanner 95

Algorithm Edges (in K) Weight Degree Shortest path


wt(M ST ) queries (in K)
Path-Greedy - 35.6 10 17 31996
-Greedy 1.1 35.6 10 17 254
-Greedy 1.0896 37.8 12 18 242
-Greedy 1.048 51.6 19 23 204
-Graph - 376.6 454 149 -
Greedy on -Graph 1.0896 37.8 12 18 3005
Greedy on -Graph 1.048 52 19 23 693
Gap-Greedy - 51.6 19 23 326

Table 2. Comparison between several t-spanner algorithms for t = 1.1

Algorithm Edges (in K) Weight Degree Shortest path


wt(M ST ) queries (in K)
Path-Greedy - 15.1 3 7 31996
-Greedy 1.5 15.1 3 7 82
-Greedy 1.44 16 3 8 77
-Greedy 1.224 22.5 5 11 63
-Graph - 118.6 76 53 -
Greedy on -Graph 1.44 16 3 8 817
Greedy on -Graph 1.224 22.5 6 11 198
Gap-Greedy - 22.6 5 11 95

Table 3. Comparison between several t-spanner algorithms for t = 1.5

Algorithm Edges (in K) Weight Degree Shortest path


wt(M ST ) queries (in K)
Path-Greedy - 11.4 2 5 31996
-Greedy 2 11.4 2 5 55
-Greedy 1.866 11.9 2 5 52
-Greedy 1.414 16.3 3 8 44
-Graph - 85.3 48 42 -
Greedy on -Graph 1.866 11.9 3 6 493
Greedy on -Graph 1.414 16.5 3 8 129
Gap-Greedy - 16 3 8 63

Table 4. Comparison between several t-spanner algorithms for t = 2


96 G. Bar-On and P. Carmi

References
1. S. P. A. Alewijnse, Q. W. Bouts, A. P. ten Brink, and K. Buchin. Computing the
greedy spanner in linear space. Algorithmica, 73(3):589606, 2015.
2. S. P. A. Alewijnse, Q. W. Bouts, A. P. ten Brink, and K. Buchin. Distribution-
sensitive construction of the greedy spanner. Algorithmica, pages 123, 2016.
3. S. Arya, D. M. Mount, and M. H. M. Smid. Randomized and deterministic algo-
rithms for geometric spanners of small diameter. In FOCS, pages 703712, 1994.
4. G. Bar-On and P. Carmi. -greedy t-spanner. CoRR, abs/1702.05900, 2017.
5. P. Bose, P. Carmi, M. Farshi, A. Maheshwari, and M. H. M. Smid. Computing the
greedy spanner in near-quadratic time. In SWAT, pages 390401, 2008.
6. P. B. Callahan. Optimal parallel all-nearest-neighbors using the well-separated
pair decomposition. In FOCS, pages 332340, 1993.
7. P. B. Callahan and S. R. Kosaraju. A decomposition of multi-dimensional point-
sets with applications to k-nearest-neighbors and n-body potential elds. In STOC,
pages 546556, 1992.
8. B. Chandra. Constructing sparse spanners for most graphs in higher dimensions.
Inf. Process. Lett., 51(6):289294, 1994.
9. B. Chandra, G. Das, G. Narasimhan, and J. Soares. New sparseness results on
graph spanners. Int. J. Comp. Geom. and Applic., 5:125144, 1995.
10. K. L. Clarkson. Approximation algorithms for shortest path motion planning. In
STOC, pages 5665, 1987.
11. G. Das, P. J. Heernan, and G. Narasimhan. Optimally sparse spanners in 3-
dimensional Euclidean space. In SoCG, pages 5362, 1993.
12. G. Das and G. Narasimhan. A fast algorithm for constructing sparse Euclidean
spanners. Int. J. Comp. Geom. and Applic., 7(4):297315, 1997.
13. G. Das and G. Narasimhan. A fast algorithm for constructing sparse Euclidean
spanners. Int. J. Comp. Geom. and Applic., 7(4):297315, 1997.
14. M. Farshi and J. Gudmundsson. Experimental study of geometric t-spanners. In
ESA, pages 556567, 2005.
15. M. Farshi and J. Gudmundsson. Experimental study of geometric t-spanners: A
running time comparison. In WEA, pages 270284, 2007.
16. M. Farshi and J. Gudmundsson. Experimental study of geometric t-spanners. ACM
Journal of Experimental Algorithmics, 14, 2009.
17. J. Gudmundsson, C. Levcopoulos, and G. Narasimhan. Fast greedy algorithms for
constructing sparse geometric spanners. SIAM J. Comput., 31(5):14791500, 2002.
18. J. M. Keil. Approximating the complete Euclidean graph. In SWAT, pages 208
213, 1988.
19. C. Levcopoulos, G. Narasimhan, and M. H. M. Smid. Improved algorithms for
constructing fault-tolerant spanners. Algorithmica, 32(1):144156, 2002.
20. G. Narasimhan and M. Smid. Geometric Spanner Networks. Cambridge University
Press, New York, NY, USA, 2007.
21. J. Soares. Approximating Euclidean distances by small degree graphs. Discrete &
Computational Geometry, 11(2):213233, 1994.
Dynamic Graph Coloring

Luis Barba1 , Jean Cardinal2 , Matias Korman3 , Stefan Langerman2 ,


Andre van Renssen4,5 , Marcel Roelozen4,5 , and Sander Verdonschot6
1
Dept. of Computer Science, ETH Zurich, Switzerland. [email protected]
2
Department dInformatique, Universite Libre de Bruxelles, Brussels, Belgium.
{jcardin,stefan.langerman}@ulb.ac.be
3
Tohoku University, Sendai, Japan. [email protected]
4
National Institute of Informatics, Tokyo, Japan. {andre,marcel}@nii.ac.jp
5
JST, ERATO, Kawarabayashi Large Graph Project.
6
School of Computer Science, Carleton University, Ottawa, Canada.
[email protected]

Abstract. In this paper we study the number of vertex recolorings that


an algorithm needs to perform in order to maintain a proper coloring of
a graph under insertion and deletion of vertices and edges. We present
two algorithms that achieve dierent trade-os between the number
of recolorings and the number of colors used. For any d > 0, the rst
algorithm maintains a proper O(CdN 1/d )-coloring while recoloring at most
O(d) vertices per update, where C and N are the maximum chromatic
number and maximum number of vertices, respectively. The second
algorithm reverses the trade-o, maintaining an O(Cd)-coloring with
O(dN 1/d ) recolorings per update. We also present a lower bound,
showing that any algorithm that maintains a c-coloring of a 2-colorable
2
graph on N vertices must recolor at least (N c(c1) ) vertices per update,
for any constant c 2.

1 Introduction

It is hard to underestimate the importance of the graph coloring problem in


computer science and combinatorics. The problem is certainly among the most
studied questions in those elds, and countless applications and variants have
been tackled since it was rst posed for the special case of maps in the mid-
nineteenth century. Similarly, the maintenance of some structures in dynamic
graphs has been the subject of study of several volumes in the past couple
of decades [1,2,11,18,19,20]. In this setting, an algorithmic graph problem is
modelled in the dynamic environment as follows. There is an online sequence of
insertion and deletion of edges or vertices, and our goal is to maintain the solution
of the graph problem after each update. A trivial way to maintain this solution is
to run the best static algorithm for this problem after each update; however, this

M. K. was partially supported by MEXT KAKENHI grant Nos. 12H00855, and
17K12635. A. v. R. and M. R. were supported by JST ERATO Grant Number
JPMJER1305, Japan. L. B. was supported by the ETH Postdoctoral Fellowship.
S. V. was partially supported by NSERC and the Carleton-Fields postdoctoral award.

Springer International Publishing AG 2017 97


F. Ellen et al. (Eds.): WADS 2017, LNCS 10389, pp. 97108, 2017.
DOI: 10.1007/978-3-319-62127-2_9
98 L. Barba et al.

is clearly not optimal. A dynamic graph algorithm seeks to maintain some clever
data structure for the underlying problem such that the time taken to update
the solution is much smaller than that of the best static algorithm.
In this paper, we study the problem of maintaining a coloring in a dynamic
graph undergoing insertions and deletions of both vertices and edges. At rst sight,
this may seem to be a hopeless task, since there exist near-linear lower bounds
on the competitive factor of online graph coloring algorithms [9], a restricted
case of the dynamic setting. In order to break through this barrier, we allow a
fair number of vertex recolorings per update. We focus on the combinatorial
aspect of the problem the trade-o between the number of colors used versus
the number of recolorings per update. We present a strong general lower bound
and two simple algorithms that provide complementary trade-os.
Denitions and Results. Let C be a positive integer. A C-coloring of a graph
G is a function that assigns a color in {1, . . . , C} to each vertex of G. A C-coloring
is proper if no two adjacent vertices are assigned the same color. We say that G
is C-colorable if it admits a proper C-coloring, and we call the smallest such C
the chromatic number of G.
A recoloring algorithm is an algorithm that maintains a proper coloring of a
simple graph while that graph undergoes a sequence of updates. Each update
adds or removes either an edge or a vertex with a set of incident edges. We say
that a recoloring algorithm is c-competitive if it uses at most c Cmax colors,
where Cmax is the maximum chromatic number of the graph during the updates.
For example, an algorithm that computes the optimal coloring after every
update is 1-competitive, but may recolor every vertex for every update. At the
other extreme, we can give each vertex a unique color, resulting in a linear
competitive factor for an algorithm that recolors at most 1 vertex per update. In
this paper, we investigate intermediate solutions that use more than C colors but
recolor a sublinear number of vertices per update. Note that we do not assume
that the value C is known in advance, or at any point during the algorithm.
In Section 2, we present two complementary recoloring algorithms: an O(dN 1/d )-
competitive algorithm with an amortized O(d) recolorings per update, and an
O(d)-competitive algorithm with an amortized O(dN 1/d ) recolorings per update,
where d is a positive integer parameter and N is the maximum number of vertices
in the graph during a sequence of updates. Interestingly, for d = (log N ), both
are O(log N )-competitive with an amortized O(log N ) vertex recolorings per
update. Using standard techniques, the algorithms can be made sensitive to the
current (instead of the maximum) number of vertices in the graph.
We provide lower bounds in Section 3. In particular, we show that for any
recoloring algorithm A using c colors, there exists a specic 2-colorable graph on N
vertices and a sequence of m edge insertions and deletions that forces A to perform
2
at least (m N c(c1) ) vertex recolorings. Thus, any x-competitive recoloring
1
algorithm performs in average at least (N x(2x1) ) recolorings per update.
To allow us to focus on the combinatorial aspects, we assume that we have
access to an algorithm that, at any time, can color the current graph (or an
induced subgraph) using few colors. Of course, nding an optimal coloring of an
Dynamic Graph Coloring 99

n-vertex graph is NP-complete in general [13] and even NP-hard to approximate


to within n1 for any  > 0 [22]. Still, this assumption is not as strong as it
sounds. Most practical instances can be colored eciently [4], and for several
important classes of graphs the problem is solvable or approximable in polynomial
time, including bipartite graphs, planar graphs, k-degenerate graphs, and unit
disk graphs [15].
Related results. Dynamic graph coloring. The problem of maintaining a col-
oring of a graph that evolves over time has been tackled before, but to our
knowledge, only from the points of view of heuristics and experimental results.
This includes for instance results from Preuveneers and Berbers [17], Ouerfelli
and Bouziri [16], and Dutot et al. [7]. A related problem of maintaining a graph-
coloring in an online fashion was studied by Borowiecki and Sidorowicz [3]. In
that problem, vertices lose their color, and the algorithm is asked to recolor them.
Online graph coloring. The online version of the problem is closely related
to our setting, except that most variants of the online problem only allow the
coloring of new vertices, which then cannot be recolored later. Near-linear lower
bounds on the best achievable competitive factor have been proven by Halldorsson
and Szegedy more than two decades ago [9]. They show their bound holds even
when the model is relaxed to allow a constant fraction of the vertices to change
color over the whole sequence. This, however, does not contradict our results. We
allow our algorithms to recolor all vertices at some point, but we bound only the
number of recolorings per update. Algorithms for online coloring with competitive
factor coming close, or equal to this lower bound have been proposed by Lovasz
et al. [14], Vishwanathan [21], and Halldorsson [8].
Dynamic graphs. Several techniques have been used for the maintenance of
other structures in dynamic graphs, such as spanning trees, transitive closure, and
shortest paths. Surveys by Demetrescu et al. [5,6] give a good overview of those.
Recent progress on dynamic connectivity [12] and approximate single-source
shortest paths [10] are witnesses of the current activity in this eld.

2 Upper bound: Recoloring-algorithms

For the description of our algorithms we consider only inserting a vertex with its
incident edges. Deletions cannot invalidate the coloring and edge insertions can
be done by removing and adding one of the vertices with the appropriate edges.
Our algorithms partition the vertices into a set of buckets, each of which has
its own distinct set of colors. All our algorithms guarantee that the subgraph
induced by the vertices inside each bucket is properly colored and this implies
that the entire graph is properly colored at all times.
The algorithms dier in the number of buckets they use and the size (maximum
number of vertices) of each bucket. Typically, there is a sequence of buckets of
increasing size, and one reset bucket that can contain arbitrarily many vertices
and that holds vertices whose color has not changed for a while. Initially, the size
of each bucket depends on the number of vertices in the input graph. As vertices
are inserted and deleted, the current number of vertices changes. When certain
100 L. Barba et al.

si si si si
1 1 1 1

s s 1
Fig. 1: The small-buckets algorithm uses d levels, each with s buckets of capacity si ,
1/d
where i is the level, s = NR , and NR is the number of vertices during the last reset.

buckets are full, we reset everything, to ensure that we can accommodate the
new number of vertices. This involves emptying all buckets into the reset bucket,
computing a proper coloring of the entire graph, and recomputing the sizes of
the buckets in terms of the current number of vertices.
We refer to the number of vertices during the most recent reset as NR , and
1/d
we express the size of the buckets in s = NR , where d > 0 is an integer
parameter that allows us to achieve dierent trade-os between the number
of colors and number of recolorings used. Since s = O(N 1/d ), where N is the
maximum number of vertices thus far, we state our bounds in terms of N . Note
that it is also possible to keep NR within a constant factor of the current number
of vertices by triggering a reset whenever the current number of vertices becomes
too small or too large. We omit these details for the sake of simplicity.

2.1 Small-buckets algorithm

Our rst algorithm, called the small-buckets algorithm, uses a lot of colors, but
needs very few recolorings. In addition to the reset bucket, the algorithm uses
ds buckets, grouped into d levels of s buckets each. All buckets on level i, for
0 i < d, have capacity si (see Fig. 1). Initially, the reset bucket contains
all vertices, and all other buckets are empty. Throughout the execution of the
algorithm, we ensure that every level always has at least one empty bucket. We
call this the space invariant.
When a new vertex is inserted, we place it in any empty bucket on level 0.
The space invariant guarantees the existence of this bucket. Since this bucket
has a unique set of colors, assigning one of them to the new vertex establishes a
proper coloring. Of course, if this was the last empty bucket on level 0, lling it
violates the space invariant. In that case, we gather up all s vertices on this level,
place them in the rst empty bucket on level 1 (which has capacity s and must
exist by the space invariant), and compute a new coloring of their induced graph
using the set of colors of the new bucket. If this was the last free bucket on level
1, we move all its vertices to the next level and repeat this procedure. In general,
if we lled the last free bucket on level i, we gather up all at most s si = si+1
vertices on this level, place them in an empty bucket on level i + 1 (which exists
by the space invariant), and recolor their induced graph with the new colors. If
we ll up the last level (d 1), we reset the structure, emptying each bucket into
Dynamic Graph Coloring 101

the reset bucket and recoloring the whole graph.


Theorem 2.1. For any integer d > 0, the small-buckets algorithm is an O(dN 1/d )-
competitive recoloring algorithm that uses at most O(d) amortized vertex recolor-
ings per update.
Proof. (sketch) The total number of colors is bounded by the maximum number
of non-empty buckets (1 + d(s 1)), multiplied by the maximum number of
colors used by any bucket. Let C be the maximum chromatic number of the
graph. Since any induced subgraph of a C-colorable graph is also C-colorable,
each bucket requires at most C colors. Thus, the total number of colors is at most
(1 + d(s 1))C, and the algorithm is O(dN 1/d )-competitive.
To analyze the number of recolorings, we use a simple charging scheme that
places coins in the buckets and pays one coin for each recoloring. Whenever we
place a vertex in a bucket on level 0, we give d + 2 coins to that bucket. One of
these coins is immediately used to pay for the vertexs new color, leaving d + 1
coins. In general, we can maintain the invariant that each non-empty bucket on
level i has si (d i + 1) coins from which the result follows. 


2.2 Big-buckets algorithm


Our second algorithm, called sd
the big-buckets algorithm, is s si
similar to the small-buckets
algorithm, except it merges
all buckets on the same level
Fig. 2: Besides the reset bucket, the big-buckets algo-
into a single larger bucket. rithm uses d buckets, each with capacity si+1 , where i
Specically, the algorithm is the bucket number.
uses d buckets in addition
to the reset bucket. These buckets are numbered sequentially from 0 to d 1,
with bucket i having capacity si+1 , see Fig. 2. Since we use far fewer buckets, an
upper bound on the total number of colors drops signicantly, to (d + 1)C. Of
course, as we will see later, we pay for this in the number recolorings. Similar
to the space invariant in the small-buckets algorithm, the big-buckets algorithm
maintains the high point invariant: bucket i always contains at most si+1 si
vertices (its high point).
When a new vertex is inserted, we place it in the rst bucket. Since this
bucket may already contain other vertices, we recolor all its vertices, so that the
subgraph induced by these vertices remains properly colored. This revalidates the
coloring, but may violate the high point invariant. If we lled bucket i beyond its
high point, we move all its vertices to bucket i + 1 and compute a new coloring
for this bucket. We repeat this until the high point invariant is satised, or we
ll bucket d 1 past its high point. In the latter case we reset, adding all vertices
to the reset bucket and computing a new coloring for the entire graph.
Theorem 2.2. For any integer d > 0, the big-buckets algorithm is an O(d)-
competitive recoloring algorithm that uses at most O(dN 1/d ) amortized vertex
recolorings per update.
102 L. Barba et al.

n1/3 1-trees
...

... ...
... ... ... ... ... ...

1/3

n2/3 1 leaves n2/3 1 leaves


n
9 1-trees

Fig. 3: (left) A 1-conguration is any forest that has many 1-trees as induced subgraphs.
(right) A 2-tree is constructed by connecting the roots of many 1-trees.

3 Lower bound
In this section we prove a lower bound on the amortized number of recolorings for
any algorithm that maintains a c-coloring of a 2-colorable graph, for any constant
c 2. We say that a vertex is c-colored if it has a color in [c] = {1, . . . , c}. For
simplicity of description, we assume that a recoloring algorithm only recolors
vertices when an edge is inserted and not when an edge is deleted, as edge deletions
do not invalidate the coloring. This assumption causes no loss of generality, as
we can delay the recolorings an algorithm would perform in response to an edge
deletion until the next edge insertion.
The proof for the lower bound consists of several parts. We begin with a specic
initial conguration and present a strategy for an adversary that constructs a
large conguration with a specic colouring and then repeatedly performs costly
operations in this conguration. In light of this strategy, a recoloring algorithm
has a few choices: it can allow the conguration to be built and perform the
recolorings required, it can destroy the conguration by recoloring parts of it
instead of performing the operations, or it can prevent the conguration from
being built in the rst place by recoloring parts of the building blocks. We show
that all these options require a large number of amortized recolorings.

3.1 Maintaining a 3-coloring


To make the general lower bound easier to understand, we rst show that to
maintain a 3-coloring, we need at least (n1/3 ) recolorings on average per update.
Lemma 3.1. For any suciently large n and any m 2n1/3 , there exists a
forest with n vertices, such that for any recoloring algorithm A, there exists a
sequence of m updates that forces A to perform (m n1/3 ) vertex recolorings to
maintain a 3-coloring throughout this sequence.
Proof. Let A be any recoloring algorithm that maintains a 3-coloring of a forest
under updates. We use an adversarial strategy to choose a sequence of updates
on a specic forest with n nodes that forces A to recolor many vertices. We
start by describing the initial forest structure.
A 1-tree is a rooted (star) tree with a distinguished vertex as its root and
Dynamic Graph Coloring 103

n2/3 1 leaf nodes attached to it. Initially, our forest consists of n1/3 pairwise
disjoint 1-trees, which account for all n vertices in our forest. The sequence of
updates we construct never performs a cut operation among the edges of a 1-tree.
Thus, the forest remains a 1-conguration: a forest of rooted trees with the n1/3
independent 1-trees as induced subgraphs; see Fig. 3 (left). We require that the
induced subtrees are not upside down, that is, the root of the 1-tree should be
closer to the root of the full tree than its children. Intuitively, a 1-conguration
is simply a collection of our initial 1-trees linked together into larger trees.
Let F be a 1-conguration. We assume that A has already chosen an initial
3-coloring of F . We assign a color to each 1-tree as follows. Since each 1-tree is
properly 3-colored, the leaves cannot have the same color as the root. Thus, a
2/3
1-tree T always has at least n 2 1 leaves of some color C, and C is dierent
from the color of the root. We assign the color C to T . In this way, each 1-tree
is assigned one of the three colors. We say that a 1-tree with assigned color C
becomes invalid if it has no children of color C left. Notice that to invalidate
2/3
a 1-tree, algorithm A needs to recolor at least n 2 1 of its leaves. Since the
1/3
coloring uses only three colors, there are at least n 3 1-trees with the same
assigned color, say X. In the remainder, we focus solely on these 1-trees.
1/3
A 2-tree is a tree obtained by merging n 9 1-trees with assigned color X, as
follows. First, we cut the edge connecting the root of each 1-tree to its parent, if
it has one. Next, we pick a distinguished 1-tree with root r, and connect the root
1/3
of each of the other n 9 1 1-trees to r. In this way, we obtain a 2-tree whose
1/3
root r has n2/3 1 leaf children from the 1-tree of r, and n 9 1 new children
that are the roots of other 1-trees; see Fig. 3 (right) for an illustration. This
1/3 1/3
construction requires n 9 1 edge insertions and at most n 9 edge deletions (if
every 1-tree root had another parent in the 1-conguration).
1/3 1/3
We build 3 such 2-trees in total. This requires at most 6( n 9 ) = 2n3 updates.
If none of our 1-trees became invalid, then since our construction involves only
1-trees with the same assigned color X, no 2-tree can have a root with color X.
Further, since the algorithm maintains a 3-coloring, there must be at least two
2-trees whose roots have the same color. We can now perform a matching link,
by connecting the roots of these two trees by an edge (in general, we may need
to perform a cut rst). To maintain a 3-coloring after a matching link, A must
recolor the root of one of the 2-trees and either recolor all its non-leaf children
or invalidate a 1-tree. If no 1-tree has become invalidated, this requires at least
n1/3
9 recolorings, and we again have two 2-trees whose roots have the same color.
Thus, we can perform another matching link between them. We keep doing this
1/3
until we either performed n 6 matching links, or a 1-tree is invalidated.
1/3
Therefore, after at most n1/3 updates ( 2n3 for the construction of the 2-trees,
n1/3
and 3 for the matching links), we either have an invalid 1-tree, in which case
n2/3 1 n1/3
A recolored at least 2 nodes, or we performed 6 matching links, which
1/3 1/3 2/3
forced at least n 6 n 9 = n54 recolorings. In either case, we forced A to
2/3
perform at least (n ) vertex recolorings, using at most n1/3 updates.
104 L. Barba et al.

Since no edge of a 1-tree was cut, we still have a valid 1-conguration, where
the process can be restarted. Consequently, for any m 2n1/3 , there exists a
sequence of m updates that starts with a 1-conguration and forces A to perform
2/3
1/3 (n
 nm ) = (m n1/3 ) vertex recolorings. 


3.2 On k-trees

We are now ready to

{
describe a general lower n2/c

{
{
{
2(c2) 2(ck+1) 2(ck)
bound for any number 0-trees n c(c1)
n c(c1) n c(c1)
of colors c. The general
1-trees (k 2)-trees (k 1)-trees
approach is the same as
when using 3 colors: We Fig. 4: A k-tree is constructed by connecting the roots of
construct trees of height a large number of (k 1)-trees.
up to c + 1, each exclud-
ing a dierent color for the root of the merged trees. By now connecting two such
trees, we force the algorithm A to recolor the desired number of vertices.
A 0-tree is a single node, and for each 1 k c, a k-tree is a tree obtained
2(ck)
recursively by merging 2 n c(c1) (k 1)-trees as follows: Pick a (k 1)-tree and
2(ck)
let r be its root. Then, for each of the 2 n c(c1) 1 remaining (k 1)-trees,
connect their root to r with an edge; see Fig. 4 for an illustration.
As a result, for each 0 j k 1, a k-tree T consists of a root r with
2(cj1)
2 n c(c1) 1 j-trees, called the j-subtrees of T , whose root hangs from r. The
root of a j-subtree of T is called a j-child of T . By construction, r is also the
root of a j-tree which we call the core j-tree of T .
Whenever a k-tree is constructed, it is assigned a color that is present among
a large fraction of its (k 1)-children. Indeed, whenever
 a k-tree is assigned a
2(ck)
color ck , we guarantee that it has at least 2c n c(c1) (k 1)-children of color ck .
We describe later how to choose the color that is assigned to a k-tree.
We say that a k-tree that was assigned color ck has a color violation if its
root no longer has a (k 1)-child with color ck . We say that a k-tree T becomes
invalid if either (1) it has a color violation or (2) if a core j-tree of T has a color
violation for some 1 j < k; otherwise we say that T is valid.
Observation 1 To obtain a color violation
 in a k-tree constructed by the above
2(ck)
2
procedure, A needs to recolor at least c n c(c1) vertices.

Notice that a valid c-colored k-tree of color ck cannot have a root with color ck .
Formally, color ck is blocked for the root of a k-tree if this root has a child with
color ck . In particular, the color assigned to a k-tree and the colors assigned to
its core j-trees for 1 j k 1 are blocked as long as the tree is valid.

3.3 On k-congurations
A 0-conguration is a set F0 of c-colored nodes, where |F0 | = T0 = n, for
some suciently large constant which will be specied later. For 1 k < c, a
Dynamic Graph Coloring 105

k-conguration is a set Fk of Tk k-trees, where


k 2(ci)
Tk = k
n1 i=1 c(c1) .
(4c)

Note that the trees of a k-conguration may be part of m-trees for m > k. If at
least T2k k-trees in a k-conguration are valid, then the conguration is valid.
For our construction, we let the initial conguration F0 be an arbitrary
c-colored 0-conguration in which each vertex is c-colored. To construct a k-
conguration Fk from a valid (k 1)-conguration Fk1 , consider the at least
Tk1
2 valid (k 1)-trees from Fk1 . Recall that the trees of Fk1 may be part
of larger trees, but since we consider edge deletions as free operations we can
separate the trees. Since each of these trees has a color assigned, among them at
least Tk1
2c have the same color assigned to them. Let ck1 denote this color.
2(ck)
Because each k-tree consists of 2 n c(c1) (k 1)-trees, to obtain Fk we merge
Tk1
2c (k 1)-trees of color ck1 into Tk k-trees, where

Tk1 1 k 2(ci)
Tk = 2(ck)
= k
n1 i=1 c(c1) .
2c 2 n c(c1) (4c)

Once the k-conguration Fk is constructed, we perform a color assign-


ment to each k-tree in Fk as follows: For a k-tree of Fk whose root has
2(ck)
2 n c(c1) 1 c-colored (k 1)-children, we assign a color that is shared by
2(ck)
at least 2c n c(c1) 1 of these (k 1)-children. Therefore, has at least
 2(ck)

2
c n children of its assigned color. After these color assignments, if each
c(c1)

(k 1)-tree used is valid, then each of the Tk k-trees of Fk is also valid. Thus,
Fk is a valid conguration. Moreover, for Fk to become invalid, A would need
to invalidate at least T2k of its k-trees. Since we use (k 1)-trees with the same
assigned color to construct k-trees, we can conclude the following about the use
of colors in any k-tree.

Lemma 3.2. Let Fk be a valid k-conguration. For each 1 j < k, each core
j-tree of a valid k-tree of Fk has color cj assigned to it. Moreover, ci = cj for
each 1 i < j < k.

We also provide bounds on the number of updates needed to construct a


k-conguration.
k
Lemma 3.3. Using ( i=j Ti ) = (Tj ) edge insertions, we can construct a
k-conguration from a valid j-conguration.

Proof. To merge Tk12c (k 1)-trees to into Tk k-trees, we need (Tk1 ) edge


insertions. Thus,
k in total, to construct a k-conguration from a j-conguration,
we need ( i=j Ti ) = (Tj ) edge insertions. 

106 L. Barba et al.

3.4 Reset phase

Throughout the construction of a k-conguration, the recoloring-algorithm A


may recolor several vertices which could lead to invalid subtrees in Fj for any
1 j < k. Because A may invalidate some trees from Fj while constructing Fk
from Fk1 , one of two things can happen. If Fj is a valid j-conguration for each
1 j k, then we continue and try to construct a (k + 1)-conguration from Fk .
Otherwise a reset is triggered as follows.
Let 1 j < k be an integer such that Fi is a valid i-conguration for each
0 i j 1, but Fj is not valid. Since Fj was a valid j-conguration with
at least Tj valid j-trees when it was rst constructed, we know that in the
T
process of constructing Fk from Fj , at least 2j j-trees where invalidated by A.
We distinguish two ways in which a tree can be invalid:

(1) the tree has a color violation, but all its j 1-subtrees are valid and no
core i-tree for 1 i j 1 has a color violation; or
(2) A core i-tree has a color violation for 1 i j 1, or the tree has a
color violation and at least one of its (j 1)-subtrees is invalid.

In case (1) the algorithm A has to perform fewer recolorings, but the tree can be
made valid again with a color reassignment, whereas in case (2) the j-tree has to
be rebuild.
Let Y0 , Y1 and Y2 respectively be the set of j-trees of Fj that are either valid,
T
or are invalid by case (1) or (2) respectively. Because at least 2j j-trees were
T
invalidated, we know that |Y1 | + |Y2 | > 2j . Moreover, for each tree in Y1 , A
2(cj)
recolored at least 2c n c(c1) 1 vertices to create the color violation on this
j-tree by Observation 1. For each tree in Y2 however, A created a color violation
in some i-tree for i < j. Therefore, for each tree in Y2 , by Observation 1, the
2(ci) 2(cj+1)
number of vertices that A recolored is at least 2c n c(c1) 1 > 2c n c(c1) 1.
Case 1: |Y1 | > |Y2 |. Recall that each j-tree in Y1 has only valid (j1)-subtrees
by the denition of Y1 . Therefore, each j-tree in Y1 can be made valid again by
performing a color assignment on it while performing no update. In this way,
T
we obtain |Y0 | + |Y1 | > 2j valid j-trees, i.e., Fj becomes a valid j-conguration
contained in Fk . Notice that when a color assignment is performed on a j-tree,
vertex recolorings previously performed on its (j 1)-children cannot be counted
again towards invalidating this tree.
Since we have a valid j-conguration instead of a valid k-conguration, we
wasted some edge insertions. We say that the insertion of each edge in Fk that is
not an edge of Fj is a wasted edge insertion. By Lemma 3.3, to construct Fk from
Fj we used (Tj ) edge insertions. That is, (Tj ) edge insertions became wasted.
However, while we wasted (Tj ) edge insertions, we also forced A to perform
2(cj) 2(cj)
(|Y1 | n c(c1) ) = (Tj n c(c1) ) vertex recolorings. Since 1 j < k c 1, we
2(cj) 2 2
know that n c(c1) n c(c1) . Therefore, we can charge A with (n c(c1) ) vertex
recolorings per wasted edge insertion. Finally, we remove each edge corresponding
to a wasted edge insertion, i.e., we remove all the edges used to construct Fk
Dynamic Graph Coloring 107

from Fj . Since we assumed that A performs no recoloring on edge deletions, we


are left with a valid j-conguration Fj .
T
Case 2: |Y2 | > |Y1 |. In this case |Y2 | > 4j . Recall that Fj1 is a valid
(j 1)-conguration by our choice of j. In this case, we say that the insertion
of each edge in Fk that is not an edge of Fj1 is a wasted edge insertion. By
Lemma 3.3, we constructed Fk from Fj1 using (Tj1 ) wasted edge insertions.
However, while we wasted (Tj1 ) edge insertions, we also forced A to perform
2(cj+1) 2(cj+1)
(|Y2 | n c(c1) ) = (Tj n c(c1) ) vertex recolorings. That is, we can charge
2(cj+1)
Tj
A with ( Tj1 n c(c1) ) vertex recolorings per wasted edge insertions. Since
2(cj) 2
Tj1
Tj = 4c n , we conclude that A was charged (n c(c1) ) vertex recolorings
c(c1)

per wasted edge insertion. Finally, we remove each edge corresponding to a wasted
edge insertion, i.e., we go back to the valid (j 1)-conguration Fj1 as before.

Regardless of the case, we know that during a reset consisting of a sequence


2
of h wasted edge insertions, we charged A with the recoloring of (h n c(c1) )
vertices. Notice that each edge insertion is counted as wasted at most once as the
edge that it corresponds to is deleted during the reset phase. A vertex recoloring
may be counted more than once. However, a vertex recoloring on a vertex v can
count towards invalidating any of the trees it belongs to. Recall though that v
belongs to at most one i-tree for each 0 i c. Moreover, two things can happen
during a reset phase that count the recoloring of v towards the invalidation of a
j-tree containing it: either (1) a color assignment is performed on this j-tree or
(2) this j-tree is destroyed by removing its edges corresponding to wasted edge
insertions. In the former case, we know that v needs to be recolored again in order
to contribute to invalidating this j-tree. In the latter case, the tree is destroyed
and hence, the recoloring of v cannot be counted again towards invalidating it.
Therefore, the recoloring of a vertex can be counted towards invalidating any
j-tree at most c times throughout the entire construction. Since c is assumed to
be a constant, we obtain the following result.

Lemma 3.4. After a reset phase in which h edge insertions become wasted, we
2
can charge A with (h n c(c1) ) vertex recolorings. Moreover, A will be charged
at most O(1) times for each recoloring.

If A stops triggering resets, then at some point we reach a (c1)-conguration


with at least Tc1 2(c + 1) trees and c + 1 valid ones. By linking together two
such trees with the same color we can force algorithm A to trigger a reset.

Theorem 3.5. Let c be a constant. For any suciently large integers n and
depending only on c, and any m = (n) suciently large, there exists a forest
F with n vertices, such that for any recoloring algorithm A, there exists a
2
sequence of m updates that forces A to perform (m n c(c1) ) vertex recolorings
to maintain a c-coloring of F .
108 L. Barba et al.

References
1. S. Baswana, M. Gupta, and S. Sen. Fully dynamic maximal matching in O(log n)
update time. SIAM J. on Comp., 44(1):88113, 2015.
2. S. Baswana, S. Khurana, and S. Sarkar. Fully dynamic randomized algorithms for
graph spanners. ACM Trans. on Alg., 8(4):35, 2012.
3. P. Borowiecki and E. Sidorowicz. Dynamic coloring of graphs. Fundamenta
Informaticae, 114(2):105128, 2012.
4. O. Coudert. Exact coloring of real-life graphs is easy. In Proc. 34th Design Autom.
Conf., pages 121126. ACM, 1997.
5. C. Demetrescu, D. Eppstein, Z. Galil, and G. F. Italiano. Dynamic graph algorithms.
In M. J. Atallah and M. Blanton, editors, Algorithms and Theory of Computation
Handbook. Chapman & Hall/CRC, 2010.
6. C. Demetrescu, I. Finocchi, and P. Italiano. Dynamic graphs. In D. Mehta and
S. Sahni, editors, Handbook on Data Structures and Applications, Computer and
Information Science. CRC Press, 2005.
7. A. Dutot, F. Guinand, D. Olivier, and Y. Pigne. On the decentralized dynamic
graph-coloring problem. In Proc. Worksh. Compl. Sys. and Self-Org. Mod., 2007.
8. M. M. Halldorsson. Parallel and on-line graph coloring. J. Alg., 23(2):265280,
1997.
9. M. M. Halldrsson and M. Szegedy. Lower bounds for on-line graph coloring. Theo.
Comp. Sci., 130(1):163 174, 1994.
10. M. Henzinger, S. Krinninger, and D. Nanongkai. A subquadratic-time algorithm
for decremental single-source shortest paths. In Proc. 25th ACM-SIAM Symp. on
Discr. Alg., pages 10531072, 2014.
11. J. Holm, K. De Lichtenberg, and M. Thorup. Poly-logarithmic deterministic
fully-dynamic algorithms for connectivity, minimum spanning tree, 2-edge, and
biconnectivity. J. ACM, 48(4):723760, 2001.
12. B. M. Kapron, V. King, and B. Mountjoy. Dynamic graph connectivity in polylog-
arithmic worst case time. In Proc. 24th ACM-SIAM Symp. on Discr. Alg., pages
11311142, 2013.
13. R. M. Karp. Reducibility among combinatorial problems. In Complexity of computer
computations, pages 85103. Plenum, New York, 1972.
14. L. Lovasz, M. E. Saks, and W. T. Trotter. An on-line graph coloring algorithm
with sublinear performance ratio. Discr. Math., 75(1-3):319325, 1989.
15. M. V. Marathe, H. Breu, H. B. Hunt, III, S. S. Ravi, and D. J. Rosenkrantz. Simple
heuristics for unit disk graphs. Networks, 25(2):5968, 1995.
16. L. Ouerfelli and H. Bouziri. Greedy algorithms for dynamic graph coloring. In
Proc. Int. Conf. on Comm., Comp. and Control App., pages 15, 2011.
17. D. Preuveneers and Y. Berbers. ACODYGRA: an agent algorithm for coloring
dynamic graphs. In Symb. Num. Alg. Sci. Comp., pages 381390, 2004.
18. L. Roditty and U. Zwick. Improved dynamic reachability algorithms for directed
graphs. In Proc. 43rd IEEE Sym. Found. Comp. Sci., pages 679688, 2002.
19. L. Roditty and U. Zwick. Dynamic approximate all-pairs shortest paths in undi-
rected graphs. In Proc. 45th IEEE Sym. Found. Comp. Sci., pages 499508, 2004.
20. M. Thorup. Fully-dynamic min-cut. Combinatorica, 27(1):91127, 2007.
21. S. Vishwanathan. Randomized online graph coloring. J. Alg., 13(4):657669, 1992.
22. D. Zuckerman. Linear degree extractors and the inapproximability of max clique
and chromatic number. Theory Comp., 3:103128, 2007.
Universal Hinge Patterns for Folding Strips
Eciently into Any Grid Polyhedron

Nadia M. Benbernou1  , Erik D. Demaine2 ,


Martin L. Demaine2 , and Anna Lubiw3
1
Google Inc., [email protected].
2
MIT Computer Science and Articial Intelligence Laboratory,
32 Vassar St., Cambridge, MA 02139, USA, {edemaine,mdemaine}@mit.edu
3
David R. Cheriton School of Computer Science, University of Waterloo,
Waterloo, Ontario N2L 3G1, Canada, [email protected]

Abstract. We present two universal hinge patterns that enable a strip


of material to fold into any connected surface made up of unit squares on
the 3D cube gridfor example, the surface of any polycube. The folding
is ecient: for target surfaces topologically equivalent to a sphere, the
strip needs to have only twice the target surface area, and the folding
stacks at most two layers of material anywhere. These geometric results
oer a new way to build programmable matter that is substantially more
ecient than what is possible with a square N N sheet of material,
which can fold into all polycubes only of surface area O(N ) and may
stack (N 2 ) layers at one point. We also show how our strip foldings
can be executed by a rigid motion without collisions (albeit assuming
zero thickness), which is not possible in general with 2D sheet folding.
To achieve these results, we develop new approximation algorithms
for milling the surface of a grid polyhedron, which simultaneously give a
2-approximation in tour length and an 8/3-approximation in the number
of turns. Both length and turns consume area when folding a strip, so
we build on past approximation algorithms for these two objectives from
2D milling.

1 Introduction
In computational origami design, the goal is generally to develop an algorithm
that, given a desired shape or property, produces a crease pattern that folds into
an origami with that shape or property. Examples include folding any shape
[9], folding approximately any shape while being watertight [10], and optimally
folding a shape whose projection is a desired metric tree [14,15]. In all of these
results, every dierent shape or tree results in a completely dierent crease pat-
tern; two shapes rarely share many (or even any) creases.
The idea of a universal hinge pattern [6] is that a nite set of hinges (possible
creases) suce to make exponentially many dierent shapes. The main result
along these lines is that an N N box-pleat grid suces to make any polycube

Work performed while at MIT.

Springer International Publishing AG 2017 109


F. Ellen et al. (Eds.): WADS 2017, LNCS 10389, pp. 109120, 2017.
DOI: 10.1007/978-3-319-62127-2_10
110 N.M. Benbernou et al.

made of O(N ) cubes [6]. The box-pleat grid is a square grid plus alternating
diagonals in the squares, also known as the tetrakis tiling. For each target
polycube, a subset of the hinges in the grid serve as the crease pattern for that
shape. Polycubes form a universal set of shapes in that they can arbitrarily
closely approximate (in the Hausdor sense) any desired volume.
The motivation for universal hinge patterns is the implementation of pro-
grammable matter material whose shape can be externally programmed. One
approach to programmable matter, developed by an MITHarvard collabora-
tion, is a self-folding sheeta sheet of material that can fold itself into several
dierent origami designs, without manipulation by a human origamist [12,1].
For practicality, the sheet must consist of a xed pattern of hinges, each with
an embedded actuator that can be programmed to fold or not. Thus for the
programmable matter to be able to form a universal set of shapes, we need a
universal hinge pattern.
The box-pleated polycube result [6], however, has some practical limitations
that prevent direct application to programmable matter. Specically, using a
sheet of area (N 2 ) to fold N cubes means that all but a (1/N ) fraction of the
surface area is wasted. Unfortunately, this reduction in surface area is necessary
for a roughly square sheet, as folding a 11N tube requires a sheet of diameter
(N ). Furthermore, a polycube made from N cubes can have surface area as
low as (N 2/3 ), resulting in further wastage of surface area in the worst case.
Given the factor-(N ) reduction in surface area, an average of (N ) layers of
material come together on the polycube surface. Indeed, the current approach
can have up to (N 2 ) layers coming together at a single point [6]. Real-world
robotic materials have signicant thickness, given the embedded actuation and
electronics, meaning that only a few overlapping layers are really practical [12].
Our results: strip folding. In this paper, we in-
troduce two new universal hinge patterns that avoid
these ineciencies, by using sheets of material that
(a)
are long only in one dimension (strips). Specically,
Fig. 1 shows the two hinge patterns: the canonical
strip is a 1 N strip with hinges at integer grid lines
and same-oriented diagonals, while the zig-zag strip
is an N -square zig-zag with hinges at just integer grid
lines. We show in Section 2 that any grid surface
any connected surface made up of unit squares on the
3D cube gridcan be folded from either strip. The (b)
strip length only needs to be a constant factor larger
than the surface area, and the number of layers is Fig. 1. Two universal
at most a constant throughout the folding. Most of hinge patterns in strips.
our analysis concerns (genus-0) grid polyhedra, that (a) A canonical strip of
is, when the surface is topologically equivalent to a length 5. (b) A zig-zag
sphere (a manifold without boundary, so that every strip of length 6. The
edge is incident to exactly two grid squares, and with- dashed lines are hinges.
out handles, unlike a torus). We show in Section 4 that a grid polyhedron of
Universal Hinge Patterns for Folding Strips Efficiently into Any Grid Polyhedron 111

surface area N can be folded from a canonical strip of length 2N with at most
two layers everywhere, or from a zig-zag strip of length 4N with at most four
layers everywhere.
The improved surface eciency and reduced layering of these strip results
seem more practical for programmable matter. In addition, the panels of either
strip (the facets delineated by hinges) are connected acyclically into a path,
making them potentially easier to control. One potential drawback is that the
reduced connectivity makes for a imsier device; this issue can be mitigated by
adding tabs to the edges of the strips to make full two-dimensional contacts
across seams and thereby increase strength.
We also show in Section 5 an important practical result for our strip foldings:
under a small assumption about feature size, we give an algorithm for actually
folding the strip into the desired shape, while keeping the panels rigid (at) and
avoiding self-intersection throughout the motion. Such a rigid folding process
is important given current fabrication materials, which put exibility only in
the creases between panels [12]. An important limitation, however, is that we
assume zero thickness of the material, which would need to be avoided before
this method becomes practical.
Our approach is also related to the 1D chain robots of [7], but based on thin
material instead of thick solid chains. Most notably, working with thin material
enables us to use a few overlapping layers to make any desired surface without
scaling, and still with high eciency. Essentially, folding long thin strips of sheet
material is like a fusion between 1D chains of [7] and the square sheet folding of
[6,12,1].
Milling tours. At the core of our ecient strip foldings are ecient approxi-
mation algorithms for milling a grid polyhedron. Motivated by rapid-fabrication
CNC milling/cutting tools, milling problems are typically stated in terms of a
2D region called a pocket and a cutting tool called a cutter, with the goal
being to nd a path or tour for the cutter that covers the entire pocket. In our
situation, the pocket is the surface of the grid polyhedron, and the cutter
is a unit square constrained to move from one grid square of the surface to an
(intrinsically) adjacent grid square.
The typical goals in milling problems are to minimize the length of the tour
[3] or to minimize the number of turns in the tour [2]. Both versions are known
to be strongly NP-hard, even when the pocket is an integral orthogonal polygon
and the cutter is a unit square. We conjecture that the problem remains strongly
NP-hard when the pocket is a grid polyhedron, but this is not obvious.
In our situation, both length and number of turns are important, as both
inuence the required length of a strip to cover the surface. Thus we develop
one algorithm that simultaneously approximates both measures. Such results
have also been achieved for 2D pockets [2]; our results are the rst we know for
surfaces in 3D. Specically, we develop in Section 3 an approximation algorithm
for computing a milling tour of a given grid polyhedron, achieving both a 2-
approximation in length and an 8/3-approximation in number of turns.
112 N.M. Benbernou et al.

Fig. 2. Strip folding of individual letters typeface, AZ and 09: unfolded font (top)
and folded font (bottom), where the face incident to the bottom edge remains face-up.

Fonts. To illustrate the power of strip folding, we designed a typeface, rep-


resenting each letter of the alphabet by a folding of a 1 x strip for some x,
as shown in Fig. 2. The individual-letters typeface consists of two fonts: the un-
folded font is a puzzle to gure out each letter, while the folded font is easy to
read. These crease patterns adhere to an integer grid with orthogonal and/or
diagonal creases, but are not necessarily subpatterns of the canonical hinge pat-
tern. This extra exibility gives us control to produce folded half-squares as
desired, increasing the fonts delity.
We have developed a web app that visualizes the font.4 Currently in devel-
opment is the ability to chain letters together into one long strip folding; Fig. 9
at the end of the paper shows one example.
The full version of this paper [5] contains details omitted from this extended
abstract.

2 Universality

In this section, we prove that both the canonical strip and zig-zag strip of Fig. 1,
of sucient length, can fold into any grid surface. We begin with milling tours
4
http://erikdemaine.org/fonts/strip/
Universal Hinge Patterns for Folding Strips Efficiently into Any Grid Polyhedron 113

(a) (b)
Fig. 3. (a) Left and (b) right turn with a canonical strip.

which provide an abstract plan for routing the strip, and then turn to the details
of how to manipulate each type of strip.
Dual graph. Recall that a grid surface consists of one or more grid squares
that is, squares of the 3D cube gridglued edge-to-edge to form a connected
surface (ignoring vertex connections). Dene the dual graph to have a dual vertex
for each such grid square, and any two grid squares sharing an edge dene a dual
edge between the two corresponding dual vertices. Our assumption of the grid
surface being connected is equivalent to the dual graph being connected.
Milling tours. A milling tour is a (not necessarily simple) spanning cycle
in the dual graph, that is, a cycle that visits every dual vertex at least once (but
possibly more than once). Equivalently, we can think of a milling tour as the
path traced by the center of a moving square that must cover the entire surface
while remaining on the surface, and return to its starting point. Milling tours
always exist: for example, we can double a spanning tree of the dual graph to
obtain a milling tour of length less than double the given surface area.
At each grid square, we can characterize a milling tour as going straight,
turning, or U-turningintrinsically on the surfaceaccording to which two sides
of the grid square the tour enters and exits. If the sides are opposite, the tour is
straight; if the sides are incident, the tour turns; and if the sides are the same, the
tour U-turns. Intuitively, we can imagine unfolding the surface and developing
the tour into the plane, and measuring the resulting planar turn angle at the
center of the grid square.
Strip folding. To prove universality, it suces to show that a canonical strip
or zig-zag strip can follow any milling tour and thus make any grid polyhedron. In
particular, it suces to show how the strip can go straight, turn left, turn right,
and U-turn. Then, in 3D, the strip would be further folded at each traversed
edge of the grid surface, to stay on the surface. Indeed, U-turns can be viewed
as folding onto the opposite side of the same surface, and thus are intrinsically
equivalent to going straight; hence we can focus on going straight and making
left/right turns.
Canonical strip. Fig. 3 shows how a canonical strip can turn left or right;
it goes straight without any folding. Each turn adds 1 to the length of the strip,
and adds 2 layers to part of the grid square where the turn is made. Therefore
a milling tour of length L with t turns of a grid surface can be followed by a
canonical strip of length L + t. Furthermore, if the milling tour visits each grid
square at most c times, then the strip folding has at most 3c layers covering any
point of the surface.
114 N.M. Benbernou et al.

Fig. 4. Going straight with a zig-zag strip requires at most two unit squares per grid
square. Left and right crease patterns show two dierent parities along the strip.

(a) (b)
Fig. 5. Turning with a zig-zag strip has two cases because of parity. (a) Turning left
at an odd position requires three grid squares, whereas turning right requires one grid
square. (b) Turning left at an even position requires one grid square, whereas turning
right requires three grid squares.

Zig-zag strip. Fig. 4 shows how to fold a zig-zag strip in order to go straight.
In this straight portion, each square of the surface is covered by two squares of
the strip. Fig. 5 shows left and right turns. Observe that turns require either one
or three squares of the strip. Therefore a milling tour of length L with t turns
can be followed by a zig-zag strip of length at most 2L + t. Furthermore, if the
milling tour visits each grid square at most c times, then the strip folding has
at most 3c layers covering any point of the surface.

Proposition 1. Every grid surface of area N can be folded from a canonical


strip of length 4N , with at most eight layers stacked anywhere, and from a zig-
zag strip of length 6N , with at most twelve layers stacked anywhere.

The goal in the rest of this paper is to achieve better bounds for grid poly-
hedra, using more carefully chosen milling tours.
Universal Hinge Patterns for Folding Strips Efficiently into Any Grid Polyhedron 115

3 Milling Tour Approximation


This section presents a constant-factor approximation algorithm for milling a
(genus-0) grid polyhedron P with respect to both length and turns. Specically,
our algorithm is a 2-approximation in length and an 8/3-approximation in turns.
Our milling tours also have special properties that make them more amenable
to strip folding.
Our approach is to reduce the milling problem to vertex cover in a tripartite
graph. Then it follows that our algorithm is a 2-approximation in turns, where
is the best approximation factor for vertex cover in tripartite graphs. The
best known bounds on are 34/33 4/3. Clementi et al. [8] proved
that minimum vertex cover in tripartite graphs is not approximable within a
factor smaller than 34/33 = 1.03 unless P = NP. Theorem 1 of [13] implies
a 4/3-approximation for minimum weighted vertex cover for tripartite graphs
(assuming we are given the 3-partition of the vertex set, which we know in our
case). Thus we use = 4/3 below. An improved approximation ratio would
improve our approximation ratios, but may also aect the stated running times,
which currently assume use of [13].

3.1 Bands
The basis for our approximation algorithms is the notion of bands for a grid
polyhedron P . Let xmin and xmax respectively be the minimum and maximum
x coordinates of P ; dene ymin , ymax , zmin , zmax analogously. These minima and
maxima have integer values because the vertices of P lie on the integer grid.
Dene the ith x-slab Sx (i) to be the slab bounded by parallel planes x = xmin +i
and x = xmin + i + 1, for each i {0, 1, . . . , xmax xmin 1}. The intersection of
P with the ith x-slab Sx (i) (assuming i is in the specied range) is either a single
band (i.e., a simple cycle of grid squares in that slab), or a collection of such
bands, which we refer to as x-bands. Dene y-bands and z-bands analogously.
Two bands overlap if there is a grid square contained in both bands. Each grid
square of P is contained in precisely two bands (e.g., if a grid squares outward
normal were in the +z-direction, then it would be contained in one x-band and
one y-band). Two bands B1 and B2 are adjacent if they do not overlap, and a
grid square of B1 shares an edge with a grid square of B2 . A band cover for P is
a collection of x-, y-, and z-bands that collectively cover the entire surface of P .
The size of a band cover is the number of its bands.

3.2 Cover Bands


The starting point for the milling approximation algorithm is to nd an approx-
imately minimum band cover, as the minimum band cover is a lower bound on
the number of turns in any milling tour:

Proposition 2. [2, Lemma 4.9] The size of a minimum band cover of a grid
polyhedron P is a lower bound on the number of turns in any milling tour of P .
116 N.M. Benbernou et al.

Next we describe how to nd a near-optimal band cover. Consider the graph


GP with one vertex per band of a grid polyhedron P , connecting two vertices by
an edge if their corresponding bands overlap. It turns out that an (approximately
minimum) vertex cover in GP will give us an (approximately minimum) band
cover in P :

Proposition 3. A vertex cover for GP induces a band cover of the same size
and vice versa.

Because the bands fall into three classes (x-, y-, and z-), with no over-
lapping bands within a single class, GP is tripartite. Hence we can use an
-approximation algorithm for vertex cover in tripartite graphs to nd an -
approximate vertex cover in GP and thus an -approximate band cover of P .

3.3 Connected Bands

Our next goal will be to eciently tour the bands in the cover. Given a band
cover S for a grid polyhedron P , dene the band graph GS to be the subgraph
of GP induced by the subset of vertices corresponding to S. We will construct
a tour of the bands S based on a spanning tree of GS . Our rst step is thus to
show that GS is connected (Lemma 5 below). We do so by showing that adjacent
bands (as dened in Section 3.1) are in the same connected component of GS ,
using the following lemma of Genc [11]:

Lemma 4. [11]5 For any band B in a grid polyhedron P , let Nb be the bands of
P overlapping B. (Equivalently, Nb is the set of neighbors of B in GP ). Then
the subgraph of GP induced by NB is connected.

Lemma 5. If S is a band cover for a grid polyhedron P , then the graph GS is


connected.

3.4 Band Tour

Now we can present our algorithm for transforming a band cover into an ecient
milling tour.

Theorem 6. Let P be a grid polyhedron with N grid squares. In O(N 2 log N )


time, we can nd a milling tour of P that is a 2-approximation in length and an
8/3-approximation (or more generally, a 2-approximation) in turns.

We now state some additional properties of any milling tour produced by the
approximation algorithm of Theorem 6, which will be useful for later applications
to strip folding in Section 4.
5
Genc [11] uses somewhat dierent terminology to state this lemma: straight cycles
in the dual graph are our bands, and crossing is our overlapping. The induced
subgraph is also dened directly, instead of as an induced subgraph of GP .
Universal Hinge Patterns for Folding Strips Efficiently into Any Grid Polyhedron 117

Proposition 7. Let P be a grid polyhedron, and consider a milling tour of P


obtained from the approximation algorithm of Theorem 6. Then the following
properties hold:

1. A grid square of P is either visited once, in which case it is visited by a


straight part of the tour; or it is visited twice, by two straight junctions or
by two turn junctions.
2. In the case of a turn junction, the length of the milling tour between the
two visits to the grid square (counting only one of the two visits to the grid
square in the length measurement) is even.
3. The tour can be modied to alternate between left and right turns (without
changing its length or the number of turns).

3.5 Polynomial Time

The algorithm described above is polynomial in the surface area N of the grid
polyhedron, or equivalently, polynomial in the number of unit cubes making
up the polyomino solid. For our application to strip folding, this is polynomial
in the length of the strip, and thus sucient for most purposes. On the other
hand, polyhedra are often encoded as a collection of n vertices and faces, with
faces possibly much larger than a unit square. In this case, the algorithm runs
in pseudopolynomial time.
Although we do not detail the approach here, our algorithm can be modied
to run in polynomial time. To achieve this result, we can no longer aord to deal
with unit bands directly, because their number is polynomially related to the
number N of grid squares, not the number n of vertices. To achieve polynomial
time in n, we concisely encode the output milling tour using fat bands rather
than unit bands, which can then be easily decoded into a tour of unit bands. By
making each band as wide as possible, their number is polynomially related to
n instead of N . Details of an O(n3 log n)-time milling approximation algorithm
(with the same approximation bounds as above) can be found in [4].

4 Strip Foldings of Grid Polyhedra

In this section, we show how we can use the milling tours from Section 3 to fold a
canonical strip or zig-zag strip eciently into a given (genus-0) grid polyhedron.
For both strip types, dene the length of a strip to be the number of grid squares
it contains; refer to Fig. 1. For a strip folding of a polyhedron P , dene the
number of layers covering a point q on P to be the number of interior points of
the strip that map to q in the folding, excluding crease points, that is, points lying
on a hinge that gets folded by a nonzero angle. (This denition may undercount
the number of layers along one-dimensional creases, but counts correctly at the
remaining two-dimensional subset of P .) We will give bounds on the length of
the strip and also on the maximum number of layers of the strip covering any
point of the polyhedron.
118 N.M. Benbernou et al.

The main idea for canonical strips is that Properties (1)


and (3) of Proposition 7 allow us to make turns as shown in
Fig. 6, so that we do not waste an extra square of the strip
per turn.
Fig. 6. A turn
Theorem 8. Let P be a grid polyhedron, and let N be the junction for a
number of grid squares of P . Then P can be covered by a canonical strip.
folding of a canonical strip of length 2N , and with at most two layers covering
any point of P .

For zig-zag strips, we instead use Properties (1) and (2) of Proposition 7:

Theorem 9. Let P be a grid polyhedron, and let N be the number of grid squares
of P . Then P can be covered by a folding of a zig-zag strip of length 4N , and
with at most four layers covering any point of P .

By coloring the two sides of the zig-zag strip dierently, we can also bicolor
the surface of P in any pattern we wish, as long as each grid square is assigned
a uniform color. We do not prove this result formally here, but mention that
the bounds in length would become somewhat worse, and the rigid motions
presented in Section 5 do not work in this setting.

5 Rigid Motion Avoiding Collision

So far we have focused on just specifying a nal folded state for the strip, and
ignored the issue of how to continuously move the strip into that folded state.
In this section, we show how to achieve this using a rigid folding motion, that is,
a continuous motion that keeps all polygonal faces between hinges rigid/planar,
bending only at the hinges, and avoids collisions throughout the motion. Rigid
folding motions are important for applications to real-world programmable mat-
ter made out of sti material except at the hinges. Our approach may still suer
from practical issues, as it requires a large (temporary) accumulation of many
layers in an accordion form.
We prove that, if the grid polyhedron P has fea-
ture size at least 2, then we can construct a rigid mo-
tion of the strip folding without collision. (By feature (a) (b)
size at least 2, we mean that every exterior voxel of P Fig. 7. Accordion for (a)
is contained in some empty 2 2 2 box.) If the grid canonical strip and (b)
polyhedron we wish to fold has feature size 1, then zig-zag strip, with hinges
one solution is to scale the polyhedron by a factor drawn thick for increased
of 2, and then the results here apply. visibility.
Our approach is to keep the yet-unused portion of the strip folded up into an
accordion and then to unfold only what is needed for the current move: straight,
left, or right. Fig. 7 shows the accordion state for the canonical strip and for
the zig-zag strip. We will perform the strip folding in such a way that the strip
never penetrates the interior of the polyhedron P , and it never weaves under
Universal Hinge Patterns for Folding Strips Efficiently into Any Grid Polyhedron 119

(a)

(b)

Fig. 8. Canonical strip, face-up cases. (a) Straight. (b) Turn where e23 is at.

previous portions of the strip. Thus, we could wrap the strip around P s surface
even if P s interior were already a lled solid. This restriction helps us think
about folding the strip locally, because some of P s surface may have already
been folded (and it thus should not be penetrated) by earlier parts of the strip.
It suces to show, regardless of the local geometry of the polyhedron at the
grid square where the milling tour either goes straight or turns, and regardless of
whether the accordion faces up or down relative to the grid square it is covering,
that we can maneuver the accordion in a way that allows us to unroll as many
squares as necessary to perform the milling-tour move. Fig. 8 shows two key
cases for unrolling part of the accordion of a canonical strip. See [5] for details.
Acknowledgments. We thank ByoungKwon An and Daniela Rus for several
helpful discussions about programmable matter that motivated this work.

References

1. B. An, N. Benbernou, E. D. Demaine, and D. Rus. Planning to fold multiple


objects from a single self-folding sheet. Robotica, 29(1):87102, 2011. Special issue
on Robotic Self-X Systems.
120 N.M. Benbernou et al.

2. E. M. Arkin, M. A. Bender, E. D. Demaine, S. P. Fekete, J. S. B. Mitchell, and


S. Sethia. Optimal covering tours with turn costs. SIAM Journal on Computing,
35(3):531566, 2005.
3. E. M. Arkin, S. P. Fekete, and J. S. B. Mitchell. Approximation algorithms for
lawn mowing and milling. Computational Geometry: Theory and Applications,
17(12):2550, 2000.
4. N. M. Benbernou. Geometric Algorithms for Recongurable Structures. PhD thesis,
Massachusetts Institute of Technology, September 2011.
5. N. M. Benbernou, E. D. Demaine, M. L. Demaine, and A. Lubiw. Universal hinge
patterns for folding strips eciently into any grid polyhedron. arXiv:1611.03187,
2016. https://arXiv.org/abs/1611.03187.
6. N. M. Benbernou, E. D. Demaine, M. L. Demaine, and A. Ovadya. Universal
hinge patterns to fold orthogonal shapes. In Origami5 : Proceedings of the 5th In-
ternational Conference on Origami in Science, Mathematics and Education, pages
405420. A K Peters, Singapore, 2010.
7. K. C. Cheung, E. D. Demaine, J. Bachrach, and S. Grith. Programmable assem-
bly with universally foldable strings (moteins). IEEE Transactions on Robotics,
27(4):718729, 2011.
8. A. E. F. Clementi, P. Crescenzi, and G. Rossi. On the complexity of approximating
colored-graph problems. In Proceedings of the 5th Annual International Conference
on Computing and Combinatorics, volume 1627 of Lecture Notes in Computer
Science, pages 281290, 1999.
9. E. D. Demaine, M. L. Demaine, and J. S. B. Mitchell. Folding at silhouettes and
wrapping polyhedral packages: New results in computational origami. Computa-
tional Geometry: Theory and Applications, 16(1):321, 2000.
10. E. D. Demaine and T. Tachi. Origamizer: A practical algorithm for folding any
polyhedron. Manuscript, 2017.
11. B. Genc. Reconstruction of Orthogonal Polyhedra. PhD thesis, University of Wa-
terloo, 2008.
12. E. Hawkes, B. An, N. M. Benbernou, H. Tanaka, S. Kim, E. D. Demaine, D. Rus,
and R. J. Wood. Programmable matter by folding. Proceedings of the National
Academy of Sciences of the United States of America, 107(28):1244112445, 2010.
13. D. S. Hochbaum. Ecient bounds for the stable set, vertex cover and set packing
problems. Discrete Applied Mathematics, 6(3):243254, 1983.
14. R. J. Lang. A computational algorithm for origami design. In Proceedings of
the 12th Annual ACM Symposium on Computational Geometry, pages 98105,
Philadelphia, PA, May 1996.
15. R. J. Lang and E. D. Demaine. Facet ordering and crease assignment in uniaxial
bases. In Origami4 : Proceedings of the 4th International Conference on Origami
in Science, Mathematics, and Education, pages 189205, Pasadena, California,
September 2006. A K Peters.

Fig. 9. An example of joining together a few letters from our typeface in Fig. 2. Un-
folding (bottom) not to scale with folding (top).
An optimal XP algorithm for Hamiltonian Cycle
on graphs of bounded clique-width

Benjamin Bergougnoux1 , Mamadou Moustapha Kante1 , and O-joung Kwon2 

1
Universite Clermont Auvergne, LIMOS, CNRS, Aubiere, France
2
Logic and Semantics, TU Berlin, Berlin, Germany
[email protected], [email protected], [email protected]

Abstract. For MSO2 -expressible problems like Edge Dominating Set


or Hamiltonian Cycle, it was open for a long time whether there is
an algorithm which given a clique-width k-expression of an n-vertex
graph runs in time f (k) nO(1) for some function f . Recently, Fomin
et al. (SIAM. J. Computing, 2014) presented several lower bounds; for
instance, there are no f (k)no(k) -time algorithms for Edge Dominating
Set and for Hamiltonian Cycle unless the Exponential Time Hypoth-
esis (ETH) fails. They also provided an algorithm running in time nO(k)
for Edge Dominating Set, but left open whether Hamiltonian Cycle
can be solved in time nO(k) .
In this paper, we prove that Hamiltonian Cycle can be solved in time
2
nO(k) . This improves the naive algorithm that runs in time nO(k ) by Es-
pelage et al. (WG 2001). We present a general technique of representative
sets using two-edge colored multigraphs on k vertices. The essential idea
behind is that for a two-edge colored multigraph, the existence of an
Eulerian trail that uses edges with dierent colors alternatively can be
determined by two information: the number of colored edges incident
with each vertex, and the connectedness of the multigraph. With this
idea, we avoid the bottleneck of the naive algorithm, which stores all
the possible multigraphs on k vertices with at most n edges. We can
apply this technique to other problems such as q-Cycle Covering or
Directed Hamiltonian Cycle as well.

1 Introduction

Tree-width is one of the graph width parameters that plays an important role
in graph algorithms. Various problems which are NP-hard on general graphs,
have been shown to be solvable in polynomial time on graphs of bounded tree-
width [1,2]. A celebrated algorithmic meta-theorem by Courcelle [3] states that
every graph property expressible in monadic second-order logic which allows

B. Bergougnoux and M.M. Kante are supported by French Agency for Research
under the GraphEN project (ANR-15-CE-0009). O. Kwon is supported by the Eu-
ropean Research Council (ERC) under the European Unions Horizon 2020 research
and innovation programme (ERC consolidator grant DISTRUCT, agreement No.
648527).

Springer International Publishing AG 2017 121


F. Ellen et al. (Eds.): WADS 2017, LNCS 10389, pp. 121132, 2017.
DOI: 10.1007/978-3-319-62127-2_11
122 B. Bergougnoux et al.

quantications over edge and vertex sets (MSO2 ) can be decided in linear time
on graphs of bounded tree-width. Minimum Dominating Set, q-Coloring,
and Hamiltonian Cycle problems are such graph problems.
Courcelle and Olariu [5] dened the notion of clique-width of graphs, whose
modeling power is strictly stronger than tree-width. The motivation of clique-
width came from the observation that many algorithmic problems are tractable
on classes of graphs that can be recursively decomposed along vertex partitions
(A, B) where the number of neighbourhood types between A and B is small. We
formally dene clique-width in Section 2. Courcelle, Makowsky, and Rotics [4]
extended the meta-theorem on graphs of bounded tree-width [3] to graphs of
bounded clique-width, at a cost of a smaller set of problems, namely, the class of
problems expressible in MSO1 , which allows quantications on vertex sets only.
Some of the known examples of graph problems that are MSO2 -denable, but not
MSO1 -denable are Max-Cut, Edge Dominating Set, and Hamiltonian
Cycle problems.
A natural question is whether such problems allow an algorithm with running
time f (k) nO(1) for some function f , when a clique-width k-expression of an
n-vertex input graph is given. This question has been carefully answered by
Fomin et al. [8,9]. In particular, they showed that for Max-Cut and Edge
Dominating Set, there is no f (k) no(k) -time algorithm unless the Exponential
Time Hypothesis (ETH) fails, and proposed for both problems algorithms with
running time nO(k) . They proved that Hamiltonian Cycle also cannot be
solved in time f (k) no(k) , unless ETH fails, but left open the question of nding
an algorithm running in time nO(k) . Until now, the best algorithm is the one by
2
Espelage, Gurski, and Wanke [7] which runs in time nO(k ) .
Our Contribution and Approach. In this paper, we prove that Hamiltonian
Cycle can be solved in time nO(k) , thereby resolving the open problem in [9].
A Hamiltonian cycle in a graph is a cycle containing all vertices of the graph.
The Hamiltonian Cycle problem asks whether given a graph G, G contains
a Hamiltonian cycle or not.

Theorem 1. Given an n-vertex graph and its clique-width k-expression, one


can solve Hamiltonian Cycle in time nO(k) .
A k-labeled graph is a graph whose vertices are labeled by integers in {1, . . . , k}.
Clique-width k-expressions are expressions which allow to recursively construct
a graph with the following graph operations: (1) creating a graph with a single
vertex labeled i, (2) taking the disjoint union of two k-labeled graphs, (3)
adding all edges between vertices labeled i and vertices labeled j, for some i = j,
(4) renaming all vertices labeled i into j. The clique-width of a graph is the min-
imum k such that it can be constructed using labels in {1, . . . , k}. One observes
that if a graph contains a Hamiltonian cycle C, then each k-labeled graph H
introduced in the clique-width k-expression admits a partition of its vertex set
into pairwise vertex-disjoint paths, path-partitions, which is the intersection of
H and C. A natural approach is to enumerate all path-partitions. Furthermore,
since the adjacency relations between this k-labeled graph and the remaining
An optimal XP algorithm for Hamiltonian Cycle on graphs of bounded clique-width 123

part only depends on the labels, it is sucient to store for each pair of labels
(i, j), the number of paths whose end vertices are labeled by i and j. As the
2
number of paths of a path-partition is bounded by n, there are at most nO(k )
possibilities. This is the basic idea of the XP algorithm developed by Espelage,
Gurski, and Wanke [7].
The essential idea of our algorithm is to introduce an equivalence relation
between two path-partitions. Given a path-partition P that is arestriction of
a Hamiltonian cycle C, we consider the maximal paths in C P P E(P ) as
another path-partition Q. As depicted in Figure 1, we can construct a multigraph
associated with P and Q on the vertex set {v1 , . . . , vk }, by adding a red edge
vi vj (an undashed edge) if there is a path in P with end vertices labeled by i and
j, and by adding a blue edge vi vj (a dashed edge) if there is a path in Q with end
vertices labeled by i and j. A crucial observation is that this multigraph admits
an Eulerian trail where red edges and blue edges are alternatively used. This is
indeed a characterisation of the fact that two such path-partitions can be joined
into a Hamiltonian cycle. To determine the existence of such an Eulerian trail,
it is sucient to know the degree of each vertex and the connected components
of the corresponding multigraphs of the two path-partitions. This motivates
an equivalence relation between path-partitions. As a byproduct, we can keep
in each equivalence class a representative and since the number of equivalence
classes is bounded by 2k log2 k nk , we can turn the naive algorithm into an nO(k) -
time algorithm (there are at most 2k log2 k partitions of k-elements set). A more
detailed explanation of our algorithm is provided in Section 3.

1
v1
2
v2
3
v3
4
v4

Fig. 1. The restriction of a Hamiltonian cycle to a k-labeled graph. The complement


part can be considered as another set of paths.

The paper is organized as follows. Section 2 contains the necessary prelimi-


naries and required notions. Section 3 is devoted to the overview of the algorithm
and the proof of the existence of Eulerian trails in two-edge colored multigraphs.
We introduce in Section 4 the equivalence relation between multigraphs on the
vertex set {v1 , . . . , vk }, and introduce operations related to the update of path-
partitions in clique-width k-expressions, and prove that they preserve the equiv-
alence relation. We dene the notion of representatives and give the algorithm in
Section 5. We conclude with more applications of our representatives in Section
6. Some proofs are omitted (statements with ) because of space constraints.
124 B. Bergougnoux et al.

2 Preliminaries
The size of a set V is denoted by |V |, and we write [V ]2 to denote the set of
all subsets of V of size 2. We denote by N the set of non-negative integers. We
essentially follow [6] for our graph terminology, but we deal only with nite
graphs. The vertex set of a graph G is denoted by V (G) and its edge set by
E(G) [V (G)]2 . We write xy to denote an edge {x, y}. Let G be a graph.
For X V (G), we denote by G[X] the subgraph of G induced by X, and for
F E(G), we write G F for the subgraph (V (G), E(G) \ F ). The degree of a
vertex x, denoted by degG (x), is the number of edges incident with x. A cut-edge
in a connected graph is an edge e such that G {e} is disconnected. For two
sets A, B V (G), A is complete to B if for every v A and w B, vw E(G).
A graph is non-trivial if it contains an edge, otherwise it is said trivial. A
walk of a graph is an alternating sequence of vertices and edges, starting and
ending at some vertices, where for every consecutive pair of a vertex x and an
edge e, x is incident with e. A trail of a graph is a walk where each edge is used
at most once. A trail is closed if its rst and last vertices are the same.
A multigraph is essentially a graph, but we allow two edges to be incident
with the same set of vertices. Formally, a multigraph G is a pair (V (G), E(G))
of disjoint sets, also called sets of vertices and edges, respectively, together with
a map multG : E(G) V (G) [V (G)]2 , which maps every edge to one or two
vertices, still called its end vertices. Note that we admit loops in multigraphs,
while we do not in our denition of graphs. If there is e E(G) such that
multG (e) = {x, y} (or multG (e) = {x}), we use the term multiedge to refer to
{x, y} (or {x}). The degree of a vertex x in a multigraph G, is dened analo-
gously as in graphs, except that each loop is counted twice, and similarly for
other notions. If there are exactly k edges e such that multG (e) = {x, y} (or
multG (e) = {x}), then we denote these distinct edges by {x, y}1 , . . . , {x, y}k (or
{x}1 , . . . , {x}k ); if k = 1, then for the sake of clarity, we write {x, y} (or {x})
instead of {x, y}1 (or {x}1 ).
An Eulerian trail in a multigraph is a closed trail containing all edges.
Clique-width. A graph is k-labeled if there is a labeling function f : V (G)
{1, . . . , k}, and we call f (v) the label of v. For a k-labeled graph G, we simply
call the set of all vertices with label i as the label class i of G.
The clique-width of a graph G is the minimum number of labels needed to
construct G using the following four operations:
1. Creation of a new vertex v with label i (denoted by i(v)).
2. Disjoint union of two labeled graphs G and H (denoted by G H).
3. Joining by an edge each vertex with label i to each vertex with label j (i = j,
denoted by i,j ).
4. Renaming label i to j (denoted by ij ).
Such an expression is called a clique-width k-expression or simply a k-expression
if it uses at most k distinct labels. We can naturally represent this expression
as a tree-structure. Such trees are known as syntactic trees associated with k-
expressions.
An optimal XP algorithm for Hamiltonian Cycle on graphs of bounded clique-width 125

A clique-width k-expression is called irredundant if whenever i,j is applied,


the constructed graph contains no prior edges between vertices with label i and
vertices with label j. Courcelle and Olariu [5] proved that given a clique-width k-
expression, it can be transformed into an irredundant k-expression in linear time.
Therefore, we can assume that a given clique-width expression is irredundant.

Path-partition. For a graph G, a set P= {P1 , . . . , Pm } of vertex-disjoint paths


in G is called a path-partition of G if 1im V (Pi ) = V (G). A path-partition
P is k-labeled if the end vertices of each path in P are labeled by some integer
in {1, . . . , k}. For a path-partition P of a k-labeled graph G, the labeling of
P induced by the labeling of G consists in assigning to each end vertex of a
path in P its label in G. Lastly, for a k-labeled path-partition P of a graph, we
dene the  auxiliary multigraph Aux(P) with vertex set {v1 , . . . , vk } and edge
set {{vi , vj }1 , . . . , {vi , vj }ij } where ij is the number of paths in P
i,j{1,...,k}
with end vertices labeled i and j respectively.

3 Overview of the algorithm

In an irredundant clique-width k-expression dening a given graph G, G is


recursively constructed using k-labeled graphs. Such k-labeled graphs H arising
in the k-expression dening G are subgraphs3 of G and satisfy the following
properties: (1) for two vertices v, w V (H) with same labels in H, NG (v)
(V (G) \ V (H)) = NG (w) (V (G) \ V (H)), and (2) for some label class i, say
Li , and label class j, say Lj , in H with i = j, if there exist v Li , w Lj with
vw E(G) \ E(H), then every vertex of Li is adjacent to every vertex of Lj
in G, and there are no edges between Li and Lj in H. The former statement is
because when we add vw, all vertices in each set Li or Lj have the same label, and
the latter statement is because of the irredundancy of . Given such a k-labeled
subgraph H of G, for any Hamiltonian cycle C, the restriction of C to H induces
a k-labeled path-partition of H. Because of the two properties (1) and (2), it is
sucient to store the end vertices of each path. This is naturally represented as a
multigraph on k vertices, motivating the denition of the auxiliary multigraphs
associated with k-labeled path-partitions. Our algorithm will be based on the
following characterization of equivalent path-partitions.
Proposition 1 (). Let P1 , P2 be k-labeled path-partitions of H whose labelings
are induced by the labeling of H such that (degAux(P1 ) (v1 ), . . . , degAux(P1 ) (vk )) =
(degAux(P2 ) (v1 ), . . . , degAux(P2 ) (vk )), and {V (C) | C is a component of Aux(P1 )}
= {V (C) | C is a component of Aux(P2 )}. Then G has a Hamiltonian cy-
cle C1containing each path in P1 as a subpath and such that every edge in
C1 ( P P1 E(P )) is contained in E(G) \ E(H) if and only if G has a Hamilto-
nian cycleC2 containing each path in P2 as a subpath and such that every edge
in C2 ( P P2 E(P )) is contained in E(G) \ E(H).
3
Disregarding the labels.
126 B. Bergougnoux et al.

Suppose there are two such path-partitions P1 and P2 where there is a cycle
C1 satisfying the conditions of Proposition 1. Let Q be the subpaths of C1 con-
necting two consecutive paths in P1 . See Figure 1 for an illustration. Note that
if a path in Q is an edge, then it is an edge between two label classes and contained
in E(G) \ E(H). By the property (2), these two label classes are complete in G.
We label each end vertex of a path in Q as the label of H, We consider the
auxiliary multigraph Aux(P1 ) and the auxiliary multigraph  Aux(Q) by consid-
ering Q as a path-partition of the underlying graph on QQ V (Q). We obtain
a multigraph F from the disjoint union of Aux(P1 ) and Aux(Q) by identifying
each vi . Following the Hamiltonian cycle C, one easily checks that there is an
Eulerian trail which alternates between edges in Aux(P1 ) and edges in Aux(Q).
We will prove that if we replace Aux(P1 ) with Aux(P2 ) in F , then the
new graph also admits an Eulerian trail, because of the given conditions in
Proposition 1. To see this, we observe the following, which is a strengthening
of Eulers theorem on Eulerian trails. It is well known that a connected graph
contains an Eulerian trail if and only if every vertex has even degree. Moreover,
when edges are colored by two colors, say red and blue, and each vertex is incident
with the same number of edges for both colors, then we can nd an Eulerian
trail where the two colors appear alternatively. We call such an Eulerian trail a
red-blue alternating Eulerian trail. For a multigraph G colored by red and blue
and v V (G), let rdegG (v) denote the number of red edges incident with v, and
let bdegG (v) denote the number of blue edges incident with v.
Lemma 1 (). Let G be a connected multigraph whose edges are colored by red
and blue. Then G has a red-blue alternating Eulerian trail if and only if for every
vertex v, bdegG (v) = rdegG (v).
Indeed, when we replace Aux(P1 ) with Aux(P2 ) in F , the set of components
does not change (thus consists of one non-trivial component), and each vertex is
incident with same number of red and blue edges, and by Lemma 1, the resulting
graph has an Eulerian trail. We will show that one can construct a Hamiltonian
cycle of G from paths of P2 using the properties (1) and (2).
Motivated by Proposition 1, we dene in Section 4 an equivalence relation
between two sets of multigraphs on the same vertex set {v1 , . . . , vk }. We further
dene operations on those multigraphs, corresponding to procedures of updating
path-partitions, and prove that the equivalence between two sets is preserved
under such operations. These results will form the skeleton of the main algorithm.

4 An equivalence relation between families of k-vertex


multigraphs
For two multigraphs G and H on the same vertex set {v1 , . . . , vk } and with dis-
joint edge sets, we denote by G//H the multigraph with vertex set {v1 , . . . , vk }
and edge set E(G) E(H).
For families F, F1 , F2 of multigraphs on the vertex set {v1 , . . . , vk } and two
distinct integers i, j {1, . . . , k}, we dene the following operations:
An optimal XP algorithm for Hamiltonian Cycle on graphs of bounded clique-width 127

1. F + (i, j) is the set of all multigraphs F  where F  can be obtained from


a multigraph F in F as follows4 : choose two distinct edges {vi , vi }t and
{vj , vj }s , and let F  be the multigraph on vertex set {v1 , . . . , vk } and edge
set (E(F ) \ {{vi , vi }t , {vj , vj }s }) {e} with e
/ E(F ) mapped to {vi , vj }.
2. F + t(i, j) is the set constructed from F by doing the operation +(i, j) t
times.
3. F|ij is the set of all multigraphs F where F can be obtained from a multi-
graph in F by replacing every edge with an end vertex vi by an edge with
an end vertex vj .
4. F1
F2 := {F1 //F2 : F1 F1 , F2 F2 }.
Let F1 and F2 be two families of multigraphs on the vertex set {v1 , . . . , vk }.
We write F1  F2 if for every multigraph H on the vertex set {v1 , . . . , vk },
- whenever there exists G2 F2 such that (degG2 (v1 ), . . . , degG2 (vk )) =
(degH (v1 ), . . . , degH (vk )) and G2 //H has at most one non-trivial component, there
exists G1 F1 such that (degG1 (v1 ), . . . , degG1 (vk )) = (degH (v1 ), . . . , degH (vk ))
and G1 //H has at most one non-trivial component.

We say that F1 is equivalent to F2 , written F1 F2 , if F1  F2 and F2  F1 .


We prove that the equivalence between two families is preserved by the op-
eration +(i, j).
Proposition 2. Let F1 and F2 be two families of multigraphs on the vertex set
{v1 , . . . , vk }. If F1 F2 , then F1 + (i, j) F2 + (i, j).

Proof. Suppose F1 F2 . It is sucient to prove that F1 +(i, j)  F2 +(i, j). For


this, suppose there exist a graph H on {v1 , . . . , vk } and G2 F2 +(i, j) such that
(degG2 (v1 ), . . . , degG2 (vk )) = (degH (v1 ), . . . , degH (vk )) and G2 //H has at most
one non-trivial component. Since G2 F2 + (i, j), there exist F2 F2 , edges
{vi , vi }t , {vj , vj }s in F2 such that G2 = (V (F2 ), E(F2 ) \ {{vi , vi }t , {vj , vj }s }
{e}) with e / E(F2 ) mapped to {vi , vj } in G2 . Let H  := (V (H), E(H) {e })

with e / E(H) mapped to {vi , vj } in H. We claim that

(degF2 (v1 ), . . . , degF2 (vk )) = (degH  (v1 ), . . . , degH  (vk )) and


F2 //H  has at most one non-trivial component.

By the construction of G2 from F2 , for every v V (F2 ) \ {vi , vj }, v has


the same degree in F2 and G2 , and the degrees of vi and vj in G2 are one
less than the degrees in F2 , respectively. Since the degrees of vi and vj in
H  are one more than the degrees in H, we have (degF2 (v1 ), . . . , degF2 (vk )) =
(degH  (v1 , . . . , degH  (vk )). Assume now that F2 //H  has at least two non-trivial
components. First observe that the four vertices vi , vj , vi , vj are in the same non-
trivial component C of F2 //H  , and {vi , vj } are in a same non-trivial component
of G2 //H. If C  is another non-trivial component of F2 //H  , then it does not
intersect {vi , vi , vj , vj }, that is, C  is non-trivial component in G2 //H that does
not intersect the one containing {vi , vj }, yielding a contradiction.
4
We allow vi (or vj ) to be equal to vi (or vj ).
128 B. Bergougnoux et al.

Since F1 F2 , there exists F1 F1 such that (degF1 (v1 ), . . . , degF1 (vk )) =


(degH  (v1 ), . . . , degH  (vk )) and F1 //H  has at most one non-trivial component.
By Lemma 1, F1 //H  contains an Eulerian trail where edges in F1 and edges
in H  are alternatively used. Let {vi , vi }t and {vj , vj }s be the edges where
{vi , vi }t , e , {vj , vj }s appear in the Eulerian trail in this order (recall that e
is mapped to {vi , vj }). Clearly, if we remove the edges {vi , vi }t , e , {vj , vj }s
and add an edge f mapped to {vi , vj } in F1 //H  , then the obtained multi-
graph K still admits an alternating Eulerian trail. Let G1 = (V (F1 ), E(F1 ) \
{{vi , vi }t , {vj , vj }s }{f }) with f / E(F1 ) mapped to {vi , vj } in G1 . One eas-
ily checks that K = G1 //H, and since K has an Eulerian trail where edges in G1
and edges in H are alternatively used, by Lemma 1, (degG1 (v1 ), . . . , degG1 (vk )) =
(degH (v1 ), . . . , degH (vk )) and G1 //H has at most one non-trivial component.
Because G1 F1 + (i, j), we can thus conclude that F1 + (i, j)  F2 + (i, j).
We prove a similar property for the other operations.
Proposition 3 (). Let F1 and F2 be families of multigraphs on the vertex set
{v1 , . . . , vk } and let i, j {1, . . . , k} be two distinct integers. If F1 F2 , then
F1 |ij F2 |ij .
Proposition 4 (). Let F1 , F2 , F3 be families of multigraphs on the vertex set
{v1 , . . . , vk }. If F1 F2 , then F1
F3 F2
F3 .

5 Hamiltonian Cycle problem


We prove the main result of this paper. We recall the statement.
Theorem 2. Given a graph G and its clique-width k-expression, one can solve
Hamiltonian Cycle in time nO(k) .
We now dene formally our notion of representatives based only on the degree
sequence and connected components of auxiliary multigraphs associated with k-
labeled path-partitions.
Denition 1 (Representatives by auxiliary multigraphs). Let G and H
be multigraphs on vertex set {v1 , . . . , vk }. We write G  H whenever
(degG (v1 ), . . . , degG (vk )) = (degH (v1 ), . . . , degH (vk )) and {V (C) | C is a com-
ponent of G} is equal to {V (C) | C is a component of H}. One easily checks
that  is an equivalence relation on any set F of multigraphs on vertex set
{v1 , . . . , vk }.
For a family F of multigraphs on vertex-set {v1 , . . . , vk }, let reduce(F) be
the operation which takes in each equivalence class of F/  a representative.
The following is a rephrasing of Proposition 1.
Proposition 5 (). Let G be a graph with its irredundant clique-width k-expression
, and let t be a node in the syntactic tree. Let Gt be the k-labeled graph con-
structed at t, and let P1 and P2 be k-labeled path-partitions of Gt whose labelings
are induced by the labeling of Gt . If Aux(P1 )  Aux(P2 ), then the following are
equivalent.
An optimal XP algorithm for Hamiltonian Cycle on graphs of bounded clique-width 129

1. G has a Hamiltonian cycle C1containing each path in P1 as a subpath and


such that every edge in C1 ( P P1 E(P )) is contained in E(G) \ E(Gt ).
2. G has a Hamiltonian cycle C2containing each path in P2 as a subpath and
such that every edge in C2 ( P P2 E(P )) is contained in E(G) \ E(Gt ).

Proof (Sketch of Proof ). Suppose G has a Hamiltonian cycle C1 satisfying 1.


LetQ be the set of all maximal paths in C1 ( P P1 E(P )), and let H :=
G[ QQ V (Q)]. We consider Q as the path-partition of H where the end vertices
of paths in Q are labeled by their labels in Gt . Since C1 is a Hamiltonian cycle,
Aux(P1 )//Aux(Q) has an Eulerian trail where edges in Aux(P1 ) and edges
in Aux(Q) are alternatively used. Since Aux(P2 )  Aux(P1 ), by Lemma 1,
Aux(P2 )//Aux(Q) admits an Eulerian trail where the edges in Aux(P2 ) and
the edges in Aux(Q) are alternatively used.
To construct a Hamiltonian cycle C2 satisfying 2, let e1 , e2 , . . . , e2m be the
sequence of the edges in an Eulerian trail of Aux(P2 )//Aux(Q) where edges in
Aux(P2 ) and edges in Aux(Q) are alternatively used such that e1 E(Aux(P2 )).
If e2i corresponds to a path of length 1 in Q between two label classes, then we
add a direct edge between end vertices of paths in P corresponding to e2i1 and
e2i+1 . If e2i corresponds to a path of length 2 in Q, then we add this path to
the subgraph and connect to the paths in P corresponding to e2i1 and e2i+1 . In
particular, the former procedure is possible because is irredundant, and thus
two label classes are complete in G. In this way, we can construct a Hamiltonian
cycle C2 satisfying 2.

Proposition 6 tells us that if F is the set of possible k-labeled path-partitions


at a node t of the syntactic tree, it is enough to store reduce({Aux(P) | P F }).

Proposition 6 (). Let F be a family of graphs on the vertex set {v1 , . . . , vk }.


Then F reduce(F).

Proof (Proof of Theorem 1). We assume that G has at least 3 vertices, otherwise
we can automatically say it is a No-instance. Since every k-expression can be
transformed into an irredundant k-expression in linear time, we may assume that
G is given with an irredundant k-expression. Let be the given irredundant k-
expression dening G, and T be the syntactic tree of . For every node t of T ,
let Gt be the subgraph of G dened at node t, and for each i {1, . . . , k}, let
Gt [i] be the subgraph of Gt induced by the vertices with label i.
For each node t and each vector (a1 , . . . , ak ) {0, 1, . . . , n}k, let c[t, (a1 , . . . , ak )]
be the set of all multigraphs F on the vertex set {v1 , . . . , vk } where
F = Aux(P) for some k-labeled path-partition P of Gt ,
for each i {1, . . . , k}, ai is the degree of vi in F .
Instead of computing the whole set c[t, (a1 , . . . , ak )], we will compute a subset
r[t, (a1 , . . . , ak )] of c[t, (a1 , . . . , ak )] of size 2O(k log k) such that r[t, (a1 , . . . , ak )]
c[t, (a1 , . . . , ak )].
We explain how to decide whether G has a Hamiltonian cycle. Let troot be
the root node of T , and let tlastjoin be the node taking the disjoint union of two
130 B. Bergougnoux et al.

graphs and closest to the root node. We can observe that G has a Hamiltonian
cycle if and only if there are some node t between troot and tlastjoin with child
t and a path-partition P of Gt such that t is a join node labeled by i,j ,
and degAux(P) (vi ) = degAux(P) (vj ) > 0 and degAux(P) (vi ) = 0 for all i
{1, . . . , k} \ {i, j}. This is equivalent to that c[t , (a1 , . . . , ak )] = for some vector
(a1 , . . . , ak ) where ai = aj > 0 and ai = 0 for all i {1, . . . , k} \ {i, j}.
Therefore, if there is a Hamiltonian cycle, then r[t , (a1 , . . . , ak )] = for such a
tuple of t, t , and (a1 , . . . , ak ), and we can correctly say that G has a Hamiltonian
cycle, and otherwise, there are no such tuples, and we can correctly say that G
has no Hamiltonian cycles.
Now, we explain how to recursively generate r[t, (a1 , . . . , ak )].

1. (Creation of a vertex v with label i)


If ai = 2 and aj = 0 for all j = i, then c[t, (a1 , . . . , ak )] consists of one graph
on the vertex set {v1 , . . . , vk } with a loop incident with vi , and otherwise, it is
an empty set. So, we add the graph ({v1 , . . . , vk }, {vi vi }) to r[t, (a1 , . . . , ak )]
when ai = 2 and aj = 0 for all j = i, and set r[t, (a1 , . . . , ak )] := otherwise.
2. (Disjoint union node with two children t1 and t2 )
Since every path-partition of Gt is obtained by taking the disjoint union of
a path-partition of Gt1 and a path-partition of Gt2 , we have

c[t,(a1 , . . . , ak )]

:= c[t1 , (a11 , . . . , a1k )]
c[t2 , (a21 , . . . , a2k )].
(a11 ,...,a1k )+(a21 ,...,a2k )=(a1 ,...,ak )

We assign

r[t, (a1 , . . . , ak )]


:= reduce r[t1 , (a11 , . . . , a1k )]
r[t2 , (a21 , . . . , a2k )] .
(a11 ,...,a1k )+(a21 ,...,a2k )=(a1 ,...,ak )

3. (Join node with the child t such that each vertex with label i is joined to
each vertex with label j)
Note that every path-partition of Gt is obtained from a path-partition of
Gt by adding some edges between end vertices of label i and end vertices of
label j. We can observe that when we add an edge between an end vertex
v of a path P1 with label i, and an end vertex w of a path P2 with label j,
these two paths P1 and P2 will be unied into a path whose end vertices are
end vertices of P1 and P2 other than v and w. Thus, it corresponds to the
operation +(i, j) on auxiliary multigraphs. We observe that

c[t,(a1 , . . . , ak )] := (c[t , (a1 , . . . , ak )] + (i, j)).
ai ai =aj aj =0
ax =ax for x = i, j
An optimal XP algorithm for Hamiltonian Cycle on graphs of bounded clique-width 131

We take all possible vectors (a1 , . . . , ak ) where ai ai = aj aj 0, and
for all t {1, . . . , k} \ {i, j}, at = at . Assume  = ai ai . For each 
{0, 1, . . . , n}, we assign

r := reduce( reduce(reduce(r[t , (a1 , . . . , ak )] + (i, j)) + (i, j)) + (i, j)),

where we repeat  times, and assign

r[t, (a1 , . . . , ak )] := reduce(r0 r1 rn ).

4. (Renaming node with a child t such that the label of each vertex with label
i is changed to j)
Every path-partition of Gt is also a path-partition of Gt , and vice versa.
Since just labelings of vertices are changed, we can observe that if ai = 0,
then c[t, (a1 , . . . , ak )] is the empty set, and otherwise, we have

c[t,(a1 , . . . , ak )] := c[t , (a1 , . . . , ak )]|ij .
ax =ax for all x = i, j
ai +aj =aj

If ai = 0, then we assign the empty set to r[t, (a1 , . . . , ak )], and otherwise,
we assign



r[t,(a1 , . . . , ak )] := reduce r[t , (a1 , . . . , ak )]|ij .

ax =ax for all x = i, j
ai +aj =aj

One can prove by induction that r[t, (a1 , . . . , ak )] c[t, (a1 , . . . , ak )] for each t
and (a1 , . . . , ak ). Therefore, we can correctly decide whether G has a Hamiltonian
cycle or not using sets r[t, (a1 , . . . , ak )].
Running time. Each constructed set r[t, (a1 , . . . , ak )] consists of at most 2O(k log k)
graphs, as we keep at most one graph for each partition of {v1 , . . . , vk } after the
reduce operation. For the node taking the disjoint union of two graphs, for a xed
vector (a1 , . . . , ak ), there are nO(k) ways to take two vectors A1 and A2 such that
A1 + A2 = (a1 , . . . , ak ). So, we can update r[, ] in time nO(k) 2O(k log k) . For the
node joining edges between two classes, the value  can be taken from 0 to n.
Since each operation +(i, j) take k 2 2O(k log k) time, we can update r[, ] in time
n2 2O(k log k) . Clearly, we can update r[, ] in time n 2O(k log k) for the relabeling
nodes. Therefore, we can solve Hamiltonian Cycle for G in time nO(k) .

6 More applications
Let q be a positive integer. The q-Cycle Covering problem asks for a given
graph G whether there is a set of at most q pairwise vertex-disjoint cycles in
132 B. Bergougnoux et al.

G whose union contains all vertices of G. Denitely, 1-Cycle Covering is the


Hamiltonian Cycle problem. In the q-Cycle Covering problem, we relax
the denition of path-partitions so that it may contain at most q cycles, and
we keep the number of cycles in the path-partition. Also, we dene its auxiliary
multigraph Aux(P) using those remaining paths. One can easily check that two
such modied path-partitions P1 and P2 are equivalent for q-Cycle Covering
if they contain the same number of cycles and Aux(P1 )  Aux(P2 ).
The second application is for Directed Hamiltonian Cycle. Clique-width
was also considered for directed graphs by Courcelle and Olariu [5]. The clique-
width operations for directed graphs are the same as for the undirected graphs,
except the one that add edges between two label classes, dened as follows: (3 )
Adding an arc (u, v) for each vertex u with label i to each vertex v with label j
(i = j, denoted by i,j ). The clique-width of a directed graph G is the minimum
number of labels needed to construct G using these operations. In this case, we
use directed auxiliary multigraphs. Similar to Lemma 1, we can show that
Lemma 2. Let G be a connected directed multigraph whose arcs are colored by
red and blue. Then the following are equivalent.
1. For every vertex v, the number of blue edges leaving v is the same as the
number of red edges entering v, and the number of red edges leaving v is the
same as the number of blue edges entering v.
2. G has a red-blue alternating Eulerian directed trail.
Using Lemma 2, we can proceed same as Theorem 1.

References
1. Arnborg, S., Proskurowski, A.: Linear time algorithms for NP-hard problems re-
stricted to partial k-trees. Discrete Appl. Math. 23, 1124 (1989)
2. Bodlaender, H.L.: A partial k-arboretum of graphs with bounded treewidth. Theor.
Comput. Sci. 209, 145 (1998)
3. Courcelle, B.: The monadic second-order logic of graphs I: Recognizable sets of nite
graphs. Information and Computation 85, 1275 (1990)
4. Courcelle, B., Makowsky, J.A., Rotics, U.: Linear time solvable optimization prob-
lems on graphs of bounded clique width. Theor. Comput. Sci. 33, 125150 (2000)
5. Courcelle, B., Olariu, S.: Upper bounds to the clique width of graphs. Discrete Appl.
Math. 101(1-3), 77114 (2000)
6. Diestel, R.: Graph Theory. No. 173 in Graduate Texts in Mathematics, Springer,
third edn. (2005)
7. Espelage, W., Gurski, F., Wanke, E.: How to solve NP-hard graph problems on
clique-width bounded graphs in polynomial time. In: Graph-theoretic concepts in
computer science (Boltenhagen, 2001), Lecture Notes in Comput. Sci., vol. 2204,
pp. 117128. Springer, Berlin (2001)
8. Fomin, F.V., Golovach, P.A., Lokshtanov, D., Saurabh, S.: Intractability of clique-
width parameterizations. SIAM J. Comput. 39(5), 19411956 (2010)
9. Fomin, F.V., Golovach, P.A., Lokshtanov, D., Saurabh, S.: Almost optimal lower
bounds for problems parameterized by clique-width. SIAM J. Comput. 43(5), 1541
1563 (2014)
Improved Algorithms for Computing
k-Sink on Dynamic Flow Path Networks

Binay Bhattacharya1 , Mordecai J. Golin2 , Yuya Higashikawa3,  , ,


Tsunehiko Kameda1 , and Naoki Katoh4,  
1
School of Computing Science, Simon Fraser University, Burnaby, Canada
2
Dept. of Computer Science, Hong Kong Univ. of Science and Technology, China
3
Dept. of Information and System Engineering, Chuo University, Tokyo, Japan
4
School of Science and Technology, Kwansei Gakuin University, Hyogo, Japan

Abstract. We address the problem of locating k sinks on dynamic


ow path networks with n vertices in such a way that the evacua-
tion completion time to them is minimized. Our two algorithms run
in O(n log n + k2 log4 n) and O(n log3 n) time, respectively. When all
edges have the same capacity, we also present two algorithms which run
in O(n + k2 log2 n) time and O(n log n) time, respectively. These algo-
rithms together improve upon the previously most ecient algorithms,
which have time complexities O(kn log2 n) [1] and O(kn) [11], in the
general and uniform edge capacity cases, respectively. The above re-
sults are achieved by organizing relevant data for subpaths in a strategic
way during preprocessing, and the nal results are obtained by extract-
ing/merging them in an ecient manner.

1 Introduction
Ford and Fulkerson [5] introduced the concept of dynamic ow which models
movement of commodities in a network. In this model, each vertex is assigned
some initial amount of supply, each edge has a capacity, which limits the rate
of commodity ow into it per unit time, and the transit time to traverse it.
One variant of the dynamic ow problem is the quickest transshipment problem,
where the source vertices have specied supplies and sink vertices have specied
demands. The problem is to send exactly the right amount of commodity out of
sources into sinks in minimum overall time. Hoppe and Tardos [12] provided a
polynomial time algorithm for this problem in the case where the transit times
are integral. However, the complexity of their algorithm is very high. Finding a
practical polynomial time solution to this problem is still open. The reader is
referred to a recent paper by Skutella [18] on dynamic ows.
This paper discusses a related problem, called the evacuation problem [8,
14], in which the supplies (i.e., evacuees) are discrete, and the sinks and their
demands are not specied. In fact, the locations of the sinks are the output of the
problem. Many disasters, such as earthquakes, nuclear plant accidents, volcanic

Partially supported by a Discovery Grant from NSERC of Canada

Partially supported by Hong Kong RGC GRF grant 16208415

Supported by JSPS KAKENHI Grant-in-Aid for Young Scientists (B) (17K12641)

Supported by JST CREST (JPMJCR1402)

Springer International Publishing AG 2017 133


F. Ellen et al. (Eds.): WADS 2017, LNCS 10389, pp. 133144, 2017.
DOI: 10.1007/978-3-319-62127-2_12
134 B. Bhattacharya et al.

eruptions, ooding, have struck in recent years in many parts of the world, and
it is recognized that orderly evacuation planning is urgently needed.

A k-sink is a set of k sinks such that the evacuation completion time to


sinks is minimized, and our objective is to nd a k-sink on a dynamic ow
path network. Congestion is said to occur when an evacuee cannot move at the
maximum speed constrained only by transit time. Thus, when the capacities of
the edges are suciently large, no congestion occurs and each evacuee can follow
the shortest path to its nearest sink at the maximum speed. This is equivalent
to the classical k-center problem in networks, which is known to be NP-hard
even on bipartite planar graphs of maximum degree 4 [17]. To the best of our
knowledge the most general polynomially solvable case for general k is where the
underlying graphs are cacti or partial t-trees with constant t. Congestion could
occur if vertex capacities are limited, in which case edges may get clogged and
congestion backs up. Our results are valid regardless of whether vertex capacities
(the number of evacuees that they can accommodate) are limited or not.

Mamada et al. [15] solved the 1-sink problem for the dynamic ow tree net-
works in O(n log2 n) time under the condition that only a vertex can be a sink,
where n is the number of vertices. When edge capacities are uniform, we have
presented O(n log n) time algorithms with a more relaxed condition that the
sink can be on an edge, as well as on a vertex [3, 10]. Dealing with congestion is
non-trivial even in path networks. On dynamic ow path networks with uniform
edge capacities, it is straightforward to compute the 1-sink in linear time, as
shown by Cheng et al. [4]. Arumugam et al. [1] showed that the k-sink problem
for dynamic ow path networks can be solved in O(kn log2 n) time, and when
the edge capacities are uniform Higashikawa et al. [11] showed that it can be
solved in O(kn) time.

In this paper we present two algorithms for the k-sink problem on dynamic
ow path networks with general edge capacities. A path network can model an
airplane aisle, a hall way in a building, a street, a highway, etc., to name a few.
Unlike the previous algorithm for the k-sink problem [1] which uses dynamic
programming, our algorithms adopt Megiddos parametric search [16] and the
sorted matrices introduced by Frederickson and Johnson [6, 7]. Together, they
outperform all other known algorithms, and they are the rst sub-quadratic
algorithms for any value of k. These improvements were made possible by our
method of merging evacuation times of subpaths stored in a hierarchical data
structure. We also present two algorithms for the dynamic ow path networks
with uniform edge capacities.

This paper is organized as follows. In the next section, we dene our model
and the terms that are used throughout the paper. Sec. 3 introduces a new
data structure, named the capacities and upper envelopes tree, which plays a
central role in the rest of the paper. In Sec. 4 we identify two important tasks
that form building blocks of our algorithms, and also discuss a feasibility test.
Sec. 5 presents several algorithms for uniform and general edge capacities. Fi-
nally, Sec. 6 concludes the paper.
Improved Algorithms for Computing k -Sink on Dynamic Flow Path Networks 135

2 Preliminaries
2.1 Denitions
Let P = (V, E) be a path network, whose vertices v1 , v2 , . . . , vn are arranged from
left to right in this order. For i = 1, 2, . . . , n, vertex vi has an integral weight
wi (> 0), representing the number of evacuees, and each edge ei = (vi , vi+1 ) has
a xed non-negative length li and an integral capacity ci , which is the upper limit
on the number of evacuees who can enter an edge per unit time. We assume that
a sink has innite capacity, so that the evacuees coming from the left and right
of a sink do not interfere with each other. An evacuation starts at the same time
from all the vertices, and all the evacuees from a vertex evacuate to the same
sink. This is called conuent ow in the parlance of the network ow theory.
This constraint is desirable in evacuation in order to avoid confusion among the
evacuees at a vertex as to which way they should move.
By x P , we mean that point x lies on either an edge or a vertex of P . For
two points a, b P , a b or b  a means that a lies to the left of b. Let d(a, b)
denote the distance (sum of the edge lengths) between a and b. If a and/or b lies
on an edge, we use the prorated distance. The transit time for a unit distance
is denoted by , so that it takes d(a, b) time to travel from a to b, and is
independent of the edge. Let c(a, b) denote the minimum capacity of the edges
on the subpath of P between a and b. The point that is arbitrarily close to vi
on its left (resp. right) side is denoted by vi (resp. vi+ ). Let P [a, b] denote the
subpath of P between a and b satisfying a b. If a, b or both are excluded, we
denote them by P (a, b], P [a, b) or P (a, b), respectively. Let V [a, b] (resp. V (a, b],
V [a, b) or V (a, b)) denotes the set of vertices on P [a, b] (resp. P (a, b], P [a, b) or
P (a, b)). We introduce a weight array W [], dened by

W [i]  wj , for i = 1, 2, . . . , n, (1)
vj V [v1 ,vi ]

and let W [vi , vj ]  W [j] W [i 1] for i j.

2.2 Completion time functions


In our model, a set of k sinks accepts evacuees from k disjoint subpaths of P .
We thus need to be able to compute the completion time for each such subpath
P [vi , vj ]. For simplicity, from now on, we assume that the optimal k sinks are
on edges, not on vertices. Small modications will be necessary if we allow some
sinks to be on vertices. We dene the completion time from left (L-time for short)
to x  vj of vertex vp on P [vi , vj ] to be the evacuation completion time to x
for the evacuees on the vertices on P [vi , vp ], assuming that they all arrive at
x continuously at a uniform rate c(vp , x). We similarly dene the completion
time from right (R-time for short) to x vi of vertex vp on P [vi , vj ] to be the
evacuation completion time to x for all the evacuees on the vertices on P [vp , vj ],
arriving at x continuously at a uniform rate c(x, vp ). For any vertex vp V [vi , vj ],
its L-time and R-time are given mathematically as
[i,j]
L (x, vp )  d(vp , x) + W [vi , vp ]/c(vp , x) for x  vj , (2)
[i,j]
R (x, vp )  d(x, vp ) + W [vp , vj ]/c(x, vp ) for x vi , (3)
136 B. Bhattacharya et al.

8 14 5 10 7 15 8 12 7 3 10
weights

lengths 3 2 4 3 2 3 2 4 2 1 4
v1 v2 v3 v4 v5 v6 v7 v8 v9 x v10 v11

capacities
5 3 4 2 6 5 3 4 5 1

Fig. 1. An example path P = (V, E) with x e9 = (v9 , v10 ).

respectively. For convenience we sometimes refer to the rst (resp. second) term
in the righthand side of (2) and (3) as the distance time (resp. weight time).
Note that the distance time is linear in the distance to x. Consider an arbitrary
subpath P [vi , vj ], where i j.
Fig. 1 shows an example, where vertices v1 , v2 , v3 , . . . (represented by black
circles) have weights 8, 14, 5, . . ., and edges e1 , e2 , e3 , . . . have lengths 3, 2, 4, . . .
and capacities 5, 3, 4, . . . Point x is located on e9 = (v9 , v10 ) so that d(v9 , x) = 2
(represented by a white circle). Assuming = 1, let us compute the L-time to
x of vertex v5 on P [v2 , v7 ]. From d(v5 , x) = 13, W [v2 , v5 ] = 36 and c(v5 , x) = 3,
[2,7]
we obtain L (x, v5 ) = 25.
To be more precise, the weight time should be W [vi , vp ]/c(vp , x) and
W [vp , vj ]/c(x, vp ) in (2) and (3), respectively, since the evacuees are discrete
entities. Although only small modications are necessary to get exact solutions
as shown in [4], we use (2) and (3) for simplicity.

Lemma 1. [9] Let s be the sink for a subpath P [vi , vj ] of a path network P . The
evacuation completion time to s (vi  vh s vh+1  vj ) for the evacuees on
P [vi , vj ] is given by
 
[i,h] [h+1,j]
[i,j] (s)  max max {L (s, v)},  max {R (s, v  )} . (4)
vV [vi ,s) v V (s,vj ]

[i,j]
Referring to (2) and (3), the vertex vp V [vi , vj ] that maximizes L (vj+ , vp )
[i,j]
(resp. R (vi , vp )) is called the L-critical vertex (resp. R-critical vertex) of
[i,j] [i,j]
P [vi , vj ], and is denoted by cL (resp. cR ). Note that (vj+ , vp ) (resp. (vi , vp ))
is used instead of (vj , vp ) (resp. (vi , vp )), and that we have d(vp , vj+ ) = d(vp , vj )
and c(vp , vj+ ) = min{c(vp , vj ), cj } (resp. d(vi , vp ) = d(vi , vp ) and c(vi , vp ) =
min{c(vi , vp ), ci1 }).
Using the example in Fig. 1 again, let us nd the L-critical vertex of P [v2 , v7 ].
[2,7] [2,7]
We rst compute L (v7+ , vp ) for p = 2, . . . , 7: L (v7+ , v2 ) = 14 + 14/2 = 21,
[2,7] + [2,7] + [2,7]
L (v7 , v3 ) = 12 + 19/2 = 21.5, L (v7 , v4 ) = 8 + 29/2 = 22.5, L (v7+ , v5 ) =
[2,7] [2,7]
5+36/3 = 17, L (v7+ , v6 ) = 3+51/3 = 20, and L (v7+ , v7 ) = 0+59/3 19.7.
[2,7]
Comparing these values, we obtain cL = v4 .
Improved Algorithms for Computing k -Sink on Dynamic Flow Path Networks 137

[i,j] [i,j] [i,j]


Proposition 1. Critical vertex vp = cL (resp. vp = cR ) maximizes L (x, vp )
[i,j]
(resp. R (x, vp )) for any point x (vj , vj+1 ] (resp. x [vi1 , vi )).

3 Data structures
A problem instance is said to be t-feasible if there are k sinks such that every
evacuee can reach a sink within time t. In our algorithms, we want to perform
t-feasibility tests for many dierent values of completion time t. Therefore, it is
worthwhile to spend some time during preprocessing to construct data structures
which facilitate these tests.

3.1 Capacities and upper envelopes (CUE) tree


[i,j] [i,j]
We want to design a data structure with which critical vertices cL and cR can
be found eciently for an arbitrary pair (i, j) with 1 i j n. To this end we
introduce the capacities and upper envelopes tree (CUE tree, for short), denoted
by T , with root , whose leaves are the vertices of P arranged from left to right.
It is a balanced tree with height O(log n). In balancing, the vertex weights are
not considered. For a node5 u of T , let T (u) denote the subtree rooted at u,
and let l(u) (resp. r(u)) denote the index of the leftmost (resp. rightmost) vertex
on P that belongs to T (u). See Fig. 2. Let ul , ur and up denote the left child
of u, the right child of u, and the parent of u, respectively. We say that node


(vi , ) (vj , )

vi vl(u) vr(u) vj

Fig. 2. Illustration of a part of CUE tree T . The small gray disks represent nodes of
N [vi , vj ] and dashed circles enclose subpaths in P[vi , vj ].

u spans subpath P [vl(u) , vr(u) ]. At node u, we store l(u), r(u) and the capacity
c(vl(u) , vr(u) ) among others. This information at every node can be computed
bottom up in O(n) time by performing heap-like operations.
For two nodes u, u of T , let (u, u ) denote the path from u to u along
edges of T . Suppose that for an index pair (i, j) with 1 i j n, node  is
5
We use the term node here to distinguish it from the vertices on the path. A
vertex, being a leaf of T , is considered a node, but an interior node of T is not a
vertex.
138 B. Bhattacharya et al.

the lowest common ancestor of vi and vj in T . Consider every node of T that


is the right child of a node on (vi ,  ) or the left child of a node on (vj ,  ),
but which itself is not on (vi ,  ) or (vj ,  ). Let N [vi , vj ] denote the set of
such nodes plus vi and vj . Then clearly N [vi , vj ] consists of O(log n) nodes. Let
P[vi , vj ] denote the set of O(log n) subpaths spanned by nodes of N [vi , vj ].

[i,j]
In order to determine cL for a given pair (i, j), we need to compute

max {d(vp , vj ) + W [vi , vp ]/c(vp , vj+1 )} . (5)


vp V [vi ,vj ]

To facilitate such a computation for an arbitrary pair (i, j), at each node u,
we precompute and store two upper envelope functions associated with sub-
path P [vl(u) , vr(u) ]. Then for u N [vi , vj ] that spans vp , we have W [vi , vp ] =
W [vi , vl(u)1 ]+W [vl(u) , vp ] and c(vp , vj+1 ) = min{c(vp , vr(u)+1 ), c(vr(u)+1 , vj+1 )}.
Since (i, j), hence W [vi , vl(u)1 ] and c(vr(u)+1 , vj+1 ), is not known during pre-
processing, we replace these values with variables W and c, respectively, and
express the two upper envelopes stored at u as functions of W = W [vi , vl(u)1 ]
and c = c(vr(u)+1 , vj+1 ), respectively. We can now break (5) down into a number
of formulea, one for each u N [vi , vj ], which is given by
!
max d(vp , vr(u) ) + (W + W [vl(u) , vp ])/ min{c(vp , vr(u)+1 ), c} . (6)
vp V [vl(u) ,vr(u) ]

Using the concrete values of W and c, we can evaluate (5) by nding the maxi-
mum of the |N [vi , vj ]| = O(log n) values, computed by (6).

Now we want to compute (6) eciently for arbitrary W and c, but of


course we have W = W [vi , vl(u)1 ] and c = c(vr(u)+1 , vj ) in mind for some i
and j. Consider two extreme cases, where for any p with vp V [vl(u) , vr(u) ] (i)
c > c(vp , vr(u)+1 ), and (ii) c c(vp , vr(u)+1 ), respectively. In Case (i), we have
from (6)
!
u
L,1 (W )  max d(vp , vr(u) ) +(W +W [vl(u) , vp ])/c(vp , vr(u)+1 ) (7)
vp V [vl(u) ,vr(u) ]
 
[l(u),r(u)] +
= max L (vr(u) , vp ) + W/c(vp , vr(u)+1 ) . (8)
vp V [vl(u) ,vr(u) ]

Note that c(vp , vr(u)+1 ) gets smaller as vp moves to the left. From (7) it is seen
u
that L,1 (W ) is the upper envelope of linear functions of W and each coecient
u
of W is positive, which means that L,1 (W ) is piecewise linear, continuous, and
increasing in W . Thus it can be encoded as a sequence of bending points. In
Case (ii), we have from (6)
u
!
L,2 (c) = max d(vp , vr(u) ) + W [vl(u) , vp ]/c . (9)
vp V [vl(u) ,vr(u) ]

Note that (9) was obtained from (6) by removing the term W/c, which does
u
not depend on vp . If we plot L,2 (c) vs. (1/c) as a graph, it is also piecewise
linear, continuous, and increasing in (1/c), and can be encoded as a sequence of
bending points.
Improved Algorithms for Computing k -Sink on Dynamic Flow Path Networks 139

u u
At node u we store both L,1 (W ) and L,2 (c) in encoded form with bending
points, which can be computed in O(r(u) l(u)) time. Similarly, in order to
[i,j]
determine cR for an arbitrary pair (i, j), we store two functions which are
u u u u
symmetric to L,1 (W ) and L,2 (c), respectively, named R,1 (W ) and R,2 (c),
in linear time. We can now prove the following lemma.
Lemma 2. Given a dynamic ow path network with n vertices, CUE tree T
with associated data can be constructed in O(n log n) time and O(n log n) space.

3.2 Using CUE tree


[i,j]
Suppose we want to nd the L-critical vertex cL for subpath P [vi , vj ]. We
work on P [vl(u) , vr(u) ] P[vi , vj ] for each node u N [vi , vj ]. Each such subpath
[i,j]
provides a candidate for cL . Clearly, among those candidates, the one that has
[i,j]
the largest L-time is cL .
Let us rst compute c = c(vr(u)+1 , vj+1 ). For this purpose, we trace the path
(vr(u)+1 , vj+1 ) in T and, at each node u N [vr(u)+1 , vj+1 ] \ {vj+1 }, retrieve
c(vl(u ) , vr(u ) ) and cr(u )+1 . Taking the minimum of the retrieved capacities, we
obtain c(vr(u)+1 , vj+1 ), which costs O(log n) time.
Using binary search, we then nd the largest index q (l(u) q r(u)), if
any, such that c(vq , vr(u)+1 ) < c = c(vr(u)+1 , vj+1 ) holds. Note that c(vq , vr(u)+1 )
is monotonically non-increasing as q decreases. To nd q we trace the path
(vr(u) , u) in T as follows. Set cmin to cr(u)+1 and u to vr(u) . If cmin < c, q is
determined as r(u). Otherwise update u to up . While u
= u and

min{cmin , c(vl(ul ) , vr(ul ) ), cr(ul )+1 } c, (10)

update cmin to the L.H.S. of (10), and u to up . If u = u and (10) holds, such
q does not exist. If (10) stops holding at some node u , then update u to ul .
While
min{cmin , c(vl(ur ) , vr(ur ) ), cr(ur )+1 } c, (11)
update cmin to the L.H.S. of (11) and u to ur . If (11) stops holding at some node
u , then update u to ur . This way we will eventually reach vq , if it exists, in
O(log n) time. If q exists, we partition P [vl(u) , vr(u) ] into two subpaths P [vl(u) , vq ]
and P [vq+1 , vr(u) ]. Letting V1 = V [vl(u) , vq ], V2 = V [vq+1 , vr(u) ], and W = W [vi ,
vl(u)1 ], we dene
 
u [l(u),r(u)] +
L,1 (W ) = max L (vr(u) , vp ) + W/c(vp , vr(u)+1 ) , (12)
vp V1
u
!
L,2 (c) = max d(vp , vr(u) ) + W [vl(u) , vp ]/c . (13)
vp V2

Note that the range of maximization vp V1 in (12) (resp. vp V2 in (13)) is


u
limited compared with (8) (resp. (9)). If q does not exist, we set L,1 (W ) = 0
and V2 = V [vl(u) , vr(u) ]. It is clear that
 
u u
max L,1 (W ), L,2 (c) + W/c (14)
140 B. Bhattacharya et al.

is equal to (6), and its maximizing vertex corresponds to a candidate from


P [vl(u) , vr(u) ] for the L-critical vertex of P [vi , vj ].
Let v1 (resp. v2 ) be a vertex in V1 V2 = V [vl(u) , vr(u) ] which maximizes the
bracketed term in (8) (resp. (9)). Once W = W [vi , vl(u)1 ] and c = c(vr(u)+1 , vj+1 )
are given, we can obtain v1 and v2 by binary search on the bending points of
u u
L,1 (W ) and L,2 (c), respectively, which can be done in O(log n) time. We can
now prove the following lemma.
Lemma 3.
(a) If v2 V1 , we have
u u
L,1 (W ) > L,2 (c) + W/c. (15)

(b) If v1 V2 , we have
u
L,1 (W ) L,2
u
(c) + W/c. (16)

(c) v1 V2 and v2 V1 cannot happen at the same time.


If v1 V1 and v2 V2 , clearly v1 and v2 also achieve the maxima in (12)
and (13), respectively. Therefore, if L,1 u
(W ) > L,2u u
(c) + W/c (resp. L,1 (W )
u
L,2 (c) + W/c), v1 (resp. v2 ) is a candidate critical vertex from P [vl(u) , vr(u) ].
Otherwise, by Lemma 3, v1 , v2 V1 or v1 , v2 V2 holds. Also by Lemma 3, if
v1 , v2 V1 (resp. v1 , v2 V2 ), v1 (resp. v2 ) is a candidate critical vertex. Based
on the above arguments, we can prove the following lemma.

Lemma 4. Suppose that CUE tree T is available. Consider subpath P [vi , vj ]


with 1 i < j n.
(a) For each node u N [vi , vj ], candidates from P [vl(u) , vr(u) ] for L-critical and
R-critical vertices of P [vi , vj ] can be computed in O(log n) time.
(b) The L-critical and R-critical vertices for P [vi , vj ] can be computed in O(log2 n)
time.

4 Building blocks
There are two useful tasks that we can call upon repeatedly. Given the starting
vertex va , the rst task is to nd the rightmost vertex vd such that all the
evacuees on V [va , vd ] can evacuate to a sink within time t. The second task is to
nd the cost of the 1-sink on a given subpath P [vi , vj ]. To perform these tasks,
we start with more basic procedures.

4.1 Basic algorithms


To implement the rst task, note that for a given index h > a, there are O(log n)
nodes in N [va , vh ]. For each such node u, we want to test where a sink s should
be placed: to the left of vl(u) , to the right of vr(u) , or between vl(u) and vr(u) .
Here is an algorithm for the rst task.
Improved Algorithms for Computing k -Sink on Dynamic Flow Path Networks 141

Algorithm 1 1-Sink(t, va )
1. Compute an integer b by binary search over h with a h n such that
[a,b] [a,b+1]
the L-time of cL to vb+ does not exceed t but the L-time of cL +
to vb+1
exceeds t.
[a,b] [a,b]
2. Solve L (vb+ , cL ) + x = t, and place a sink s (vb , vb+1 ] satisfying
d(vb , s) = x.
3. If s (vb , vb+1 ), set c to b + 1. If s = vb+1 , set c to b + 2. Compute an integer
[c,d]
d by binary search over h with c h n such that the R-time of cR to s
[c,d+1]
does not exceed t but the R-time of cR to s exceeds t.

Lemma 5. If CUE tree T is available, 1-Sink(t, va ) runs in O(log3 n) time.


[a,h] [a,h]
Proof. In Step 1, for a xed h, nding cL and computing the L-time of cL
to vh+ take O(log2 n) time by Lemma 4. Clearly, we repeat this computation
O(log n) times, thus Step 1 takes O(log3 n) time. Step 2 takes O(1) time and
Step 3 takes O(log3 n) time similarly to Step 1. Summarizing these, we complete
the proof. 

Here is an algorithm for the second task.
Algorithm 2 Local-Cost(vi , vj )
1. Let u be the node where the two paths (vi , ) and (vj , ) meet.
[i,r(u )] [l(u ),j]
2. If the L-time of cL l and the R-time of cR r have the same value at
some point x on the edge (vr(ul ) , vl(ur ) ), then output x as the 1-sink.
[i,r(u )] [l(u ),j]
3. If the L-time of cL l is higher (resp. lower) than the R-time of cR r at
every point on edge (vr(ul ) , vl(ur ) ), then let u = ul (resp. u = ur ) and repeat
Step 2, using the new ul and ur .
We have the following lemma.
Lemma 6. If CUE tree T is available, Local-Cost(vi , vj ) nds a 1-sink on
subpath P [vi , vj ] in O(log3 n) time.

4.2 t-feasibility test


We carry out 1-Sink(t, v) repeatedly, starting from the left end of P , i.e., v1 .
Clearly, the problem instance is t-feasible if and only if the rightmost vertex vn
belongs to the l-th isolated subpath, where l k.
Lemma 7. Given a dynamic ow path network, if CUE tree T is available, we
can test its t-feasibility in O(min{n log2 n, k log3 n}) time.
Proof. Starting at the leftmost vertex v1 of P , invoke 1-Sink(t, v1 ), which iso-
lates the rst subpath in O(log3 n) time by Lemma 5, and remove it from P .
We repeat this at most k 1 more times on the remaining subpath, spending
O(k log3 n) time.
On the other hand, when each 1-Sink(t, va ) is executed, suppose we compute
[a,h]
the L-time of cL to vh+ for h = a, a + 1, . . . one by one at Step 1, and similarly
142 B. Bhattacharya et al.

[c,h]
the R-time of cR to s for h = c, c + 1, . . . one by one, instead of binary search.
Then, the computations of L-time and R-time are invoked at most n times during
a t-feasibility test. Since each computation of L-time or R-time takes O(log2 n)
time by Lemma 4, the total time is O(n log2 n) in this way. 

4.3 Uniform edge capacity case


The problem is much simplied if the edges have the same capacity. In particular,
we can compute the critical vertex of a subpath resulting from concatenating
two subpaths in constant time. At each node u of T bottom up, we compute
+
and record the L- and R-critical vertices of P [vl(u) , vr(u) ] with respect to vr(u)
and their costs, based on the following lemma.
Lemma 8. [11] For a node u of CUE tree T , let vl(ul ) = vh , vr(ul ) = vi , vl(ur ) =
[h,j] [h,j] [i+1,j]
vi+1 , and vr(ur ) = vj , and assume that the critical vertices, cL , cR , cL ,
[i+1,j]
and cR have already been computed.
[h,j] [h,i] [i+1,j]
(a) The L-critical vertex cL is either cL or cL .
[h,j] [h,i] [i+1,j]
(b) The R-critical vertex cR is either cR or cR .
The following two lemmas provide counterparts to Lemmas 2 and 4, respec-
tively.
Lemma 9. Given a dynamic ow path network with n vertices and uniform
edge capacities, CUE tree T with associated data can be constructed in O(n)
time and O(n) space.
Lemma 10. Suppose that CUE tree T is available. For any i and j (1 i < j
n), we can comput the L-critical and R-critical vertices for P [vi , vj ] in O(log n)
time.
Similarly to Lemma 7, we can prove the following lemma.
Lemma 11. Given a dynamic ow path network with uniform edge capacities,
if CUE tree T is available, we can test its t-feasibility in O(min{n, k log n}) time.

5 Optimization
5.1 Parametric search approach
Lemma 12. [1] If t-feasibility test can be tested in (t) time, then the k-sink
can be found in O(k(t) log n) time, excluding the preprocessing time.
By Lemma 2 it takes O(n log n) time to construct T with weight and capacity
data, and (t) = O(k log3 n) by Lemma 7. Lemma 12 thus implies
Theorem 1. Given a dynamic ow path network with n vertices, we can nd
an optimal k-sink in O(n log n + k 2 log4 n) time.
Applying Megiddos main theorem in [16] to Lemma 11, we obtain
Theorem 2. Given a dynamic ow path network with n vertices and uniform
edge capacities, we can nd an optimal k-sink in O(n + k 2 log2 n) time.
Improved Algorithms for Computing k -Sink on Dynamic Flow Path Networks 143

5.2 Sorted matrix approach

Let OP T (l, r) denote the evacuation time for the optimal 1-sink on subpath
P [vl , vr ]. Dene an n n matrix A whose entry (i, j) entry is given by

OPT (n i + 1, j) if n i + 1 j
A[i, j] = (17)
0 otherwise.

It is clear that matrix A includes OPT (l, r) for every pair of integers (l, r)
such that 1 l r n. There exists a pair (l, r) such that OPT (l, r) is
the evacuation time for the optimal k-sink on the whole path. Then the k-sink
location problem can be formulated as: Find the smallest A[i, j] such that the
given problem instance is A[i, j]-feasible. Note that we do not actually compute
all the elements of A[ ], but element A[i, j] is computed on demand as needed.
A matrix is called a sorted matrix if each row and column of it is sorted in the
nondecreasing order. In [6, 7], Frederickson and Johnson show how to search for
an element in a sorted matrix. The following lemma is implicit in their papers.

Lemma 13. Suppose that A[i, j] can be computed in g(n) time, and feasibility
can be tested in f (n) time with h(n) preprocessing time. Then we can solve the
k-sink problem in O(h(n) + ng(n) + f (n) log n) time.

We have h(n) = O(n log n) by Lemma 2, g(n) = O(log3 n) by Lemma 6, and


f (n) = O(n log2 n) by Lemma 7. Lemma 13 thus implies

Theorem 3. Given a dynamic path network with n vertices and general edge
capacities, we can nd an optimal k-sink in O(n log3 n) time.

In the uniform edge capacity case, we have h(n) = O(n) by Lemma 9, g(n) =
O(log n) by Lemma 10, and f (n) = O(n) by Lemma 11. Lemma 13 thus implies

Theorem 4. Given a dynamic path network with n vertices and uniform edge
capacities, we can nd the k-sink in O(n log n) time.

6 Conclusion and discussion

We have presented more ecient algorithms than the existing ones to solve the
k-sink problem on dynamic ow path networks. Due to lack of space, we could
not present all the proofs. All our results are valid if the model is changed slightly,
so that the weights and edge capacities are not restricted to be integers. Then
it becomes conuent transshipment problem.
For dynamic ow tree networks with uniform edge capacities, it is known
that computing evacuation time to a vertex can be transformed to that on a
path network [13]. We believe that our method is applicable to each spine,
which is a path in the spine decomposition of a tree [2], and we think we may be
able to solve the k-sink problem on dynamic ow tree networks more eciently.
This is work in progress.
144 B. Bhattacharya et al.

References
1. G. P. Arumugam, J. Augustine, M. J. Golin, and P. Srikanthan. A polynomial time
algorithm for minimax-regret evacuation on a dynamic path. arXiv:1404,5448v1,
2014.
2. R. Benkoczi, B. Bhattacharya, M. Chrobak, L. Larmore, and W. Rytter. Faster
algorithms for k-median problems in trees. Mathematical Foundations of Computer
Science, Springer-Verlag, LNCS 2747:218227, 2003.
3. Binay Bhattacharya and Tsunehiko Kameda. Improved algorithms for computing
minmax regret sinks on path and tree networks. Theoretical Computer Science,
607:411425, Nov. 2015.
4. S. W. Cheng, Y. Higashikawa, N. Katoh, G. Ni, B. Su, and Y. Xu. Minimax
regret 1-sink location problem in dynamic path networks. In Proc. Annual Conf.
on Theory and Applications of Models of Computation (T-H.H. Chan, L.C. Lau,
and L. Trevisan, Eds.), Springer-Verlag, volume LNCS 7876, pages 121132, 2013.
5. L. R. Ford and D. R. Fulkerson. Constructing maximal dynamic ows from static
ows. Operations research, 6(3):419433, 1958.
6. G. N. Frederickson. Optimal algorithms for tree partitioning. In Proc. 2nd ACM-
SIAM Symp. Discrete Algorithms, pages 168177, 1991.
7. G. N. Frederickson and D. B. Johnson. Finding kth paths and p-centers by gener-
ating and searching good data structures. J. Algorithms, 4:6180, 1983.
8. H.W. Hamacher and S.A. Tjandra. Mathematical modeling of evacuation prob-
lems: a state of the art. in: Pedestrian and Evacuation Dynamics, Springer Verlag,,
pages 227266, 2002.
9. Y. Higashikawa. Studies on the space exploration and the sink location under
incomplete information towards applications to evacuation planning. PhD thesis,
Kyoto University, Japan, 2014.
10. Y. Higashikawa, M. J. Golin, and N. Katoh. Minimax regret sink location problem
in dynamic tree networks with uniform capacity. J. of Graph Algorithms and
Applications, 18.4:539555, 2014.
11. Y. Higashikawa, M. J. Golin, and N. Katoh. Multiple sink location problems in
dynamic path networks. Theoretical Computer Science, 607:215, 2015.
12. B. Hoppe and E. Tardos. The quickest transshipment problem. Mathematics of
Operations Research, 25(1):3662, 2000.
13. N. Kamiyama, N. Katoh, and A. Takizawa. An ecient algorithm for evacuation
problem in dynamic network ows with uniform arc capacity. IEICE Transactions,
89-D(8):23722379, 2006.
14. S. Mamada, K. Makino, and S. Fujishige. Optimal sink location problem for dy-
namic ows in a tree network. IEICE Trans. Fundamentals, E85-A:10201025,
2002.
15. S. Mamada, T. Uno, K. Makino, and S. Fujishige. An O(n log2 n) algorithm for
a sink location problem in dynamic tree networks. Discrete Applied Mathematics,
154:23872401, 2006.
16. N. Megiddo. Combinatorial optimization with rational objective functions. Math.
Oper. Res., 4:414424, 1979.
17. N. Megiddo and A. Tamir. New results on the complexity of p-center problems.
SIAM J. Comput., 12:751758, 1983.
18. M. Skutella. An introduction to network ows over time. In Research Trends in
Combinatorial Optimization, pages 451482. Springer, 2009.
A 2-Approximation for the Height of Maximal
Outerplanar Graph Drawings 

Therese Biedl and Philippe Demontigny

David R. Cheriton School of Computer Science, University of Waterloo, Waterloo,


Ontario N2L 1A2, Canada.
[email protected], [email protected]

Abstract In this paper, we study planar drawings of maximal outer-


planar graphs with the objective of achieving small height. (We do not
necessarily preserve a given planar embedding.) A recent paper gave an
algorithm for such drawings that is within a factor of 4 of the optimum
height. In this paper, we substantially improve the approximation fac-
tor to become 2. The main ingredient is to dene a new parameter of
outerplanar graphs (the umbrella depth, obtained by recursively splitting
the graph into graphs called umbrellas). We argue that the height of any
poly-line drawing must be at least the umbrella depth, and then devise
an algorithm that achieves height at most twice the umbrella depth.

1 Introduction

Graph drawing is the art of creating a picture of a graph that is visually appeal-
ing. In this paper, we are interested in drawings of so-called outerplanar graphs,
i.e., graphs that can be drawn in the plane such that no two edges have a point
in common (except at common endpoints) and all vertices are incident to the
outerface. All drawings are required to be planar, i.e., to have no crossing. The
drawing model used is that of at visibility representations where vertices are
horizontal segments and edges are horizontal or vertical segments, but any such
drawing can be transformed into a poly-line drawing (or even a straight-line
drawing if the width is of no concern) without adding height [6].
Every planar graph with n vertices has a straight-line drawing in an n n-
grid [19,9]. Minimizing the area is NP-complete [17], even for outerplanar graphs
[7]. In this paper, we focus on minimizing just one direction of a drawing (we use
the height; minimizing the width is equivalent after rotation). It is not known
whether minimizing the height of a planar drawing is NP-hard (the closest related
result concerns minimizing the height if edges must connect adjacent rows [16]).
Given the height H, testing whether a planar drawing of height H exists is xed
parameter tractable in H [12], but the run-time is exceedingly large in H. As
such, approximation algorithms for the height of planar drawings are of interest.

TB supported by NSERC. Part of this work appeared as PDs Masters thesis [10].

Springer International Publishing AG 2017 145


F. Ellen et al. (Eds.): WADS 2017, LNCS 10389, pp. 145156, 2017.
DOI: 10.1007/978-3-319-62127-2_13
146 T. Biedl and P. Demontigny

It is known that any graph G with a planar drawing of height H has pw(G)
H [13], where pw(G) is the so-called pathwidth of G. This makes the path-
width a useful parameter for approximating the height of a planar graph draw-
ing. For a tree T , Suderman gave an algorithm to draw T with height at
most  32 pw(T ) [20], making this an asymptotic 32 -approximation algorithm. It
was discovered later that optimum-height drawings can be found eciently for
trees [18]. Approximation-algorithms for the height or width of order-preserving
and/or upward tree drawing have also been investigated [1,2,8].
For outerplanar graphs, the rst author gave two results that will be improved
upon in this paper. In particular, every maximal outerplanar graph has a drawing
of height at most 3 log n1 [3], or alternatively of height 4pw(G)3 [5]. Note that
the second result gives a 4-approximation on the height of drawing outerplanar
graphs, and improving this 4 is the main objective of this paper. A number
of results for drawing outerplanar graphs have been developed since paper [3].
In particular, any outerplanar graph with maximum degree admits a planar
straight-line drawing with area O(n1.48 ) [15], or with area O(n log n) [14].
The former bound was improved to O(n1.48 ) area[11]. Also, every so-called
balanced outerplanar graph can be drawn in an O( n) O( n)-grid [11].
In this paper, we present a 2-approximation algorithm for the height of planar
drawings of maximal outerplanar graphs. The key ingredient is to dene the
so-called umbrella depth ud(G) in Section 3. In Section 4, we show that any
outerplanar graph G has a planar drawing of height at most 2ud(G) + 1. This
algorithm is a relatively minor modication of the one in [5], albeit described
dierently. The bulk of the work for proving a better approximation factor hence
lies in proving a better lower bound, which we do in Section 5: Any maximal
outerplanar graph G with a planar drawing of height H has ud(G) H 1.

2 Preliminaries

Throughout this paper, we assume that G is a simple graph with n 3 vertices


that is maximal outerplanar. Thus, G has a standard planar embedding in which
all vertices are in the outer face (the innite connected region outside the draw-
ing) and form an n-cycle, and all interior faces are triangles. We call an edge
(u, v) of G a cutting edge if G {u, v} is disconnected, and a non-cutting edge
otherwise. In a maximal outerplanar graph, any cutting edge (u, v) has exactly
two cut-components, i.e., there are two maximal outerplanar subgraphs G1 , G2
of G such that G1 G2 = {u, v} and G1 G2 = G.
The dual tree T of G is the weak dual graph of G in the standard embedding,
i.e., T has a vertex for each interior face of G, and an edge between two vertices
i their corresponding faces in G share an edge. An outerplanar path P is a
maximal outerplanar graph whose dual tree is a path. P connects edges e and
e if e is incident to the rst face and e is incident to the last face of the path
that is the dual tree of P . An outerplanar path P with n = 3 is a triangle and
connects any pair of its edges. Since any two interior faces are connected by a
path in T , any two edges e, e of G are connected by some outerplanar path.
A 2-Approximation for the Height of Maximal Outerplanar Graph Drawings 147

r2
r2

2
r1 r1
2

1 1

(a) (b)

Figure 1: (a) A straight-line drawing in the standard embedding, including the


dual tree (dashed edges) and an outerplanar path (shaded) connecting (1 , 2 )
with (r1 , r2 ). (b) A at visibility representation. Both drawings have height 4.

Graph drawing: A drawing of a graph assigns to each vertex a point or an


axis-aligned box, and to each edge a polygonal curve connecting its endpoints.
We only consider planar drawings where none of the points, boxes, or curves
intersect unless the corresponding elements do in the graph. In this paper, a
planar drawing is not required to reect a graphs given planar embedding.
We require that all dening features (points, endpoints of segments, bends) are
placed at points with integer y-coordinates. A layer (or row) is a horizontal line
with integer y-coordinate that intersects elements of the drawing, and the height
is the number of layers.
In a at visibility representation vertices are horizontal line segments, and
edges are vertical or horizontal straight-line segments. (For ease of reading, we
draw vertices as boxes of small height in our illustrations.) In a poly-line drawing
vertices are points and edges are polygonal curves, while in a straight-line draw-
ing vertices are points and edges are line segments. In this paper, we only study
planar at visibility representations, but simply speak of a planar drawing, be-
cause it is known that any planar at visibility representation can be converted
into a planar straight-line drawing of the same height and vice versa [6].

3 Umbrellas, bonnets and systems thereof

In this section, we introduce a method of splitting maximal outerplanar graphs


into systems of special outerplanar graphs called umbrellas and bonnets.

Denition 1. Let G be a maximal outerplanar graph, let U be a subgraph of


G with n 3, and let (u, v) be a non-cutting edge of G. We say that U is an
umbrella with cap (u, v) if

1. U contains all neighbours of u and v,


2. there exists a non-empty outerplanar path P U (the handle) that connects
(u, v) to some non-cutting edge of G, and
3. any vertex of U is either in P or a neighbour of u or v.
148 T. Biedl and P. Demontigny

See also Figure 2(a). For such an umbrella U , the fan at u is the outerplanar
path that starts at an edge (u, x) of the handle P , contains all neighbours of
u, and that is minimal with respect to these constraints. If all neighbours of u
belong to P , then the fan at u is empty. Dene the fan at v similarly, using v.
Any edge (a, b) of U that is a cutting edge of G, but not of U , is called
an anchor-edge of U in G. (In the standard embedding, such edges are on the
outerface of U but not on the outerface of G.) The hanging subgraph with respect
to anchor-edge (a, b) of U in G is the cut-component Sa,b of G with respect to
cutting-edge (a, b) that does not contain the cap (u, v) of U . We often omit of
U in G when umbrella and super-graph are clear from the context.

Denition 2. Let G be a maximal outerplanar graph with n 3, and let (u, v)


be a non-cutting edge of G. An umbrella system U on G with root-edge (u, v) is
a collection U = U0 U1 Uk of subgraphs of G for some k 0 that satisfy
the following:

1. U0 contains only one subgraph U0 (the root umbrella), which is an umbrella


with cap (u, v).
2. U0 has k anchor-edges. We denote them by (ui , vi ) for i = 1, . . . , k, and let
Si be the hanging subgraph with respect to (ui , vi ).
3. For i = 1, . . . , k, Ui (the hanging umbrella system) is an umbrella system of
Si with root-edge (ui , vi ).

The depth of such an umbrella system is dened recursively to be d(U) := 1 +


max1ik d(Ui ); in particular d(U ) = 1 if k = 0.

u v u v

a b
x

(a) (b)

Figure 2: (a) An umbrella system of depth 3. The root umbrella is shaded, with
its handle darker shaded. (b) The same graph has a bonnet system of depth 2,
with the root bonnet shaded and its ribbon darker shaded.

See also Figure 2(a). A graph may have many dierent umbrella systems
with the same root-edge. Dene ud(G; u, v) (the (rooted) umbrella depth of G)
to be the minimum depth over all umbrella systems with root-edge (u, v). Note
that the umbrella depth depends on the choice of the root-edge; dene the free
umbrella depth ud(G) := udfree (G) to be the minimum umbrella depth over all
A 2-Approximation for the Height of Maximal Outerplanar Graph Drawings 149

possible root-edges. (One can show that the free umbrella depth is at most one
unit less than the rooted umbrella depth for any choice of root-edge; see [10].)
Bonnets: A bonnet is a generalization of an umbrella that allows two handles,
as long as they go to dierent sides of the interior face at (u, v). Thus, condition
(2) of the denition of an umbrella gets replaced by
2. There exists a non-empty outerplanar path P U (the ribbon) that connects
two non-cutting edges and contains u, v and their common neighbour.
Other than that, bonnets are dened exactly like umbrellas. See also Figure 2(b).
We dene bonnet system, root bonnet, etc., exactly as for an umbrella system,
except that bonnet is substituted for umbrella everywhere. Let bd(G; u, v)
(the rooted bonnet-depth of G) be the minimum possible depth of a bonnet
system with root-edge (u, v), and let bdfree (G) = bd(G) be the minimum bonnet-
depth over all choices of root-edge. Since any umbrella is a bonnet, we have
bd(G) ud(G).
By denition the root bonnet U0 must contain all edges incident to the ends
u, v of the root-edge. If follows that no edge incident to u or v can be an anchor-
edge of U0 , else the hanging subgraph at it would contain further neighbours of
u (resp. v). We note this trivial but useful fact for future reference:
Observation 1 In a bonnet system with root-edge (u, v), no edge incident to u
or v is an anchor-edge of the root bonnet.

4 From Bonnet System to Drawing


In this section, we show that any outerplanar graph G has a at visibility rep-
resentation of height at most 2ud(G) + 1. We actually show a slightly stronger
bound, namely a height of 2bd(G) + 1 2ud(G) + 1. So x a bonnet system of
G of depth bd(G) with root-edge (u, v). For merging purposes, we want to draw
(u, v) in a special way: It spans the top layer, which means that u touches the
top left corner of the drawing, and v touches the top right corner, or vice versa
(see for example Figure 3(d)). We rst explain how to draw the root bonnet U0 .

Lemma 1. Let U0 be the root bonnet of a bonnet system with root-edge (u, v).
Then there exists a at visibility representation of U0 on three layers such that
1. (u, v) spans the top layer of .
2. Any anchor-edge of U0 is drawn horizontally in the middle or bottom layer.

Proof. As a rst step, we draw the ribbon P of U0 on 2 layers in such a way


that (u, v) and all anchor-edges are drawn horizontally; see Figure 3(a) for an
illustration. (This part is identical to [5].) To do this, consider the standard
embedding of P in which the dual tree is a path, say it consists of faces f1 , . . . , fk .
We draw k + 1 vertical edges between two layers, with the goal that the region
between two consecutive ones belong to f1 , . . . , fk in this order. Place u and
v as segments in the top layer, and with an x-range such that they touch all
150 T. Biedl and P. Demontigny

the regions of faces that u and v are incident to. Similarly create segments for
all other vertices. The placement for the vertices is uniquely determined by the
standard planar embedding, except for the vertices incident to f1 and fk . We
place those vertices such that the leftmost/rightmost vertical edge is not an
anchor-edge. To see that this is possible, recall that P connects two non-cutting
edges e1 , e2 of G that are incident to f1 and fk . If e1
= (u, v), then choose the
layer for the vertices of f1 such that e1 is drawn vertically. If e1 = (u, v), then one
of its ends (say u) is the degree-2 vertex on f1 and drawn in the top-left corner.
The other edge e incident to u is not an anchor-edge of U by Observation 1, and
we draw e vertically. So the leftmost vertical edge is either a non-cutting edge
(hence not an anchor-edge) or edge e (which is not an anchor-edge). We proceed
similarly at fk so that the rightmost vertical edge is not an anchor-edge. Finally
all other vertical edges are cutting edges of U0 and hence not anchor-edges.
The drawing of P obtained in this rst step has (u, v) in the top layer. As a
second step, we now release (u, v) as in [5]. This operation adds a layer above
the drawing, moves (u, v) into it, and re-routes edges at u and v by expanding
vertical ones and turning horizontal ones into vertical ones. In the result, (u, v)
spans the top layer. See Figure 3(b) for an illustration and [5] for details.

u v

fan at v
br
u v br fan at u
rest of P
e f1 f2 f3 f4 rest of P e2
a
a
(c) Adding the fans. The resulting drawing is not in
(a) Drawing the ribbon. the standard embedding.
u v

x y

u v Sa,b

new layers
br
rest of P Sx,y

a a b

(b) Releasing (u, v). (d) Merging hanging subgraphs.

Figure 3: From bonnet system to drawing.

As the third and nal step, we add the fans. Consider the fan at v, and let
(v, br ) be the edge that it has in common with the ribbon P . Assume rst that
(v, br ) was drawn horizontally after the rst step, see Figure 3(a). After releasing
(u, v) therefore no edge at br attaches on its left, see Figure 3(b). Into this space
A 2-Approximation for the Height of Maximal Outerplanar Graph Drawings 151

we insert, after adding columns, the remaining vertices of the fan at v, in order
in which they appear around v in the standard embedding. See Figure 3(c)).
Else, (v, br ) was drawn vertically after the rst step. (Figure 3(c) does not
illustrate this case for v, but illustrates the corresponding case for u.) Since the
drawing of the rst step is in the standard embedding, and (v, br ) is on the
outerface of the ribbon, therefore (v, br ) must be the rightmost vertical edge.
We can then simply place the vertices of the fan to the right of br and extend v.
The fan at u is placed in a symmetric fashion. It remains to show that all
anchor-edges are horizontal and in the bottom two layers. We ensured that this
is the case in the rst step. Releasing (u, v) adds more vertical edges, but all of
them are incident to u or v and not anchor-edges by Observation 1. Likewise,
all vertical edges added when inserting the fans are incident to u or v. The only
horizontal edge in the top layer is (u, v), which is not an anchor-edge.

Now we explain how to merge hanging subgraphs.

Theorem 1. Any maximal outerplanar graph G has a planar at visibility rep-


resentation of height at most 2bdfree (G) + 1.

Proof. We show by induction that any graph with a bonnet system U of depth
H has a drawing of height 2H + 1 where the root-edge (u, v) spans the top
layer. This proves the theorem when using a bonnet system U of depth bdfree (G).
Let U0 be the root bonnet of the bonnet system, and draw U0 on 3 layers
using Lemma 1. Thus (u, v) spans the top and any anchor-edge (a, b) of U0
is drawn as a horizontal edge in the bottom two layers of 0 . If H = 1 then
there are no hanging subgraphs and we are done. Else add 2H 2 layers to 0
between the middle and bottom layers. For each anchor-edge (a, b) of U0 , the
hanging subgraph Sa,b of U0 has a bonnet system of depth at most H 1 with
root-edge (a, b). By induction Sa,b has a drawing 1 on at most 2H 1 layers
with (a, b) spanning the top layer.
If (a, b) is in the bottom layer of 0 , then we can rotate (and reect, if
necessary) 1 so that (a, b) is in the bottom layer of 1 and the left-to-right
order of a and b in 1 is the same as their left-to-right order in 0 . This updated
drawing of 1 can then be inserted in the space between (a, b) in 0 . This ts
because 1 has height at most 2H 1, and in the insertion process we can re-use
the layer spanned by (a, b). If (a, b) is in the middle layer of U0 , then we can
reect 1 (if necessary) so that (a, b) has the same left-to-right order in 1 as in
0 . This updated drawing of 1 can then be inserted in the space between (a, b)
in 0 . See Figure 3(d). Since we added 2H 2 layers to a drawing of height 3,
the total height of the nal drawing is 2H + 1 as desired.

Our proof is algorithmic, and nds a drawing, given a bonnet system, in


linear time. One can also show (see [10]) that the rooted bonnet depth, and an
associated bonnet system, can be found in linear time using dynamic program-
ming in the dual tree. The free bonnet depth can be found in quadratic time by
trying all root-edges, but one can argue [10] that this will save at most one unit
of depth and hence barely seems worth the extra run-time.
152 T. Biedl and P. Demontigny

Comparison to [5]: The algorithm in [5] has only two small dierences. The
main one is that it does not do the third step when drawing the root bonnet,
thus it draws the ribbon but not the fans. Thus in the induction step our algo-
rithm always draws at least as much as the one in [5]. Secondly, [5] uses a special
construction if pw(G) = 1 to save a constant number of levels. This could easily
be done for our algorithm as well in the case where pw(G) = 1 but bd(G) = 2.
As such, our construction never has worse height (and frequently it is better).
Comparison to [3]: One can argue that bd(G) log(n + 1) (see [10]). Since
[3] uses 3 log n 1 levels while ours uses 2bd(G) + 1 2 log(n + 1) + 1 levels, the
upper bound on the height is better for n 9.

5 From Drawing to Umbrella System


The previous section argued that given an umbrella system (or even more gen-
erally, a bonnet system) of depth H, we can nd a drawing of height at most
2H 1. To show that this is within a factor of 2 of the optimum, we show in this
section that any drawing of height H gives rise to an umbrella system of depth
at most H 1. (Any umbrella system is also a bonnet system, so it also has a
bonnet system of depth at most H 1.)
We rst briey sketch the idea. We assume that we have a at visibility
representation, and further, for some non-cutting edge (u, v) we have an escape
path, i.e., a poly-line to the outerface that does not intersect the drawing. Now
nd an outerplanar path that connects the leftmost vertical edge (x, y) of the
drawing with (u, v). This becomes the handle of an umbrella U with cap (u, v).
One can now argue that any hanging subgraph of U is drawn with height at
most H 1, and furthermore, has an escape path from its anchor-edge. The
claim then holds by induction.
We rst clarify some denitions illustrated in Figure 4(a). Let be a at
visibility representation, and let B be a minimum-height bounding box of .
A vertex w G has a right escape path in if there exists a polyline inside B
from w to a point on the right side of B that is vertex-disjoint from except
at w, and for which all bends are on layers. We say that (r1 , r2 ) is a right-free
edge of if it is vertical, and any layer intersected by (r1 , r2 ) is empty, except
for vertices r1 , r2 , to the right of the edge. In particular, for both r1 and r2 the
rightward ray on its layer is an escape path. Dene left escape paths and left-free
edges symmetrically; an escape path is a left escape path or a right escape path.
Observe that in any at visibility representation any leftmost vertical edge
(v, w) is left-free. (Such vertical edges exist, presuming the graph has minimum
degree 2, since the leftmost vertex in each layer has at most one incident hori-
zontal edge.) For in any layer spanned by (v, w), no vertical edge is farther left
by choice of (v, w), and no vertex can be farther left, else the incident vertical
edge of the leftmost of them would be farther left. So (v, w) is left-free.
For the proof of the lower bound, we use as handle an outerplanar path
connecting to a left-free edge. Recall that the denition of handle requires that
it connects to a non-cutting edge, so we need a left-free edge that is not a cutting
A 2-Approximation for the Height of Maximal Outerplanar Graph Drawings 153

B = B A
1 1 1

w r1  1 w r1

 2

2 r2 2 2 r2

(a) (b)

Figure 4: w has a right escape path, (1 , 2 ) is left-free and (r1 , r2 ) is right-free.
After ipping the cutting component at (1 , 2 ), the non-cutting edge (1 , 2 )
becomes left-free.

edge. This does not exist in all drawings (see e.g. Figure 4(a)), but as we show
now, we can modify the drawing without increasing the height such that such an
edge exists. To be able to apply it later, we must also show that this modication
does not destroy a given escape path.
Lemma 2. Let be a at visibility representation of a maximal outerplanar
graph G.
1. Let (r1 , r2 ) be a right-free edge of , and let w be a vertex that has a right
escape path. Then there exists a drawing  in which w has a right escape
path, (r1 , r2 ) is a right-free edge, and there exists a left-free edge that is not
a cutting edge of G.
2. Let (1 , 2 ) be a left-free edge of , and let w be a vertex that has a left
escape path. Then there exists a drawing  in which w has a left escape
path, (1 , 2 ) is a left-free edge, and there exists a right-free edge that is not
a cutting edge of G.
In either case, the y-coordinates of all vertices in are unchanged in  , and
in particular both drawings have the same height.
Proof. We prove the claim by induction on n and show only the rst claim (the
other is symmetric). Let (1 , 2 ) be the leftmost vertical edge of ; this is left-free
as argued above. If (1 , 2 ) is not a cutting edge of G, then we are done with
 = . This holds in particular if n = 3 because then G has no cutting edge.
So assume n 4 and (1 , 2 ) is a cutting edge of G. Let A and B be the cut-
components of (1 , 2 ), named such that w A. Let A [resp. B ] be the drawing
of A [B] induced by . Edge (1 , 2 ) is left-free for both A and B . Reect B
horizontally (this makes (1 , 2 ) right-free) to obtain B . By induction, we can
create a drawing B from B in which (1 , 2 ) is right-free and there is a left-free
edge (1 , 2 ) that is not a cutting edge of B. We have (1 , 2 )
= (1 , 2 ), because
the common neighbour of 1 , 2 in B forces a vertex or edge to reside to the left
of the right-free edge (1 , 2 ). So (1 , 2 ) is not a cutting edge of G either.
As in Figure 4(b), create a new drawing that places B to the left of A and
extends 1 and 2 to join the two copies; this is possible since (1 , 2 ) has the
154 T. Biedl and P. Demontigny

same y-coordinates in A , , B and B , and it is left-free in A and right-free


in B . Also delete one copy of (1 , 2 ). The drawing A is unchanged, so w will
have the same right escape path in  as in , and  will have right-free edge
(r1 , r2 ) and left-free non-cutting edge (1 , 2 ), as desired.

We are now ready to prove the lower bound if there is an escape path.

Lemma 3. Let be a at visibility representation of a maximal outerplanar


graph G with height H, and let (u, v) be a non-cutting edge of G. If there exists
an escape path from u or v in , then G has an umbrella system with root-edge
(u, v) and depth at most H 1.

Proof. We proceed by induction on H. Assume without loss of generality that


there exists a right escape path from v (all other cases are symmetric). Using
Lemma 2, we can modify without increasing the height so that v has a right
escape path, and there is a left-free edge (1 , 2 ) in that is a not a cutting edge
of G. Let P be the outerplanar path that connects edge (1 , 2 ) and (u, v). Let
U0 be the union of P , the neighbors of u, and the neighbors of v; we use U0 as
the root umbrella of an umbrella system.
We now must argue that all hanging subgraphs of U0 are drawn with height
at most H 1 and have escape paths from their anchor-edges; we can then nd
umbrella systems for them by induction and combining them with U0 gives the
umbrella system for G as desired. To prove the height-bound, dene dividing
paths as follows. The outerface of U0 in the standard embedding contains (1 , 2 )
(since it is not a cutting edge) as well as v. Let P1 and P2 be the two paths from
1 and 2 to v along this outerface in the standard embedding. Dene the dividing
path i (for i = 1, 2) to be the poly-line in that consists of the leftward ray
from i , the drawing of the path Pi (i.e., the vertical segments of its edges and
parts of the horizontal segments of its vertices), and the right escape path from
v. See Figure 5.

u v
u
P1
Sa,b
b 1
Sa,b v

a P2 1
a
b 2
1

2 2

Figure 5: Extracting dividing paths from a at visibility representation. P1 /1


is dotted while P2 /2 is dashed.

Now consider any hanging subgraph Sa,b of U0 with anchor-edge (a, b). No
edge incident to v is an anchor-edge, and neither is (1 , 2 ), since it is not a
cutting edge. So (a, b) is an edge of P1 or P2 (say P1 ) that is not incident to v.
A 2-Approximation for the Height of Maximal Outerplanar Graph Drawings 155

Therefore (a, b) (and with it Sa,b ) is vertex-disjoint from P2 . It follows that the
drawing S of Sa,b induced by is disjoint from the dividing path 2 . Since
2 connects a point on the left boundary with a point on the right boundary,
therefore S must be entirely above or entirely below 2 , say it is above. Since
2 has all bends at points with integral y-coordinate, therefore the bottom layer
of is not available for S , and S has height at most H 1 as desired.
Recall that (a, b) belongs to P1 and is not incident to v. After possible re-
naming of a and b, we may assume that b is closer to 1 along P1 than a. Then
the sub-path of P1 from b to 1 is interior-disjoint from Sa,b . The part of 1
corresponding to this path is a left escape path from b that resides within the
top H 1 layers, because it does not contain v and hence is disjoint from 2 .
We can hence apply induction to Sa,b to obtain an umbrella system of depth at
most H 2 with root-edge (a, b). Repeating this for all hanging subgraphs, and
combining the resulting umbrella systems with U0 , gives the result.

Theorem 2. Let G be a maximal outerplanar graph. If G has a at visibility
representation of height H, then udfree (G) H 1.
Proof. Using Lemma 2, we can convert into a drawing  of the same height in
which some edge (u, v) is a right-free non-cutting edge. This implies that there is
a right escape path from v, and by Lemma 3 we can nd an umbrella system of
G with root-edge (u, v) and depth H 1. So udfree (G) ud(G; u, v ) H 1.

6 Conclusions and Future Work


We presented an algorithm for drawing maximal outerplanar graphs that is a
2-approximation for the optimal height. To this end, we introduced the umbrella
depth as a new graph parameter for maximal outerplanar graphs, and used as
key result that any drawing of height H implies an umbrella-depth of at least
H 1. Our result improves the previous best result, which was based on the
pathwidth and gave a 4-approximation. We close with some open problems:
Our result only holds for maximal outerplanar graphs. Can the algorithm be
modied so that it becomes a 2-approximation for all outerplanar graphs?
Clearly one could apply the algorithm after adding edges to make the graph
maximal, but which edges should be added to keep the umbrella depth small?
The algorithm from Section 4 creates a drawing that does not place all
vertices on the outerface. Can we create an algorithm that approximates the
optimal height in the standard planar embedding?
What is the width achieved by the algorithm from Section 4 if we enforce
integral x-coordinates? Any visibility representation can be modied without
changing the height so that the width is at most m+n, where m is the number
of edges and n is the number of vertices [6]. Thus the width is O(n), but
what is the constant?
Finally, can we determine the optimal height for maximal outerplanar graphs in
polynomial time? This question is of interest both if (as in our algorithm) the
embedding can be changed, or if the drawing must be in the standard embedding.
156 T. Biedl and P. Demontigny

References
1. Md. J. Alam, Md. A.H. Samee, M. Rabbi, , and Md. S. Rahman. Minimum-layer
upward drawings of trees. J. Graph Algorithms Appl., 14(2):245267, 2010.
2. J. Batzill and T. Biedl. Order-preserving drawings of trees with approximately
optimal height (and small width), 2016. CoRR 1606.02233 [cs.CG]. In submission.
3. T. Biedl. Drawing outer-planar graphs in O(n log n) area. In S. Kobourov and
M. Goodrich, editors, Graph Drawing (GD01), volume 2528 of LNCS, pages 54
65. Springer-Verlag, 2002. Full version included in [4].
4. T. Biedl. Small drawings of outerplanar graphs, series-parallel graphs, and other
planar graphs. Discrete and Computational Geometry, 45(1):141160, 2011.
5. T. Biedl. A 4-approximation algorithm for the height of drawing 2-connected out-
erplanar graphs. In T. Erlebach and G. Persiano, editors, Workshop on Approxi-
mation and Online Algorithms (WAOA12), volume 7846 of LNCS, pages 272285.
Springer-Verlag, 2013.
6. T. Biedl. Height-preserving transformations of planar graph drawings. In C. Dun-
can and A. Symvonis, editors, Graph Drawing (GD14), volume 8871 of LNCS,
pages 380391. Springer, 2014.
7. T. Biedl. On area-optimal planar grid-drawings. In J. Esparza, P. Fraigniaud,
T. Husfeldt, and E. Koutsoupias, editors, International Colloquium on Automata,
Languages and Programming (ICALP 14), volume 8572 of LNCS, pages 198210.
Springer-Verlag, 2014.
8. T. Biedl. Ideal tree-drawings of approximately optimal width (and small height).
Journal of Graph Algorithms and Applications, 21(4):631648, 2017.
9. H. de Fraysseix, J. Pach, , and R. Pollack. How to draw a planar graph on a grid.
Combinatorica, 10:4151, 1990.
10. P. Demontigny. A 2-approximation for the height of maximal outerplanar graphs.
Masters thesis, University of Waterloo, 2016. See also CoRR report 1702.01719.
11. G. Di Battista and F. Frati. Small area drawings of outerplanar graphs. Algorith-
mica, 54(1):2553, 2009.
12. V. Dujmovic, M. Fellows, M. Kitching, G. Liotta, C. McCartin, N. Nishimura,
P. Ragde, F. Rosamond, S. Whitesides, , and D. Wood. On the parameterized
complexity of layered graph drawing. Algorithmica, 52:267292, 2008.
13. S. Felsner, G. Liotta, , and S. Wismath. Straight-line drawings on restricted integer
grids in two and three dimensions. J. Graph Alg. Appl, 7(4):335362, 2003.
14. F. Frati. Straight-line drawings of outerplanar graphs in O(dn log n) area. Comput.
Geom., 45(9):524533, 2012.
15. A. Garg and A. Rusu. Area-ecient planar straight-line drawings of outerplanar
graphs. Discrete Applied Mathematics, 155(9):11161140, 2007.
16. L.S. Heath and A.L. Rosenberg. Laying out graphs using queues. SIAM Journal
on Computing, 21(5):927958, 1992.
17. M. Krug and D. Wagner. Minimizing the area for planar straight-line grid drawings.
In S. Hong, T. Nishizeki, and W. Quan, editors, Graph Drawing (GD07), volume
4875 of LNCS, pages 207212. Springer-Verlag, 2007.
18. D. Mondal, Md. J. Alam, , and Md. S. Rahman. Minimum-layer drawings of trees.
In N. Katoh and A. Kumar, editors, Algorithms and Computations (WALCOM
2011), volume 6552 of LNCS, pages 221232. Springer, 2011.
19. W. Schnyder. Embedding planar graphs on the grid. In ACM-SIAM Symposium
on Discrete Algorithms (SODA 90), pages 138148, 1990.
20. M. Suderman. Pathwidth and layered drawings of trees. Intl. J. Comp. Geom.
Appl, 14(3):203225, 2004.
Splitting B2 -VPG Graphs into Outer-string and
Co-comparability Graphs

Therese Biedl and Martin Derka

David R. Cheriton School of Computer Science,


University of Waterloo, Waterloo, ON, N2L 3G1, Canada
{biedl,mderka}@uwaterloo.ca

Abstract. A B2 -VPG representation of a graph is an intersection rep-


resentation that consists of orthogonal curves with at most 2 bends. In
this paper, we show that the curves of such a representation can be
partitioned into O(log n) groups that represent outer-string graphs or
O(log3 n) groups that represent permutation graphs. This leads to bet-
ter approximation algorithms for hereditary graph problems, such as
independent set, clique and clique cover, on B2 -VPG graphs.

1 Introduction

An intersection representation of a graph is a way of portraying a graph using


geometric objects. In such a representation, every object corresponds to a vertex
in the graph, and there is an edge between vertices u and v if and only if their two
objects u and v intersect. One example are the string graphs, where the objects
are (open) curves in the plane with no intersections that are overlaps or touch
points. An outer-string representation is one where all the curves are inside a
polygon P and touch the boundary of P at least once. A string representation
is called a 1-string representation if any two strings intersect at most once. It is
called a Bk -VPG-representation1 (for some k 0) if every curve is an orthogonal
curve with at most k bends. We naturally use the term outer-string graph for
graphs that have an outer-string representation, and similarly for other types of
intersecting objects.
Our contribution: This paper is concerned with partitioning string graphs (and
other classes of intersection graphs) into subgraphs that have nice properties,
such as being outer-string graphs or permutation graphs (dened formally be-
low). We can then use such a partition to obtain approximation algorithms for
some graph problems, such as weighted independent set, clique, clique cover and
colouring. More specically, partitioning in this paper usually means a vertex
partition, i.e., we split the vertices of the graph as V = V1 Vk such that
the subgraph induced by each Vi has nice properties. In one case we also do

T.B. was supported by NSERC; M.D. was supported by Vanier CGS.
1
Vertex intersection graphs of k-bend Paths in a Grid; see [8] and the references
therein.

Springer International Publishing AG 2017 157


F. Ellen et al. (Eds.): WADS 2017, LNCS 10389, pp. 157168, 2017.
DOI: 10.1007/978-3-319-62127-2_14
158 T. Biedl and M. Derka

an edge-partition where we partition E = E1 E2 and then work on the two


subgraphs Gi = (V, Ei ), for i = 1, 2.
Our paper was inspired by a paper by Lahiri et al. [8] in 2014. They gave
an algorithm to approximate the maximum (unweighted) independent set in a
B1 -VPG graph within a factor of 4 log2 n (log in this paper denotes log2 ). We
greatly expand on their approach as follows. First, rather than solving maxi-
mum independent set directly, we instead split such a graph into subgraphs.
This allows us to approximate not just independent set, but more generally any
hereditary graph problem that is solvable in such graphs.
Secondly, rather than using co-comparability graphs for splitting as Lahiri
et al. did, we use outer-string graphs. This allows us to stop the splitting ear-
lier, reducing the approximation factor from 4 log2 n to 2 log n, and to give an
algorithm for weighted independent set (wIS).
Finally, we allow much more general shapes. For splitting into outer-string
graphs, we can allow any shape that can be described as the union of one vertical
and any number of horizontal segments (we call such intersection graphs single-
vertical). Our results imply a 2 log n-approximation algorithm for wIS in such
graphs, which include B1 -VPG graphs, and a 4 log n-approximation for wIS in
B2 -VPG graphs.
In the second part of the paper, we consider splitting the graph such that the
resulting subgraphs are co-comparability graphs. This type of problem was rst
considered by Keil and Stewart [7], who showed that so-called subtree lament
graphs can be vertex-partitioned into O(log n) co-comparability graphs. The
work of Lahiri et al. [8] can be seen as proving that every B1 -VPG graph can be
vertex-partitioned into O(log2 n) co-comparability graphs. We focus here on the
bigger class of B2 -VPG-graphs, and show that they can be vertex-partitioned
into O(log3 n) co-comparability graphs. Moreover, these co-comparability graphs
have poset dimension 3, and if the B2 -VPG representation was 1-string, then
they are permutation graphs. This leads to better approximation algorithms for
clique, colouring and clique cover for B2 -VPG graphs.

2 Decomposing into outer-string graphs

We argue in this section how to split a graph into outer-string graphs if it


has an intersection representation of a special form. A single-vertical object is a
connected set S R2 of the form S = s0 s1 sk , where s0 is a vertical
segment and s1 , . . . , sk are horizontal segments, for some nite k. Given a number
of single-vertical objects S1 , . . . , Sn , we dene the intersection graph of it in
the usual way, by dening one vertex per object and adding an edge whenever
objects have at least one point in common (contacts are considered intersections).
We call such a representation a single-vertical representation and the graph a
single-vertical intersection graph. The x-coordinate of one single-vertical object
is dened to be the x-coordinate of the (unique) vertical segment. We consider
a horizontal segment to be a single-vertical object as well, by attaching a zero-
length vertical segment at one of its endpoints.
Splitting B2-VPG Graphs into Outer-string and Co-comparability Graphs 159

Theorem 1. Let G be a single-vertical intersection graph. Then the vertices of


G can be partitioned into at most max{1, 2 log n} sets such that the subgraph
induced by each is an outer-string graph.2
Our proof of Theorem 1 uses a splitting technique implicit in the recursive
approximation algorithm of Lahiri et al. [8]. Let R be a single-vertical represen-
tation on G and S be an ordered list of the x-coordinates of all the objects in R.
We dene the median m of R to be a value such that at most |S| 2 x-coordinates
|S|
in S are smaller than m and at most 2 x-coordinates in S are bigger than m.
(m may or may not be the x-coordinate of at least one object.) Now split R into
three sets: The middle set M of objects that intersect the vertical line m with
x-coordinate m; the left set L of objects whose x-coordinates are smaller than m
and that do not belong to M , and the right set R of objects whose x-coordinates
are bigger than m and that do not belong to M . Split M further into ML = {
c | the x-coordinate of c is less than m} and MR = M \ ML .

L ML MR R

Fig. 1: The split of a representation into L, M = ML MR and R.

Lemma 2. The subgraph induced by the objects in ML is outer-string.


Proof. All the objects in ML intersect curve m. Since all the x-coordinates of
those objects are smaller than m, all the intersections of the objects occur left
of m. If an object is not a curve, one can replace it by a closed curve that traces
around the part of the object that is left of m and that intersects the same
set of objects (possibly repeatedly). Doing so for every object, one obtains a
representation that induces the same graph as ML and where all curves are in
the left half-space of m and intersect m, hence an outer-string representation.


2
This bound is not tight; a more careful analysis shows that we get at most
max{1, 2log n 2} graphs.
160 T. Biedl and M. Derka

A similar proof shows that the graph induced by objects in MR is an outer-


string graph. Now we can prove our main result:

Proof (of Theorem 1). Let G be a graph with a single-vertical representation.


We proceed by induction on the number of vertices n in G. If n 2, then the
graph is outer-string and we are done, so assume n 3, which implies that
log n 32 . By Lemma 2, both ML and MR individually induce an outer-string
graph. Applying induction, we get at most

max{1, 2 log |L|} max{1, 2 log(n/2)} = max{1, 2 log n 2} = 2 log n 2

outer-string subgraphs for L, and similarly at most 2 log n 2 outer-string sub-


graphs for R. Since the objects in L and R are separated by the vertical line
m, there are no edges between the corresponding vertices. Thus any outer-string
subgraph dened by L can be combined with any outer-string subgraph dened
by R to give one outer-string graph. We hence obtain 2 log n 2 outer-string
graphs from recursing into L and R. Adding to this the two outer-string graphs
dened by ML and MR gives the result.

Our proof is constructive, and nds the partition within O(log n) recursions.
In each recursion we must nd the median m and then determine which objects
intersect the line m. If we presort three lists of the objects (once by x-coordinate
of the vertical segment, once by leftmost x-coordinate, and once by rightmost
x-coordinate), and pass these lists along as parameters, then each recursion
can be done in O(n) time, without linear-time median-nding. The presorting
takes O(N + n log n) time, where N is the total number of segments in the
representation. Hence the run-time to nd the partition is O(N + n log n).
The above results were for single-vertical graphs. However, the main focus of
this paper is Bk -VPG-graphs, for k 2. Clearly B1 -VPG graphs are single-
vertical by denition. It is not obvious whether B2 -VPG graphs are single-
vertical graphs or not. Note that a B2 -VPG representation may not be a single-
vertical representationit may consist of both curves with two horizontal seg-
ments and curves with two vertical segments (so no rotation of the representation
can give a single-vertical representation). However, we can still handle them by
doubling the number of graphs into which we split.

Lemma 3. Let G be a B2 -VPG graph. Then the vertices of G can be partitioned


into 2 sets such that the subgraph induced by each is a single-vertical B2 -VPG
graph.

Proof. Fix a B2 -VPG-representation of G. Let Vv be the vertices that have at


most one vertical segment in their curve, and Vh be the remaining vertices. Since
every curve has at most three segments, and all curves in Vh have at least two
vertical segments, each of them has at most one horizontal segment. Clearly Vv
induces a single-vertical B2 -VPG graph, and after rotating all curves by 90 Vh
also induces a single-vertical B2 -VPG graph.

Combining this with Theorem 1, we immediately obtain:


Splitting B2-VPG Graphs into Outer-string and Co-comparability Graphs 161

Corollary 4. Let G be a B2 -VPG graph. Then the vertices of G can be parti-


tioned into at most max{1, 4 log n}sets such that the subgraph induced by each is
an outer-string graph.

3 Decomposing into co-comparability graphs

We now show that by doing further splits, we can actually decompose B2 -VPG
graphs into so-called co-comparability graphs of poset dimension 3 (dened for-
mally below). While we require more subgraphs for such a split, the advantage is
that numerous problems are polynomial for such co-comparability graphs, while
for outer-string we know of no problem other than weighted independent set
that is poly-time solvable.
We rst give an outline of the approach. Given a B2 -VPG-graph, we rst
use Lemma 3 to split it into two single-vertical B2 -VPG-graphs. Given a single-
vertical B2 -VPG-graph, we next use a technique much like the one of Theorem 1
to split it into log n single-vertical B2 -VPG-graphs that are centered in some
sense. Any such graph can easily be edge-partitioned into two B1 -VPG-graphs
that are grounded in some sense. We then apply the technique of Theorem 1
again (but in the other direction) to split a grounded B1 -VPG-graph into log n
B1 -VPG-graphs that are cornered in some sense. The latter graphs can be
shown to be permutation graphs. This gives the result after arguing that the
edge-partition can be un-done at the cost of combining permutation graphs into
co-comparability graphs.
We assume for this section that the B2 -VPG representation is in general
position in the sense that no two horizontal or vertical segments overlap each
other. Since curves do not overlap or touch, this is not a restriction for B2 -VPG
representations.

3.1 Co-comparability graphs

We start by dening the graph classes that we use in this section only. A graph
G with vertices {1, . . . , n} is called a permutation graph if there exist two permu-
tations 1 , 2 of {1, . . . , n} such that (i, j) is an edge of G if and only if 1 lists
i, j in the opposite order as 2 does. Put dierently, if we place 1 (1), . . . , 1 (n)
at points along a horizontal line, and 2 (1), . . . , 2 (n) at points along a parallel
horizontal line, and use the line segment (1 (i), 2 (i)) to represent vertex i, then
the graph is the intersection graph of these segments.
A co-comparability graph G is a graph whose complement can be directed
in an acyclic transitive fashion. Rather than dening these terms, we describe
here only the restricted type of co-comparability graphs that we are interested
in. A graph G with vertices {1, . . . , n} is called a co-comparability graph of poset
dimension k if there exist k permutations 1 , . . . , k such that (i, j) is an edge if
and only if there are two permutations that list i and j in opposite order. (See
Golumbic et al. [5] for more on these characterizations.) Note that a permutation
graph is a co-comparability graph of poset dimension 2.
162 T. Biedl and M. Derka

(a) (b) (c) 3 (d)

Fig. 2: (a) A graph that has simultaneously (b) a permutation representation;


(c) a co-comparability representation of poset dimension 3; and (d) a cornered
B1 -VPG graph.

3.2 Cornered B1 -VPG graphs


A B1 -VPG-representation is called cornered if there exists a horizontal and a
vertical ray emanating from the same point such that any curve of the repre-
sentation intersects both rays outside their common end. See Fig. 2(d) for an
example.

Lemma 5. If G has a cornered B1 -VPG-representation, say with respect to rays


r1 and r2 , then G is a permutation graph. Further, the two permutations dening
G are exactly the two orders in which vertex-curves intersect r1 and r2 .

Proof. Since the curves have only one bend, the intersections with r1 and r2
determine the curve of each vertex. In particular, two curves intersect if and
only if the two orders along r1 and r2 are not the same, which is to say, if their
orders are dierent in the two permutations of the vertices dened by the orders
along the rays. Hence using these orders shows that G is a permutation graph.

3.3 From grounded to cornered


We call a B1 -VPG representation grounded if there exists a horizontal line
segment H that intersects all curves, and has all horizontal segments of all
curves above it. See also Fig. 3 and [1] for more properties of graphs that have
a grounded representation. We now show how to split a grounded B1 -VPG-
representation into cornered ones. It will be important later that not only can
we do such a split, but we know how the curves intersect H afterwards. More
precisely, the curves in the resulting representations may not be identical to
the ones we started with, but they are modied only in such a way that the
intersections points of curves along H is unchanged.

Lemma 6. Let R be a B1 -VPG-representation that is grounded with respect


to segment H . Then R can be partitioned into at most max{1, 2 log n} sets
R1 , . . . , RK such that each set Ri is cornered after upward translation and segment-
extension of some of its curves.

Proof. A single curve with one bend is always cornered, so the claim is easily
shown for n 4 where max{1, 2 log n} n. For n 5, it will be helpful to
Splitting B2-VPG Graphs into Outer-string and Co-comparability Graphs 163

split R rst into two sets, those curves of the form |h and those that form h| (no
other shapes can exist in a grounded B1 -VPG-representation). The result follows
if we show that each of them can be split into log n many cornered B1 -VPG-
representations.
So assume that R consists of only |hs. We apply essentially the same idea as
in Theorem 1. Let again m be the vertical line along the median of x-coordinates
of vertical segments of curves. Let M be all those curves that intersect m. Since
curves are |hs, any curve in M intersects H to the left of m, and intersects
m above H . Hence taking the two rays along H and m emanating from their
common point shows that M is cornered.

m
m

lh GL GR lh

Fig. 3: An illustration for the proof of Lemma 6. (left) Splitting a cornered B1 -


VPG graph. (right) Combining a graph GL (solid black) from L with a graph
GR (solid blue) from R so that the result is a cornered B1 -VPG graph.

We then recurse both in the subgraph L of vertices entirely left of m and the
subgraph R of vertices entirely right of m. Each of them is split recursively into
at most max{1, log(n/2)} = log n 1 subgraphs that are cornered. We must now
argue how to combine two such subgraphs GL and GR (of vertices from L and
R) such that they are cornered while modifying curves only in the permitted
way.
Translate curves of GL upward such that the lowest horizontal segment of
GL is above the highest horizontal segment of GR . Extend the vertical segments
of GL so that they again intersect H . Extend horizontal segments of both GL
and GR rightward until they all intersect one vertical line segment. The resulting
representation satises all conditions.
Since we obtain at most log n 1 such cornered representations from the
curves in R L, we can add M to it and the result follows.

Corollary 7. Let G be a graph with a grounded B1 -VPG representation. Then
the vertices of G can be partitioned into at most max{1, 2 log n} sets such that
the subgraph induced by each is a permutation graph.

3.4 From centered to grounded


We now switch to VPG-representations with 2 bends, but currently only allow
those with a single vertical segment per curve. So let R be a single-vertical B2 -
164 T. Biedl and M. Derka

VPG-representation. We call R centered if there exists a horizontal line segment


H that intersects the vertical segment of each curve. Given such a representa-
tion, we can cut each curve apart at the intersection point with H . Then the
parts above H form a grounded B1 -VPG-representation, and the parts below
form (after a 180 rotation) also a grounded B1 -VPG-representation. Note that
this split corresponds to splitting the edges into E = E1 E2 , depending on
whether the intersection for each edge occurs above or below H . If curves may
intersect repeatedly, then an edge may be in both sets. See Fig. 4 for an example.
With this, we can now split into co-comparability graphs.



Fig. 4: Splitting a centered single-vertical B2 -VPG-representation into two


grounded B1 -VPG-representations.

Lemma 8. Let G be a graph with a single-vertical centered B2 -VPG represen-


tation. Then the vertices of G can be partitioned into at most max{1, 4 log2 n}
sets such that the subgraph induced by each is a co-comparability graph of poset
dimension 3.

Proof. The claim clearly holds for n 4, so assume n 5. Let H be the


horizontal segment along which the representation is centered. Split the edges
into E1 and E2 as above, and let R1 and R2 be the resulting grounded B1 -
VPG-representations, which have the same order of vertical intersections along
H . Split R1 into K 2 log n sets of curves R11 , . . . , R1K , each of which forms a
cornered B1 -VPG-representation that uses the same order of intersections along

H . Similarly split R2 into K  2 log n sets R21 , . . . , R2K of cornered B1 -VPG-
representations.
Now dene Ri,j to consist of all those curves r where the part of r above H
belongs to R1i and the part below belongs to R2j . This gives K K  4 log2 n
sets of curves. Consider one such set Ri,j . The parts of curves in Ri,j that
were above H are cornered at H and some vertical upward ray, hence dene
Splitting B2-VPG Graphs into Outer-string and Co-comparability Graphs 165

a permutation 1 along the vertical ray and 2 along H . Similarly the parts
of curves below H dene two permutations, say 2 along H and 3 along
some vertical downward ray. But the split into cornered B1 -VPG-representation
ensured that the intersections along H did not changed, so 2 = 2 . The three
permutations 1 , 2 , 3 together hence dene a co-comparability graph of poset
dimension 3 as desired.

We can do slightly better if the representation is additionally 1-string.
Corollary 9. Let G be a graph with a single-vertical centered 1-string B2 -VPG
representation.Then the vertices of Gcan be partitioned into at most max{1, 4 log2 n}
sets such that the subgraph induced by each is a permutation graph.
Proof. The split is exactly the same as in Lemma 8. Consider one of the sub-
graphs Gi and the permutations 1 , 2 , 3 that came with it, where 2 is the
permutation of curves along the centering line H . We claim that Gi is a per-
mutation graph, using 1 , 3 as the two permutations. Clearly if (u, v) is not an
edge of Gi , then all of 1 , 2 , 3 list u and v in the same order. If (u, v) is an
edge of Gi , then two of 1 , 2 , 3 list u, v in opposite order. We claim that 1
and 3 list u, v in opposite order. For if not, say u comes before v in both 1 and
3 , then (to represent edge (u, v)) we must have u after v in 2 . But then the
curves of u and v intersect both above and below H , contradicting that we have
a 1-string representation. So the two permutations 1 , 3 dene graph Gi .

3.5 Making single-vertical B2 -VPG-representations centered


Lemma 10. Let G be a graph with a single-vertical B2 -VPG representation.
Then the vertices of G can be partitioned into at most max{1, log n} sets such that
the subgraph induced by each has a single-vertical centered B2 -VPG-representation.
Proof. The approach is quite similar to the one in Theorem 1, but uses a hor-
izontal split and a dierent median. The claim is easy to show for n 3, so
assume n 4. Recall that there are n vertical segments, hence 2n endpoints of
such segments. Let m be a value such that at most n of these endpoints each
are below and above m, and let m be the horizontal line with y-coordinate m.
Let M be the curves that are intersected by m; clearly they form a single-
vertical centered B2 -VPG-representation. Let B be all those curves whose ver-
tical segment (and hence the entire curve) is completely below m. Each such
curve contributes two endpoints of vertical segments, hence |B| n/2 by choice
of m. Recursively split B into at most max{1, log(n/2)} = log n 1 sets, and
likewise split the curves U above m into at most log n 1 sets.
Each chosen subset GB of B is centered, as is each chosen subset GU of
U . Since GB uses curves below m while GU uses curves above, there are no
crossings between these curves. We can hence translate the curves of GB such
they are centered with the same horizontal line as GU . Therefore GB GU has a
centered single-vertical B2 -VPG-representation. Repeating this for all of R U
gives log n 1 centered single-vertical B2 -VPG-graphs, to which we can add the
one dened by M .

166 T. Biedl and M. Derka

3.6 Putting it all together


We summarize with our main result about splits into co-comparability graphs:
Theorem 11. Let G be a B2 -VPG-graph. Then the vertices of G can be parti-
tioned into at most max{1, 8 log3 n} sets such that the subgraph induced by each
is co-comparability graph of poset dimension 3. If G is a 1-string B2 -VPG graph,
then the subgraphs are permutation graphs.
Proof. The claim is trivial for n 3 since then n 8 log3 n, so assume n 4.
Fix a B2 -VPG-representation R, and split it into two single-vertical B2 -VPG-
representations (Lemma 3). Split each of them into log n single-vertical centered
B2 -VPG-representations using Lemma 10, for a total of at most 2 log n sets of
curves. Split each of them into 4 log2 n co-comparability graphs (or permutation
graphs if the representation was 1-string) using Lemma 8 or Corollary 9.

We can do better for B1 -VPG-graphs. The subgraphs obtained in the result
below are the same ones that were used implicitly in the 4 log2 n-approximation
algorithm given by Lahiri et al.[8].
Theorem 12. Let G be a B1 -VPG-graph. Then the vertices of G can be parti-
tioned into at most max{1, 4 log2 n} sets such that the subgraph induced by each
is a permutation graph.
Proof. The claim is trivial if n = 1, so assume n > 1. Fix a B1 -VPG-representation
R, and split it into log n single-vertical centered B1 -VPG-representations using
Lemma 10. Split each of them into two centered B1 -VPG-representations, one
of those curves with the horizontal segment above the centering line, and one
with the rest. Each of the resulting 2 log n centered B1 -VPG-representations is
grounded (possibly after a 180 rotation) and can be split into 2 log n permuta-
tion graphs using Corollary 7, for a total of 4 log2 n permutation graphs.

4 Applications
We now show how Theorem 1 and 11 can be used for improved approximation
algorithms for B2 -VPG-graphs. The techniques used here are virtually the same
as the one by Keil and Stewart [7] and require two things. First, the problem
considered needs to be solvable on the special graphs class (such as outer-string
graph or co-comparability graph or permutation graph) that we use. Second,
the problem must be hereditary in the sense that a solution in a graph implies
a solution in an induced subgraph, and solutions in induced subgraphs can be
used to obtain a decent solution in the original graph.
We demonstrate this in detail using weighted independent set, which Keil
et al. showed to be polynomial-time solvable in outer-string graphs [6]. Recall
that this is the problem, given a graph with vertex-weights, of nding a subset
I of vertices
 that has no edges between them. The objective is to maximize
w(I) := vI w(v), where w(v) denotes the weight of vertex v. The run-time to
solve weighted independent set in outer-string graphs is O(N 3 ), where N is the
number of segments in the given outer-string representation.
Splitting B2-VPG Graphs into Outer-string and Co-comparability Graphs 167

Theorem 13. There exists a (2 log n)-approximation algorithm for weighted in-
dependent set on single-vertical graphs with run-time O(N 3 ), where N is the total
number of segments used among all single-vertical objects.
Proof. If n = 1, then the unique vertex is the maximum weight independent set.
Else, use Theorem 1 to partition the vertices of the given graph G into at most
2 log n sets, each of which induces an outer-string graph, and nd the largest
weighted independent set in each applying the algorithm of Keil et al. If Gi had
an outer-string representation with Ni segments in total, then this takes time
O( Ni3 ) time. Note that if a single-vertical object consisted of one vertical
and  horizontal segments, then we can trace around it with a curve with O()
segments. Hence all curves together have O(N ) segments and the total run-time
is O(N 3 ).
Let Ii be the maximum-weight independent set in Gi , and return as set I
the set in I1 , . . . , Ik that has the maximum weight. To argue the approximation-
factor, let I be the maximum-weight independent set of G, and dene Ii to
be all those elements of I that belong to Ri , for i = 1, . . . , k. Clearly Ii is an
independent set of Gi , and so w(Ii ) w(Ii ). But on the other hand maxi w(Ii )
w(I )/k since we split I into k sets. Therefore w(I) = maxi w(Ii ) w(I )/k,
and so w(I) is within a factor of k 2 log n of the optimum.

We note here that the best polynomial algorithm for independent set in
general string graphs achieves an approximation factor of O(n ), under the as-
sumption that any two strings cross each other at most a constant number of
times [3]. This algorithm only works for unweighted independent set; we are not
aware of any approximation results for weighted independent set in arbitrary
string graphs.
Because B2 -VPG-graphs can be vertex-split into two single-vertical B2 -VPG-
representations, and the total number of segments used is O(n), we also get:
Corollary 14. There exists a (4 log n)-approximation algorithm for weighted in-
dependent set on B2 -VPG-graphs with run-time O(n3 ).
Another hereditary problem is colouring: Find the minimum number k such
that we can assign numbers in {1, . . . , k} to vertices such that no two adjacent
vertices receive the same number. Fox and Pach [3] pointed out that if we have
a c-approximation algorithm for Independent Set, then we can use it to ob-
tain an O(c log n)-approximation algorithm for colouring. Therefore our result
also immediately implies an O(log2 n)-approximation algorithm for colouring in
single-vertical graphs and B2 -VPG-graphs.
Another hereditary problem is weighted clique: Find the maximum-weight
subset of vertices such that any two of them are adjacent. (This is indepen-
dent set in the complement graph.) Clique is NP-hard in outer-string graphs
even in its unweighted version [2]. For this reason, we use the split into co-
comparability graphs instead; weighted clique can be solved in quadratic time in
co-comparability graphs (because weighted independent set is linear-time solv-
able in comparability graphs [4]). Weighted clique is also linear-time solvable on
permutation graphs [4]. We therefore have:
168 T. Biedl and M. Derka

Theorem 15. There exists an (8 log3 n)-approximation algorithm for weighted


clique on B2 -VPG-graphs with run-time O(n2 ). The run-time becomes O(n) if
the graph is a 1-string B2 -VPG graph, and the approximation factor becomes
4 log2 n if the graph is a B1 -VPG-graph.
In a similar manner, we can get poly-time (8 log3 n)-approximation algo-
rithms for any hereditary problem that is solvable on co-comparability graphs.
This includes clique cover, maximum k-colourable subgraph, and maximum h-
coverable subgraph. See [7] for the denition of these problems, and the argument
that they are hereditary.

5 Conclusions
We presented a technique for decomposing single-vertical graphs into outer-string
subgraphs, B2 -VPG-graphs into co-comparability graphs, and 1-string B2 -VPG-
graphs into permutation graphs. We then used these results to obtain approxi-
mation algorithms for hereditary problems, such as weighted independent set.
As for open problems, we are very interested in approximation algorithms
for Bk -VPG graphs, where k is a constant. Also, if curves are not required to
be orthogonal, but have few bends, are there approximation algorithms better
than those for arbitrary string graphs?

References
1. Jean Cardinal, Stefan Felsner, Tillmann Miltzow, Casey Tompkins, and Birgit
Vogtenhuber. Intersection graphs of rays and grounded segments. Technical Report
1612.03638 [cs.DM], ArXiV, 2016.
2. Sergio Cabello, Jean Cardinal and Stefan Langerman. The Clique Problem in Ray
Intersection Graphs. Discrete & Computational Geometry 50(3), 771783, 2013.
3. Jacob Fox and Janos Pach. Computing the independence number of intersection
graphs. In Dana Randall, editor, Proceedings of the Twenty-Second Annual ACM-
SIAM Symposium on Discrete Algorithms, SODA 2011, San Francisco, California,
USA, January 23-25, 2011, pages 11611165. SIAM, 2011.
4. M. C. Golumbic. Algorithmic graph theory and perfect graphs. Academic Press, New
York, 1st edition, 1980.
5. Martin Charles Golumbic, Doron Rotem, and Jorge Urrutia. Comparability graphs
and intersection graphs. Discrete Mathematics, 43(1):3746, 1983.
6. J. Mark Keil, Joseph S. B. Mitchell, Dinabandhu Pradhan, and Martin Vatshelle. An
algorithm for the maximum weight independent set problem on outerstring graphs.
Comput. Geom., 60:1925, 2017.
7. J. Mark Keil and Lorna Stewart. Approximating the minimum clique cover and
other hard problems in subtree lament graphs. Discrete Applied Mathematics,
154(14):19831995, 2006.
8. Abhiruk Lahiri, Joydeep Mukherjee, and C. R. Subramanian. Maximum indepen-
dent set on B1 -VPG graphs. In Zaixin Lu, Donghyun Kim, Weili Wu, Wei Li,
and Ding-Zhu Du, editors, Combinatorial Optimization and Applications (COCOA
2015), volume 9486 of Lecture Notes in Computer Science, pages 633646. Springer,
2015.
A Deterministic Algorithm
for Online Steiner Tree Leasing

Marcin Bienkowski1 , Artur Kraska1 , and Pawel Schmidt1

Institute of Computer Science, University of Wroclaw, Poland

Abstract. We study the Online Steiner Tree Leasing (OSTL) problem,


dened in a weighted undirected graph with a distinguished root node r.
There is a known set L of available lease types, where each type  L
is characterized by its duration D and cost factor C . As an input,
an online algorithm is given a sequence of terminals and has to connect
them to the root r using leased edges. An edge of length d can be leased
using lease type  for cost C d and remains valid for time D .
The OSTL problem contains the online Steiner tree and the single-source
rent-or-buy problems as specic subcases. We present the rst determin-
istic online algorithm for OSTL, whose competitive ratio is O(|L| log k),
where k is the number of dierent terminals in the input. The currently
best randomized algorithm attains the ratio of O(log |L| log n), where
n k is the number of nodes in the graph.

Keywords: Steiner tree Leasing Competitive analysis Online al-


gorithms

1 Introduction

The traditional network design focuses on graph optimization problems, in which


an algorithm purchases bandwidth on links to maintain certain graph proper-
ties, such as connectivity or throughput. A standard feature of most considered
models is the permanence of bandwidth allocations. For example, in the Steiner
tree problem [23], the goal is to buy a subset of edges connecting a given set
of terminals to the chosen root node r. Even the online avor of this prob-
lem [4,5,16,18,22] has this feature: the terminals arrive in online manner, and
an algorithm irrevocably buys additional links, so that the terminals seen so far
are connected to the root r. In this setting, each purchase is everlasting, i.e., the
problem should be rather termed incremental Steiner tree.

Rent-or-Buy Variants. A well-studied modication of the online Steiner tree


scenario is to relax the need of upfront commitment and additionally allow an al-
gorithm to rent edges (at a fraction of the edge purchase price). Each terminal
must be connected to the root r using either type of edges, but rented edges are

Partially supported by the Polish National Science Centre grant
2016/22/E/ST6/00499.

Springer International Publishing AG 2017 169


F. Ellen et al. (Eds.): WADS 2017, LNCS 10389, pp. 169180, 2017.
DOI: 10.1007/978-3-319-62127-2_15
170 M. Bienkowski et al.

valid only for a single terminal and cannot be reused by subsequent ones. This
variant is called online single-source rent-or-buy [3,10,11,12,15,17,21] and is also
equivalent to the le replication problem.
Note that the rent-or-buy variant is still incremental: bought edges persist in
the graph till the end and if a request to connect a specic terminal appears
suciently many times in the input any reasonable algorithm nally buys
a path connecting this terminal to the root r.

Leasing Variants. Many markets give an option of temporary leasing of re-


sources. In particular, the advent of digital services in cloud computing changed
the business model from buying physical servers to leasing virtual ones. This al-
lowed companies to adapt quickly to varying requirements of their customers [7].
Furthermore, the software-dened networking enabled similar mechanisms on the
network level, allowing companies to lease network links on the y [13]. Typ-
ically, possible leases have dierent lengths and costs, and obey economies of
scale, e.g., leasing a link for a week is more expensive than leasing it for a day,
but not more than seven times. One can view rent-or-buy variants as an extreme
case of leasing, where only two leases are available: a lifetime one (buying) and
a lease of innitesimal duration (renting).
These trends motivate the study of algorithmic leasing variants of popular
network design mechanisms [1,2,6,19,20]. Note that from the algorithmic stand-
point, leasing variants have a truly online nature: leases have nite duration and
expire after some time. An online algorithm has to adapt itself to varying access
patterns, e.g., by acquiring longer leases in response to increased demand.

1.1 The Model


In this paper, we study the Online Steiner Tree Leasing (OSTL) problem in-
troduced by Meyerson [19]. The problem is dened in a weighted undirected
graph G with a distinguished root node r V (G). For each pair of nodes u
and v, by dG (u, v) we denote the length (with respect to edge weights) of the
shortest path between u and v. There is a known set L of available lease types,
where each type  L is characterized by its duration D and cost ratio C . We
denote the number of leases by L = |L|.
An input to the problem consists of a sequence of requests, each being
a terminal (a node of G), arriving sequentially in an online manner. We treat
the root r also as a terminal. We assume that each request arrives at a dierent
time (arrival times are real non-negative numbers). In response to a requested
terminal t , which appears at time t, an online algorithm has to connect t to r
using leased edges in G, leasing additional ones if necessary. (We note that a
terminal may occur multiple times in sequence .) If an algorithm acquires a
lease type  L of an edge e = (u, v), it pays C dG (u, v). The edge leased at
time t remains available for the period [t, t + D ); afterwards the lease expires.
To recap, an input instance I is a tuple (G, dG , r, L; ), where G, dG , r, and L
are known a priori, and is presented in an online fashion to an algorithm. For
any algorithm A, A(I) is the cost of A on input I and is subject to minimization.
A Deterministic Algorithm for Online Steiner Tree Leasing 171

The goal is to minimize the competitive ratio, dened as a worst-case ratio of the
cost of an online algorithm to the cost of the optimal oine solution (denoted
Opt) on the same input.

1.2 Previous Results


The OSTL problem on a single edge is known as the parking permit problem
for which optimally competitive algorithms were given by Meyerson [19]: a de-
terministic O(L)-competitive one and a randomized O(log L)-competitive one.
(Note that the rent-or-buy variant on a single edge is equivalent to the classic
ski rental problem with a trivially achievable constant competitive ratio.)
The randomized algorithm can be extended to trees [19]. As any n-node graph
can be approximated by a random tree with expected distortion of O(log n) [14],
this approach yields a randomized O(log Llog n)-competitive solution for graphs.
Better or non-randomized algorithms were known only for specic variants of
the OSTL. In particular, for a rent-or-buy variant (recall that it corresponds to
a special 2-lease variant, where the cheaper lease suces only for serving a single
request, and the more expensive lease lasts forever) Awerbuch, Azar and Bartal
gave a randomized O(log k)-competitive algorithm and O(log2 k)-deterministic
one [9]. The latter result was improved to O(log k) only recently by Umboh [21].
In these results, k denotes the number of dierent terminals in an input.

1.3 Our Contribution


In this paper, we present the rst deterministic online algorithm for the OSTL
problem. Our algorithm is O(L log k)-competitive. It outperforms the random-
ized O(log L log n)-competitive solution by Meyerson [19] when k (the number
of dierent terminals in the input) is small.
While the result might not be optimal, neither O(L) nor O(log k) can be
beaten by a deterministic solution: (L) bound follows by the lower bound on
the parking permit problem (which is equivalent to the OSTL on a single edge)
and (log k) bound follows by the online Steiner tree problem (which is a specic
case of the OSTL with a single lease of the innite duration).
In our solution (presented in Sect. 4), a path that connects a requested termi-
nal to an already existing Steiner tree is chosen greedily. However, we still have
to decide which lease type to use for such path. To this end, we check how many
requests were recently served in a neighborhood of the currently requested
terminal; once certain thresholds are met, more expensive leases are acquired.
While such approach is natural, the main diculty stems from the dynamics
of the leased edges. Namely, while in the rent-or-buy scenario the Steiner tree
maintained by an algorithm may only grow, in the leasing variant it may also
shrink as edge leases expire. As a result, the already aggregated serving cost may
cease to be sucient to cover a more expensive lease for the new connection.
Coping with this issue is the main challenge we tackle in this paper.
We use a recent analysis technique by Umboh [21]: the online algorithm is
run on a graph G, but its cost is compared to the cost of Opt run on a tree T .
172 M. Bienkowski et al.

This tree T is a hierarchically separated tree (HST), whose leaves are requested
terminals and whose distances dominate graph distances. By showing that our
algorithm is O(L)-competitive against Opt on T , for any choice of T , we obtain
that it is O(L log k)-competitive against Opt on the original graph G. The
details of this reduction are presented in Sect. 2.
We emphasize that the competitive ratio of our algorithm is a function of the
number of dierent terminals, k, and not the number of nodes in the graph, n,
as it is the case for the randomized algorithm of [19]. In fact, our algorithm and
its analysis work without changes also in any (innite) metric space, e.g., on the
Euclidean plane; in the paper, we use the graph terminology for simplicity.

1.4 Related Work

Other network design problems were also studied in leasing context. In par-
ticular, a randomized O(log L log n)-competitive algorithm was given for the
Online Steiner Forest Leasing by Meyerson [19]. Deterministic algorithms for
this problem are known only for the rent-or-buy subcase, for which an opti-
mal competitive ratio of O(log k) was achieved by Umboh [21]. Other problems
include the facility location [1,20] and the set cover [2].
The leasing setting was also applied to oine scenarios of the problems above
by Anthony and Gupta [6], who showed an interesting reduction between leasing
and stochastic optimization variants.

2 HST Embeddings

In this section, we show how to use hierarchically separated trees (HSTs) for the
analysis of an algorithm for the OSTL problem. Unlike many online construc-
tions for network design problems (see, e.g., [8,19]), here HSTs are not used for
an algorithm construction. Moreover, in our analysis, an HST will approximate
not the whole graph, but only the subgraph spanned by terminals.

Denition 1 (Dominating HST embedding of terminals). Fix any input


instance I = (G, dG , r, L; ) of the OSTL problem. Let X V (G) be the set
of terminals requested in (including the root r). Assume that the minimum
distance between any pair of nodes from X is at least 1.1 A dominating HST
embedding of terminals of I is a rooted tree T with pairwise distances given by
metric dT , satisfying the following properties.

1. The leaves of T are exactly the nodes of X and they are on the same level.
2. The distance from any leaf of T to its parent is 1.
3. The edge lengths increase by a factor of 2 on any leaf-to-root path.
4. dT dominates dG , i.e., dT (u, v) dG (u, v) for any pair of nodes u, v X.
1
For analysis, we may always scale the instance, so that this property holds.
A Deterministic Algorithm for Online Steiner Tree Leasing 173

Fix now any instance I = (G, dG , r, L; ) of the OSTL and let (T, dT ) be any
dominating HST embedding of terminals of I. Let IT = (T, dT , r, L; ) be the
instance I, where graph G was replaced by tree T with distances given by dT .
While estimating Opt(I) directly may be quite involved, lower-bounding
Opt(IT ) is much easier. In particular, for each request t there is a unique path
in T connecting t with r. As dT dominates dG , it is also feasible to compare
the cost of an online algorithm on I to Opt(IT ). Finally, it is possible to relate
Opt(IT ) to Opt(I) as stated in the following lemma, due to Umboh [21].

Lemma 2. Let I = (G, dG , r, L; ) be an instance of the OSTL problem and


let X be the set of terminals of I. There exists a dominating HST embedding
(T , dT ) of terminals X, such that Opt(IT ) O(log |X|) Opt(I), where
IT = (T , dT , r, L; ).

Proof. Fix any dominating HST embedding (T, dT ) of terminals X. The solution
Opt(I) is a schedule that leases particular edges of G at particular times. Let
Off(IT ) be an oine solution that, for any leased edge e = (u, v) in Opt(I),
leases all edges on the unique path in T from u to v, using the same lease
type. While it is not necessary for the proof, it is worth observing that, by the
domination property (cf. Denition 1), Opt(I) Off(IT ).
By the FRT approximation [14], there exists a probability distribution D
over dominating HST embeddings (T, dT ) of X, such that ET D [dT (u, v)]
O(log |X|) dG (u, v) for all u, v X. This relation summed over all edges (u, v)
used in the solution of Opt(I) yields that

ET D [Off(IT )] O(log |X|) Opt(I) .

By the average argument, there exists a dominating HST embedding (T , dT ),


such that Off(IT ) O(log |X|) Opt(I), and the proof follows by observing
that Opt(IT ) is at most Off(IT ).

The lemma can be generalized to any network design problem whose objective
function is a linear combination of edge lengths. In Sect. 4, we will construct an
algorithm for the OSTL which is O(L)-competitive against the cost of Opt on
any HST embedding. By Lemma 2, this algorithm is O(L log k)-competitive.

3 Interval Model
In this section, we make several assumptions on the available leases. At the
expense of a constant increase of the competitive ratio, they will make the con-
struction of our algorithm easier. Similar assumptions were also made for the
parking permit problem [19].

Denition 3. In the interval model, the following conditions hold for the input
instance.
Costs factors and durations of all leases are powers of two.
174 M. Bienkowski et al.

Lease types are sorted both by their costs and durations, i.e., if  < , then
D < D and C < C .
Fix any lease type  and let Jm = [m D , (m + 1) D ) for any m N.
For any time t and any edge, there is a unique lease of type  that can be
acquired by an algorithm: it is the lease for period Jm containing t.
The last property of the interval model means that, unlike the standard
leasing model outlined in Sect. 1.1, if an algorithm leases an edge at a time t
using a lease type  L, such transaction may occur within the lease duration.
Hence, the acquired lease may expire earlier than at time t + D . We also dene
J [t] to be the period Jm containing time t.
Observation 4. In the interval model, when lease of type  expires, all leases
of smaller types expire as well.
Lemma 5. Any (online or oine) algorithm for the original leasing model can
be transformed into an algorithm for the interval model (and back) without chang-
ing its cost by more than a constant factor.
The lemma above follows by standard rounding arguments (its proof is omit-
ted; see [19] for a similar argument). Hence, if an algorithm is R-competitive for
the interval model, it is O(R)-competitive for the original leasing model. There-
fore, we will assume the interval model in the remaining part of the paper.

4 Algorithm Construction
We present our algorithm Accumulate-and-Lease-Greedily (Alg). For sim-
plicity of the description, we assume that a given graph G is complete (with the
metric given by dG ). Such assumption is without loss of generality, as leasing
the edge (u, v) can be always replaced by leasing a shortest path connecting u
and v.
We will say that an edge e is -leased at time t, if an algorithm leased e for
period J [t] using lease type . Additionally, a request t is -leased if at time t
an algorithm -leases an edge e = (t , u) for some u.
By F [t] and Fm we denote the set of all requests that arrived during J [t]
and Jm , respectively. Furthermore, T [t] denotes the set of requests that are
connected, at time t, to the root r using edges of lease types at least .

High-level idea. In the execution of Alg, at any time t, the set of all currently
leased edges will be a single (possibly empty) tree, called the Steiner tree of Alg.
Furthermore, on any path from the root r that consists of leased edges, the closer
we are to the root, the longer leases we have. In eect, T [t] always forms a tree.
Moreover, when leases expire, the set of leased edges shrinks, but it remains
connected.
When a request t arrives, we check whether we can aord a lease  for t ,
starting from the longest (and the most expensive) available lease: We compute
the distance d from t to T [t]. Then, we check if there were suciently many
requests served recently in a small (compared to d) neighborhood of t . If
so, then we connect t to T [t] using lease type .
A Deterministic Algorithm for Online Steiner Tree Leasing 175

Algorithm 1 Accumulate-and-Lease-Greedily for the OSTL problem


1: while request t arrives do
2: for  L . . . 1 do
3: if t is not connected to the root r with a path of leased edges then
4: /* Check whether we can aord lease  for t */
5: let x be the node of T [t] closest to t
6: j log dG (t , x ) 
7: Nt {f F [t] : dG (t , f ) 2j2 and class(f ) = j}
8: if |Nt | C1 C or  = 1 then
9: -lease the edge (t , x )
10: class(t ) j

Algorithm description. More precisely, x any time t when a request t is pre-


sented to Alg. Alg checks, for each lease type  starting from the most expensive
(the L-th one), what the cost of connecting t to the tree T [t] would be. That
is, among all the nodes of T [t], it nds the node x closest to t . If we -lease
the edge (t , x ) at the cost C dG (t , x ), then t becomes connected to the
root r via a path of leased edges (of lease type at least ). We round the distance
dG (t , x ) up to the smallest power of two, denoted 2j . Then, we look at the
set Nt (cf. Line 7 in Algorithm 1) of requests that

arrived at any time in J [t],


are at distance at most 2j /4 from t ,
are of class j (i.e., upon their arrival, Alg connected them to its Steiner
tree, using an edge of length from (2j1 , 2j ], i.e., roughly dG (t , x )).

Note that the terminals of Nt are not necessarily connected to the Steiner
tree of Alg at time t. If the number of requests in Nt is at least C /C1 , then Alg
-leases the edge (t , x ) and sets the class of t to j. Otherwise, Alg proceeds
to cheaper lease types. If no lease type  satises the condition |Nt | C /C1 ,
Alg eventually 1-leases the edge (t , x1 ). Note that Alg leases exactly one edge
for each terminal that is not connected to the tree at the time of its arrival.
Pseudocode of Alg is given in Algorithm 1. We recall the property of Alg
stated earlier in its informal description.

Observation 6. For any time t and lease type  L, T [t] is a single tree.

5 Analysis

Throughout this section, we x an input instance I = (G, dG , r, L; ) and a cor-


responding tree instance IT = (T, dT , r, L; ), where (T, dT ) is a dominating
HST embedding of terminals of I (cf. Sect. 2).
Without loss of generality, we assume that when a request t arrives, it
is not yet connected to the Steiner tree of Alg (otherwise t would be ignored
by Alg). If t was -leased, then we call Nt (computed in Line 7 of Algorithm 1)
176 M. Bienkowski et al.

its neighbor set. We denote the set of all requests of class j by Wj . Additionally,
let Wj consist of all requests from Wj that were -leased.
A brief idea of the proof is as follows. Suppose each request t Wj receives
a credit of C1 2j when it arrives. If t was -leased, the actual cost paid by
Alg was C 2j . While the latter amount can be much larger for an individual
request t , in Sect. 5.1, we show that, for any xed lease type , the total cost
paid for -leased edges is bounded by the sum of all requests credits. In Sect. 5.2,
we exploit properties of dominating HST embeddings to show how all credits can
be charged (up to constant factors) to the leasing costs Opt pays for particular
edges of the tree T . Altogether, this will show that Alg(I) O(L) Opt(IT ).
Along with Lemma 2, this will bound the competitive ratio of Alg (see Sect. 5.3).

5.1 Upper Bound on ALG


The core of this section is Lemma 8, which essentially states that for any lease
type , all requests credits can cover all leases of type . Before proceeding to
its proof, we rst show the following structural property.

Lemma 7. Fix a class j, a lease type , and a pair of distinct requests s , t


Wj . Their neighbor sets, Nt and Ns , are disjoint.

Proof. Without loss of generality, s < t. We will prove the lemma by contradic-
tion. Assume there exists a request u Ns Nt .
By the denition of neighbor sets, u F [s] F [t]. In the interval model,
there are only two possibilities: either periods J [s] and J [t] are equal or they
are disjoint. As in the latter case the corresponding sets F [s] and F [t] would
be disjoint as well, it holds that J [s] = J [t].
As the leases of type  that Alg bought for t and s started and expired
at the same time, s was in the tree T [t] when t arrived. Thus, the dis-
tance between t and the tree T [t] was at most dG (t , s ). From the trian-
gle inequality and diameters of sets Ns and Nt , it follows that dG (t , s )
dG (t , u ) + dG (u , s ) 2j2 + 2j2 = 2j1 . Hence, the request t would be
of class j 1 or lower, which would contradict its choice.

Lemma 8. For any class j and a lease type  L, C |Wj | C1 |Wj |.

Proof. The lemma follows trivially for  = 1, and therefore we assume that  2.
We look at any request t Wj and its neighbor set Nt . As t is of class j,
N contains requests only of class j, i.e., Nt Wj . 
t
By Lemma 7, the neighbor
sets of all requests from Wj are disjoint, and hence t W  |Nt | |Wj |.
j
t
As Alg -leases requestt , its neighbor set N contains at least C /C1
requests. Therefore, |Wj | t W  |N | t W  C /C1 = |Wj | C /C1 .
t

j j


Lemma 9. For any input I, it holds that Alg(I) L j |Wj | C1 2j .

Proof. The cost of serving any request t Wj is at most C 2j . Using Lemma 8,
  
we obtain Alg(I) L j |Wj | C 2j L j |Wj | C1 2j .

A Deterministic Algorithm for Online Steiner Tree Leasing 177

Fig. 1. An example of an HST embedding. Square nodes (leaves of the HST) repre-
sent terminals from an input sequence (including root r). Edge e is a 2-level edge (of
length 22 ). D(e) is the set of leaves below edge e.

5.2 Lower Bound on OPT


In this part, we bound the sum of all requests credits by O(1) Opt(IT ).
We number edge levels of T starting from bottom ones and counting from 0.
That is, a j-level edge is of length 2j . Moreover, for an edge e, we denote the set
of all leaves below it by D(e), see Fig. 1. We denote the set of all j-level edges
by Ej . The next observation follows immediately by Denition 1.
Observation 10. Fix any j-level edge e. For any two leaves u, v D(e), it holds
that dG (u, v) dT (u, v) 2j+1 .
Lemma 11. For any request t of class j 3, there exists an edge e Ej3 ,
such that t D(e) and e lies on the unique path from t to the root r in T .
Proof. When Alg -leases request t and assigns class j to it, the distance
between t and the tree T [t] is larger than 2j1 , and thus dG (t , r) > 2j1 .
By Observation 10, the unique path in T between r and t must cross two
(j 2)-level edges, and hence also two (j 3)-level edges. We pick e to be the
(j 3)-level edge that is closer to t (see Fig. 1).

The lemma above implicitly creates a mapping from the set of all requests
of class j 3 to edges in tree T : a request of class j (i.e., connected by Alg
with an edge of length at most 2j ) is mapped to a tree edge of level j 3 (of
length 2j3 ). Note that a request of class j could be mapped to an edge in Ej2 .
However, the next lemma requires that all the requests mapped to an edge e are
close to each other. We extend to include also the requests of classes j 2,
by mapping any such request t to the edge e E0 adjacent to t in tree T . In
these terms, 1 (e) is a set of requests mapped to e. For an edge e of level j 1,
3
1 (e) = D(e) Wj+3 , and for e E0 , we have 1 (e) = D(e) j=0 Wj .
Let Opt(e) be the total leasing cost of e in the optimal solution for IT .
Our goal now is to show that the sum of credits of requests in 1 (e) is at
most O(Opt(e)). To do so, we rst prove a general bound on the amount of credit
that holds for all possible periods Jm . Later on, we will apply it to periods Jm
when Opt leased edge e.
Lemma 12. Fix a lease type  > 1 and a j-level edge e of T . Then, for any
m N, |1 (e) Fm | 8 C /C1 .
178 M. Bienkowski et al.

Proof. We rst assume that j 1 and we will show that |1 (e) Fm |
C /C1 + 1 2 C /C1 .
For a contradiction, assume that 1 (e) Fm contains more than b =
C /C1 + 1 requests. Let s and t be the b-th and the (b + 1)-th of them,
respectively. By Lemma 11, all requests of 1 (e) are of class j + 3 and are
contained in D(e). By Observation 10, they are all within a distance of 2j+1
from s in the graph. Therefore, Ns , the neighbor set of s considered by Alg,
contains all previous requests from 1 (e) Fm (there are b 1 = C /C1 many
of them). The condition at Line 8 of Algorithm 1 is thus fullled, and therefore
Alg buys a lease of type at least  for s .
In eect, when t arrives, s is in T [t]. Hence, the distance from t to the
tree T [t] in the graph is at most dG (t , s ) dT (t , s ) 2j+1 . Therefore,
the class of t is at most j + 1, which contradicts the choice of t .
The analysis above can be extended to any 0-level edge e. Because D(e) for
e E0 contains exactly one terminal, all requests from 1 (e) Fm are always
contained in the appropriate neighbor set. This implies that |1 (e) Fm
3
Wi | 2 C /C1 for any class i {0, 1, 2, 3}. As 1 (e) = D(e) i=0 Wi , we
obtain |1 (e) Fm | 4 2 C /C1 .

Lemma 13. Fix a j-level edge e of T. Then, |1 (e)| C1 2j 8 Opt(e).
Proof. By Lemma 11, for each request t in 1 (e), Opt has to have edge e
leased at time t, as e lies on the only path between t and the root r (see also
Fig. 1).
Let P (e) be the set
 of all pairs (, m), such that Opt -leases e for period Jm .
That is, Opt(e) = (,m)P (e) C 2 . In the optimal solution Jm periods are
j

pairwise disjoint for all pairs (, m) in P (e), and hence so are sets Fm . Thus,

|1 (e)| C1 2j = |1 (e) Fm | C1 2j
(,m)P (e)

8 C 2j = 8 Opt(e) ,
(,m)P (e)

where the inequality follows by Lemma 12.



Lemma 14. For any input  I and any dominating HST embedding (T, dT ) of
terminals of I, it holds that j |Wj | C1 2j O(1) Opt(IT ).
Proof. Fix any level j 1. Recall that all requests of class j + 3 (and only them)
are mapped by to edges from Ej . Hence, we obtain

|Wj+3 | = eEj |1 (e)| . (1)

On the other hand, all requests of class j


 {0, 1, 2, 3} (and
 only them) are
mapped by to edges from E0 . Therefore, j3 |Wj | = eE0 |1 (e)|, and
consequently  
|Wj | 2j 8 |1 (e)| . (2)
j3 eE0
A Deterministic Algorithm for Online Steiner Tree Leasing 179

We use (1) and (2) to bound j |Wj | 2j :
   
|Wj | C1 2j 8 |1 (e)| C1 + 2j+3 |1 (e)| C1
j0 eE0 j1 eEj
 
1
= 8 2 |
j
(e)| C1
j0 eEj
 
8 8 Opt(e) = O(1) Opt(IT ) .
j0 eEj

The second inequality is a consequence of Lemma 13.


5.3 The Competitive Ratio


Theorem 15. Accumulate-and-Lease-Greedily is O(Llog k)-competitive.

Proof. Fix an instance I = (G, dG , r, L; ). By Lemma 2, there exists a domi-


nating HST embedding (T, dT ), such that Opt(IT ) O(log k) Opt(I), where
IT = (T, dT , r, L; ). By Lemma
 9, the total cost of Alg is at most L times the
sum of all requests credits, j |Wj |C1 2j . By Lemma 14, the latter amount is at
most O(1)Opt(IT ), and hence Alg(I) O(L)Opt(IT ) O(Llog k)Opt(I),
which concludes the proof.

6 Conclusions
We showed that the technique of analyzing greedy algorithms using HSTs can be
also applied to the leasing variant of the online Steiner tree (the OSTL problem).
A natural research direction is to employ it for other leasing variants of graph
problems, such as Steiner forest or facility location.
Closing the gap between the current upper and lower bounds for the deter-
ministic algorithms solving the OSTL problem (O(L log k) and (L + log k),
respectively) is an intriguing open problem. In particular, it seems that improv-
ing the competitive ratio requires a very careful interplay between path-choosing
and lease-upgrade routines. We remark that analogous gaps exist also for ran-
domized algorithms for the OSTL problem and for a leasing variant of the facility
location problem [20].

References
1. Absho, S., Kling, P., Markarian, C., Meyer auf der Heide, F., Pietrzyk, P.: Towards
the price of leasing online. Journal of Combinatorial Optimization pp. 120 (2015)
2. Absho, S., Markarian, C., Meyer auf der Heide, F.: Randomized online algorithms
for set cover leasing problems. In: Proc. 8th Int. Conf. on Combinatorial Optimiza-
tion and Applications (COCOA). pp. 2534 (2014)
3. Albers, S., Koga, H.: New on-line algorithms for the page replication problem.
Journal of Algorithms 27(1), 7596 (1998)
180 M. Bienkowski et al.

4. Alon, N., Azar, Y.: On-line Steiner trees in the Euclidean plane. In: Proc. 8th ACM
Symp. on Computational Geometry (SoCG). pp. 337343 (1992)
5. Angelopoulos, S.: On the competitiveness of the online asymmetric and Euclidean
Steiner tree problems. In: Proc. 7th Workshop on Approximation and Online Al-
gorithms (WAOA). pp. 112 (2009)
6. Anthony, B.M., Gupta, A.: Infrastructure leasing problems. In: Proc. 12th Int.
Conf. on Integer Programming and Combinatorial Optimization (IPCO). pp. 424
438 (2007)
7. Armbrust, M., Fox, A., Grith, R., Joseph, A.D., Katz, R.H., Konwinski, A.,
Lee, G., Patterson, D.A., Rabkin, A., Stoica, I., Zaharia, M.: Above the clouds: A
Berkeley view of cloud computing. Tech. Rep. UCB/EECS-2009-28, EECS Depart-
ment, University of California, Berkeley (2009), https://www2.eecs.berkeley.
edu/Pubs/TechRpts/2009/EECS-2009-28.pdf
8. Awerbuch, B., Azar, Y.: Buy-at-bulk network design. In: Proc. 38th IEEE Symp.
on Foundations of Computer Science (FOCS). pp. 542547 (1997)
9. Awerbuch, B., Azar, Y., Bartal, Y.: On-line generalized Steiner problem. Theoret-
ical Computer Science 324(23), 313324 (2004)
10. Awerbuch, B., Bartal, Y., Fiat, A.: Competitive distributed le allocation. In: Proc.
25th ACM Symp. on Theory of Computing (STOC). pp. 164173 (1993)
11. Bartal, Y., Fiat, A., Rabani, Y.: Competitive algorithms for distributed data man-
agement. Journal of Computer and System Sciences 51(3), 341358 (1995)
12. Black, D.L., Sleator, D.D.: Competitive algorithms for replication and migra-
tion problems. Tech. Rep. CMU-CS-89-201, Department of Computer Science,
Carnegie-Mellon University (1989)
13. Chowdhury, N.M.K., Boutaba, R.: A survey of network virtualization. Computer
Networks 54(5), 862876 (2010)
14. Fakcharoenphol, J., Rao, S., Talwar, K.: A tight bound on approximating arbitrary
metrics by tree metrics. Journal of Computer and System Sciences 69(3), 485497
(2004)
15. Fleischer, R., Glazek, W., Seiden, S.S.: New results for online page replication.
Theoretical Computer Science 324(23), 219251 (2004)
16. Imase, M., Waxman, B.M.: Dynamic Steiner tree problem. SIAM Journal on Dis-
crete Mathematics 4(3), 369384 (1991)
17. Lund, C., Reingold, N., Westbrook, J., Yan, D.C.K.: Competitive on-line algo-
rithms for distributed data management. SIAM Journal on Computing 28(3), 1086
1111 (1999)
18. Matsubayashi, A.: Non-greedy online Steiner trees on outerplanar graphs. In: Proc.
14th Workshop on Approximation and Online Algorithms (WAOA). pp. 129141
(2016)
19. Meyerson, A.: The parking permit problem. In: Proc. 46th IEEE Symp. on Foun-
dations of Computer Science (FOCS). pp. 274284 (2005)
20. Nagarajan, C., Williamson, D.P.: Oine and online facility leasing. Discrete Op-
timization 10(4), 361370 (2013)
21. Umboh, S.: Online network design algorithms via hierarchical decompositions. In:
Proc. 26th ACM-SIAM Symp. on Discrete Algorithms (SODA). pp. 13731387
(2015)
22. Westbrook, J., Yan, D.C.K.: The performance of greedy algorithms for the on-line
Steiner tree and related problems. Mathematical Systems Theory 28(5), 451468
(1995)
23. Wu, W., Huang, Y.: Steiner trees. In: Encyclopedia of Algorithms, pp. 21022107
(2016)
The I/O Complexity of Strassens Matrix
Multiplication with Recomputation

Gianfranco Bilardi1 and Lorenzo De Stefani2


1
Department of Information Engineering, University of Padova,
Via Gradenigo 6B/Padova, Italy
[email protected]
2
Department of Computer Science, Brown University,
115 Waterman Street/Providence, United States of America
[email protected]


Abstract. A tight ((n/ M )log2 7 M ) lower bound is derived on the
I/O complexity of Strassens algorithm to multiply two n n matrices,
in a two-level storage hierarchy with M words of fast memory. A proof
technique is introduced, which exploits the Grigorievs ow of the matrix
multiplication function as well as some combinatorial properties of the
Strassen computational directed acyclic graph (CDAG). Applications to
parallel computation are also developed. The result generalizes a similar
bound previously obtained under the constraint of no-recomputation,
that is, that intermediate results cannot be computed more than once.

1 Introduction
Data movement is increasingly playing a major role in the performance of
computing systems, in terms of both time and energy. This technological trend [1]
is destined to continue, since the very fundamental physical limitations on
minimum device size and on maximum message speed lead to inherent costs
when moving data, whether across the levels of a hierarchical memory system
or between processing elements of a parallel system [2]. The communication
requirements of algorithms have been the target of considerable research in the
last four decades; however, obtaining signicant lower bounds based on such
requirements remains an important and challenging task.
In this paper, we focus on the I/O complexity of Strassens matrix multiplica-
tion algorithm. Matrix multiplication is a pervasive primitive utilized in many
applications. Strassen [3] showed that two n n matrices can be multiplied with
O(n ) operations, where = log2 7 2.8074, hence with asymptotically fewer
than the n3 arithmetic operations required by the straightforward implementation
of the denition of matrix multiplication. This result has motivated a number of
eorts which have lead to increasingly faster algorithms, at least asymptotically,
with the current record being at < 2.3728639 [4].

This work was supported, in part, by MIUR of Italy under project AMANDA
2012C4E3KT 004 and by the University of Padova under projects CPDA121378/12,
and CPDA152255/15.

Springer International Publishing AG 2017 181


F. Ellen et al. (Eds.): WADS 2017, LNCS 10389, pp. 181192, 2017.
DOI: 10.1007/978-3-319-62127-2_16
182 G. Bilardi and L. De Stefani

Previous and Related Work: I/O complexity has been introduced in the
seminal work by Hong and Kung [5]; it is essentially the number of data transfers
between the two levels of a memory hierarchy with a fast memory of M words and
a slow memory with an unbounded number of words. Hong and Kung presented
techniques to develop lower bounds to the I/O complexity of computations
modeled by computational directed acyclic graphs (CDAGs). The resulting lower
bounds apply to all the schedules of the given CDAG, including those with
recomputation, that is, where some vertices of the CDAG
 are evaluated multiple
3

times. Among other results, they established an n / M lower bound to
the I/O complexity of the denition-based matrix multiplication algorithm,
which matched a known upper bound [6]. The techniques of [5] have also been
extended to obtain tight communication bounds for the denition-based matrix
multiplication in some parallel settings [79] and for the special case of sparse
matrix multiplication [10]. Ballard et al. generalized the results on matrix
multiplication of Hong and Kung [5] in [11, 12] by using the approach proposed
in [8] based on the Loomis-Whitney geometric theorem [13, 14]. The same papers
present tight I/O complexity bounds for various classical linear algebra algorithms,
for problems such as LU/Cholesky/LDLT/QR factorization and eigenvalues and
singular values computation.
It is natural to wonder what is the impact of Strassens reduction of the
number of arithmetic operations on the number of data transfers. In an important
contribution, Ballard et al. [15], obtained an ((n/ M )log2 7 M ) I/O lower bound
for Strassens algorithm, using the edge expansion approach. The authors extend
their technique to a class of Strassen-like fast multiplication algorithms and to
fast recursive multiplication algorithms for rectangular matrices [16]. This result
was later generalized to a broader class of Strassen-like algorithms by Scott
et. al [17] using the path routing technique. In [18] (Chap. 4.5), De Stefani
presented an alternative technique for obtaining I/O lower bounds for a large
class of Strassen-like algorithms characterized by a recursive structure. This result
combines the concept of Grigorievs ow of a function and the dichotomy width
technique [19]; it generalizes previous results and simplies the analysis.
A parallel, communication avoiding implementation of Strassens algorithm
whose performance matches the known lower bound [15, 17], was proposed by
Ballard et al. [20]. A communication ecient algorithm for the special case of
sparse matrices based on Strassens algorithm was presented in [21].
On the impact of recomputation: The edge expansion technique of [15],
the path routing technique of [17], and the closed dichotomy width technique
of [19] all yield I/O lower bounds that apply only to computational schedules for
which no intermediate result is ever computed more than once (nr-computations).
While it is of interest to know what is the I/O complexity achievable by nr-
computations, it is also important to investigate what can be achieved with
recomputation. In fact, for some CDAGs, recomputing intermediate values reduces
the space and/or the I/O complexity of an algorithm [22]. In [23], it is shown
that some algorithms admit a portable schedule (i.e., a schedule which achieves
optimal performance across memory hierarchies with dierent access costs) only
The I/O Complexity of Strassen's Matrix Multiplication with Recomputation 183

if recomputation is allowed. Recomputation can also enhance the performance


of simulations among networks (see [24] and references therein) and plays a key
role in the design of ecient area-universal VLSI architectures with constant
slowdown [25]. A number of lower bound techniques that allow for recomputation
have been presented in the literature, including the S-partition technique [5],
the S-span technique [22], and the S-covering technique [26] which merges
and extends aspects from both [5] and [22]. However, none of these have been
previously applied to fast matrix multiplication
algorithms.
Our results: We extend the ((n/ M )log2 7 M ) I/O complexity lower bound
for Strassens algorithm to schedules with recomputation. A matching upper
bound is known, and obtained without recomputation; hence, we can conclude
that, for Strassens algorithm, recomputation does not help in reducing I/O
complexity if not, possibly, by a constant factor. Our proof technique is of
independent interest, since it exploits to a signicant extent the divide and
conquer nature exhibited by many algorithms. We follow the dominator set
approach pioneered by Hong and Kung in [5]. However, we focus the dominator
analysis only on a select set of target vertices, specically the outputs of the
sub-CDAGs of Strassens CDAG that correspond to sub-problems of a suitable
size (i.e., chosen as a function of the fast memory capacity M ). Any dominator
set of a set of target vertices can be partitioned into two subsets, one internal
and one external to the sub-CDAGs. The analysis of the internal component
can be carried out based only on the fact that the sub-CDAGs compute matrix
products, irrespective of the algorithm (in our case, Strassens) by which the
products are computed. To achieve this independence of the algorithm, we resort
on the concept of Grigorievs ow of a function [27] and on a lower bound to
such ow established by Savage [28] for matrix multiplication..
In order to obtain our general lower bound for the I/O complexity, we then
build on this result combining it with the analysis of the external component
of the dominator, which requires instead rather elaborate arguments that are
specic to Strassens CDAG. The paper is organized as follows: In the rst part
of Sect. 2, we provide the details of our model and of several theoretical notions
needed in our analysis. In the second part of Sect. 2, we analyze the relation
between the Grigorievs ow of a function and the size of the dominator sets of
subsets of output vertices of a CDAG. In Sect. 3, we present the I/O complexity
lower bound for Strassens algorithm when recomputation is allowed. Extensions
of the result to a parallel model are also discussed.

2 I/O Complexity, Dominator Sets and Grigorievs Flow

We consider algorithms which compute the product C = AB of n n matrices


A, B with entries from a ring R. We focus on algorithms whose execution, for
any given n, can be modeled as a computational directed acyclic graph (CDAG)
G = (V, E), where each vertex v V represents either an input value or the
result of a unit time operation (i.e., an intermediate result or one of the output
values), while the directed edges in E represent data dependences. A directed
184 G. Bilardi and L. De Stefani

7 5 4 1 3 2 6 7 5 4 1 3 2 6 C1,1 C1,2 C2,1 C2,2

A1,1 A1,2 A2,1 A2,2 B1,1 B1,2 B2,1 B2,2 M7 M 5 M4 M 1 M3 M 2 M 6

(a) EncA (b) EncB (c) Dec

Fig. 1: Basic building blocks of Strassens CDAG. EncA and EncB are isomorphic.

C1,1 C1,2 C2,1 C2,2 C1,1 C1,2 C2,1 C2,2


Dec n2 Dec
M7 M5 M4 M1 M3 M2 M6
H7nn H5nn H4nn H1nn H3nn H2nn H6nn

EncA EncB n2 EncA n2 EncB

A1,1 A1,2 A2,1 A2,2 B1,1 B1,2 B2,1 B2,2 A1,1 A1,2 A2,1 A2,2 B1,1 B1,2 B2,1 B2,2

(a) Strassens H 22 CDAG (b) Recursive construction of H 2n2n

Fig. 2: Black vertices represent combinations of the input values from the factor
matrices A and B which are used as input values for the sub-problems Mi ;
Grey vertices represent the output of the seven sub-problems which are used to
compute the output values of the product matrix C.

path connecting vertices u, v V is an ordered sequence of vertices for which u


and v are respectively the rst and last vertex such that there is in E a (directed)
edge pointing from each vertex in the sequence to its successor. We say that
G = (V  , E  ) is a sub-CDAG of G = (V, E) if V  V and E  E (V  V  ).
Properties of Strassens CDAG: Consider Strassens algorithm [3] when
used to compute C = AB, where A and B are n n matrices with entries
from the ring R. Let H nn denote the corresponding CDAG. For n 2, H nn
can be obtained by using a recursive construction which mirrors the recursive
structure of the algorithm. The base of the construction is the H 22 CDAG which
corresponds to the multiplication of two 2 2 matrices using Strassens algorithm
(Fig. 2a). H 2n2n can then be constructed by composing seven copies of H nn ,
each corresponding to one of the seven sub-products generated by the algorithm
(see Fig. 2b): n2 disjoint copies of CDAG EncA (resp., EncB ) are used to connect
the input vertices of H 2n2n , which correspond to the values of the input matrix
A (resp., B) to the appropriate input vertices of the seven sub-CDAGs Hinn ;
the output vertices of the sub-CDAGs Hinn (which correspond to the outputs
of the seven sub-products) are connected to the appropriate output vertices of
the entire H 2n2n CDAG using n2 copies of the decoder sub-CDAG Dec.
We will exploit the following recursive structure of Strassens CDAG:
The I/O Complexity of Strassen's Matrix Multiplication with Recomputation 185

Lemma 1. Let H nn denote the CDAG of Strassens algorithm for input matri-
ces of size n n. For 0 i log n 1, there are exactly 7i disjoint sub-CDAGs
H n/2 n/2 .
i i

We will also capitalize on the existence of vertex-disjoint paths connecting the


global input vertices of H nn to the local input vertices of the sub-CDAGs
H n/2 n/2 for 0 i log n 1, with the help of the following lemma.
i i

Lemma 2. Given an encoder CDAG, for any subset Y of its output vertices,
there exists a subset X of its input vertices, with min{|Y |, 1 + (|Y | 1) /2}
|X| |Y |, such that there exist |X| vertex-disjoint paths connecting the vertices
in X to vertices in Y .
We refer the reader to the extended on-line version of this paper [29] for a detailed
presentation of Strassens algorithm and for the proofs of Lemmas 1 and 2.
Model: We assume that sequential computations are executed on a system
with a two-level memory hierarchy consisting of a fast memory or cache of size
M , measured in words, and a slow memory of unlimited size. A memory word
can store at most one value from R. An operation can be executed only if all its
operands are in cache. Data can be moved from the slow memory to the cache by
read operations, and, in the other direction, by write operations. Read and write
operations are also called I/O operations. We assume the input data to be stored
in slow memory at the beginning of the computation. The evaluation of a CDAG
in this model can be analyzed by means of the red-blue pebble game [5]. The
number of I/O operations executed when evaluating a CDAG depends on the
computational schedule, that is, on the order in which vertices are evaluated and
on which values are kept in/discarded from cache. The I/O complexity IOG (M )
of a CDAG G is dened as the minimum number of I/O operations over all
possible computational schedules.
We also consider a parallel model where P processors, each with a local
memory of size M , are connected by a network. We assume that the input
is initially distributed among the processors, thus requiring that M P 2n2 .
Processors can exchange point-to-point messages among each other. For this
model, we derive lower bounds to the number of words that must be either sent
or received by at least one processor during the CDAG evaluation.
Grigorievs ow and dominator sets: The concept of dominator set was
originally introduced in [5]. We use the following, slightly dierent, denition:
Denition 1 (Dominator set). Given a CDAG G = (V, E), let I V denote
the set of input vertices. A set D V is a dominator set for V  V with respect
to I  I if every path from a vertex in I  to a vertex in V  contains at least a
vertex of D. When I  = I, D is simply referred as a dominator set for V  V .
The ow of a function was introduced by Grigoriev [27]. We use a revised
formulation by Savage [28]. The ow is an inherent property of a function, not of
a specic algorithm by which the function may be computed.
Denition 2 (Grigorievs ow). A function f : Rp Rq has a w (u, v)
Grigorievs ow if for all subsets X1 and Y1 , of its p input and q output variables,
186 G. Bilardi and L. De Stefani

with |X1 | u and |Y1 | v, there is a sub-function h of f obtained by making


some assignment to variables of f not in X1 and discarding output variables not
in Y1 , such that h has at least |R|w(u,v) points in the image of its domain.
A lower bound on the Grigorievs ow for the square matrix multiplication
2 2
function fnn : R2n Rn over the ring R was presented in [28] (Thm. 10.5.1).
2 2 2
Lemma 3 (Grigorievs ow of fnn : R2n Rn [28]). fnn : R2n
2
Rn has a wnn (u, v) Grigorievs ow, where:
"
2 2 #
1 2n u
wnn (u, v) v , for 0 u 2n2 , 0 v n2 . (1)
2 4n2

The ow of a function measures the amount of information that suitable


subsets of outputs encode about suitable subsets of inputs. Such information
must be encoded by any dominator of those outputs, thus implying the following
lower bound on the size of dominators.
Lemma 4. Let G = (V, E) be a CDAG computing f : Rp Rq with Grigorievs
ow wf (u, v). Let I (resp., O) denote the set of input (resp., output) vertices of
G. Any dominator set D for any subset O O with respect to any subset I  I
satises |D| wf (|I  |, |O |).
Proof. Given I  I and O O, suppose the values of the input variables in
I \ I  to be xed. Let D be a dominator set for O O with respect to I  I.
The lemma follows combining statements (i) and (ii):
(i) By Denition 2, there exists an assignment of the input variables in I  , such
 
that the output variables in O can assume |R|wf (|I |,|O |) distinct values.
(ii) Since all paths I  to O intercept D, the values of the outputs in O are
determined by the inputs in I \ I  , which are xed, and by the values of the
vertices in D; hence, the outputs in O can take at most |R||D| distinct values.
We let Gnn denote the CDAG corresponding to the execution of an unspeci-
ed algorithm for the square matrix multiplication function.
Lemma 5. Given Gnn , let O O be a subset of its output vertices O. For
any subset D of the vertices of Gnn with |O |$ 2|D|, there exists a set I  I of
the input vertices I with cardinality |I  | 2n |O | 2|D|, such that all vertices
in I  are connected to some vertex in O by directed paths with no vertex in D.
Proof. Lemma 5 follows by applying the results in Lemmas 3 and 4 to the CDAG
Gnn . Let I  I denote the set of all input vertices of Gnn , such that all paths
connecting these vertices to the output vertices in O include at least a vertex in
D (i.e., I  is the largest subset of I with respect to whom D is a dominator set
for O ). From Lemmas 3 and 4 the following must hold:
"
2 2 #
1  2n |I  |
|D| wnn |O | . (2)
2 4n2
The I/O Complexity of Strassen's Matrix Multiplication with Recomputation 187

Let I  = I \ I  . By the denition of I  , the vertices in I  are exactly those that


are connected to vertices in O by directed paths with no vertex in D. Since
|I| = 2n2 , from (2) we have |I  |2 4n2 (|O | 2|D|).

3 Lower Bounds for Schedules with Recomputation

Without recomputation, once an input value is loaded in memory or an intermedi-


ate result is computed, it must be kept in memory (either cache or slow) until the
result of each operation which uses it has been evaluated. This is exploited by the
dichotomy width technique [19], the boundary ow technique [30], and those
yielding I/O lower bounds for Strassens algorithm [1618]. With recomputation,
intermediate results can instead be deleted from all memory and recomputed
starting from the global input values. This considerably complicates the analysis
of the I/O cost (see [11] for an extensive discussion). In this section, we present
a technique which addresses these complications. First, we obtain a lower bound
for the minimum size of the dominator
set of subset of vertices corresponding
to theoutput values of the (n/(2 M ))log2 7 Strassens sub-problems with input
size 2 M 2 M . In turn, this dominator bound yields an asymptotically tight
I/O lower bound both in the sequential and the parallel model.
For 1 M n2 /4, with M a power of four, we focus on the subset Y oflogthe7
input vertices and
the
subset Z of the output vertices of the (n/(2 M )) 2
2 M 2 M
sub-CDAGs H of H nn
. Further, we let X be the set of the global
input vertices of H nn which correspond to the entries of matrices A and B.

Lemma 6. Given H nn , let Q be a set of internal (i.e., not input) vertices of


 log2 7
its n/(2 M ) sub-CDAGs H 2 M 2 M . For any Z Z with |Z| 2|Q|
$
there exist X X and Y Y with |X| = |Y | 4 M (|Z| 2|Q|) such that,
(a) there are |X| = |Y | vertex-disjoint paths from X to Y , and (b) each vertex in
Y is connected to some vertex in Z by a directed path with no vertex in Q.

Proof. For a xed M , we proceed
by induction on n = 2 M , 4 M , . . . In the
base case, H nn = H 2 M 2 M , and
the sets Y and X coincide.

The statement
is a consequence of Lemma 5 as H 2 M 2 M is a G2 M 2 M CDAG.
Assuming now inductively that the statement holds for H nn , with n 2 M ,
we shall show it also holds for H 2n2n . Let H1nn , H2nn , . . . , H7nn denote the
seven sub-CDAGs of H 2n2n , each corresponding to one of the seven sub-products
generated by the rst recursive step of Strassens algorithm.
Let Zi , Yi and Qi respectively denote the subsets of Z, Y and Q in Hinn .
Since, from Lemma 1, the seven sub-CDAGs Hinn are mutually vertex-disjoint,
7 Z, Y1 , Y2 , . . . , Y7 partition
clearly Z1 , Z2 , . . . , Z7 partition 7 Y and Q1 , Q2 , . . . , Q7
partition Q. This implies i=1 |Zi | = |Z|, and i=1 |Qi | = |Q|. Letting i =
7
max{0, |Zi | 2|Qi |}, we have = i=1 i |Z| 2|Q|.
Applying the inductive hypothesis to each Hinn , we have that there is a
subset Yi Yi with |Yi | 4 M i such that vertices of Yi are connected to
188 G. Bilardi and L. De Stefani

vertices in Zi via paths with no vertex in Qi . In the sequel, the set Y referred
to in the statement will be identied as a suitable subset of 7i=1 Yi so that
property (b) will be automatically satised. Towards property (a), we observe
by the inductive hypothesis that vertices in Yi can be connected to a subset Ki
of the input vertices of Hinn with |Ki | = |Yi | using vertex-disjoint paths. Since
the sub-CDAGs Hinn are vertex-disjoint, so are the paths $ connecting vertices in
Yi to vertices in Ki . It remains to show that at least 4 M (|Z| 2|Q|) of these
paths can be extended to X while maintaining them vertex-disjoint.
In Strassens CDAG H 2n2n (Sect. 2), vertices in X corresponding to input
matrix A (resp., B) are connected to vertices in K1 , K2 , . . . , K7 by means of
n2 encoding sub-CDAGs EncA (resp., EncB ). None of these 2n2 encoding sub-
CDAGs share any input or output vertices. No two output vertices of the same
encoder sub-CDAG belong to the same sub-CDAG Hinn . This fact ensures that
for a single sub-CDAG Hinn it is possible to connect all the vertices in Ki to a
subset of the vertices in X via vertex-disjoint paths.
For each of the 2n2 encoder sub-CDAGs, let us consider the vector yj {0, 1}7
such that yj [i] = 1 i the corresponding i-th output vertex (respectively according
to the numbering indicated in Fig. 1a or Fig. 1b) is in Ki . Therefore, |yj |
equals the number of output vertices of the j-th encoder sub-CDAG which
are in K. From Lemma 2, for each encoder sub-CDAG there exists a subset
Xj X of the input vertices of the j-th encoder sub-CDAG for which it is
possible to connect each vertex in Xj to a distinct output vertex of the j-th
encoder sub-CDAG using vertex-disjoint paths, each constituted by a singular
edge with min{|yj |, 1 + (|yj | 1) /2} |Xj | |yj |. Therefore, the number
of vertex-disjoint paths connecting vertices in X to vertices in 7i=1 Ki is at
2n2 2n2
least j=1 min{|yj |, 1 + (|yj | 1) /2} under the constraint that j=1 yj [i] =

4 M i . Let us assume, w.l.o.g., that 1 2 . . . 7 . As previously stated, it
is possible to connect all vertices in K1 to vertices in X through vertex-disjoint
paths. Consider now all possible dispositions of the vertices in 7i=2 Ki over
the outputs of the 2n2 encoder sub-CDAGs. Recall that the output vertices
of an encoder sub-CDAG belong each to a dierent H nn sub-CDAG. From
Lemma 2, we have that for each encoder, there exists a subset Xj X of
the input vertices of the j-th encoder sub-CDAG with |Xj | min |yj |, 1 +
  
7
(|yj | 1) /2 yj [1] + i=2 yj [i] /2, for which it is possible to connect all
vertices in Xj to |Xj | distinct output vertices of the j-th encoder sub-CDAG
which are in 7i=1 Ki using |Xj |, thus using vertex-disjoint paths. As all the
Enc sub-CDAGs are vertex-disjoint, we can add their contributions so that the
number of vertex-disjoint paths connecting vertices in X to vertices in 7i=1 Ki is
1
7  7
at least |K1 | + 2 i=2 |Ki | = 4 M 1 + 12 i=2 i . Squaring this quantity
leads to:
" " ##2 " 7 #2
7 7 $
$ 1 $ $  1 $
4 M 1 + i = 16M 1 + 1 i + i ,
2 i=2 i=2
2 i=2
The I/O Complexity of Strassen's Matrix Multiplication with Recomputation 189

since, by assumption, 1 . . . 7 , we have: 1 i i for i = 2, . . . , 7. Thus:
" " ##2
$ 7
1 $ 7  $ 2
4 M 1 + i 16M i 4 M (|Z| 2|Q|) .
2 i=2 i=1
$
Thus,there are at least 4 M (|Z| 2|Q|) vertex-disjoint paths connecting vertices
in X to vertices in 7i=2 Ki as desired.

Lemma 7. For 1 M n2 /4, and for any subset Z Z in H nn with
|Z| = 4M , any dominator set D of Z satises |D| |Z|/2 = 2M .
Proof. Suppose for contradiction that D is a dominator set for Z in H nn
such that |D| 2M 1. Let D D be the subset of the vertices
of D
composed by vertices which are not internal to the sub-CDAGs H 2 M 2 M .
From Lemma $ 6, with Q = D \ D , there exist X X and Y Y with |X| =
|Y | 4 M (|Z| 2 (|D| |D |)) such that vertices in X are connected to
vertices in Y by vertex-disjoint paths. Hence, each vertex in D can be on
 
at most one of these
 
$ paths. Thus, there exists X X and Y  Y  with

|X | = |Y | = 4 M (|Z| 2 (|D| |D |)) |D | paths from X to Y with
no vertex in D . From Lemma 6, we also have that all vertices in Y , and, hence,
in Y  , are connected to some vertex in Z by a path with no vertex in D \ D .
Thus, there are at least paths connecting vertices in X  X to vertices in
Z with no vertex in D. We shall now show that the contradiction assumption
|D| 2M 1 implies > 0:
 $ 2
4 M (|Z| 2 (|D| |D |)) = 16M (|Z| 2 (|D| |D |)) ,
= 16M (|Z| 2|D|) + 32M |D |.

By |D| 2M 1, we have |Z| 2|D| > 4M 2(M 1) > 0. Furthermore, from


D D, we have 32M > 2M 1 > |D| |D |. Therefore:
 $ 2
2
( + |D |) = 4 M (|Z| 2 (|D| |D |)) > |D |2 . (3)

Again, |D| 2M 1 implies M (|Z| 2 (|D| |D |)) > 0. Hence, we can take
the square root on both sides of (3) and conclude that > 0. Therefore, for
|D| 2M 1 there are at least > 0 paths connecting a global input vertex
to a vertex in Z with no vertex in D, contradicting the assumption that D is a
dominator of Z.

Lemma 7 provides us with the tools required to obtain our main result.
Theorem 1 (Lower bound I/O complexity Strassens algorithm). The
I/O-complexity of Strassens algorithm to multiply two matrices A, B Rnn ,
on a sequential machine with cache of size M n2 , satises:
 log2 7
1 n
IOH nn (M ) M. (4)
7 M
190 G. Bilardi and L. De Stefani

On P processors, each with a local memory of size M n2 , the I/O complexity


satises:
 log2 7
1 n M
IOH nn (P, M ) . (5)
7 M P


Proof. We start by proving (4). Let n = 2a and M = 2b for some a, b N.
At least 3n2 3M I/O operations are necessary in order to read the 2n2 input
values from slow memory to the cache and to write the n2 output
values to the
slow memory. The bound in (4) is therefore veried if n 2 M .
 log2 7
For n 4 M , let Z denote the set of output vertices of the n/(2 M )

sub-CDAGs H 2 M 2 M of H nn . Let C be any computation schedule for the se-
quential execution of Strassens algorithm using a cache of size M . We partition C
into segments C1 , C2 , . . . such that during each Ci exactly 4M distinct vertices in Z
 log 7
(denoted as Zi ) are evaluated for the rst time. Since |Z| = 4M n/(2 M ) ,
 log 7
there are n/(2 M ) such segments. Below we show that the number qi of
I/O operations executed during each Ci satises qi M , from which (4) follows.
To bound qi , consider the set Di of vertices of H nn corresponding to the at
most M values stored in the cache at the beginning of Ci and to the at most qi
values loaded into the cache from the slow memory during Ci by means of a read
I/O operation. Clearly, |Di | M + qi . In order for the 4M values from Zi to be
computed during Ci there cannot be any path connecting any vertex in Zi to any
input vertex of H nn which does not have at least one vertex in Di ; that is, Di
has to be a dominator set of Zi . We recall that |Zi | = 4M and, from Lemma 7,
we have that any subset of 4M elements of Z has dominator size at least 2M ,
whence M + qi |Di | 2M , which implies qi M as stated above.
The proof for the bound for the parallel model in (5), follows a similar strategy:
At least one of the P processors being used, denoted as P , must compute at
 log 7
least |Z|/P = 4M n/(2 M ) /P values corresponding to vertices in Z. The
bound follows by applying the same argument discussed for the sequential case to
the computation executed by P (details the extended on-line version [29]).

Ballard et al. [20] presented a version of Strassens algorithm whose I/O cost
matches the lower bound of Theorem 1 to within a constant factor. Therefore, our
bound is asymptotically tight, and the algorithm in [20] is asymptotically I/O opti-
mal. Since in this algorithm no intermediate result is recomputed, recomputation
can lead at most to a constant factor reduction of the I/O complexity.

The lower bound of Theorem 1 generalizes to ((n/ M )log2 7 M B ) in the
External Memory Model introduced by Aggarwal and Vitter [31], where B 1
values can be moved between cache and consecutive slow memory locations with
a single I/O operation.
The I/O Complexity of Strassen's Matrix Multiplication with Recomputation 191

4 Conclusion
This work has contributed to the characterization of the I/O complexity of
Strassens algorithm by establishing asymptotically tight lower bounds that
hold even when recomputation is allowed. Our technique exploits the recursive
nature of the CDAG, which makes it promising for the analysis of other recursive
algorithms, e.g., for fast rectangular matrix multiplication [32].
The relationship we have exploited between dominator size and Grigorievs ow
points at connections between I/O complexity, (pebbling) space-time tradeos [28],
and VLSI area-time tradeos [33]; these connections deserve further attention.
Some CDAGs for which non-trivial I/O complexity lower bounds are known
only in the case of no recomputations are described in [19]. These CDAGs are of
interest in the limiting technology model, dened by fundamental limitations
on device size and message speed, as they allow for speedups super-linear in the
number of processors. Whether such speedups hold even when recomputation is
allowed remains an open question, which our new technique might help answer.
While we know that recomputation may reduce the I/O complexity of some
CDAGs, we are far from a characterization of those CDAGs for which recompu-
tation is eective. This broad goal remains a challenge for any attempt toward a
general theory of the communication requirements of computations.

References
1. Patterson, C.A., Snir, M., Graham, S.L.: Getting Up to Speed:: The Future of
Supercomputing. National Academies Press (2005)
2. Bilardi, G., Preparata, F.P.: Horizons of parallel computation. Journal of Parallel
and Distributed Computing 27(2) (1995) 172182
3. Strassen, V.: Gaussian elimination is not optimal. Numerische Mathematik 13(4)
(1969) 354356
4. Le Gall, F.: Powers of tensors and fast matrix multiplication. In: Proc. ACM
ISSAC, ACM (2014) 296303
5. Hong, J., Kung, H.: I/o complexity: The red-blue pebble game. In: Proc. ACM
STOC, ACM (1981) 326333
6. Cannon, L.E.: A cellular computer to implement the Kalman lter algorithm.
Technical report, DTIC Document (1969)
7. Ballard, G., Demmel, J., Holtz, O., Lipshitz, B., Schwartz, O.: Brief announce-
ment: strong scaling of matrix multiplication algorithms and memory-independent
communication lower bounds. In: Proc. ACM SPAA, ACM (2012) 7779
8. Irony, D., Toledo, S., Tiskin, A.: Communication lower bounds for distributed-
memory matrix multiplication. Journal of Parallel and Distributed Computing
64(9) (2004) 10171026
9. Scquizzato, M., Silvestri, F.: Communication lower bounds for distributed-memory
computations. arXiv preprint arXiv:1307.1805 (2013)
10. Pagh, R., Stockel, M.: The input/output complexity of sparse matrix multiplication.
In: Proc. ESA, Springer (2014) 750761
11. Ballard, G., Demmel, J., Holtz, O., Schwartz, O.: Minimizing communication in
numerical linear algebra. SIAM Journal on Matrix Analysis and Applications 32(3)
(2011) 866901
192 G. Bilardi and L. De Stefani

12. Ballard, G., Demmel, J., Holtz, O., Schwartz, O.: Communication-optimal parallel
and sequential Cholesky decomposition. SIAM Journal on Scientic Computing
32(6) (2010) 34953523
13. Loomis, L.H., Whitney, H.: An inequality related to the isoperimetric inequality.
Bull. Amer. Math. Soc. 55(10) (10 1949) 961962
14. V. A. Zalgaller, A. B. Sossinsky, Y.D.B. The American Mathematical Monthly
96(6) (1989) 544546
15. Ballard, G., Demmel, J., Holtz, O., Schwartz, O.: Graph expansion and communi-
cation costs of fast matrix multiplication. JACM 59(6) (2012) 32
16. Ballard, G., Demmel, J., Holtz, O., Lipshitz, B., Schwartz, O.: Graph expansion
analysis for communication costs of fast rectangular matrix multiplication. In:
Design and Analysis of Algorithms. Springer (2012) 1336
17. Scott, J., Holtz, O., Schwartz, O.: Matrix multiplication I/O complexity by Path
Routing. In: Proc. ACM SPAA. (2015) 3545
18. De Stefani, L.: On space constrained computations. PhD thesis, University of
Padova (2016)
19. Bilardi, G., Preparata, F.: Processor-time trade os under bounded speed message
propagation. Lower Bounds. Theory of Computing Systems 32(5) (1999) 531559
20. Ballard, G., Demmel, J., H., O., Lipshitz, B., Schwartz, O.: Communication-optimal
parallel algorithm for Strassens matrix multiplication. In: Proc. ACM SPAA. (2012)
193204
21. Jacob, R., Stockel, M.: Fast output-sensitive matrix multiplication. In: Proc. ESA.
Springer (2015) 766778
22. Savage, J.E.: Extending the Hong-Kung model to memory hierarchies. In: Com-
puting and Combinatorics. Springer (1995) 270281
23. Bilardi, G., Peserico, E.: A characterization of temporal locality and its portability
across memory hierarchies. In: Automata, Languages and Programming. Springer
(2001) 128139
24. Koch, R.R., Leighton, F.T., Maggs, B.M., Rao, S.B., Rosenberg, A.L., Schwabe,
E.J.: Work-preserving emulations of xed-connection networks. JACM 44(1) (1997)
104147
25. Bhatt, S.N., Bilardi, G., Pucci, G.: Area-time tradeos for universal VLSI circuits.
Theoret. Comput. Sci. 408(2-3) (2008) 143150
26. Bilardi, G., Pietracaprina, A., DAlberto, P.: On the space and access complexity of
computation DAGs. In: Graph-Theoretic Concepts in Computer Science, Springer
(2000) 4758
27. Grigorev, D.Y.: Application of separability and independence notions for proving
lower bounds of circuit complexity. Zapiski Nauchnykh Seminarov POMI 60 (1976)
3848
28. Savage, J.E.: Models of Computation: Exploring the Power of Computing. 1st edn.
Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA (1997)
29. Bilardi, G., Stefani, L.D.: The i/o complexity of strassens matrix multiplication
with recomputation. arXiv preprint arXiv:1605.02224 (2016)
30. Ranjan, D., Savage, J.E., Zubair, M.: Upper and lower I/O bounds for pebbling
r-pyramids. Journal of Discrete Algorithms 14 (2012) 212
31. Aggarwal, A., Vitter, Jerey, S.: The input/output complexity of sorting and
related problems. Commun. ACM 31(9) (September 1988) 11161127
32. Le Gall, F.: Faster algorithms for rectangular matrix multiplication. In: Proc. IEEE
FOCS, IEEE (2012) 514523
33. Thompson, C.: Area-time complexity for VLSI. In: Proc. ACM STOC, ACM (1979)
8188
Maximum Plane Trees in Multipartite
Geometric Graphs

Ahmad Biniaz1 , Prosenjit Bose1 , Kimberly Crosbie1 , Jean-Lou De Carufel2 ,


David Eppstein3 , Anil Maheshwari1 , and Michiel Smid1

Abstract. A geometric graph is a graph whose vertices are points in the


plane and whose edges are straight-line segments between the points. A
plane spanning tree in a geometric graph is a spanning tree that is non-
crossing. Let R and B be two disjoint sets of points in the plane where
the points of R are colored red and the points of B are colored blue, and
let n = |R B|. A bichromatic plane spanning tree is a plane spanning
tree in the complete bipartite geometric graph with bipartition (R, B).
In this paper we consider the maximum bichromatic plane spanning tree
problem, which is the problem of computing a bichromatic plane span-
ning tree of maximum total edge length.
1. For the maximum bichromatic plane spanning tree problem, we
present an approximation algorithm with ratio 1/4 that runs in
O(n log n) time.
2. We also consider the multicolored version of this problem where the
input points are colored with k > 2 colors. We present an approxi-
mation algorithm that computes a plane spanning tree in a complete
k-partite geometric graph, and whose ratio is 1/6 if k = 3, and 1/8
if k  4.
3. We also revisit the special case of the problem where k = n, i.e., the
problem of computing a maximum plane spanning tree in a complete
geometric graph. For this problem, we present an approximation
algorithm with ratio 0.503; this is an extension of the algorithm
presented by Dumitrescu and Toth (2010) whose ratio is 0.502.

1 Introduction
Let P be a set of n points in the plane in general position, i.e., no three points
are collinear. Let K(P ) be the complete geometric graph with vertex set P . It
is well known that the standard minimum spanning tree (MinST) problem in
K(P ) can be solved in (n log n) time. Also, any minimum spanning tree in
K(P ) is plane, i.e., its edges do not cross each other. The maximum spanning
tree (MaxST) problem is the problem of computing a spanning tree in K(P )
whose total edge length is maximum. Monma et al. [5] showed that this problem
1
Carleton University, Ottawa. Supported by NSERC. [email protected], kim-
[email protected], {jit, anil, michiel}@scs.carleton.ca
2
University of Ottawa, Ottawa. Supported by NSERC. [email protected]
3
University of California, Irvine. Supported by NSF grant CCF-1228639. epp-
[email protected]

Springer International Publishing AG 2017 193


F. Ellen et al. (Eds.): WADS 2017, LNCS 10389, pp. 193204, 2017.
DOI: 10.1007/978-3-319-62127-2_17
194 A. Biniaz et al.

can be solved in (n log n) time. However, a MaxST is not necessarily plane.


Alon et al. [1] started the maximum plane spanning tree (MaxPST) problem,
which is the problem of computing a plane spanning tree in K(P ) whose total
edge length is maximum. It is not known whether or not this problem is NP-hard.
They presented an approximation algorithm with ratio 0.5 for this problem. This
approximation ratio was improved to 0.502 by Dumitrescu and Toth [4].
Let R and B be two disjoint sets of points in the plane such that R B is in
general position, and let n = |RB|. Suppose that the points of R are colored red
and the points of B are colored blue. Let K(R, B) be the complete bipartite ge-
ometric graph with bipartition (R, B). The minimum bichromatic spanning tree
(MinBST) problem is to compute a minimum spanning tree in K(R, B). The
maximum bichromatic spanning tree (MaxBST) problem is to compute a span-
ning tree in K(R, B) whose total edge length is maximum. Recently, Biniaz et
al. [2] showed that both the MinBST and the MaxBST problems can be solved
in (n log n) time. We note that none of MinBST and MaxBST is necessarily
plane; they might have crossing edges. Borgelt et al. [3] studied the problem of
computing a minimum bichromatic plane spanning tree, which we refer to as
the MinBPST problem. They showed that this problem is NP-hard, and also
presenteda polynomial-time approximation algorithm with approximation ra-
tio of O( n). In this paper we study the problem of computing a maximum
bichromatic plane spanning tree, which we refer to as the MaxBPST problem.
See Figure 1.

MaxBST MaxBPST Max-4-ST Max-4-PST

Fig. 1. Maximum spanning trees.

A natural extension of the MinBST and the MaxBST problems is to have


more than two colors. In this multicolored version, the input points are colored
by k > 2 colors, and we are looking for a minimum (resp. maximum) spanning
tree in which the two endpoints of every edge have distinct colors. In other words,
we look for a minimum (resp. maximum) spanning tree in a complete k-partite
geometric graph. We refer to these problems as the Min-k-ST and the Max-k-ST
problems, respectively. Biniaz et al. [2] showed that both these problems can be
solved in O(n log n log k) time. Notice that the MinST and the MaxST problems
are special cases of the Min-k-ST and the Max-k-ST problems in which every
input point has a unique color, i.e., k = n. In this paper we also study the
problem of computing a plane Max-k-ST, which we refer to as the Max-k-PST
problem. See Figure 1.
Maximum Plane Trees in Multipartite Geometric Graphs 195

1.1 Our contributions


In this paper we study the maximum plane spanning tree problems. In Section 3
we present an approximation algorithm with ratio 1/4 for the MaxBPST prob-
lem. We study the Max-k-PST problem in Section 4. For this problem, we present
an approximation algorithm whose ratio is 1/6 if k = 3, and 1/8 if k  4. In
Section 5 we consider the MaxPST problem, where we modify the algorithm pre-
sented by Dumitrescu and Toth [4] for this problem; this modication improves
the approximation ratio to 0.503. All the presented approximation algorithms
run in O(n log n) time, where n is the number of input points.

2 Preliminaries
For any two points p and q in the plane, we refer to the line segment between
p and q as pq, and to the Euclidean distance between p and q as |pq|. The lune
between p and q, which we denote by lune(p, q), is the intersection of the two
disks of radius |pq| that are centered at p and q.
For a point set P , the diameter of P is the maximum Euclidean distance
between any two points of P . A pair of points that realizes the diameter of P is
referred to as a diametral pair.
Let G be a geometric graph with colored vertices. We denote by L(G) the
total Euclidean length of the edges of G. A star is a tree with one internal node,
which we refer to as the center of the star. For a color c, a c-star in G is a star
whose center is colored c and the colors of its leaves are dierent from c.

3 The MaxBPST problem


In this section we consider the MaxBPST problem. Recall that in this problem we
are given two sets R and B of red and blue points in the plane, respectively, and
we are looking for a maximum plane spanning tree in K(R, B). Let n = |R B|.
We present an approximation algorithm with ratio 1/4 for this problem that
runs in O(n log n) time.
We will show that the length of the longest star in K(R, B) is at least 1/4
times the length of an optimal MaxBPST. In fact, we present an algorithm that
returns such a star. Moreover, we show that this estimate is the best possible for
the length of a longest star. The longest star can easily be augmented to form
a plane spanning tree as follows. The longest star has exactly one point of one
color as its center, and all points of other color as its leaves. The edges of this
star can be extended to partition the plane into convex cones, possibly except
one cone; we split this cone into two convex cones by adding its bisector. Then,
we connect all the remaining points in each cone to one of the leaves that is on
the boundary of that cone.
If |R| = 1 or |B| = 1, then the problem is trivial. Assume |R|  2 and |B|  2.
Our algorithm rst computes a diametral pair (a, b) in R and a diametral pair
(p, q) in B. Then, returns the longest star Sx in K(R, B) that is centered at
196 A. Biniaz et al.

a point x {a, b, p, q}. Since diametral pairs of R and B can be computed in


O(n log n) time, the running time of the algorithm follows. In the rest of this
section we will show that the longest of these stars satises the approximation
ratio.
Let T be an optimal MaxBPST and let L denote the length of T . We
make an arbitrary point the root of T and partition the edges of T into two

sets as follows. Let ER be the set of edges (u, v) in T where u is a red point

and u is the parent of v. Let EB be the set of edges (u, v) where u is a blue

point and u is the parent of v. The edges of ER (resp. EB ) form a forest in
which each component is a red-star (resp. blue-star). Let LR and LB denote the


total lengths of the edges of ER and EB , respectively. Without loss of generality

assume that LR  LB . Then,
L = LB + LR  2LB . (1)
We will show that, in this case, the longest of Sp and Sq is a desired tree.
To that end, let FB be the set of edges that is obtained by connecting every
red point to its farthest blue point. Notice that the edges of FB form a forest in
which every component is a blue-star. Moreover, observe that
LB  L(FB ). (2)
Lemma 1. L(FB )  2 (L(Sp ) + L(Sq )).
3

Proof. Let Cp and Cq be the two disks of radius |pq| that are centered at p and
q, respectively. Since (p, q) is a diameter of B, all blue points lie in lune(p, q);
see Figure 2(a).

r r
q
p q p q p q
1
f (r) p x

f (r) 1

f (r)
3
Cp Cq
s s
(a) (b) (c)

Fig. 2. Illustration of Lemmas 1 and 2: r is a red point, and p, q, f (r) are blue points.

For any red point r R, let f (r) denote its neighbor in FB . Recall that f (r)
is the farthest blue point to r, and note that f (r) is in lune(p, q). See Figure 2(a).
Maximum Plane Trees in Multipartite Geometric Graphs 197

We are going to show that |rf (r)|  23 (|rp| + |rq|). Depending on whether or
not r lune(p, q) we consider the following two cases.

r / lune(p, q). Thus, we have that r / Cp or r / Cq . Without loss of


generality assume r / Cp ; see Figure 2(a). By the triangle inequality we have
|rf (r)|  |rq|+|qf (r)|. Since pq is a diameter of B, we have |qf (r)|  |pq|. In
addition, since r / Cp , we have |pq|  |rp|. By combining these inequalities,
we get
|rf (r)|  |rq| + |qf (r)|  |rq| + |pq|  |rq| + |rp|.

r lune(p, q). Without loss of generality assume that pq has unit length, pq
is horizontal, r is above pq, and r is closer to q than to p. If f (r) is on or
above pq, then |rf (r)| is smaller than |pq|, and hence smaller than |rp| + |rq|.
Assume f (r) is below pq. Let s be the intersection point of the boundaries
of Cp and Cq that is below pq as in Figure 2(b).

Claim 1. |rf (r)|  |rs|.


Proof of Claim 1. Let f  (r) be the intersection point of the ray that is
emanating from r and passing through f (r) with the boundary of lune(p, q).
Note that |rf (r)|  |rf  (r)|. If f  (r) is on the boundary of Cq , then the
perpendicular bisector of the segment sf  (r) passes through q. In this case
r is in the same side of this perpendicular as f  (r), and thus, |rf  (r)|  |rs|;
see Figure 2(b). Similarly, if f  (r) is on the boundary of Cp , then both r and
f  (r) are on a same side of the perpendicular bisector of sf  (r) which passes
through p. This proves the claim.

Extend the line segment sp from the endpoint p. Let p be the point on the
extended line that is closest to r. Dene q  similarly. Note that |rp |  |rp|
and |rq  |  |rq|. Based on this and Claim 1, in order to show that |rf (r)| 
2 (|rp| + |rq|), it suces to show that |rs|  2 (|rp | + |rq  |). Let = rsq,
3 3
and note that 0   6 ; see Figure 2(c). Since the triangles rsp and
rsq  are right-angled and spq is equilateral, we have |rq  | = |rs| sin
and |rp | = |rs| sin(/3 ). Thus,

3
|rq  | + |rp | = |rs| (sin + sin(/3 ))  2
|rs|,

where the inequality is valid because sin + sin(/3 ) is at least 3/2
for all 0   6 . This implies that |rs|  23 (|rp | + |rq  |).

Since in both previous cases |rf (r)|  2 (|rp| + |rq|), we have


3
  2 2
L(FB ) = |rf (r)|  (|rp| + |rq|) = (L(Sp ) + L(Sq )).
3 3
rR rR



198 A. Biniaz et al.

Combining Inequalities (1), (2), and Lemma 1, we get


4
L  2LB  2L(FB )  (L(Sp ) + L(Sq )).
3

Therefore, the length of the longest of Sp and Sq is at least 83 0.215 times

L . In the following lemma we improve the bound of Lemma 1 by proving that
L(FB )  L(Sp ) + L(Sq ); this improves the approximation ratio to 1/4. However,
the proof of this lemma is algebraic.
Lemma 2. L(FB )  L(Sp ) + L(Sq ).
Proof. For any red point r R, let f (r) denote its neighbor in FB . In order to
prove this lemma, as we have seen in the proof of Lemma 1, it suces to show
that |rf (r)|  |rp| + |rq|. Dene lune(p, q) as in the proof of Lemma 1. As we
have seen there, if r
/ lune(p, q), then |rf (r)|  |rp|+|rq|. Assume r lune(p, q).
Without loss of generality assume that pq has unit length, pq is horizontal, r is
above pq, and r is closer to q than to p; see Figure 2(c). Dene the point s as in
the proof of Lemma 1. By Claim 1 in the proof of Lemma 1, in order to show
that |rf (r)|  |rp| + |rq|, it suces to showthat |rs|  |rp| + |rq|. Let x = |rs|
and = rsq; see Figure 2(c). Note that 3/2  x  3 and 0   6 . By
the cosine rule we have
$ $
|rp| = 1 + x2 2x cos(/3 ) and |rq| = 1 + x2 2x cos .

Dene
$ $
f (x, ) = 1 + x2 2x cos(/3 ) + 1 + x2 2x cos x. (3)

Then, |rp| + |rq| |rs| =


f (x, ). In
the full version of the paper we show
that f (x, )  0 for all 3/2  x  3 and 0   6 . This implies that
|rs|  |rp| + |rq|.

To this end, we have proved the following theorem:
Theorem 1. Let R and B be two disjoint sets of points in the plane such that
R B is in general position, and let n = |R B|. One can compute, in O(n log n)
time, a plane spanning tree in K(R, B) whose length is at least 1/4 times the
length of a maximum plane spanning tree.

3.1 A matching upper bound


In this section we show that the above estimate is best possible for the length
of the longest star in K(R, B). Consider a set R of n/2 red points and a set B
of n/2 blue points that are equally distributed in two circles of arbitrary very
small radius with their centers at distance 1; see Figure 3. The bichromatic plane
spanning tree/path that is shown in this gure, has n 2 edges of unit length
and one small edge. Any star in K(R, B) has n/4 edges of unit length, plus n/4
edges of very small length. Thus, the length of the longest star, in this example,
is about 1/4 times the length of an optimal MaxBPST (at the limit).
Maximum Plane Trees in Multipartite Geometric Graphs 199

Fig. 3. Illustration of the upper bound.

4 The Max-k-PST problem


In the multicolored version of the maximum plane spanning tree problem, the
input points are colored by more than two colors, and we want the two endpoints
of every edge in the tree to have distinct colors. Formally, we are given a set
P of n points in the plane in general position that is partitioned into subsets
P1 , . . . , Pk , with k  3. For each c {1, . . . , k}, assume the points of Pc are
colored c. Let K(P1 , . . . , Pk ) be the complete multipartite geometric graph on
P , which has edges between every point of each set in the partition to all points of
the other sets. The Max-k-PST problem is the problem of computing a maximum
plane spanning tree in K(P1 , . . . , Pk ). The standard MaxPST problem can be
interpreted as an instance of this multicolored version in which k = n, i.e., each
point has a unique color. In this section, we present an approximation algorithm,
for the Max-k-PST problem, whose ratio is 1/6 if k = 3, and 1/8 if k  4.
We will show that the length of the longest star in K(P1 , . . . , Pk ) is at least
1/8 (resp. 1/6) times the length of an optimal Max-k-PST if k  4 (resp. k =
3). In fact, we present an O(n log n)-time algorithm that returns such a star.
The algorithm is as follows. Compute a bichromatic diameter (p, q) of P , i.e.,
two points of dierent colors that have the maximum distance. It can easily be
veried, by contradiction, that the MaxST in K(P ), which can be computed in
O(n log n) time [5], contains a bichromatic diameter of P . Notice that the length
of any edge in K(P1 , . . . , Pk ) is at most |pq|. Without loss of generality assume
that p Pi and q Pj . Notice that all points of P \ (Pi Pj ) lie in lune(p, q),
because, otherwise (p, q) cannot be a bichromatic diameter of P . To simplify
the notation, we write R, B, and G, for Pi , Pj , and P \ (Pi Pj ), respectively.
Moreover, we assume that the points of R, B, and G are colored red, blue,
and green, respectively. Compute a diametral pair (r, r  ) in R, a diametral pair
(b, b ) in B, and a diametral pair (g, g  ) in G. Return the longest star Sx in
K(P1 , . . . , Pk ) that is centered at a point x {p, q, r, r , b, b , g, g  }. We show
that the length of Sx is at least 1/8 times the length of an optimal tree.
Let T be an optimal Max-k-PST, and let L denote the length of T . We
make an arbitrary point the root of T and partition the edges of T into four

sets as follows. Let ER be the set of edges (u, v) in T where u is a red point

and u is the parent of v. Let EB be the set of edges (u, v) where u is a blue

point and u is the parent of v. Let EG be the set of edges (u, v) where u is a
green point, v is not a green point, and u is the parent of v. Let E be the set

of edges (u, v) where both u and v are green points. The edges of each of ER ,
200 A. Biniaz et al.


EB , and EG form a forest in which each component is a red-star, a blue-star,
and a green-star, respectively. Let LR , LB , and LG denote the total lengths of

the edges of ER , EB , and EG , respectively. Let LE denote the total length of
the edges in E . Then,

L = LR + LB + LG + LE .

We consider the following two cases depending on where or not LE is larger than
max{LR , LB , LG }.

LE  max{LR , LB , LG }. In this case LE  14 L . The number of edges in E


is at most n(G)1, where n(G) is the number of points in G. Recall that the
length of every edge in E is at most |pq|. Thus LE  (n(G) 1) |pq|. Each
of the stars Sp and Sq has an edge to every point of G. Thus L(Sp )+L(Sq ) 
n(G) |pq|. Therefore,
1
4
L  LE  (n(G) 1) |pq| < n(G) |pq|  L(Sp ) + L(Sq ),

which implies that the longest of Sp and Sq has length at least 18 L .


LE < max{LR , LB , LG }. Without loss of generality assume that LB =
max{LR , LB , LG }. Thus, LB  14 L . Let FB be the set of edges that is
obtained by connecting every point of R G to its farthest blue point.
Notice that the edges of FB form a forest in which every component is
a blue-star. Observe that LB  L(FB ). Moreover, by Lemma 2 we have
L(FB )  L(Sb ) + L(Sb ). Therefore,
1
4
L  LB  L(FB )  L(Sb ) + L(Sb ),

which implies that the longest of Sb and Sb has length at least 18 L .

The point set {p, q, r, r , b, b , g, g  } can be computed in O(n log n) time, and thus,
the running time of the algorithm follows.

Note 1. If k = 3, then E is empty, and thus, the longest star Sx with x


{r, r , b, b , g, g  } has length at least 16 L .

Note 2. If the diameter pair of P is monochromatic, then we get the ratio of


1/6. Assume both points of a diametral pair (p, q) of P belong to Pi . Let R = Pi
and G = R \ Pi . Then, B is empty and L = LR + LG + LE . Moreover, we have
r = p and r = q. If LG  13 L , then the longest of Sg and Sg has length at
least 16 L . If LG < 13 L , then LR  L(Sr ) + L(Sr ) and LE  L(Sr ) + L(Sr ).
Thus, the longest of Sr and Sr has length at least 16 L .

Theorem 2. Let P be a set of n points in the plane in general position that is


partitioned into subsets P1 , . . . , Pk , with k  3. One can compute, in O(n log n)
time, a plane spanning tree in K(P1 , . . . , Pk ) whose length is at least 1/8 (resp.
1/6) times the length of a maximum plane spanning tree if k  4 (resp. k = 3).
Maximum Plane Trees in Multipartite Geometric Graphs 201

5 The MaxPST problem

In this section we study the MaxPST problem, a special case of the Max-k-PST
problem where every input point has a unique color. Formally, given a set P
of points in the plane in general position and we want to compute a maximum
plane spanning tree in K(P ). We revisit this problem which was rst studied by
Alon, Rajagopalan and Suri (1993), and then by Dumitrescu and Toth (2010).
Alon et al. [1] presented an approximation algorithm with ratio 1/2 for this
problem. In fact they proved that the length of the longest star in K(P ) is at
least 0.5 times the length of an optimal tree; this bound is tight for a longest
star. Dumitrescu and Toth [4] improved the approximation ratio to 0.502. They
proved that the length of the longest double-star in K(P ) (a double-star is a tree
with two internal nodes) is at least 0.502 times the length of an optimal solution.
They left as an open problem a more precise