A L G O R I T H M I C A S P E C T S O F C O N S T R A I N E D U N I T DISK G R A P H S By Heinz Breu B.Sc. University of British Columbia, 1978 M.Sc. University of British Columbia, 1980 A THESIS SUBMITTED IN PARTIAL F U L F I L L M E N T OF T H E REQUIREMENTS FOR T H E D E G R E E OF D O C T O R OF P H I L O S O P H Y in T H E FACULTY OF G R A D U A T E STUDIES C O M P U T E R SCIENCE We accent this thesis as conforming to the required standard T H E UNIVERSITY OF BRITISH COLUMBIA April 1996 © Heinz Breu, 1996 In presenting this thesis in partial fulfillment of the requirements for an advanced degree at the University of British Columbia, I agree that the Library shall make it freely available for reference and study. I further agree that permission for extensive copying of this thesis for scholarly purposes may be granted by the head of my department or by his or her representatives. It is understood that copying or publication of this thesis for financial gain shall not be allowed without my written permission. Computer Science The University of British Columbia 2366 Main Mall Vancouver, Canada V 6 T 1Z4 Date: Abstract Computational problems on graphs often arise in two- or three-dimensional geometric contexts. Such problems include assigning channels to radio transmitters (graph colouring), physically routing traces on a printed circuit board (graph drawing), and modelling molecules. It is reasonable to expect that natural graph problems have more efficient solutions when restricted to such geometric graphs. Unfortunately, many familiar N P complete problems remain NP-complete on geometric graphs. Indifference graphs arise in a one-dimensional geometric context; they are the intersection graphs of unit intervals on the line. Many NP-complete problems on arbitrary graphs do have efficient solutions on indifference graphs. Yet these same problems remain NP-complete for the intersection graphs of unit disks in the plane (unit disk graphs), a natural two-dimensional generalization of indifference graphs. What accounts for this situation, and how can algorithms be designed to deal with it? To study these issues, this thesis identifies a range of subclasses of unit disk graphs in which the second spatial dimension is gradually, introduced. More specifically, T - strip graphs "interpolate" between unit disk graphs and indifference graphs; they are the intersection graphs of unit-diameter disks whose centres are constrained to lie in a strip of thickness r. This thesis studies algorithmic and structural aspects of varying the value r for r-strip graphs. The thesis takes significant steps towards characterizing, recognizing, and laying out strip graphs. We will also see how to develop algorithms for several problems on strip graphs, and how to exploit their geometric representation. In particular, we will see that problems become especially tractable when the strips are "thin" (r is small) or "discrete" ii (the number of possible y-coordinates for the disks is small). Note again that indifference graphs are the thinnest (r = 0) and most discrete (one y-coordinate) of the nontrivial r-strip graphs. The immediate results of this research concern algorithms for a specific class of graphs. The real contribution of this research is the elucidation of when and where geometry can be exploited in the development of efficient graph theoretic algorithms. in Table of Contents Abstract ii List of Tables ix List of Figures xi Acknowledgement 1 Introduction 1 1.1 Prologue 1 1.2 Geometric Constraints in Graph Theory 3 1.3 Conventions, Background, and Notation 5 1.3.1 Sets 6 1.3.2 Graphs 10 1.3.3 Geometry 17 1.3.4 Algorithms 19 1.3.5 Unit Disk, Strip, and 2-Level Graphs 24 1.4 2 xvi Overview: A Reader's Guide 26 Related Research 29 2.1 Unit Disk Graphs 29 2.1.1 Cluster Analysis 30 2.1.2 Random Test Case 30 2.1.3 Molecular Graphics and Decoding Noisy Data 31 iv 2.1.4 31 2.2 Geometric Intersection Graphs 32 2.3 Perfect Graphs 34 2.3.1 Cocomparability Graphs 36 2.3.2 Indifference Graphs 40 2.3.3 Grid Graphs 44 2.4 3 Radio Frequency Assignment Proximity Graphs 46 2.4.1 The Delaunay Triangulation Hierarchy 47 2.4.2 Sphere of Influence Graphs 48 Unit Disk Graphs 50 3.1 Basic Observations 51 3.1.1 Connections with Planarity 52 3.1.2 Every r-Strip Graph is a Cocomparability Graph 54 3.2 3.3 3.4 Exploiting a Geometric Model 57 3.2.1 Least Vertex-Weight Paths in Unit Disk Graphs 57 3.2.2 Semi-Dynamic Single-Point Circular-Range Queries 67 3.2.3 Building an Adjacency List from a Model 72 NP-Complete Problems Restricted to Unit Disk Graphs 83 3.3.1 Independent Set 85 3.3.2 Maximum Clique 90 3.3.3 Chromatic Number 94 Unit Disk Graph Recognition is NP-Hard 104 3.4.1 Coin Graphs 105 3.4.2 A Graph That Simulates S A T I S F I A B I L I T Y 108 3.4.3 Drawing the Graph on the Grid 109 v 4 Simulating the Drawing with Coins 114 3.4.5 Fabricating Flippers 118 3.4.6 Capacity Arguments 120 3.4.7 The Skeleton of the Graph G 3.4.8 The Components of the Graph G 124 3.4.9 Building and Realizing Gc 135 123 c c 3.4.10 Extending Coin Graph Recognition 137 3.4.11 Miscellaneous Properties 143 Cocomparability Graphs 146 4.1 Introduction 146 4.2 Algorithms for Dominating and Steiner Set Problems . 151 4.2.1 Connected Dominating Sets 153 4.2.2 Minimum Cardinality Dominating Sets 160 4.2.3 Total Dominating Sets 170 4.2.4 Weighted Independent Dominating Sets 177 4.2.5 Weighted Steiner Sets 182 4.2.6 Applications 188 4.3 5 3.4.4 Transitive Orientation, Implication Classes, and Dominating Paths . . . . 190 4.3.1 Definitions and Basic Properties 190 4.3.2 Transitive Orientation and Dominating Paths 193 4.3.3 Implications for Cocomparability Graphs 202 Strip G r a p h s 203 5.1 Exploiting a Geometric Model 205 5.1.1 Review of Cocomparability Results 206 5.1.2 Application to Strip Graphs 206 vi 5.2 Characterization V i a Cycles in Weighted Digraphs 209 5.2.1 Solving Systems of Difference Constraints 212 5.2.2 Constraint Digraphs Corresponding to r-Strip Graphs 216 5.2.3 A n 0(V ) 3 Algorithm for Laying Out Levelled, Complement Ori- ented, Strip Graphs 5.3 Stars in Strip-Graphs . 220 5.4 Distinguishing Strip Graphs and Indifference Graphs 227 5.4.1 Dangerous 4-Cycles 228 5.4.2 Connection with Indifference Graph Characterization 234 5.5 6 218 A Characterization of Trees in Strip Graphs 235 5.5.1 236 A Universal Embedding for Caterpillars Two-Level Graphs 242 6.1 Definitions 244 6.2 Examples 246 6i3 Exploiting a Geometric Realization 250 6.3.1 &:-Level Graphs and their Oriented Complements 250 6.3.2 A n Implicit Representation of the Oriented Complement 251 6.3.3 A n Algorithm for Constructing the Representation 254 6.3.4 A n Implicit Representation of the Transitive Reduction 257 6.3.5 Weighted Cliques and Independent Dominating Sets 259 6.4 Relation to Indifference Graphs 261 6.4.1 Trapezoid Graphs and PI* Graphs 262 6.4.2 Cross Edges Induce a Bipartite Permutation Graph 267 6.4.3 Short Edges Induce an Indifference Graph 273 vii 6.4.4 Every Two-Level Graph is the Intersection of Two Indifference Graphs 6.5 Recognizing Two-Level Graphs 281 6.5.1 Striated Two-Level Graphs 281 6.5.2 Orienting the Complement of a Two-Level Graph 284 6.5.3 There is No Forbidden-Ordered-Triple Characterization of Striated 6.5.4 6.6 7 275 Two-Level Graphs 298 Incomparability Between Different Thicknesses 300 Determining the Thickness of the Strip 305 Conclusion 310 7.1 312 Epilogue Bibliography 314 Appendix 325 A A D a t a Structure for Maintaining A.l "Test Tube" M a x i m a Definitions 325 325 A.2 Test Tubes, Maxima, and Their Properties 326 A.3 The Data Structure 332 A.4 Building the Data Structure 334 A.5 Deletions 340 Index 346 vm List of Tables 3.1 Algorithm: D I J K S T R A ( G , S ) 59 3.2 Algorithm: V E R T E X - D I J K S T R A ( G , S ) 61 3.3 Algorithm: MIN-PATH(G,S) 63 3.4 Algorithm: L I S T - D E L E T E ( G , u) 65 3.5 Algorithm: A D J - P L A N E - S W E E P ( V ) 77 3.6 Algorithm: A D J - D E L A U N A Y ( V , S) 79 3.7 Approximation algorithms 83 3.8 Algorithm: G R E E D Y ( G ) 99 4.1 Algorithm: OCC(G) 149 4.2 Complexity of Domination Problems 152 4.3 Algorithm: M C C D S - O C C ( G ) 158 4.4 Algorithm: M C C D S - C C ( G ) 159 4.5 Algorithm: AO-MCDS-OCC(G) 166 4.6 Algorithm: A l - M C D S - O C C ( G ) 167 4.7 Algorithm: A 3 - M C D S - 0 C C ( G ) 167 4.8 Algorithm: A 4 - M C D S - 0 C C ( G ) 168 4.9 Algorithm: A 5 - M C D S - 0 C C ( G ) 168 4.10 Algorithm: Aux-MCDS-OCC(G') 169 4.11 Algorithm: MCDS-OCC(G') 170 4.12 Algorithm: M C T D S - O C C ( G ) 176 4.13 Algorithm: M W M C - C ( G ) 181 ix 4.14 Algorithm: MWIDS-CC(G) 182 4.15 Algorithm: M W S S - O C C ( G , R) 184 4.16 Algorithm: MWSS-CC(G*, R) 187 5.1 Algorithm: MWSS-OCC(G', R) 207 5.2 Algorithm: S T R I P - L A Y O U T ( G ) 219 6.1 Algorithm: I N I T I A L I Z E - O R I E N T E D - C O M P L E M E N T ( V , / ) 252 6.2 Algorithm: T W O - L E V E L - F ( , j , p, n, / ) 255 6.3 Algorithm: G E N E R A T E - F ( V , / ) 256 6.4 Algorithm: k T R A N S ( V , / ) 258 6.5 Algorithm: M W M C - k ( V , / ) 260 6.6 Algorithm: 2STRIAE(G) 308 A.l Algorithm: C H I L D R E N ( u , d(L U R)) 334 ? A.2 Algorithm: F I L L - I N T E R N A L ^ ) 335 A.3 Algorithm: M E R G E R , dL, I, dR, r) 337 A.4 Algorithm: B R I D G E ( 3 L , /, dR, r) 338 A.5 Algorithm: DELETE-SITE(p, d(LuR),v) 343 x List of Figures 2.1 A permutation diagram (a) and its corresponding permutation graph (b). 37 2.2 Functions for intervals [/ ,r ] and [/„,r„] 40 2.3 Forbidden indifference graphs 42 2.4 A grid subgraph that is not a grid graph 44 2.5 Simulating edges in grid subgraphs with grid graphs 45 2.6 The grid graph G{ corresponding to the grid subgraph G 46 3.1 Crossing segments in a disk graph realization 52 3.2 A K^-free disk graph homeomorphic to K§ 54 3.3 A set of five points that generate an induced cycle 56 3.4 Adversary argument for shortest path 57 3.5 Any unit-radius query disk covers at most 21 cells 69 3.6 Algorithm A D J - P L A N E - S W E E P examines site p 77 3.7 The disk through p and q contains Voronoi center O; 80 3.8 Embedding the mth vertex [after [Val81]] 86 3.9 Components for simulating grid embeddings 87 3.10 Simulation of the grid embedding of a small graph 88 3.11 A saturated edge and a selected node disk 88 3.12 Saturating an unsaturated edge 90 3.13 The lune through a pair of sites 91 3.14 The unit-lune denned by a pair of sites 93 3.15 G(N(p) n N(q)) is not always cobipartite 95 u u s xi 3.16 A planar graph with degree at most 4 96 3.17 The graph from Figure 3.16 embedded in the grid . 3.18 Simulations for edges and pseudo-edges 97 97 3.19 A n instance of unit disk graph 3-colourability . 98 3.20 A S A T I S F I A B I L I T Y graph drawn on the grid 110 3.21 A n oriented grid drawing 112 3.22 A skewed oriented grid drawing 114 3.23 Schematic drawings for cages and flippers 115 3.24 The hexagonal realization of a cage 116 3.25 Joining cages 117 3.26 A hexagonal packing 117 3.27 Fabricating full flippers 118 3.28 Fabricating a half flipper 119 3.29 Dividing a hexagon into a quarter and three-quarters 120 3.30 Dividing a hexagon into two quarters and a half . . 121 3.31 The horizontal wire component 125 3.32 The vertical wire component 127 3.33 The corner components 128 3.34 The crossover component 129 3.35 The positive literal 131 3.36 The negative literal 132 3.37 Clause component 133 3.38 Capping a terminal 134 3.39 How to connect components 136 3.40 Expanding flippers 3.41 Joining square cages 138 139 xii 4.1 A cocomparability graph on nine vertices 147 4.2 Every 5-cycle in a cocomparability graph has a chord 150 4.3 Lemma 4.8, Case 2 155 4.4 Lemma 4.8, Case 3 156 4.5 Lemma 4.8, Case 4 156 4.6 Lemma 4.8.(ii) A graph with \P\ = 3 and \M\ = 2 157 4.7 Reducing total domination to domination 171 4.8 The effect of function / on a minimum cardinality dominating set 173 4.9 Lemma 4.26 Case 1 174 4.10 Lemma 4.26 Case 2.1 174 4.11 Lemma 4.26 Case 2.2 174 4.12 (a -i,b -i) k k e E if and only if (a ,b ) k k £ E 192 4.13 A n induced cycle on n > 5 vertices 193 4.14 The endpoints of a chordless path force the chords in the complement. . . 194 4.15 (s, t) captures (u, v) 195 4.16 Definition of u' and v' 196 5.1 7^1,4 is a 0.8-strip graph 204 5.2 The weighted digraph corresponding to 217 5.3 Point a is not on the boundary 222 5.4 Point b is not on the boundary 223 5.5 Point a is not on the boundary 225 5.6 Point b is not on the boundary 226 5.7 A claw in a thin strip 227 5.8 Case 1: (a, b) is positive, and (a,d) is positive 230 5.9 Case 2: (a, b) is positive, and (a,d) or (d, a) is negative 231 xiii 5.10 Case 3: (a, b) is negative, and (d,a) is positive 231 5.11 Case 4: (a,b) is negative, and (a,d) or (d,a) is negative 232 5.12 (—,+,—, -f) in D corresponds to a square in G 233 5.13 ( —, —, +, +) in D corresponds to a claw in G 233 5.14 The leaves of this tree form an asteroidal triple 235 5.15 The infinite degree-4 caterpillar 236 5.16 The iterative conditions 237 5.17 Embedding the first four vertices 238 5.18 Placing a new leaf 238 5.19 Circle C(d) intersects the lower level 239 5.20 Circle C(c) intersects the lower level 239 5.21 Circle C(b') intersects arc A 240 5.22 Point c' is on C(c) and inside C(b') 240 5.23 The strip graph generated by {a, c, d, a', c', d'} 241 6.1 A n induced square 247 6.2 A n induced claw 248 6.3 A uniquely levelled, uniquely complement oriented, two-level graph. . . . 249 6.4 Definition of array F 253 6.5 Arc (u,w) is transitively implied by (u,v) and (v,w) 258 6.6 A dense oriented complement 261 6.7 The convention used to specify a trapezoid 263 6.8 Definition of triangle graphs 265 6.9 Ki 4 is a permutation graph and therefore also a PI* graph 267 t 6.10 A n indifference graph that is not a permutation graph 269 6.11 Constructing permutations P and Q from a two-level graph 272 xiv 6.12 Three L\ disks (rotated squares) • . 278 6.13 Two indifference graphs whose intersection is 281 6.14 Forcing striae 283 6.15 The arc (a, b) is unextendable 287 6.16 The unit-radius disks about a and b 288 6.17 The neighbourhoods of a and b 290 6.18 The rotation operation preserves arcs with v on the lower level 293 6.19 The rotation operation preserves arcs with v on the upper level 293 6.20 The rotation operation preserves edges with v on the lower level 295 6.21 The rotation operation preserves edges with v on the upper level 296 6.22 Two-level graphs that are not forced 297 6.23 A n unforbidden order that is not a two-level order 299 6.24 The only unforbidden order for this non two-level graph 300 6.25 A 1/2-TWO graph that is not a n a - T W O graph for any a > 5/8 302 6.26 A 3/4-TWO graph that is not an a - T W O graph for any a < 5/8 304 7.1 A Hierarchy of Graphs 313 A.l A test tube rotating clockwise about site p 327 A.2 Raising a test tube 328 A.3 Two neighbouring maxima 329 A.4 Both Tw 339 a n d T i intersect the separator r r A.5 Site q is maximal in S \ {p} but not in S 342 A.6 Deleting the left bridge site, / 343 xv Acknowledgement This thesis would not have been possible without my mentor and supervisor, Professor David G . Kirkpatrick . It is not possible to say that his influence is stronger in any one 1 chapter, since every part of this thesis has felt his touch. My thesis committee comprised Professors Richard Anstee, Alain Fournier, Maria Klawe, Nick Pippenger, and Alan Wagner. Thanks for many comments, especially in setting early directions. I am grateful to Professors Y . Daniel Liang, Indiana Purdue University at Fort Wayne; Lorna Stewart, University of Alberta; and C. Pandu Rangan, Indian Institute of Technology Madras for helpful discussions and references related to domination algorithms on cocomparability graphs (§4.2). I am also grateful to Professor Jan Kratochvil, Charles University, Prague, for helpful discussions on the NP-hardness proof for unit disk graphs (§3.4), and Dr. Madhav Marathe, Los Alamos National Labs, for extended discussions on approximation algorithms for unit disk graphs (§3.3.3). Thanks to Hewlett-Packard Company, and especially Hewlett-Packard Laboratories, for keeping me on leave-of-absence for so many years. I also must thank two long-time friends for greatly enriching my years at U . B . C . : Professor David Lowe, for welcoming us to Vancouver, for always showing a keen interest in my work, for always being encouraging, and for teaching me how to teach; and Professor Trevor Hurwitz, for many lunches and stimulating discussions. Many new friends, far too many to acknowledge individually, have also influenced this thesis. Still, two have made unusual impacts: Professor Yossi Gil, the Technion, Haifa; and Dr. W i l l Evans. 1 Individuals whose affiliations are not explicitly stated are with the University of British Columbia. xvi My parents have been an enormous influence. I would not be here without their early encouragement of my scientific career. They have also contributed greatly to the resolution of those daily tasks that face us all, yet take so much of our time. Finally, thank you Wendy, my wife and partner for 16 years. You put your own interests on hold for over six long years so that I might pursue this research. In particular, you supported us financially when you would much rather have participated full time in the life of our son Lorenz, now four years old. To you I dedicate this thesis. xvn Chapter 1 Introduction 1.1 Prologue "It just can't be this hard," mumbled Alice to herself. "I wouldn't feel so bad if my graph 1 theoretic model didn't fit the problem so well, but it seems so natural. It really simplifies the statement of my problem; it just doesn't seem to lead to an efficient algorithm." She found herself ruminating over the events of the last few months. It all began with a big project meeting at Blue Sky Airlines ("The airline where the rubber meets the sky"), where Alice designs algorithms for a living. Blue Sky had equipped each airplane in its fleet with a radio beacon. Every beacon has the same range, which is uniform in all directions. Over the next few weeks, Alice discovered that one of her tasks is to solve the "midnight bell problem", as she called it. Every day at midnight (Vancouver time), every plane in a certain trans-Pacific corridor must either send a beacon signal, or receive one from at least one other plane. Blue Sky will know the location (including the altitude) of every plane in the corridor each midnight. Alice's job is to minimize the number of beacons that must send a signal. Naturally, Alice does not plan to show up every midnight to tell Blue Sky which beacons to buzz. Her problem is really to design an algorithm to solve this problem for her, given the number and locations of the planes as input. Furthermore, Blue Sky expects to have more than 50 airplanes in the corridor every night by late next decade Alice and her company are fictional. This prologue, and its epilogue in the Conclusion chapter, is intended only to motivate the theoretical problems addressed in this thesis, and to strengthen your intuition. 1 1 Chapter 1. Introduction 2 ("The sky's the limit, Alice!"), so it had better be a good algorithm. Alice thought about this problem for some time, formulating suitable abstractions. Eventually she constructed a graph theoretic model of her problem. The airplanes are vertices in the graph, and two vertices are adjacent in the graph if they are within beacon range. Now, she only needs to find a minimum cardinality subset of vertices (the "transmitters") such that every other vertex ("receiver") is adjacent to a transmitter. Alice was pleased with her formulation; she likes using graph theory and knows that there are many algorithms available for many different problems. But this graph theoretical problem looks like it might be hard. She consulted her favorite reference book on these matters, Computers and Intractability: a Guide to the Theory of NP-Completeness, by Garey and Johnson [GJ79]. After a few hours—Alice is easily distracted by the many interesting problems to be found in Garey and Johnson—she discovered that the corresponding decision problem is called the D O M I N A T I N G SET problem, and that it is indeed NP-complete. What could she do now? Fifty airplanes are not that many, but still too many to consider every subset of airplanes, in exponential time. She could develop a heuristic solution, but this approach always leaves her feeling unsatisfied. Perhaps graph theory is a little too general. After all, her original problem had a very geometric flavour to it, involving airplanes in a shallow corridor and beacons with circular ranges. What happened to all the geometry? And how could it be used to solve her problem, anyway? She could think of no other option but to start the whole abstraction process again. Alice slumped heavily over her desk, with the dreadful feeling that she had run out of alternatives. Chapter 1. 1.2 Introduction 3 Geometric Constraints in Graph Theory Let us propose an alternative to Alice: exploit geometric constraints in graph theoretic problems. We will study this advice by deriving a class of graphs from geometric situations. In particular, this thesis studies unit disk graphs, which are the intersection graphs of closed unit-diameter disks in the plane. Although this thesis may on occasion draw your attention to related problems set in higher dimensional space, its primary concern is with the plane, that is, with two-dimensional space. Clearly, unit disk graphs capture some two-dimensional constraints. Some subclasses of unit disk graphs capture even more geometric constraints. In particular, if we constrain the centres of the circles to be collinear, then we call the graphs indifference graphs or unit interval graphs. Clearly, indifference graphs capture some one-dimensional constraints. With some care, we can move "gradually" from unit interval graphs to unit disk graphs, as outlined below. This thesis explores algorithmic implications of this gradual movement. As hinted in the prologue, this thesis studies the complexity of some NP-complete graph theoretical problems restricted to these classes of unit disk graphs. Graph theoretic problems on these classes exhibit diverse behaviour. Some problems remain NP-complete for some of these classes, but some problems admit polynomial time solutions, and some problems may be efficiently approximated. Sometimes there are efficient algorithms that require a model for the graph, that is, a set of disks that realize the graph. We are therefore also interested in the complexity of recognizing unit disk graphs, or of constructing a realization. Unfortunately, we will see that the decision problem corresponding to both problems is NP-hard. On the other hand, there are algorithms for some problems that do not require models. A graph is a unit disk graph if each vertex can be mapped to a closed, unit diameter disk in the plane such that two vertices are adjacent (in the graph) if and only if their Chapter 1. Introduction 4 corresponding disks intersect (on the plane). Since there are other definitions for unit disk graphs, let us refer to this mapping of vertices to disks as a unit disk model. Another definition is that a graph is a unit disk graph if each vertex can be mapped to a point in the plane such that two vertices are adjacent (in the graph) if and only if their corresponding points are within unit distance of one another. definition of these terms. See Section 1.3.5 for a more careful Such a mapping of vertices to points is called a proximity model of the graph. Clearly, there is a one-to-one correspondence between these families of models: the centre of a disk is the mapped-to point. Clearly also, the unit of distance is of no great consequence, since the models of graphs under one unit can be transformed into another by scaling. This thesis uses both models for the analysis of algorithms, and sometimes also for their implementation. Alternatively, we can think of the model as generating the unit disk graph. Construct a unit disk graph from a set of points (or unit disks) in the plane by identifying vertices with points and by putting an edge between two vertices if the distance between them is at most unit distance (or if the disks intersect). For example, Alice's Blue Sky problem can be modelled in two dimensions (i.e., assume that the airplanes lie in a common vertical plane) by letting the unit distance be the beacon range, and by centering unit-diameter disks on the airplanes. Alice's problem is even more constrained. Let us imagine that a "trans-Pacific corridor" is an (effectively) infinite length strip (rectangle) with thickness r , which is determined by the least and greatest allowed altitudes. We are particularly interested in the case where r is small compared to the (unit) range of the radio beacons, say 0 < r < "v/3/2. Such unit disk graphs, where the disks lie in a thin strip, are called r-strip graphs or just strip graphs when r = y/H/2. The reason for the number y/Z/2 is that every strip graph is also a cocomparability graph (Theorem 3.7). Such graphs are perfect, which is often a hint that many graph theoretic problems involving cliques, Chapter 1. Introduction 5 colours, and independent sets can be solved in polynomial time. In fact, we will solve Alice's problem for cocomparability graphs in Chapter 4. Note that the class of 0-strip graphs is identical to the class of indifference graphs. Note also that every unit disk graph is a T-strip graph for some (not necessarily small) value r. Cocomparability graphs properly include the class of strip graphs. Is it possible to exploit the additional constraints from strips? It is, as Chapter 5 demonstrates by solving a problem related to Alice's, namely the minimum weight Steiner set problem, even more efficiently for strip graphs than for cocomparability graphs. We also could imagine that certain "rules of the road" apply to Blue Sky's airplanes in the corridor. For example, perhaps they restrict east bound traffic to the upper boundary of the corridor (let us hope that they also restrict west bound traffic to the lower boundary). Such a unit disk graph is called a two-level T-strip graph. Chapter 6 solves another problem related to Alice's, namely the minimum weight independent dominating set problem for two-level graphs. 1.3 Conventions, Background, and Notation The following definitions for sets (§1.3.1), geometry (§1.3.3), algorithms (§1.3.4), and graphs (§1.3.2) are standard, or as nearly so as the literature allows. This thesis assumes that you are already familiar with these basic concepts, but presents their definitions to avoid ambiguity. Furthermore, the body of the thesis repeats some of these definitions as they are required. You may therefore want to skim lightly over this section on a first reading, to ensure that these definitions coincide with your expectations. The section on unit disk graphs (§1.3.5) is more esoteric, so you may want to examine it more closely. Chapter 1. 1.3.1 Introduction 6 Sets These definitions are common to many standard textbooks on discrete mathematics or algorithms, for example"[Gol80], [CLR90], [Epp95]. The terms set and element are the undefined primitives of axiomatic set theory, but the intended meaning is that a set is a collection of elements. Some sets have special symbols: 0 is the empty set, which contains no elements, Z is the set of integers, Z + is the set of positive integers, and R is the set of real numbers. The following table summarizes basic relations on sets. Write: and say: if, for all elements x in some universal set: x e S x is in S x is an element of set S x(£S x is not in S x is not an element of set S ACB A is a subset of B x £ A implies x £ B A=B A equals B ACB and B C A AcB A is a proper subset of B ACB but A^ B AD B A is a superset of B BCA AD B A is a proper superset of B BC A For example, \/2 £ R but y/2 £ Z, and Z C R. Usually, sets will be uppercase symbols, and elements will be lowercase. This thesis is concerned primarily with finite sets, for which the elements can often be listed explicitly or implicitly inside curly braces. For example, { 1 , 2 , 3 , . . . , n} denotes the set of integers from 1 to n inclusive. We can also specify sets by rule, for example {1,2, 3 , . . . , n} = {i : i £ Z and 1 < i < n). For a finite set S, let l ^ l denote its cardinality, in this case the number of elements in S. For example, |{1,2, 3 , . . . , n}| = n. A multiset is similar to a set, except that it may have two or more elements with the same name. For example, set {1,2,3} and set {1,2,2,3} are the same and have three elements, but multiset {1,2,2,3} has four elements, including Chapter 1. Introduction 7 two occurrences of element 2. The basic set operations in the following table are especially useful. Here, A and B are sets, and U is some "universe" set that will be clear from context. operator: written: equals: union AUB {x : x G A or x G B} intersection An difference A\B {x : x G A and x £ B} complement A {x : x G U and x £ A} Cartesian Ax {x : x G A and x G B} B {(a,b) : a G A and b G B} B Product Two sets A and B are disjoint if A fl Z? = 0. If the operands A and B of the union operator are disjoint, we may write the disjoint union A-\-B instead of AUB to emphasize this fact. The Cartesian product operation is also defined on more than two sets: Si X £2 X ••• X S = {(si, k S2, • • • , s ) •• «i G Si, k 5 2 G S, 2 .. . , and s G S^}. fc The elements of the Cartesian product of k sets are called (ordered) k-tuples. When all k sets are the same, it is traditional to write SxSx---xS = S. k For example, R 2 denotes the real plane as a set of coordinates (x,y) G R . 2 A k-ary relation on a Cartesian product of sets Si x S2 x • • • x Sk is just a subset of this product. This thesis is mainly concerned with binary relations, for which k = 2. More specifically, it is primarily concerned with binary relations on a Cartesian product of the same set. Therefore, say that a (binary) relation on a set S is a pair (S, R), where R C S. 2 Sometimes we will write aRb to mean (a, b) G R. There are a few standard properties on binary relations, as summarized by the following table. Chapter 1. Introduction A binary relation 8 if, for all a, b, c G S: (S, R) is said to be: reflexive (a, a) G R irreflexive (a, a) £ R symmetric (a,b) G R implies (6, a) G i? asymmetric (a, 6) G i? implies (6, a) ^ i? antisymmetric (a, 6) G R and (6, a) G R implies a = b transitive (a, 6) G i? and (6, c) G -R implies (a, c) G i? complete a ^ b implies (a, 6) G -R or (6, a) G strongly complete (a, 6) G # or (6, a) G i? It is sometimes advantageous to force a relation to have one or more of these properties. The following table defines a set of operations on relations designed for this purpose. This operation yields the relation: on relation R inverse R~ = {(a,b) : (6, a) G R} reflexive closure RU{(a,a) symmetric closure R U {(b, a) : (a, b) G R} = R U R~ transitive closure the smallest transitive superset of R transitive reduction the smallest relation having the same l : (a,a) G R] l transitive closure as R Some relations are given special names, depending on the standard properties they satisfy. The following table summarizes the relations used in this thesis. Chapter 1. Introduction A Binary Relation 9 if it is: (S, R) is said to be a: partial order strict partial order linear order strict linear order equivalence relation reflexive, antisymmetric, and transitive irreflexive, asymmetric, and transitive a strongly complete, partial order a complete, strict partial order reflexive, symmetric, and transitive (If (S, =) is an equivalence relation, and a 6 5, then the equivalence class of a is the set [a] = {x : x = a}.) Note that the literature also refers to linear orders as total orders, complete orders, and simple orders. A strict linear order can also be specified by listing its elements (ai,a2,... ,a ) with the understanding that a,- < aj if and only if i < j. This thesis is n mainly concerned with strict partial orders (and strict linear orders), which are sometimes written as pairs (S, <). Furthermore, to distinguish the relation from the set on which it is defined, we will sometimes want to refer to the relation R as a partial order, and the pair (S, R) as a partially ordered set, or more economically, as a poset. A n element a in a poset (S, <) is maximal (respectively minimal) if a < x (respectively x < a) does not hold for any element x £ S. In particular, a set 5" in a family of sets J- is maximal if it is a maximal element in the poset (T, C ) . The restriction (S', R') of a relation (S, R) to a subset S' C S is defined by the equation R' = {(a,b) : a,b £ S' and (a,b) £ R}. Note that the restriction of a poset is also a poset. A linear extension of a strict partial order R is a complete strict partial order R', where R C R'. It is perhaps not obvious that such a linear extension exists; you can always generate one by listing (topologically sorting, [CLR90] pages 485-488) its elements as follows. Remove a maximal element from S, Chapter 1. Introduction 10 recursively list the partial order restricted to S \ {m}, and append m to the end of the list. The operators union, intersection, and difference are defined also for binary relations on sets, by operating on the set and the relation. For example, the intersection (Si, Ri)f) (S2, R2) of two binary relations is the relation (S\ D S2, RiC\ R2). In nearly all cases, this thesis applies set operators only to binary relations on the same set. The dimension of a partial order P is the minimum number of linear orders whose intersection is P. Note that, if P is the intersection of k linear orders, then each linear order is a linear extension of P. Note also, that P is the intersection of all of its linear extensions, so the notion of dimension is well-defined. A n interval is a contiguous subset of a linearly ordered set. There are open, closed, and partially closed intervals defined by the following table. {x : a < x < b} open (a,b)--= closed [a,b} --{x: = a < x < b} partially closed (a,b} = = {x a < x < b} partially closed [a,b) == {x a < x < b} A poset (S, R) is called an interval order if S is a set of intervals, and R = {(( , 6), (c, d)) : (a, b) £ a S, (c, d) £ S, and b < c}. The interval order dimension of a poset P is the smallest number of interval orders whose intersection is P. 1.3.2 Graphs For the most part, the graph theoretic definitions in this thesis conform to those in Golumbic's book [G0I8O] on algorithmic graph theory. A graph G — (V, E) is a set of Chapter 1. Introduction 11 vertices V and an irreflexive binary relation E, called edges, on the vertices. We also write V(G) — V and E(G) = E. Unless mentioned otherwise, both sets are finite; the order of a graph G is the value |V(Cr)|. A multigraph is similar to a graph, except that E is a multiset. If, in addition, E is not irreflexive, then G is called a pseudograph. If E is symmetric, the graph is said to be undirected. In this case, it is sometimes convenient to assume that edges (a, b) and (b,a) are the same edge, which is also said to be undirected. Since graphs are irreflexive, the complement G of a graph G is defined differently than the complement of a relation, it is the graph G = (V, E) where E = {(u,v) : (u,v) £ E and u ^ v}. If E is not symmetric, then G is called a directed graph and has directed edges or arcs. We will often write A instead of E for arcs. A n oriented graph is a directed graph G = (V, A) where A is asymmetric. A n orientation of an undirected graph G = (V, E) is an oriented subgraph H = (V, A) where E = A-\- A~ x (the arc set A is also called an orientation of the edge set E). The adjectives dense and sparse are used informally in this thesis. Roughly, a graph G is dense if |JE(G)| = Q(V ) and sparse otherwise. 2 Two vertices u and v in V are said to be adjacent if (u,v) £ E; vertex u is said to be adjacent from vertex v, and vertex v is said to be adjacent to vertex u. Two adjacent vertices are said to be connected by an edge. If (u, v) is an edge, then vertices u and v are said to be its endpoints. A n edge is said to be incident to its endpoints, and two edges are adjacent if they have a common endpoint. Graph vertices will usually be drawn as small circles. A n undirected edge will be drawn as a solid, usually straight, line segment between the circles corresponding to its endpoints. A directed edge (u,v) will be drawn as an arrow from circle u to circle v. When an edge in the complement of a graph needs to be emphasized, it will be drawn as a dotted line segment. The following table summarizes some familiar parameters of vertices in graphs. Chapter 1. Introduction 12 Name Symbol Meaning adjacency list AdJH {u : (v,u) G £ } out-neighbourhood N (u) Adj(i;)U{i;} in-neighbourhood N"(u) {u : (u,u) G £ } U {v} neighbourhood (undirected) N(u) N (u) indegree indegree(u) |{(u,i;):( ,i;)e£}| outdegree outdegree(u) |{(t;,u):(t;,u)e£}| degree (for undirected graphs) deg(u) outdegree(u) + + M Note that the adjacency list of v is just the set of vertices adjacent to v, and that deg(u) = indegree(u) = outdegree(u) = |Adj(u)| for undirected graphs. The neighbourhood N(S) of a subset S C V(G) is the union of the neighbourhoods of its elements. 2 That is, N(S') = {u : u G N(v) for some v G S}. A source in a directed graph G is a minimal vertex in G (that is, one with indegree 0). Similarly, a sink in a directed graph G is a maximal vertex in G (that is, one with outdegree 0). A graph G = (V , E ) is a subgraph of a graph G = (V, E), written G C G, if V C V s and E C s a s s s Subgraph G is spanning if V = V . The subgraph of G = (V, i?) induced s s by (induced on, generated by) a subset of vertices U C V is the graph G(£/) = (U,Eu) where .Ey is the set of all edges in E that have both endpoints in U. A class of graphs is hereditary or closed under taking induced subgraphs if every induced subgraph of every graph in the class is also a graph in the class. When this is the case (and only when this is case), it makes sense to consider a forbidden subgraph characterization of the class. A graph F is a forbidden subgraph of the class if it is not in the class, but every induced subgraph of F is in the class. The forbidden subgraph characterization of a class of hereditary graphs is the set of all forbidden subgraphs. T h e neighbourhood of a vertex is also sometimes called the closed neighbourhood is because some authors use "neighbourhood" to mean the adjacency list. 2 of the vertex. This Chapter 1. Introduction The complement G 13 of a graph G = (V, E) is the graph G = (V,E). vertices U C V is independent is, if E(G(U)) A subset of if no pair of vertices in U is connected by an edge, that = 0. A subgraph K of a graph G is a clique (or completely every pair of vertices in A' is connected by an edge, that is, if E(K) connected) if = 0. A matching in a graph G is a subset of edges M C Z£(G) such that no two edges are adjacent. Let D be a subset of the vertices V of a graph G = (V,E). dominate Subset D is said to a vertex v G V if u G Z) or if v is adjacent to some vertex in Z). Subset D is a dominating set, and said to dominate the graph G (or the vertices V), if Z? dominates every vertex in V . Subset D is said to be a connected dominating set and the subgraph it induces is connected. Subset D is an independent if it is dominating dominating is dominating and the subgraph it induces has no edges. Subset D is a total set if it dominating set if every vertex in V (including those in D) is adjacent to some vertex in D. Given a graph and a required set R C V, a subset S C V \ R is a Steiner set if the subgraph induced by R U S is connected. In general, a maximum subgraph satisfying some specified property is one that attains the greatest cardinality. For example, a maximum many vertices as any other clique, and a maximum clique is a clique that has at least as matching is one that has at least as many edges as any other matching. A graph G = (V, E, <) is partially ordered if (V, <) is a partial order on the vertex set. Often this partial order will be linear. If G\ and G2 are subgraphs in a linearly-ordered graph, then G\ < G2 if u < v for all u G V{G\) and v G V^G^)- The subgraphs are said to overlap in the order if neither G\ < G2 nor G2 < G\. The vertices V of a graph G are weighted by a function w : V —> R. Similarly, the edges £ of a graph G are weighted by a function w : E —> R. A weighted graph G = (V,E,w) may be either a vertex weighted graph or an edge weighted graph, depending on context. The weight of a graph is typically the sum of the weights of its vertices (or Chapter 1. Introduction 14 edges), but may be redefined to be some other function of its constituent weights. A chain of length k (v , vi, v , . . . , v ) 0 2 k in a graph G is a sequence of vertices from V(G) such that («,•_!, u-) G E or (u;,u _i) G E for i = 1, 2,. . . , k. The vertices ?Jo and v t k 4 are called the endpoints of the chain, and the chain is between its endpoints. A graph is connected (and a digraph is weakly connected) if there is a chain between every pair of vertices. A path of length k (VQ, VI, V 2 , . . . , v ) in a graph G is a sequence of V(G) such k that (v{-i, G E for i = 1, 2 , . . . , k. A directed graph is strongly connected if there is a path between every pair of vertices. A cycle of length A; is a path (uo, vi,...,v k = vo). Note that all cycles are paths, and all paths are chains. A chain or path of length k is called simple if i ^ j implies u,- / Vj for all i,j < k. A cycle of length k is called simple if z 7^ j implies Uj ^ Uj for all i , j < k. It is sometimes convenient to treat a chain simply as a set of vertices or edges by context. Let P = (uo, Vi, • • •, v ) be a chain. A n edge k (a, 6) G £ is an edge o / P if (a,b) = (u _i,u ) 8 8 or (a,b) = (vi,Vi-\) for some i G An edge (a,b) (E. E is a chord of P if a G P and 6 G P , but (a, 6) ^ P and (6, a) ^ P . A chain (or path or cycle) is chordless if it is simple and has no chords. Some graphs prove to be so useful (and ubiquitous) that they have been given their own names, as the following table illustrates. Chapter 1. Introduction 15 Name Symbol Meaning G = (V, E) where complete graph on Kn ra vertices E = {(u,v) : u,v £ V} complete bipartite graph G = (U,V,E) on m + ra vertices E = {(u,v) :ueU chordless cycle on star on and v £ V} G = ({1,2, . . . , « } , £ ? ) where Cn ra vertices where E = {(i, (i modra)+ 1) : i <G [1, ra]} + 1 vertices square c claw Kl,3 triangle K 4 3 Two graphs Gi = (V\,Ei) =C 3 and G2 = ( V ^ , ^ ) are said to be isomorphic if there is a bijection (an isomorphism) f : v\ —> V2 that preserves adjacency, that is, (u,v) 6 Ei if and only if (f(u),f(v)) £ E2 for all u,v £ V i . Clearly, the relation of being isomorphic, also called isomorphism, is an equivalence relation, that is, it is relexive, symmetric, and transitive. The following table defines some well-known graph parameters studied in this thesis. Note that the value of any one of these parameters would be the same for all graphs in an isomorphism equivalence class. Therefore these parameters are also called graph invariants (they are invariant up to isomorphism). Chapter 1. Introduction 16 Name Symbol Meaning (maximum) graph degree A(G) max{deg(u) : v £ V(G)} minimum graph degree 6(G) min{deg(u) : v £ V(G)} (maximum) graph indegree A (G) max{indegree(u) : v £ V(G)} in minimum graph indegree independence (or stability) min{indegree(u) : v £ V(G)} a(G) number clique number cardinality of a maximum independent set in G u(G) cardinality of a maximum clique in G clique cover number chromatic number KG) X(G) least number of cliques for which every v £ V is in some clique. least number of colours to colour G. (A graph G = (V, E) is (correctly) coloured by a function c : V —, Z + if (u,v) £ E implies c(u) 7^ c(v).) A graph is said to be k-partite if its vertex set can be partitioned into k non-empty independent sets, that is, if its chromatic number is at most k. In this thesis, the most important value for k is 2; such graphs are called bipartite. To emphasize a bipartition of a graph's vertex set, it is traditional to write G = (U, V, E), where vertex sets U and V are both independent sets. A graph is said to be cobipartite if its complement is bipartite. A planar graph is one that can be drawn on the plane such that edges may share a vertex, but do not otherwise cross. Such a drawing is called a plane graph. Kuratowski characterized planar graphs in 1930. We will need the following definitions to appreciate his theorem. To subdivide an edge (u,v) in a graph G , replace it with a path ( u , u , « , • •. ,Uk = v) of length k > 1. A graph H is a subdivision of a graph G if H 1 2 Chapter 1. Introduction 17 can be constructed from G by subdividing some of its edges. Finally, two graphs are homeomorphic if they are subdivisions of the same graph. T h e o r e m 1.1 (Kuratowski [Kur30]) Every non-planar graph has a subgraph homeo- morphic to either K$ or Kz,z. The binary set (and binary relation) operators are defined for graphs also, by operating on the edge and vertex sets. For example, the intersection of two graphs G\ = (Vi, E\) and G = (V2,E2) is G\ fl G2 — (Vi Pi V ,Ei 2 2 fl E ). In nearly all cases, this thesis will 2 only apply set operators to graphs that have the same vertex set. The intersection the intersection graph 0 ( 0 ) generated by a family (a multiset) O of sets, also called graph ofO, is the graph G where V(G) = 0 and G(E) = {(u,v) : u,v G O and uC\v ^ 0}. The intersection graph class of a set S is the set of all intersection graphs generated by finite (multi) subsets O of S (cf. [Sch85]). A graph G is an S-intersection graph if it is isomorphic to 0,(0) for some subset O C S. Extending the codomain of the isomorphism / : V(G) —>• O to the entire set S leads to the following equivalent definition. A graph G is an S-intersection graph if there is a mapping / : V(G) —> S such that (u,v) G E(G) if and only if f(u) n f(v) ^ 0. The function / : V(G) -> S is called an S-realization 1.3.3 of G, or a realization of G in terms of 5". Geometry Points in space R (or E to emphasize Euclidean metric space) are denoted with lower d d case letters (for example, p and q) or, when there is a one-to-one correspondence between points and the vertices of a graph, just with the names of the vertices. The coordinates of a point are denoted p = (pi,j»2? • • • -,Pd)- We need only a few standard operations on points (as vectors): p + q = (p + q ,p x x 2 + q , • • •,Pd + qd), cp = (cpi,cp ,..., 2 2 cp ), where n c G R, and p — q = p H—!(<?)• This thesis focuses on two-dimensional space, where the Chapter 1. Introduction 18 coordinates of a point are denoted p = (x ,y ). p p This thesis uses three metrics in the plane: the L\ metric, also called the city block (or taxi cab or Manhattan) metric; the L metric, also called the Euclidean metric; and the 2 Leo metric, also called the maximum coordinate (or chess board or queen's move) metric. These metrics are defined by their associated distance functions, L being defined by the k distance function || • \\ : R — > R, where d k IblU = ( £ \IH \t=i for all p G R . The distance function for is given by: d llplloo = lim \\p\\ = max{|pi| : 1 < i < d}. k The distance between two points p and q is given by the expression lb - g|UThis thesis concerns itself primarily with the Euclidean metric in two dimensions. The distance function therefore will usually denote Wvh = \J l + y x 2 P If p and q are points in space, then the (open) line segment between them is the set (p, q) = {r : (1 — X)p + Xq where A G (0,1)}. The diameter of a set of points P in space is m a x { | | p - q\\ :p,q£ P}. Two points in a set are said to be diametral if the distance between them is the diameter of the set. The sphere of radius r about a point c in <i-dimensional space is the set {p : \\p — c\\=r and p G E }. d Chapter 1. Introduction 19 The two-dimensional sphere is called a circle. The (closed) ball of radius r about a point c in d-dimensional space is the set {p : \\p — c|| < r and p £ E }. d The two-dimensional ball is called a disk. A unit sphere, circle, ball, or disk is a sphere, circle, ball, or disk respectively with radius 1/2, that is, with unit diameter. The lune through a pair of points p and q is the set {s : \\s — p\\ < ||p — q\\ and \\s — q\\ < ||p — q\\}. 1.3.4 Algorithms Most of the algorithms described in this thesis manipulate graphs. A traditional model of computation for such work is the Random Access Machine [AHU74], or R A M for short. Briefly, a R A M has three devices (an input, an output, and a memory), as well as a program, of course. A R A M can read from input, write to output, or store in memory, an arbitrary integer, all at unit cost in space and time. It also can execute the usual [AHU74] arithmetic and comparison operations between two integers, and program control instructions, in unit time each. Finally, this thesis uses a R A M augmented with a unit-time floor function. Geometric computations on a R A M must restrict any input points to integer coordinates (or rational coordinates represented as pairs of integers). We can deal with the possibly irrational Euclidean distance between points by computing only the squared Euclidean distance, which is an integer (or a rational). This model, or one easily transformed to it, also will be assumed for NP-hardness proofs. A disadvantage of using an integer R A M is the temptation to exploit the algorithmic properties of small integers. For example, we may be tempted to sort coordinates in linear time, using counting sort [CLR90], Chapter 1. Introduction 20 for example. While such an exploitation can have practical benefits, particularly when the application domain is naturally discrete, it is peripheral to this investigation. The purpose of this thesis is to investigate the role of geometric constraints in graph theory. That is, we wish to exploit geometric constraints (e.g., position, proximity, and distance) in dealing with combinatorial problems. In any representation of the underlying entities (space, points, and graphs) there are issues that are peripheral to this cause. For example, (physical) digital computers represent numbers to some finite precision. Therefore, programs written for such machines must deal with issues such as inconsistent roundoff and the need for higher precision during intermediate calculations. Where such issues are secondary to a more primary interest, as they are in this thesis, it has become customary to adopt a model of computation called a real RAM [PS85]. A real R A M can read, write, and store a real number, to infinite precision, in unit time and space. It also can execute the usual arithmetic and comparison operations between two real numbers in unit time each. Again, this thesis augments the real R A M with a unit-time floor function. A disadvantage of using a real R A M is the temptation to exploit the unit memory and operation times for infinite precision numbers. Again, such exploitation is not the intention of this thesis. We will use the real R A M model to describe geometric algorithms when it simplifies the presentation. Although the R A M or real R A M is the underlying computational model, this thesis does not actually describe algorithms in terms of these primitive models. Rather, it describes algorithms with a much higher-level pseudocode. This pseudocode follows the conventions laid out by Cormen, Leiserson, and Rivest ([CLR90] pp. 4-5). You should have no trouble reading it even without consulting [CLR90]. The only exception is that this thesis uses the following notation for comments: / * This is a comment. */ Chapter 1. Introduction 21 The thesis assumes that you are familiar with the elementary algorithms and data structures usually considered in any introductory textbook [Sed83, CLR90] on that subject. In particular, you should understand linked lists, balanced trees, and binary search. You should be familiar with the representation of a graph G = (V, E) as an adjacency list, for example as an array of linked lists each representing Adj(u) for all v G V, and as an adjacency matrix, for example as a | V | x \V\ array M , where M „ = 1 if and U) only if (u,v) G E. Also, you should be aware of fundamental algorithms on these graph representations, such as depth-first and breadth-first search. As a matter of routine "programming" style, this thesis will use a sentinel [Sed83], in place of an explicit test for boundary conditions, wherever possible. A sentinel is just a "dummy" element in a data structure that holds the values for the boundary condition. For example, to search a list for a value without having to test for an end-of-list condition, first append a sentinel holding the desired value to the end of the list. In analyzing algorithms in this thesis, we are interested primarily in their consumption of time and space resources. The run-time of an algorithm on an input is the number of primitive (unit-time) operations executed by the algorithm. We are interested in how the run-time changes as a function of the input size, which depends on the problem, but will always be explicit in this thesis. In nearly all cases, we will be interested in an algorithm's worst case behaviour (taken over all possible inputs) in the limit, that is, as the input size goes to infinity. This is normally expressed in asymptotic notation, as summarized by the following equations. 0(g(n)) — {f(n) : there exist positive constants c and N such that |/(n)| < c\g(n)\ for all n > N} ti(g(n)) = {/(ra) : there exist positive constants c and N such that |/(ra)| > c\g(n)\ for all ra > N} Chapter 1. Introduction 22 e(g(n)) = {/(n) : f(n) € 0(g(n)) and g(n) € 0(/(n))} o(g(n)) = {/(n) : for all positive constants c, there exists a positive constant ./V such that |/(n)| < c|g(n)| for all n > N} Following the lead of Cormen, Leiserson, and Rivest [CLR90], this thesis drops the setcardinality symbols from asymptotic notation. For example, interpret 0 ( V l o g V + E) as ( 9 ( | V | l o g | V | + \E\). By convention, we write f(n) = 0(g(n)) instead of f(n) € 0(g(n)), and say that f(n) is order (at most) g(n). The computational complexity of an algorithm refers to its worst case run-time (and memory usage). Say that an algorithm has polynomial time (or space) complexity if its worst case run-time (or memory usage) satisfies f(n) = 0(n ) k for some constant k. Several algorithms in this thesis use matrix multiplication. The best upper bound known for the time to multiply two n x n matrices is n 2 - 3 7 6 [CW87]. Most often, we will be multiplying two | V | X | V | adjacency matrices, so let us abbreviate the upper time bound on this operation by 0(M(V)) = 0(V 2 3 7 6 ). This thesis addresses several combinatorial optimization problems [GJ79, PS82]. Essentially, an instance of a combinatorial optimization problem is a pair (S,c), where S is a finite (hence combinatorial) set of candidate (or feasible) solutions, and c : S —> R is a cost function, telling us how expensive a feasible solution is. The goal is to find an optimal solution for (S,c), that is, a candidate solution s* of minimum (or possibly maximum) cost: c(s*) = min{c(.s) : s G 5"}. A combinatorial optimization problem is a set of instances of a combinatorial optimization problem. For example, the chromatic number (combinatorial optimization) problem is to use the minimum number of positive integers to colour the vertices of a graph such that Chapter 1. Introduction 23 adjacent vertices do not get the same colour. A n instance (S, c) of this problem comprises all (correct) ways S of assigning colours { 1 , 2 , . . . , |V(G)|} to the vertices of a given graph G, and the number c of colours used for each way. Let IT be an optimization problem. A n approximation algorithm for LT is an algorithm that takes instances of IT as input and returns candidate solutions as output. A n approximation algorithm A achieves a performance ratio R if c(A(I)) < R • for every instance / E LT, where OPT(I) c(OPT(I)) is an optimal solution for instance I. Other problems in this thesis are decision problems: they have a yes or no answer. A decision problem corresponds to "recognizing" the yes instances of the problem. B y convention, a problem name typeset in all capital letters is a decision prob- lem, sometimes even the decision version of an optimization problem. For example, K - C O L O U R A B I L I T Y is the decision version, "Can the vertex set of the input graph be correctly coloured with k colours?", of the chromatic number problem. Although researchers have identified many complexity classes, this thesis is concerned with only some of these: P, N P , NP-complete, and NP-hard. The class P consists of those decision problems that can be recognized (answered) in polynomial time. The class N P comprises those decision problems that can be "certified" in polynomial time. That is, a (decision) problem is in N P if there is a (necessarily polynomial size) "certificate" that the answer is yes , and if the certificate can be checked in polynomial time. For 3 example, K - C O L O U R A B I L I T Y is in N P since a graph coloured with k colours can be checked in polynomial time by examining every adjacent pair of vertices in the graph. Clearly, P C N P . If you could solve every NP-problem in polynomial time by solving problem A in polynomial time, then problem A is said to be NP-hard. 3 A problem is in co-NP if there is a polynomial-time-checkable "certificate" that the answer is no. Chapter 1. Introduction 24 A decision problem is NP-complete if it is both in N P and NP-hard. The N P hardness of a problem A is typically demonstrated by providing a polynomial-time "reduction" of some known NP-complete problem to problem A. These complexity classes are normally defined more rigorously using notions of language recognition on deterministic and nondeterministic Turing machines. See the book by Garey and Johnson [GJ79] for these definitions. The significance of these definitions rests in the fact that there are no known polynomial-time algorithms for any NP-complete problems. That is, no one has shown that P = N P . Therefore, proving a problem to be NP-hard gives an effective lower bound on the complexity of any algorithm for solving the problem. On the other hand, no one has shown that P ^ N P . 1.3.5 Unit Disk, Strip, and 2-Level Graphs The background of the last few sections allows us to define unit disk graphs more carefully. A unit disk graph is, an S-intersection graph where S is the set of unit diameter disks in the plane. That is, a graph is a unit disk graph if each vertex can be mapped to a closed, unit diameter disk in the plane such that two vertices are adjacent (in the graph) if and only if their corresponding disks intersect (on the plane). This thesis briefly (§3.4) studies disk graphs also; these are S-intersection graphs where S is the set of disks with arbitrary (not just unit) diameter in the plane. As mentioned in Section 1.2, an alternative to the unit disk model is the proximity model. That is, a graph is a unit disk graph if each vertex can be mapped to a point in the plane such that two vertices are adjacent (in the graph) if and only if their corresponding points are within unit distance of one another. When a set of points P is given and generates a unit disk graph, then clearly the unit of distance does matter, since different graphs will be generated by different "threshold" values. When this is important, we will write G$(P) = (P, E) to signify the unit disk Chapter 1. Introduction 25 graph generated by points P , where adjacent endpoints are at most distance S apart. The following, more formal, definition summarizes this discussion. Definition 1.2 The unit disk graph G$(P) generated by a set of points P and a real threshold 5 is the graph (P, E) where E = {(p,q) : \\p — q\\ < S}. Clearly Gs(P) is isomorphic to G i ( | P ) for every set of points P . A graph G is a unit disk graph if it is isomorphic to Gi(P) for some P C R . Extending the codomain of the isomorphism 2 / : V(G) —> P to the plane leads to the following equivalent definition. A graph G is a unit disk graph if there is a mapping / : V(G) R such that (u, v) £ E(G) if and only 2 if || f(u) — f(v)\\ < 1. The function / is called a realization of the unit disk graph. We write f(v) = (xf(v),yj(v)), where v £ V and f(S) = {f(v) : v G S}. Sometimes, when it is clear what the mapping is, we will drop the subscripts and write x(v) and y(v). | A unit disk graph is a strip graph if there is a realization that maps all vertices onto a thin strip. For technical "reasons that will be clear later (e.g., Theorem 3.7), we are interested only in sufficiently thin (at most \/3/2 units for the Euclidean metric) strips. The following, more formal, definition summarizes. Definition 1.3 A graph G = (V, E) is a T-strip graph if there is a mapping / : V —> R x [0,r] such that (u,v) £ E if and only if ||/(u) — /(t>)|| < 1- The function / is called a T-strip realization of the graph. where ||(x,y)|| = ||(a;,y)||2 = \/x 2 Normally, we are concerned with the L metric, 2 + y . For these usual L T-strip graphs, restrict r to 2 2 the interval [0,\/3/2]. Occasionally, we will be interested in the L\ metric also, where ||(#,2/)||i = \x\ + |y|. For L\ T-strip graphs, restrict T to the interval [0,1/2]. | Say that a strip graph is a two-level graph if it has a realization that maps every vertex onto the boundary of the strip. The following definition states this more formally. Chapter 1. Introduction 26 Definition 1.4 A graph G = (V, E) is a two-level r-strip graph if there is a mapping / : V -» R x {0,T} such that (u,v) £ E if and only if ||/(u) - f(v)\\ < 1. The function / is called a two-level r-strip realization of the graph. 1.4 | Overview: A R e a d e r ' s G u i d e The following chapters present and derive the results discussed in the introduction. Chapter 2, Related Research, sets the stage by reviewing the context of the research reported in this thesis. In particular it defines several related classes of graphs, some of which appear in this introduction without definition. One class is particularly relevant—indifference graphs are precisely 0-strip graphs—so Chapter 2 gives it extra attention. The remaining chapters study the "gradual introduction" of the second dimension in reverse order. They begin with Chapter 3, Unit Disk Graphs, in which the y-coordinate of the disk centres is unrestricted, as it is for the x-dimension. Chapter 3 shows how to exploit an explicit realization of a unit disk graph to find least vertex-weight paths. To do so, it makes use of a data structure whose details have been relegated to Appendix A . It also shows how to use a realization to report an adjacent vertex, and to delete a vertex, in O(log V ) amortized time. This result is used by Chapters 5 and 6 to design efficient domination algorithms for strip graphs and two-level graphs. Chapter 3 continues by showing how to build the entire adjacency structure of a unit disk graph in 0(V log V+E) time, given only the | V | points that form the image of a realization / : V —, R . 2 Chapter 3 also shows how to prove that some problems are NP-complete for unit disk graphs. In particular, it conjectures that any problem that is NP-complete for degree 4 planar graphs is also NP-complete for unit disk graphs. In particular, it applies a generic transformation schema to show the NP-completeness of both I N D E P E N D E N T S E T and C H R O M A T I C N U M B E R . On the other hand, it shows how to find a maximum clique in Chapter 1. Introduction 27 polynomial time. The main result of this chapter is that unit disk graph recognition is NP-hard. In proving this result, we will see that penny graph, bounded-diameter-ratio 4 coin graph, and bounded-diameter-ratio disk graph recognition are all NP-hard. The next three chapters limit the second dimension to a strip of thickness r. Since r-strip graphs are cocomparability graphs for all r £ [0, \/3/2], Chapter 4 studies cocomparability graphs. In particular, it develops efficient algorithms for several dominating set problems on cocomparability graphs, which are then automatically applicable to strip graphs. In the process, the chapter develops a novel, efficient algorithm for finding a minimum weight maximal clique in a comparability graph, and therefore also a minimum weight maximal independent set in a cocomparability graph. Chapter 4 also discusses properties of the "forcing" relation on cocomparability graphs, which are used in the next chapter. Chapter 5 studies strip graphs. It begins by demonstrating how to combine an algorithm for finding least-weight paths in unit disk graphs and an algorithm for finding least-weight Steiner sets in cocomparability graphs. The resulting algorithm for finding a minimum weight Steiner set in a strip graph is more efficient than any known for either unit disk graphs or cocomparability graphs. Chapter 5 then characterizes strip graphs with systems of difference constraints. It uses this characterization to find efficiently a realization for a strip graph that has been "levelled" and whose complement graph has been oriented to meet certain constraints. Chapter 5 continues to explore this characterization by determining which stars are r-strip graphs for different values of r. It also shows that the characterization implies that a strip graph is an indifference graph if it is free of induced squares and claws. The chapter concludes by characterizing those strip graphs that are trees. 4 A graph is a coin graph if it is the intersection graph of a set of interior-disjoint disks. A coin graph is a penny graph if it is the intersection graph of a set of unit-diameter interior-disjoint disks. Chapter 1. Introduction 28 Chapter 6, Two-Level Graphs, is the final technical chapter. It begins by examining some elementary properties of two-level graphs. For example, it exhibits small examples (the square and the claw) that highlight the difference between two-level graphs and indifference graphs. It continues by showing again how the realization can be exploited, this time by improving on the minimum weight independent set algorithm for cocomparability graphs. Chapter 6 also examines how intimately two-levels graphs are related to other classes of graphs, such as bipartite permutation graphs and trapezoid graphs. The chapter concludes by studying the recognition problem for two-level graphs. Finally, Chapter 7, the Conclusion, summarizes the thesis. Two Notes About the Bibliography This thesis mentions many related results. For the most part, the bibliography cites the originators, unless a result is very well known. The rule of thumb is that a result is very well known if it is discussed in a standard textbook, such as Introduction to Algorithms by Cormen, Leiserson, and Rivest [CLR90]. In such a case, the bibliography normally cites the standard text, rather than the original. Also, the thesis mentions some results in passing, for completeness, and I may not have been able to obtain the paper in question. Also, the bibliography may cite a result used by another researcher, but not directly by this thesis. In such cases, the bibliography cites the paper, but includes an annotation of the form "cited by [abc]", where "abc" is another paper that discusses and cites the result. Chapter 2 Related Research This chapter describes some of the context for the research described in this thesis, including other classes of graphs that are related to unit disk graphs. It begins (§2.1) by describing how and where unit disk graphs have arisen previously. This chapter also describes other kinds of intersection graphs (§2.2), perfect graphs (§2.3), and other kinds of proximity graphs (§2.4). 2.1 Unit Disk Graphs Unit disk graphs are the subject of several algorithmic investigations. In particular, Clark, Colbourn, and Johnson [CCJ90] show that several well-known problems remain NP-complete for unit disk graphs (see Section 3.3 for details). Marathe, Breu, Hunt, Ravi, and Rosenkrantz [MHR92, M B H 9 5 ] develop several approximation algorithms for + unit disk graphs (again, see Section 3.3 for details). Unit disk graphs are also simplified models for several applications. In general, they model the interaction of objects in a physical situation where the interaction (forces, visibility, or whatever) is "cut off" after a fixed distance. Sections 2.1.1 to 2.1.4 present some examples. 29 Chapter 2. Related Research 2.1.1 30 Cluster Analysis Unit disk graphs arise as a conceptual mechanism in cluster analysis [Zah71, DH73, God88] when "dissimilarity" is measured by Euclidean distance. More precisely, the similarity of a set of objects 0 = { O i , . . . , O } is typically described by an n x n dissimilarity n matrix D that is not necessarily Euclidean nor even metric. Godehardt [God88] defines a "similarity" graph T(8) = (0,E) where [O^Oj) G E if D l3 < 5. Note that G {0) is 5 a unit disk graph if the 0 , are points in the plane and Dij = ||0; — Oj\\. Godehardt f mentions that the clusters produced by two well known techniques, single-linkage clusters and complete linkage clusters, correspond to the components and the cliques of the graph T, respectively. Efficient algorithms for constructing the components and a maximum clique of a unit disk graph are given in Sections 3.2.3 and 3.3.2 of this thesis. 2.1.2 R a n d o m Test Case Johnson, Aragon, McGeogh, and Schevon [JAMS91] use a class of random graphs to test heuristics for the travelling salesman problem in arbitrary graphs. Their geometric graph U, n r random is, in the terminology of this thesis, the unit disk graph G (P) r where \P\ = n, and where P is chosen randomly from a unit square . Efficient algorithms 1 for unit disk graphs could therefore be used to give exact solutions to various problems on random geometric graphs. These exact solutions could then be compared with those produced by the heuristic under evaluation. For example, Philips [Phi90] uses U o,5 to ni evaluate his heuristic for finding the maximum clique, which he does by comparing it with another heuristic. The 0 ( n (or the 0(n - ) 4 5 3 5 log n) maximum clique algorithm presented in Section 3.3.2 algorithm in [CCJ90]) would have allowed him to make a comparison with the exact solution in polynomial time. Johnson et al. generate P by picking 2n independent numbers uniformly from the interval (0,1) and viewing these as the coordinates of n points. 1 Chapter 2. Related Research 2.1.3 31 Molecular Graphics and Decoding Noisy Data Bentley, Stanat, and Williams [BSW77] mention that merely listing the edges of a unit disk graph, a problem that they call "finding fixed-radius near neighbors", also has applications in molecular graphics and decoding noisy data. Their algorithm, along with others, is discussed in Section 3.2.3. 2.1.4 Radio Frequency Assignment Suppose that a radio spectrum manager wishes to assign frequencies to a set of transmitters. Perhaps the simplest two-dimensional setting is that these transmitters all have the same power, and each has a fixed location on a uniform terrain so that their effective ranges are the same. Suppose further that the available frequencies, called channels, are a discrete set. Two transmitters must not be assigned the same channel if they might interfere, which they would do if they are within a fixed distance of one another. The manager's objective is to use the minimum number of channels. In his review of spectrum management, Hale [Hal80] calls this problem the F*D constrained cochannel assignment problem. He formalizes it as follows. Given a finite set of points V in the plane, and a positive rational number 8, find an assignment A : V — > Z such that (1) max A(V) is as small as possible and (2) if u, v € V, u ^ v, and + —1>|| < 5, then A(u) / A[y). This is just the problem of finding an optimal colouring of a unit disk graph. Hale's survey concludes with some relevant open questions: There is no graph coloring algorithm or heuristic which exploits the special structure of unit disk or disk graphs. There is no known intrinsic characterization of unit disk graphs (a reasonable forbidden subgraph characterization Chapter 2. Related Research 32 seems out of the question, as a large list of infinite families of forbidden subgraphs continues to grow). What is the complexity of the clique problem . . . for unit disk graphs? These questions are at least partially resolved in this thesis, and elsewhere. In reverse order, the clique problem is in solvable in 0 ( V ' log V) time (§3.3.2), U N I T DISK 3 5 G R A P H R E C O G N I T I O N is NP-hard (§3.4), and there are simple polynomial time algorithms that colour unit disk graphs with no more than three times the chromatic number (§3.3.3). The most comprehensive study of this frequency assignment (or unit disk graph colouring) problem is due to Graf (see [Gra95] and §3.3.3). In his PhD thesis, Graf also identifies and colours strip graphs (which he calls y/d/2 stripe graphs). 2.2 G e o m e t r i c Intersection G r a p h s A graph G is an S-intersection graph if S is a family of sets, and there is a mapping / : V(G) -> S such that (u,v) G E(G) if and only if f(u) f) f(v) ^ 0 for all vertices u and v in V. The function / is called an S-realization (or a representation, or a model) of G in terms of S. Any graph is an intersection graph for some model. For example, model each vertex of a given graph by the set of edges incident with it. Geometric models promise to constrain the available intersection graphs that can be represented in this way. But even greatly constrained geometric models can generate many graphs. Any planar graph is an intersection graph of a set of curves in the plane. In fact, an intersection model made up solely of star-shaped polygons can be constructed from a straight line embedding of 2 a planar graph. The stars are concentric with the vertices, and their "arms" reach up 2 Every planar graph has a straight line embedding (c/. [NC88]). Chapter 2. Related Research 33 along each line segment corresponding to an edge. More remarkably, every finite planar graph is the intersection graph of a set of interiordisjoint disks. Since such intersection graphs, also called coin graphs, are themselves clearly planar, this means that the class of finite planar graphs is equivalent to the class of coin graphs. This result was first demonstrated by Koebe in 1935. See Sachs's [Sac94] account for a more detailed history and for references. Wegner [Weg67, CM78] proves that any graph is the intersection graph of a set of convex objects in R . Unfortunately, Capobianco and Molluzzo [CM78], who cite Wegner's 3 result, do not give the proof. Researchers have studied numerous kinds of geometric intersection models other than disks and unit disks. In particular, graphs with the following one- and two-dimensional intersection models, some with efficient algorithms, can be found in the literature: • unit intervals [Rob68a, L093], • intervals [FG65, GH64, BL76, GLL82, Kei85, Kei86, Ber86, BB86, RR88a, RR88b], • squares [Ima82, BB86], • rectangles [IA83, Kra94], • line segments [IA86, KM94], • strings [Kas80, Kra91a, Kra91b], • circular arcs [Kas80, GLL82], • chords of a circle [Kas80]. Recognition complexity questions have also been studied in the literature. In particular, there are polynomial time algorithms for recognizing intersection graphs on unit intervals [L093], intervals [BL76], circular arcs [Tuc80], and chords of a circle [GHS89]. In his Chapter 2. Related Research 34 summary of graph algorithms [van90], van Leeuwen states wistfully that "It should probably be required of any class of graphs that is distinguished that its recognition problem is of polynomial-time bounded complexity." This desire notwithstanding, many interesting classes are difficult to recognize. In particular, it is NP-hard to recognize intersection graphs for strings [Kra91b], isothetic rectangles [Kra94], and segment graphs [KM94]. The complexity of recognizing unit square graphs was still open. However, Theorem 3.46 proves that this problem is NP-hard. 2.3 Perfect Graphs Historically, there were two kinds of perfect graphs, both identified by Berge [Ber61]. A graph G is \-perfect if the chromatic number x °f every induced subgraph G(S) is the same as the size to of its largest clique. More formally, a graph G is x-P f t er u(G{S)) = x{G(S)) for all S C V. Clearly, (G(S)) X ec if > io{G(S)) for all graphs, perfect or otherwise, since every vertex in a clique must get a different colour. A graph G is a-perfect if the number k of cliques required to cover any induced subgraph is the same as the size a of its maximum independent set. More formally, a graph G is a-perfect if a(G(S)) = k(G(S)) for all S CV. Clearly, k(G(S)) > a(G(S)) for all graphs since every clique can cover at most one vertex in an independent set. Clearly, too, a graph is x - P f t if and only if its complement is a-perfect, since a clique in a graph is an e r e c independent set in its complement. A graph is perfect if it is both ^-perfect and aperfect. In fact, a graph is %-perfect if and only if it is a-perfect, as first conjectured by Berge [Ber61] and proved ten years later by Lovasz [Lov72]: Theorem 2.1 (The Perfect Graph Theorem [Ber61, Lov72]) The following statements are equivalent for all graphs G: • u(G(S)) = (G(S)) for all X SCV, Chapter 2. Related Research • a(G{S)) = k(G(S)) for allS • u(G(S))a(G{S)) 35 CV, > \S\ for all S CV. Grotschel, Lovasz, and Schrijver [GLS84] show that these invariants (a(G), UJ(G), x(G), and k(G)) can be computed in polynomial time for perfect graphs. Their algorithms use the ellipsoid method, a general technique that has also been used to solve linear programming in polynomial time (see [GLS84] for details and references). Grotschel et al. do not recommend their algorithms for practical use, due to numerical stability problems with the ellipsoid method. Furthermore, the complexity of P E R F E C T G R A P H R E C O G N I T I O N is unknown, though Grotschel et al. show that it is in co-NP. Consequently, there are many results on subclasses of perfect graphs in the literature (see in particular Golumbic's book [G0I8O]). There are many such subclasses. For example, bipartite graphs are clearly x-perfect; assuming a bipartite graph has at least one edge, both its clique number and chromatic number is 2, and it is trivial to find such a maximum clique or such a colouring. Finding a maximum independent set of a bipartite graph is not that easy, but can be accomplished in polynomial time by matching (c/. §3.3.2). In this thesis, cocomparability graphs (see Section 2.3.1 and Chapter 4), which are perfect, are especially relevant. The family of cocomparability graphs properly includes the family of trapezoid graphs (see Section 6.4.1). In turn, the family of trapezoid graphs properly includes the families of permutation and interval graphs (see below for definitions). Finally, the family of interval graphs properly include the family of indifference graphs. On the other hand, unit disk graphs are not perfect. For example, C 5 is a unit disk graph (as is any cycle) but it is not perfect since u>(C ) = 2 and x{C ) n n = 3 for all odd n > 5. However, strip graphs are perfect since they are cocomparability graphs. Chapter 2. Related Research 2.3.1 36 Cocomparability Graphs A n undirected graph G — (V, E) is a comparability graph if there exists a transitive orientation of its edges. We can also say that a comparability graph is a transitively orientable graph. Recall from Section 1.3.2 that a transitive orientation of an undirected graph G = (V, E) is an oriented subgraph G = (V, A) where E = A + A - 1 and A is tran- sitive. Note that transitive orientations are acyclic since A is asymmetric. Conversely, we can think of comparability graphs as being generated by partially ordered sets. The edges of the comparability graph G = (V, E) corresponding to a strict poset (V, <) are given by E = {(u,v) : u < v or v < u}. A graph is a cocomparability graph if its complement is a comparability graph. Both comparability graphs and cocomparability graphs have been extensively studied (c/. [Gol80, M6h85]). Both classes include permutation graphs as proper subclasses, and cocomparability graphs properly include interval graphs and indifference graphs (c/. [Duc84]). Comparability graphs (and therefore cocomparability graphs also) can be oriented in 0(V ) 2 and recognized in 0(M(V)) time [Spi85, Spi94]. Previous algorithmic work on cocomparability graphs relevant to this thesis includes polynomial time algorithms for several domination problems ([KS93], but see §4.2 for improved time complexities), and a cubic time algorithm for the Hamiltonian cycle problem [DS94]. There are also algorithms for comparability graphs [M6h85], so that the complementary problem can be solved on cocomparability graphs. Once a vertex-weighted comparability graph has been transitively oriented, one can extract a maximum weight clique in 0(V ) 2 maximum weight independent set in 0(V ) 3 time , and a 3 time [M6h85]. This algorithm for maximum weight clique cannot be used to find a minimum weight maximal clique. See §4.2.4 for an explanation and an algorithm that finds a minimum (and maximum) weight maximal clique in 0(M(V)) time. 3 Chapter 2. Related Research 37 Permutation Graphs A graph G = (V, E) is a permutation graph if there is some pair of permutations (ordered lists) P and Q of the vertices such that u and v are adjacent if and only if their order differs in the two permutations. The permutations P and Q are said to realize the permutation graph G, and make up a permutation realization or permutation model. For example, if P = (3,5,1,4,2) and Q = (5,2,3,4,1) model some permutation graph G= (V,E), then (3,5) G E but (3,1) E. We can also think in terms of a permutation diagram; lay out the permutations on two parallel rows and connect corresponding vertices with line segments. Then u and v are adjacent if and only if their corresponding line segments cross; see Figure 2.1, for example. 3 5 1 4 2 5 2 3 4 1 5 2 1 3 4 (a) (b) Figure 2.1: A permutation diagram (a) and its corresponding permutation graph (b). Here, P = (3,5,1,4,2) and Q = (5,2,3,4,1). To simplify the notation, the first permutation P is traditionally (c/. [Gol80]) written as a relabelling of the vertices P = ( 1 , 2 , . . . , | V | ) . The second permutation Q is written as a list Q = (TT(1), TT(2), . . . , 7r(|V|), where n : V —> V is a permutation (that is, a bijection) on V. Then (u,v) G E if and only if (u — V)(TT~ (U) — 7r (t>)) < 0 (think X -1 of 7 r ( u ) as the "location" of v in Q). We can therefore think of ir as the defining _1 permutation (corresponding to permutation P) for the permutation graph G. Spinrad Chapter 2. Related Research 38 has shown that a defining permutation for a given permutation graph can be found in 0(V ) 2 time [Spi85]. The complement of a permutation graph is also a permutation graph. It is easy to verify that if n is a defining permutation for G, then the reverse i\ of 7r, where r 7r (z) = 7r(| V | + l — r for all i, is a defining permutation for G. Since permutation graphs are comparability graphs, it follows that permutation graphs are also cocomparability graphs. In fact, this latter observation characterizes permutation graphs. That is, a graph G is a permutation graph if and only if G and G are comparability graphs [PLE71]. Recall that the dimension of a partial order P is the minimum number of linear orders whose intersection is P. If G is the comparability graph of a partial order P, then P has dimension at most 2 if and only if G is transitively orientable [DM41] (that is, G is also a comparability graph). It follows that G is a permutation graph if and only if the partial order underlying any transitive orientation of G has dimension at most 2. There has been considerable interest in solving dominating set problems on permutation graphs [FK85, BK87, CS90a, TH90, A R 9 2 ] . These problems are discussed in Section 4.2, which also summarizes their complexity on permutation graphs. That section presents new polynomial time algorithms for these dominating problems on cocomparability graphs, which properly includes permutation graphs, as mentioned above. Permutation graphs also play a role in Chapter 6, in which bipartite permutation graphs appear in strip graphs. Function Graphs Cocomparability graphs may also be characterized as intersection graphs. Let F be a family of continuous functions / ; : [0,1] —» R. Say that two functions / - and fj intersect if t there is a value x £ [0,1] such that fi(x) = fj(x), that is, the images of [0,1] under /,• and fj intersect. Function graphs are the intersection graphs of such families F. Golumbic, Chapter 2. Related Research 39 Rotem, and Urrutia [GRU83] show that a graph is a function graph if and only if it is a cocomparability graph. Since all partial orders corresponding to a comparability graph have the same dimension [TJS76], this number can equally well serve as the dimension of the comparability graph. Golumbic et al. show that a cocomparability graph is the concatenation of k — 1 permutation diagrams, where k is the dimension of the graph's complement. For example, permutation graphs (and their complements) have dimension 2. This also characterizes permutation graphs; they are exactly the intersection graphs of linear functions. Interval graphs are also the concatenation of permutation diagrams, since they are cocomparability graphs. However, interval graphs cannot be characterized as the concatenation of some finite number of permutation graphs. For example, C\ is a permutation graph, but it is not an interval graph. However, we can characterize interval graphs with a class of piecewise-linear functions, made up of three linear pieces. Let G = (V, E) be an interval graph where n = \V\, and let I = [^2,^2]? • • •, [^n,^n]} be an interval realization of loss of generality that l ,r v v G. We can assume without G { 1 , 2 , . . . , 2n}. The function f : [0,1] — > R corresponding v to the interval [/„,r„], where /„ < r , is given by: v l Iv if 0 < x <2n+l v MX) = (2n + l)x i f ^ if 1 1 rv T < < x < ^ 2n+l — T x X This process is illustrated in Figure 2.2, which shows the "construction line" y = (2n + l)x for clarity. If two functions intersect, then they do so on the construction line, and mimic the original intervals. Clearly then, two intervals intersect if and only if the corresponding functions intersect. Chapter 2. Related Research 40 2n-\ 2n + 1 V r.. r,u V u 0 0 0 Figure 2.2: Functions for intervals [/ ,r„] and [/„,r„]. u 2.3.2 Indifference Graphs Roberts [Rob68a] named indifference graphs after the notion of "indifference" from psychology and economics. The subsection introduces the idea of indifference graphs, and views them as one-dimensional unit disk graphs. Can an individual's preference within a finite. set of options be assigned a scalar measure? Such a measure / would map the options into real numbers. To a first approximation, the individual would prefer option a to b if and only if /(a) > /(&). This approximation would imply that indifference corresponds to equality and is therefore transitive. Roberts [Rob78] cites several sources that argue against the transitivity of indifference. To model indifference more accurately, he suggests that the preference measure have the property that, if the individual is indifferent between a and 6, then \f(a)-f(b)\<6. Definition 2.2([Rob68a]) A graph G = (V, E) is an indifference graph if there is a mapping / : V —>• R of its vertices to the reals such that (u, v) £ E if and only if \f(u)-f(v)\<l. | Chapter 2. Related Research 41 Although Definition 2.2 is sufficient, indifference graphs can also be defined by any of the characterizations in Theorem 2.3. A l l uncited characterizations below are due to Roberts [Rob68a]. Definitions of the emphasized terms in the characterizations follow the theorem. Theorem 2.3 Let G = (V, E) be a graph. Then the following are equivalent: 1. G is an indifference graph. 2. There is a semiorder (V, <) such that (u,v) 6 E if and only if neither u < v nor v < u, for all u, v in V. 3. G is a unit interval graph 4- G is a K\o,-free interval graph. 5. G is a proper interval graph. 6. ([Rob78] page 33) The adjacency matrix of G has the consecutive-ones property. 7. G is chordal and none of the graphs in Figure 2.3 are induced subgraphs. 8. [Duc84] The closed neighbourhoods of G constitute the edges of an interval hypergraph. 9. [Duc84] G admits an orientation G that satisfies both: (a) G has no cycle, (b) G(N (v)) + and G(N~(t?)) are complete graphs. 10. [Jac92] G is an astral triple-/ree graph. 11. [Duc79] There exists a linear ordering of V such that, ifu<v<w then both (u,v) and (v,w) are in E. and (u, w) £ E, Chapter 2. Related Research 42 Figure 2.3: Forbidden indifference graphs. These graphs, together with C for n > 4, make up the forbidden subgraph characterization of indifference graphs. n astral triple Three vertices in a graph such that, between any two of them, there is path P that avoids the third vertex u, and no two consecutive vertices in P are both adjacent to v. consecutive-ones property A binary matrix is said to have the consecutive-ones property if it is possible to permute the rows so that the ones in each column are consecutive. interval graph The intersection graph of a set of intervals on a linearly ordered set. interval hypergraph A (not necessarily binary) relation H = (V, E) for which there exists a linear order on the vertices V such that every element (edge) in E is an interval in the order. proper interval graph The intersection graph of a set of intervals on a linearly ordered set, none of which is contained by (is a subset of) any other. semiorder A n irreflexive relation (A, <) is a semiorder if for all x,y,z,w 6 A: x < y and z < w implies x < w or z < y; and x < y and y < z implies x < w or w < z. unit interval graph The intersection graph of a set of equal-sized (unit length) intervals on the real line. Chapter 2. Related Research 43 Looges and Olariu [L093] have developed several optimal algorithms for indifference graphs. In particular, they show how to recognize an indifference graph G = (V, E) in 0(V + E) time. Their recognition algorithm returns an efficient representation of the ordering from Theorem 2.3.11. Using this representation, Looges and Olariu colour the graph, find a shortest path between two vertices, compute a Hamiltonian path, and compute a maximum matching, each in 0(V) additional time. It is clear from the definition of indifference graphs (Definition 2.2) that the class indifference graphs is the special case of r-strip graphs where r = 0 (cf. Definition 1.3). It would be beneficial for algorithm design if some or all of the properties for indifference graphs in Theorem 2.3 were preserved for r-strip graphs as r increases. However, such preservation does not seem to be the case. For example both the square and the claw are r-strip graphs for all r > 0. In particular, the algorithms by Looges and Olariu do not seem to generalize, since the closest analogue to Theorem 2.3.11 that applies to r-strip graphs is the spanning order (which characterizes the more general class of cocomparability graphs) discussed in Chapter 4. Roberts [Rob68b] generalizes the notion of indifference to higher dimensions by defining the cubicity of a graph to be the smallest dimension k for which there exists a function / : V -> R , such that (u,v) G E if and only if \\f(u) — fc /(u)||oo < 1- The corresponding notion for the L metric is called the sphericity [Hav82a, Fis83] of a graph. Clearly, the 2 graphs that have cubicity or sphericity at most one are precisely the indifference graphs. The notion of sphericity is well defined, as Maehara's theorem shows. T h e o r e m 2.4 ([Mae84]) Every graph of order n is isomorphic to some space graph [unit sphere graph] in n-space. The sphericity (respectively, cubicity) of a graph is just the smallest dimension in which it is a unit disk graph—generalized with respect to dimension—under the L (respectively, 2 Chapter 2. Related Research 44 L Q O ) metric. The (not generalized) unit disk graphs correspond exactly to graphs with sphericity at most 2. How is sphericity related to cubicity? Havel [Hav82a, Fis83] shows that cubicity can exceed sphericity. For example the cubicity and sphericity of A^ are 3 and 2 respectively. 1;5 In fact, Havel shows that there are finite graphs of sphericity 2 that have arbitrarily large cubicity. Fishburn [Fis83] shows that sphericity can exceed cubicity for cubicity 2 and 3 but leaves the question open for larger cubicity. Maehara [Mae86] answers this question by showing that there is a complete bipartite graph with sphericity exceeding cubicity for every value of cubicity at least 6. 2.3.3 Grid Graphs A grid graph is a node-induced finite subgraph of the infinite grid [IPS82]. Equivalently therefore, a grid graph is a unit disk graph that has a realization with integer coordinates. More carefully, a graph G is a grid graph if there is a function / : G(V) —>• Z such that, 2 (u, v ) € E i f and only if ||/(u) - /(u)|| < 1 for all u, v e V. Some authors [Had77, BC87] prefer to define grid graphs as (not necessarily induced) subgraphs of the infinite grid (let us call these grid subgraphs). For example, the tree in Figure 2.4 is a grid subgraph, but not a grid graph, since every grid realization of this graph must put two leaves within unit distance of one another. 9 9 -o o 6 9 Figure 2.4: A grid subgraph that is not a grid graph. Grid graphs arise in several applications, including integrated circuit design (cf. [Had77]). Chapter 2. Related Research 45 The infinite grid represents the possible conducting material. A chip isolates a portion of the grid, effectively inducing a rectangular subgraph on the grid. The graph is further complicated by electronic components on the chip, which remove any covered vertices and edges from the graph. A typical problem in this context is to lay out (embed) an interconnection pattern (a graph) on the chip (in the corresponding grid graph), possibly by dilating (subdividing) edges in the pattern, so as to minimize the size of its layout. Since grid graphs (and grid subgraphs) are bipartite, and bipartite graphs are perfect, grid graphs are also perfect and subject to the same efficient algorithms (see Section 2.3). On the other hand, several familiar problems that are NP-complete for arbitrary graphs remain NP-complete for grid graphs, including finding a Hamiltonian path [IPS82] and finding an optimal Steiner tree [GJ77]. GRID S U B G R A P H R E C O G N I T I O N is NP-complete [BC87], even for grid subgraphs that are binary trees [Gre89]. The following simple reduction shows that GRID G R A P H R E C O G N I T I O N is also NP-complete. Let G = (V, E) be an instance of GRID SUBG R A P H R E C O G N I T I O N . Create a graph G' = (V, E') from G by replacing each edge in E with the edge simulator graph shown in Figure 2.5. Since each edge simulator has Figure 2.5: Simulating edges in grid subgraphs with grid graphs. a unique induced embedding in the grid (up to rotation, reflection, and translation), it follows that G' is a grid graph if and only if G is a grid subgraph. Figure 2.6 shows an embedded grid subgraph and the embedded grid graph that results from this reduction. In his PhD thesis [Gra95], Graf generalizes the notion of grid graphs by allowing disks of larger than unit diameter. More formally, he defines the class of UD^ graphs Chapter 2. Related Research 46 Figure 2.6: The grid graph Gi corresponding to the grid subgraph G . s to be the intersection graphs of disks with diameter d £ Z and centres in Z . Clearly, + 2 all UDd graphs are unit disk graphs, and U D i is equivalent to the class of grid graphs. Graf shows that each UD^ graph G = (V, E) has a realization that can be encoded with 0(V\og(dV)) bits, so that U D rf G R A P H R E C O G N I T I O N is in N P . B y comparison, UNIT DISK G R A P H R E C O G N I T I O N is not known to be in N P . He shows that U D 2 graph recognition is NP-complete by reducing it from grid graph recognition. He also conjectures that U D ^ recognition is NP-complete for all fixed d. Again by comparison, Section 3.4 shows that UNIT DISK G R A P H R E C O G N I T I O N is NP-hard. Finally, Graf shows that U D G R A P H 3 - C O L O U R A B I L I T Y is NP-complete. Since VB 2 d C VT> kd for all positive integers d and k, it follows that G R A P H 3 - C O L O U R A B I L I T Y is N P complete for all XJDd where d is even. 2.4 Proximity Graphs Two vertices are adjacent in a unit disk graph if their realizations satisfy a certain proximity condition: they must be within unit distance of one another. Other proximity conditions lead to other kinds of graphs. Chapter 2. Related Research 2.4.1 47 The Delaunay Triangulation Hierarchy The Euclidean minimum spanning tree [Zah71, SH75, Yao82, AESW90] MST(P) of a set of points P in the plane is a minimum spanning tree of the complete graph K(P) with edge weights equal to the Euclidean distance between endpoints. The relative neighbourhood graph [Tou80, Sup83] RNG(P) — (P, EJING) of P has an edge (p, q) between two vertices if and only if the lune through p and q does not contain any other point in P. That is, (p, q) £ ERNG if and only if \\p — q\\ < \\p — r\\ and 11jo — q\\ < \\q — r\\ for all r not equal to p or q. Two vertices p and q of the Gabriel graph [GS69, MS80] GG(P) = (P, EGG) are adjacent if and only if the smallest disk through p and q does not contain any other point in P. That is, (p, q) £ EGG if and only if \\p — q\\ < \\p — r\\ + \\q — r\\ for all r not equal to p or q. Perhaps the best known proximity graph is the Delaunay graph. Three vertices p, q, and r are pairwise adjacent in the Delaunay graph [Del34] DT(P) if and only if the smallest disk through all three does not contain any other point in P. Since the (straight line) plane graph corresponding to DT(P) partitions the plane into triangles and an external face, the Delaunay graph is usually called the Delaunay triangulation. A n alternative definition involves the Voronoi diagram [Vor08, PS85]. The Voronoi polygon or Voronoi cell associated with a point p is the set of points in the plane that are closer to p than any other point in P. The Voronoi diagram is the partition of the plane induced by the Voronoi polygons associated with the points in P. Define an edge in EDT to be a pair of points (p, q) if and only if the Voronoi polygons associated with p and q share an edge. That is, the Delaunay triangulation is the straight line geometric dual of the Voronoi diagram. Chapter 2. Related Research 48 These four graphs are related as follows [PS85]: MST(P) C RNG(P) C GG(P) C D T ( P ) . The number of edges in each of these graphs is linear in the number of vertices. Historically at least, there has been little emphasis on recognizing these graphs. How- ever, Eades and Whitesides [EW94] recently showed that recognizing Euclidean minimum spanning trees is NP-hard. There has been more emphasis on constructing these graphs from a given point set P; each graph can be constructed in 0(P log P) time ([PS85, Sup83, MS80, PS85] respectively). 2.4.2 Sphere of Influence Graphs Let P be a set of points in the plane and let D = {D : p £ P} be a corresponding set p of disks, where D is the largest disk centered on p whose interior is empty of any point p in P other than p. That is, radius(D ) p = min{||p — q\\ '• q £ P and q ^ p} for every p £ P. Avis and Horton [AH85] define the (closed) sphere of influence graph G(P) to be the intersection graph fi(D) of the disks D. Clearly, the sphere of influence graph is a disk graph. They show that the sphere of influence graph is neither a subgraph nor a supergraph of any of the minimum spanning tree, the relative neighbourhood graph, the Gabriel graph, or the Delaunay triangulation. They also show that G(P) has at most 29|P| edges and that the graph can be constructed in 0 ( P l o g P) time, which they show to be optimal. There is a subgraph relationship between sphere of influence graphs and unit disk graphs. In particular, G (P)CG(P)CGs (P), 5l where Si = 2 • mm{radius(D ) p 2 : p £ P} and S = 2 • max{radius(D ) 2 p : p £ P}. This also can be stated in terms of intersection graphs. The intersection graph £l(C \ ), m n where Chapter 2. Related Research 49 C i is a set of equal-diameter disks, is a subgraph of fl(D), where D is a set of disks with m n varying diameters, concentric with C - , each of which is no smaller than the disks in m m Gmin- Similarly, the intersection graph Q(D) of a set of disks D with varying diameters, is a subgraph of 0 ( C m a x ) , where C m a x is a set of equal-diameter disks, concentric with D , each of which is no smaller than the largest disk in D. Unit disk graphs share the property with sphere of influence graphs that they do not fall nicely into the Delaunay triangulation hierarchy. Nevertheless, one of the algorithms in Section 3.2.3 efficiently constructs (enumerates the edges of) a unit disk graph by thresholding the Delaunay triangulation. Chapter 3 Unit Disk Graphs How does the geometry of intersecting unit disks affect the associated intersection graphs? To address this question, Section 3.1 makes some basic observations about unit disk graphs that are exploited throughout the thesis. Section 3.2.1 then shows how to exploit a geometric realization of a unit disk graph to find least vertex-weight paths. Section 3.2.2 solves some more fundamental tasks: given a vertex v G V, report a vertex adjacent to v (LISTl(u)), and delete v (MARK(u)). a sequence of 0(V) More specifically, it shows how to execute calls to LIST1 and M A R K in O ( V l o g V ) time and 0(V) space. Section 3.2.3 shows how to construct a unit disk graph from its geometric realization (that is, from | V | points in the plane) in 0 ( V l o g V + E) time. Recall that efficient construction has historically been of interest for other kinds of proximity graphs (§2.4). Section 3.3.2 shows how to use a realization to find a maximum clique in polynomial time. Unfortunately, the geometry is not always so exploitable. The rest of Section 3.3 shows that several familiar problems remain NP-hard for unit disk graphs. In proving some of these ( I N D E P E N D E N T SET and C H R O M A T I C N U M B E R ) , this section draws a connection between unit disk graphs and planar graphs with no degree exceeding 4. Finally, we will see in Section 3.4 that even unit disk graph recognition is NP-hard. Furthermore, penny graph, bounded-diameter-ratio coin graph, and bounded-diameterratio disk graph recognition are all NP-hard, even for square disks and coins. That is, both 2-SPHERICITY and 2 - C U B I C I T Y are NP-hard. 50 Chapter 3. Unit Disk Graphs 3.1 51 Basic Observations This section makes some elementary observations about disk graphs and unit disk graphs that will prove useful later in the thesis. In particular, this section proves that the star Ki t6 is forbidden, and that triangle-free disk graphs are planar. We will also see that all strip graphs are cocomparability graphs. Lemma 3.1 (The Star Lemma) There are no induced stars with degree greater than 5 in any unit disk graph, and no induced stars with degree greater than 4 under the L\ and Loo metrics. Proof: At most five Euclidean disks can pack around a central disk without intersecting one another. More precisely, let / : V —»• R 2 be a realization of a unit disk graph G — (V, E). Let u be any vertex in V , and let I C Adj(u) be a set with more than five vertices, i.e., | / | > 6. Then there must be two vertices v and w in I such that the angle between the segments s = (f(u), f(v)) and s v w then, since the segments s and s v (f(v),f(w)) w = (f(u), f(w)) is at most 60 degrees. But have at most unit length, it follows that the segment also has at most unit length. Therefore (v,w) 6 E and G(I U {v}) is not isomorphic to Ki,\i\Similarly, disks under the L\ and metrics are closed square boxes. At most four such boxes can pack around a central box without intersecting one another. Corollary 3.1.1 | The star Ki^ is not an induced subgraph of any unit disk graph. Lemma 3.2 In every unit disk graph, there is a vertex v that has degree at most 3 in any induced star. Similarly, in every unit disk graph under the L\ and L^ metrics, there is a vertex v that has degree at most 2 in any induced star. Proof: Let / : V -> R 2 be a realization of a unit disk graph G = (V, E). Let v 6 V be a vertex such that f(v) is an extreme point, a leftmost point, for example. Then the Chapter 3. Unit Disk Graphs 52 neighbourhood of v lies in a half plane through v. The rest of the proof is similar to that of the Star Lemma. 3.1.1 | Connections with Planarity Recall from Section 2.2 that Koebe showed that every finite planar graph is the intersection graph of a set of interior-disjoint disks. So every finite planar graph is a disk graph. However, there are disk graphs (without the interior-disjoint restriction) that are not planar. For example, disk graphs may contain arbitrarily large cliques. This subsection shows (Theorem 3.4) that if a disk graph contains only very small cliques (with at most two vertices), then it is planar. The converse is clearly not true, as demonstrated by a triangular packing of unit disks, which generates a planar disk graph with many triangles (cliques with three vertices). Lemma 3.3 Let f : V — > R 2 (locations) and r : V — > R (disk radii) be a realization of a disk intersection graph G — (V,E). Let (a, b) and (c,d) be edges in E with distinct endpoints. If the line segments (f(a),f(b)) and (/(c), f(d)) cross, then the subgraph induced by {a, b, c, d} contains a triangle. Proof: For readability, let v denote also f(v) for v £ {a, b, c, d}. Suppose that (a, b) and (c, d) cross at some point e, as shown in Figure 3.1. Then the sum of each pair of opposite d b c Figure 3.1: If two segments cross in a disk graph realization, then their endpoints induce a triangle. 53 Chapter 3. Unit Disk Graphs sides of the quadrilateral acfed is at most the sum of its diagonals. More precisely, let uv denote the Euclidean distance ||u — v\\ between points u and v. Then ac + bd < (ae + ec) + (fee -f- ed) = (ae + fee) + (ec + ed) = ab + cd. Since (u,v) £ E if and only if itu < r(u) + r(v), it follows that ac + bd < afe + cd < r(a) + r(fe) + r(c) + r(d) = (r(a) + r(c)) + (r(b) + r(d)). Therefore, either ac < r(a) + r(c) or bd < r(b) + r(d). That is, either (a,c) £ E or (b,d) G P . Similarly, ao! + fee < afe + cd, so that either (a,d) £ E or (fc, c) £ these four possibilities implies a triangle. Any of | T h e o r e m 3.4 Every triangle-free disk graph is planar. Proof: Let / : V —> R 2 (locations) and r : V —¥ R (disk radii) be a realization of a disk intersection graph G = (V,E). If, for some pair of edges (a,b) and (c, d) in E with distinct endpoints, the line segments (/(a),/(fe)) and (/(c),/(d)) cross, then the endpoints induce a triangle in G by Lemma 3.3. Otherwise, no such line segments cross, and the graph is planar by definition. | Corollary 3.4.1 No disk graph has an induced subgraph homeomorphic to K^^. Proof: Suppose some disk graph has an induced subgraph homeomorphic to A ^ . Then there is a disk graph homeomorphic to A ^ , since any class of intersection graphs is closed under taking induced subgraphs. This graph is clearly not planar. However, all Chapter 3. Unit Disk Graphs graphs homeomorphic to A ' contradiction. 3j3 54 are triangle-free. Therefore G is planar by Theorem 3.4, a | On the other hand, there are AVfree disk graphs that are not planar. For example, the graph in Figure 3.2 is homeomorphic to K5. Note that although Figure 3.2 is K4- Figure 3.2: A K -ivee disk graph homeomorphic to K$ 4 free, it is naturally (by Theorem 3.4) not triangle-free . Figure 3.2 is actually a unit disk graph. To see this, notice that in the realization shown, there is exactly one disk that is larger than unit size. Simply shrink it about its centre until it is of unit size. This will make it less visible in the drawing, but will not affect its adjacency. 3.1.2 E v e r y r - S t r i p G r a p h is a C o c o m p a r a b i l i t y G r a p h D e f i n i t i o n 3.5 A directed orientation G = (V, E) of the complement of a r-strip graph G, and a realization / : V(G) —> R x [0, r] are compatible if they satisfy (u,v) £ E if and only if (u,v) £ E and xj(u) < Xf(y) for all u,v G V. | Note that G really is an orientation since, for every (u,v) € E, either xj(u) < xj(v) or xj(v) < Xf(u), but not both. That is, G is asymmetric, as required. Notice that Chapter 3. Unit Disk Graphs 55 there is precisely one compatible orientation for every realization, but that there might be several realizations that are compatible with any orientation. Lemma 3 . 6 For every strip thickness r G [0,\/3/2] the compatible orientation associ; ated with any T-strip realization of a graph is a transitive orientation (i.e., a strict partial order). Proof: Let G = (V, E) be a strip graph, / be a strip realization, and G = (V, E) the compatible orientation. Then G is transitive. For if (a, b) £ E and (6, c) G E then xj(a) < xj(b) < Xf(c). Furthermore, since ||/(&) — / ( « ) | | > 1 and 0 < r < y/d/2, we have x (b)-x {a) f > f y/l-(y {b)-y (a)y f > yjl - T > 1/2. f 2 Similarly, xj(c) — x/(b) > 1/2. Therefore, x (c) - x (a) f f = (x/(c) - x {b)) + (x (b) - > 1/2 + 1/2 = 1. s f x (a)) f It follows that (a,c) G E and (a,c) G E. By a similar proof, compatible orientations for L\ strip graphs (for which 0 < r < 1/2) are also transitive. | Theorem 3 . 7 Strip graphs form a subclass of cocomparability graphs. Proof: Follows immediately from Lemma 3.6. I 56 Chapter 3. Unit Disk Graphs Theorem 3.8 For every strip thickness r > \/3/2, there is a r-strip graph that is not a cocomparability graph. Proof: We will construct C5 in a "thick" strip. Since cocomparability graphs are perfect but C5 is not, it follows that C 5 is not a cocomparability graph. Chapter 4 proves the stronger claim that no induced cycle (odd or even) on five or more vertices is a cocomparability graph (Theorem 4.6). Let y be any value that satisfies < y < min{r, V15/4}. Construct five points P = {Pi P2,P3,P4,j05} in the strip, where 5 P l p 2 = (-3/4,0), = (-1/2, y), Ps = (1/2,y), P4 = (3/4,0), PB = (0,0), as shown in Figure 3.3. Then the unit disk graph G(P) generated by P is isomorphic to P2 Pi P3 Ps P4 Figure 3.3: A set of five points that generate an induced cycle. C 5 (although this is clearly not the only way to realize C 5 in a suitably thick strip). | Chapter 3. Unit Disk Graphs 3.2 57 Exploiting a Geometric Model 3.2.1 Least Vertex-Weight Paths in Unit Disk Graphs Finding short paths is a natural operation on graphs, see ([CLR90] pages 514-578) for example. This section develops an algorithm that finds a path (that minimizes the sum of the weights of its vertices) from a set of source vertices to all other vertices in a unit disk graph. That is, it solves the multiple-source least vertex-weight path problem on unit disk graphs. Any algorithm for finding a least edge-weight path must examine at least Q(E) edges, so that fl(E) is a lower bound for the algorithm's run time. To see this, consider an algorithm on the bipartite graph in Figure 3.4 in which all edges but one, to be determined U V Figure 3.4: Adversary argument for shortest path by an adversary, have weight 1. Suppose the algorithm fails to examine some edge (u, v) from the \U\• \ V\ = Q(E) edges between sets U to V. The adversary then makes (u, v) the 0-weight edge. Therefore, the algorithm clearly fails to find the shortest path (s,u,v,t) from s to t. Chapter 3. Unit Disk Graphs 58 This adversary argument does not hold for least vertex-weight paths. If we could implicitly represent the edges, then we might be able to design algorithms whose complexities do not depend on the number of edges. This section does so by exploiting a geometric representation for unit disk graphs. In particular, it solves the multiple-source least vertex-weight path problem for unit disk graphs with nonnegative vertex-weight in O ( V l o g V ) time, where the unit disk graph G = (V, E) is represented by a realization / : V —> R . We will derive the final algorithm by modifying Dijkstra's algorithm in 2 several phases. By way of background, Dijkstra's algorithm solves the single-source shortest path problem on graphs with nonnegatively weighted edges; see ([CLR90] pages 527-532) for example. The version in Table 3.1 solves a variation of this problem; it finds the least edge-weight path from any vertex in S to all vertices in V. A well-known way of solving this multisource variation, without modifying Dijkstra's algorithm, is to modify the input graph by adding a new source vertex that is incident, via zero-weight edges, to all vertices in S. We will usually not have the luxury of effecting such modifications to our unit disk graphs when they are represented by sets of points in the plane. Therefore, Dijkstra's algorithm in Table 3.1 simulates the new source vertex and the l ^ l new edges by "priming" the queue with the source vertices in S. Dijkstra's algorithm uses a priority queue Q, a data structure that supports the following operations. <5.construct(V,c/) builds the priority queue containing the set V with keys d. Q.not-emptyQ is true if Q does not contain any elements. Q.extract-minQ removes and returns the highest priority item, i.e., the one with the lowest key d , from the queue. v Chapter 3. Unit Disk Graphs 59 Table 3.1: Algorithm: D I J K S T R A ( G , S ) [Dijkstra's Algorithm] Input: A nonnegatively weighted graph G = (V,E,w) and a set of source vertices S C.V. Output: A shortest path forest, given by the parent array TT, and the distance from S to every vertex, given by d. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 for each vertex u G V do if u G 5 / * Prime the queue with S. */ then d <— 0 / * i.e., simulate w(s,u) = 0 */ else d i— oo TT « - N I L <5-construct( V, d ) while Q.not-empty() do u <r- Q.extract-min() L <- {v : G £} for each vertex u G L " do if d > d„ + w(u, v) then d^ d + w(u,v) Q.decrease-key(v, d ) u u u v u v 7T,; return (7r, d) U Chapter 3. Unit Disk Graphs Q.decrease-key(v,d ) v 60 increases the priority of v by lowering its key to d . v Dijkstra's algorithm finds least edge-weight paths in 0((V + E) log V) time when its priority queue is implemented as a binary heap [CLR90]. Note that this performance can be improved to 0 ( V l o g V + E) time using Fibonacci heaps [CLR90], but the algorithms presented in this section do not need to do so since they attain their efficiency in other ways. Before modifying the algorithm any further, let us prove that the key of any 1 vertex removed from the queue (at Step 8) is no more than that of any subsequently removed vertex. Lemma 3.9 (The Monotone Lemma) The vertex keys form a nondecreasing sequence in the order that Dijkstra's algorithm removes them from the queue. Proof: We need only prove that Dijkstra's algorithm maintains the invariant that no vertex in the queue has a key less than that of an already removed vertex. This invariant holds trivially after the algorithm constructs the queue. Thereafter, the algorithm changes the priority of a vertex v only at Step 13, by calling Q.decrease-key(u, d ). At v this stage, vertex u has just been removed from the queue, and d <— d + w(u, v). Therev u fore d > d , since all weights are nonnegative. By the invariant, d is no less than the v u u key of any other removed vertex. It follows that d also is not less than that of any v removed vertex. | Vertex Weights We can further modify Dijkstra's algorithm to solve the least vertex-weight path problem. Here, the weight of a path is- the sum of the weights of its vertices. The vertex weights must be nonnegative, as was also true for the edge weights in the previous algorithm. This fact is probably well-known. Nevertheless, I was unable to find it stated in a standard reference, so I have chosen to prove it here for completeness. 1 Chapter 3. Unit Disk Graphs 61 Again, the usual way of solving this variation is to modify the graph, not the algorithm. To simulate the weight of a vertex with edge weights, set the weight of every incoming edge to the vertex weight. Since we wish to avoid explicit edge weights, we must change the algorithm by changing every occurrence of w(u,v) to w(v). In particular, we must change the already-simulated w(s, u) in Step 3 from the constant 0 to w(u) for all u £ S. Also, in Steps 11 and 12, we must change the edge-weight term w(u,v) to the vertexweight term w(v). The modified algorithm V E R T E X - D I J K S T R A is shown in Table 3.2. Table 3.2: Algorithm: V E R T E X - D I J K S T R A ( G , S ) [Dijkstra's algorithm for vertex weights] Input: A nonnegatively vertex-weighted graph G = (V, E,w) and a set of sources S C V. Output: A least-weight path forest, given by the parent array TT, and the weight from S to every vertex, given by d. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 for each vertex u £ V do if u £ S / * Prime the queue with S. */ then d f- to (it) / * i.e., simulate w(s,u) = to (it) */ else d oo TT <NIL Q.construct(V, d) while Q.not-empty() ' do u f- Q.extract-minQ L <- {v : (u,v) £ E} for each vertex v £ L u u U then d •(— d + w(y) Q. deer ease-key (v, 'V d. v u return (TT, d) The running time has not changed; it is still 0((V + E)logV). We can do better, though, because algorithm V E R T E X - D I J K S T R A changes the priority of each vertex Chapter 3. Unit Disk Graphs 62 exactly once, when the algorithm visits it for the first time. This is shown by the following lemma. Note that the lemma would not be true for Algorithm D I J K S T R A , that is, if the algorithm uses arbitrary edge weights. L e m m a 3 . 1 0 Algorithm VERTEX-DIJKSTRA determines the final priority of a non- source vertex the first time it removes an adjacent vertex from the queue. Proof: Let v be a nonsource vertex, and let u be the first adjacent vertex removed from the queue (at Step 8). Then d 4— d + w(v) at Step 12, and d either remains infinite if v u v d is infinite, or attains some finite value if d is finite. Now, let v! be any subsequently u u removed vertex adjacent to v. By the Monotone Lemma, d < d i when the algorithm u u removes u' from the queue (at Step 8). Therefore, d = d + w(v) < d > + w(v), so that v u u the test at Step 11 fails, and Step 13 does not get called to change the priority of v. | This lemma implies that Algorithm V E R T E X - D I J K S T R A , when recalculating priorities, need not examine all vertices adjacent to a removed vertex. Rather, it need only examine those nonsource vertices that are not adjacent to any previously removed vertices. To facilitate this, we can modify the algorithm to mark source vertices at Step 3.5 and adjacent nonsource vertices at Step 9.5. The new algorithm must also compute the set of adjacent unmarked vertices L accordingly. The complete algorithm M I N - P A T H is shown in Table 3.3. L e m m a 3.11 Algorithm MIN-PATH finds a lightest path forest in 0(V log V + E) time. Proof: The correctness of the algorithm follows from the correctness of Dijkstra's algorithm and the preceding discussion. Using a binary heap priority queue, Q.construct () takes 0(V) time, 0;- tract-min() takes 0(log V") time, and Q.decrease-key() takes 0(log V) ex time (see [CLR90] pages 140-152). Vertex operations therefore take O ( V l o g V ) time Chapter 3. Unit Disk Graphs 63 Table 3.3: Algorithm: MIN-PATH(G,5) [Least Vertex-Weight Path] Input: A nonnegatively vertex-weighted graph G — (V, E, w) and a set of sources S C V. Output: A lightest path forest, given by the parent array 7r, and the weight of the lightest path from S to every vertex, given by d. 1 2 3 3.5 4 5 6 7 8 9 9.5 10 11 12 13 14 15 for each vertex it £ V do if u £ S then d «— w(u) MARK(u) else d ^— co 7T„ <r- NIL <5-construct(V, d) while Q.not-empty() do it <— Q.extract-minQ L <— {i; : v is not marked and (it, u) £ E} MARK(L) for each vertex v £ L do if d > d + iu(u) then c?„ ^— d + w(v) Q.decrease-key(i;, d ) u u v u u v TTy return (7r, d) f- It Chapter 3. Unit Disk Graphs 64 since the algorithm removes each vertex from the queue exactly once, marks it exactly once, and therefore decreases its key at most once. The remaining step is Step 9, which examines every edge twice in a straightforward implementation. This takes 0(E) and the lemma follows. time | Exploiting Unit Disk Graphs Now that we have isolated the dependence of Algorithm M I N - P A T H on the edges of the graph, we can eliminate this dependence for unit disk graphs. We will do this by efficiently implementing vertex marking, as well as Step 9 in Algorithm M I N - P A T H , for unit disk graphs represented as a set of points in the plane. We will follow the theoretical framework proposed by Imai and Asano [IA86], who solve depth first search and breadth first search in 0 ( V l o g V) time for another class of geometrically represented graphs. In the process, we will also derive depth first and breadth first search algorithms that run in 0(V\ogV) time on unit disk graphs. We will require two basic operations: LISTl(u) and M A R K ( u ) . The M A R K ( u ) operation marks a vertex v, as in Algorithm M I N - P A T H . The operation LISTl(u) returns an unmarked vertex adjacent to v if one exists, and returns NIL otherwise. We can therefore implement Step 9 (which includes Step 9.5) in the M I N - P A T H algorithm by calling Algorithm L I S T - D E L E T E in Table 3.4. The following property of L I S T - D E L E T E is straightforward. Property 3.12 ([IA86]) Every sequence of 0(V) calls to LIST-DELETE makes 0(V) calls to LIST1 and to MARK. This, together with our previous discussion of Algorithm M I N - P A T H , proves the following lemma. Chapter 3. Unit Disk Graphs 65 Table 3.4: Algorithm: L I S T - D E L E T E ( G , u) [Return and mark (delete) all unmarked vertices adjacent to u in G] Input: A graph G = (V, E) and a vertex u £ V Output: L = {v : v is not marked and (u,v) £ E} Side Effect: AU vertices in L are marked. 1 v <- LISTl(u) 2 L 4- 0 3 while v ± NIL 4 doif-L + W 5 MARK(u) 6 v <- LISTl(w) 7 return L Lemma 3.13 Suppose any sequence ofO(V) calls to LIST1 and MARK can be executed, on-line, in g (V, E) (= ffc(V)) time and g (V,E) (= 0 ( V ) ) space. T/ien Algorithm MINt s PATH finds a lightest path forest in 0(g (V,E) + V l o g V ) time and 0(g (V,E)) space. t Proof: As in the proof of Theorem 3.11, 0;- s cons truct() takes 0(V) time, Q.extract- min() takes O(log V), time, and Q.decrease-key() takes O(log V ) time using a binary heap priority queue. Vertex operations therefore take 0(g (V,E) + V l o g V ) time since t the algorithm removes each vertex from the queue exactly once, marks it exactly once, and therefore decreases its key at most once. The remaining step is Step 9, which the algorithm executes exactly once for each of | V | vertices on the queue. This therefore takes 0(gt(V, E)) time by Property 3.12, and the lemma follows. | Suppose a unit disk graph G = (V,E) is represented by a realization / : V — y R . 2 Then we can implement a call to LISTl(u) with a disk query, that is, by finding a point in / ( V ) that lies within the unit radius disk centered at f(v). We can implement a call to Chapter 3. Unit Disk Graphs 66 M A R K ( u ) by simply deleting v from V. We will see how to implement these operations efficiently in Section 3.2.2. In particular, we will prove the following theorem. Theorem 3.17 (Section 3.2.2) Given a finite set of points f(V) in the plane, a sequence of 0{V) disk queries and point deletions execute in 0(V log V) time, given 0(V log V ) preprocessing time with 0(V) space. Since LIST1 and M A R K are effectively equivalent to disk query and site deletion respectively, we immediately have the following corollary. Corollary 3.13.1 A sequence of 0(V) can be executed in 0(VlogV) calls to LIST1 and MARK on unit disk graphs time and 0(V) space. Lemma 3.13 and Corollary 3.13.1 therefore prove the main result of this section, as stated by the following theorem. Theorem 3.14 Given a representation of a unit disk graph by its realization (V,f), a least vertex-weight path can be found in 0 ( V l o g V) time and 0(V) space. In addition to finding least weight paths, efficiently, we can also perform an efficient depth first search on a unit disk graph, given a realization. Imai and Asano [IA86] show that depth first search can be executed quickly if LIST1 and M A R K can be executed quickly. The following theorem makes this more precise. Theorem 3.15 ( [ I A 8 6 ] ) Suppose a sequence of 0(V) calls to LIST1 and MARK can be executed, on-line, in g (V, E) (= O(V)) time and g (V,E) t s (= O(V)) space. Depth first search can be executed in 0(gt(V, E)) time and 0(g (V, E)) space. s Theorem 3.16 below applies Theorem 3.15 to unit disk graphs. We will use Theorem 3.16 in Section 5.1 to determine if unit disk graphs are connected in O ( V l o g V ) time. Chapter 3. Unit Disk Graphs T h e o r e m 3.16 67 Depth first search on unit disk graphs can be executed in 0(V log V ) time and 0(V) space, given a geometric representation. P r o o f : The theorem follows from Theorem 3.15 and Corollary 3.13.1. 3.2.2 | S e m i - D y n a m i c Single-Point C i r c u l a r - R a n g e Queries We are now ready to discuss disk queries in more detail. Given a finite set S of sites (points in the plane), a disk query asks for just one site inside a (closed) query disk with unit radius, or a report that no such site exists. Equivalently, it asks for a site within unit distance of a query point, that is, the center of the query disk. In addition, we want to delete sites from the set. This section presents an algorithm that executes a disk query operation in O(log S) time and deletes a site in 0(log S) amortized time, given 0(S log S) preprocessing time with O(S) space. The disk query problem resembles circular range searching—report all sites in a query disk [PS85]. Another related problem is nearest neighbour search—report the site closest to the query—which can be solved with Voronoi diagrams [PS85]. These results are not immediately useful for our needs, since they do not support deletions efficiently. Note, however, that the algorithms developed in this section are not fully dynamic in that they do not support insertion. The D a t a Structure At the coarsest level, our disk-query data structure is a square grid in the plane. The \S\ sites fall into the cells of this grid, and the contents of each cell are organized in a data structure. At a finer level, the data structure explicitly represents only those cells that contain sites, \S\ cells at most. More concretely, construct the data structure by conceptually partitioning the plane into square cells with unit diagonals, that is, with Chapter 3. Unit Disk Graphs 68 \Jl/2 sides. To avoid ambiguous site placement, assume that each cell is closed on the left and bottom, and open on the right and top. Label a cell with the coordinates of its lower left corner. We can determine the label of the cell that contains a given site in constant time since our model of computation includes the floor function. The data structure is a balanced tree (ordered lexicographically by label) of those cells that contain sites. In this way we can determine in which cell in the tree a site lies, or determine that the site is not in any cell in the tree, in 0(log S) time. We can also insert a new cell in ©(logs') time. We can therefore create the complete tree of cells in 0(S log S) time as follows. For each site v, determine if the cell containing v is already in the tree. If not, create a new cell, insert it into the tree, and associate a linked list (containing just v) with the cell. Otherwise, just append v to the end of the list associated with the cell in constant time. Each cell must now organize its list of sites into its own data structure. Searching Cells Before discussing how the sites within a cell are organized, let us first examine the structure of a query with respect to these cells. Note that the cells covered by any query disk come from a set of 21 cells as shown in Figure 3.5. We can therefore answer the query by looking in at most 21 cells. Consider the cell in which the center of the query disk lies. This cell always lies completely within the query disk. Therefore, if it is in the tree, any site within it satisfies the query. The other covered cells lie either strictly to the left, to the right, above, or below the query point. Suppose first that the cell lies strictly below the query point q = (x ,y ); q q the other three cases are handled symmetrically. We can therefore assume that our query disk is in fact a query "test tube", that is, the union of the query disk and the infinite Chapter 3. Unit Disk Graphs 69 Figure 3.5: Any unit-radius query disk covers at most 21 cells. rectangle [x — 1, x +1] x [y , oo). The center of the test tube is still defined to be (x ,y ). q q q q q The following definitions and observations are from Appendix A . A tube T contains a subset P C S of sites if P C T, and it is empty if it does not contain any sites. A tube and a site on its boundary are said to be incident. A tube is said to be supporting (with respect to S) if it is incident to exactly one site and is otherwise empty. A site in S is said to be a test tube maximal site with respect to S, or just a maximal, if it is incident to some supporting tube. By the following lemma, if we wish to report a site in a test tube, it suffices to examine only maximal sites. Lemma A.2 (Appendix A) A test tube contains a site if and only if it contains a maximal site. 70 Chapter 3. Unit Disk Graphs Binary Searching Maxima Order the maxima from left to right. Say that two maxima are neighbouring if they are adjacent in the order. Then binary search can be used to report a maximal in a query test tube. The following lemmas provide the details. The proofs are presented in the appendix. Lemma A.3 (Appendix A) If a site p is incident to a test tube that contains a site to the left of p and a site to the right of p, then p is not maximal. Lemma A . 5 (Appendix A) Let p be a maximal and let T be any incident test tube. p If T does not contain the right neighbour of p, then T does not contain any sites to p v the right of p. Similarly, if T does not contain the left neighbour of p, then T does not p v contain any sites to the left of p. We are now ready to search for a maximal in a test tube. Let p be an arbitrary maximal and let T be the query test tube. If T contains p, then we are done. If p lies strictly left of T, then any sites in T must lie to the right of p. Similarly, if p lies strictly to the right of T, then any sites in T must lie to the left of p. Otherwise, if p lies neither strictly to the left nor strictly to the right of T, then we can lower T onto p to get test tube T". If T' does not contain any sites, then neither does T (since T is strictly contained by T'). By Lemma A.3, at most one neighbour of p lies in T'. By Lemma A.5, if no neighbour lies in T", no sites at all lie in T' and we are done. Also by Lemma A.5, if a neighbour does lie in T", then any other sites in T' (and therefore any sites in T) must lie on this neighbour's side of p. Any data structure that supports binary search can therefore determine, in O(log S) time, if one of the (at most \S\) maxima lies in a given test tube T. Such a data structure is developed in Appendix A ; the test tube data structure represents the test Chapter 3. Unit Disk Graphs tube maxima of the set of sites S. 71 The following two theorems from the appendix describe the performance of this data structure. Theorem A.11 (Appendix A) The test tube data structure (B(S), D(S)) of sites S can be built in 0(S log S) time and O(S) space. Theorem A.17 (Appendix A) O(S) sites can be deleted from the test tube data structure (B(S), D(S)) of sites S in 0(S\ogS) time. Since any cell could be either to the left, right, above, or below a query point, each cell must maintain four sets of maxima. We can derive the other three directions for cells symmetrically, by rotating the coordinate system in 90 degree increments. This completes the disk query data structure. A Summary of Algorithms In summary, the data structure requires the following three algorithms. The preprocessing algorithm builds the data structure by constructing the tree of cells in 0(S log S) time. Then, for each cell 6, it builds four sets of maxima from its n& sites in 0(nf,logn(,) time. Since Yl,b b = \S\, and log b < log \ S\, the sum of the 0(nt, log rib) costs over all nonempty n cells is 0(S log S). To find a site in a query disk, the query algorithm must examine at most 21 cells. The locations of these cells are all closely related to the location of the cell containing the query point, so the query algorithm can find each each such cell in O(log S) time. The query algorithm can then extract a suitable site in constant time from the center cell, or in Oilognb) time from any of the others. To delete a site, the deletion algorithm finds the cell that contains the site in the tree in (9(log S) time. It then deletes the site from all four maxima lists in 0(log rib) = O(log S) amortized time. This proves the following theorem. Chapter 3. Unit Disk Graphs 72 T h e o r e m 3.17 Let S be a set of sites in the plane. A sequence of O(S) disk queries and site deletions execute in 0(S log S) time, given 0(S log S) preprocessing time and O(S) space. 3.2.3 B u i l d i n g an Adjacency List from a M o d e l Recall from Definition 1.2 that the unit disk graph G$(P) generated by a set V of points and a real threshold 8 is the graph (V, E) where E = {(p,q) : \\p — q\\ < 8}. How does Gs(P) change as 8 changes? In particular, how does the number of edges change? Surprisingly, the number of edges generated by two different distance units are linearly related (Theorem 3.18 below). We saw how a geometric realization of a unit disk graph can be used to implicitly represent the edges, and consequently to design algorithms whose computational complexity does not depend on the number of edges. What can we do if we have only the geometric representation of the graph, and we wish to compute its edges? One solution would be to simply look at every pair of vertices, and check if the corresponding points are within unit distance of one another. This method would take Q(V ) time, which is 2 optimal for dense graphs. We can do better if our graphs are sparse. Theorem 3.18 makes it possible to report efficiently the edges of a generated unit disk graph Gs(V) = (V, Es) in 0(V log V + Es) time. This section demonstrates this property by presenting and analyzing two different algorithms. Given a set V of points in the plane, these algorithms report the edges Es in the unit disk graph Gs{V, Es) for all distance thresholds 8. Although these two algorithms are correct for different reasons, we will see that their efficiency is due to Theorem 3.18. This reporting problem is also known in the literature [BSW77, DD90, LS94] as the fixedradius all-nearest neighbours problem: given a set P G H of points and a fixed radius 8, k report all pairs of points within 8 of each other. Chapter 3. Unit Disk Graphs Theorem 3.18 and G (V) A 73 Let 8 < A be two nonnegative distance thresholds. If G$(V) = (V, E$) = (V, E&) are unit distance graphs generated by the same set V of sites, then \E \ = 0(V + E ). A s Proof: This proof generalizes a demonstration by Dickerson and Drysdale [DD90] showing (effectively) that \E \ = 0(V + E\). Let N [v) denote the closed neighbourhood of 2 v in G . A A That is, N (v) is the set of sites in P within A units of f(v). A To simplify the presentation, let us assume that all graphs have loops, that is, that (v,v) G E(G) for every v £ V(G). Let us also assume that each undirected edge is really two undirected edges. Then E A N {v)} = \J{{u,v):ue vev A and (3.1) \E \ = J2\N (v)\. A A vev The rest of this proof shows that J2 ev \NA(V)\ = O(Es) by deriving a lower bound for v \E$\. The basic idea is to partition the plane into regions with diameter at most 8. Any pair of sites in such a region will generate an edge in E$. We will then associate, with each site v, a region containing at least a constant fraction of the sites in N (v). A Each such region therefore contributes roughly |A^A("y)| edges to E$. Although a region might 2 be associated with more than one site, it will not be associated with more sites than a constant multiple of \N (v)\. A The (disjoint) sum of edges in these associated regions is therefore at least roughly J2(\NA(V)\ /\N (V)\)=Y,\NA(V)\. 2 A vev vev More concretely (and more carefully), overlay the plane with a square grid whose cell diagonals are 8 units long, that is, whose sides are 8/y/2 units long. Let the cells be closed on the left and bottom, and open on the right and top. These cells clearly partition the plane and have diameter at most 8, as outlined in the previous paragraph. Chapter 3. Unit Disk Graphs 74 For any vertex v, the neighbourhood NA(V) comes from at most a constant number k\ of these grid cells. The exact value of this constant is not crucial, but it is nevertheless easy to exhibit a value that will suffice. For example, there are at most k = sk [ l = [ ^ 2 ' 1 (3 2) columns strictly between v and the leftmost site in N&(v), since each cell has width 8/\/2. Therefore, counting the leftmost, rightmost, and center columns, the sites in N&(v) come from at most 3 + 2k columns. The same argument holds for rows, so N&(v) touches at most ki = (3 + 2k) cells. 2 Let the maximum cell C be the cell that contains the most sites from N (v) (break v A ties arbitrarily). The Pigeonhole principle implies that the maximum cell C contains at v least \N {v)\/kx sites from N (v). A That is, A ici > (3.3) fci where \C \ is the number of sites in C (note that not all of these \C \ sites need belong V to NA(V)). v AS V promised, every pair of sites in C generates an edge in E$ since every v such pair is separated by at most 8 units. Does this mean that \E$\ > Z^ev jC^.| ? No, 2 because cell C may be counted more than once in this way if it is the maximum cell for v more than one site, that is, if C — C for some site u ^ v. v u Fortunately, there is a constant k such that no cell C is counted more than /c j C | 2 v 2 v times. Again, the exact value of k is not crucial, but we can easily derive a suitable 2 one. Suppose C = C for some site u. Then there are again at most k columns (see u v Equation 3.2) strictly between u and C . By the same argument as above, u must come v from one of k = (3 + A;) cells. But if the cell C* containing u contains more than \C \ 2 2 V sites, then C would could not be the maximal cell for u, since C* contains only sites v from NA(U). Therefore u must be one of at most A^ICJ sites. Chapter 3. Unit Disk Graphs 75 A lower bound for the number of edges in Gs is, therefore, ^ 1 sl number of pairs in C v ^2 - h > \{u-c* = c }\ v \Cy\ 2 k2\C \ veV Y v E (3-4) 1^1 Substituting Inequality 3.3 into Inequality 3.4 yields 1 k\ ko ^-tr That is, E I ^ H I ^ ^ I ^ I ( - ) 3 5 vev Finally, substituting Inequality 3.5 into Inequality 3.1, \E \ A < E < kx k 1£7$1 • Finally, if E' and E' are versions of s A 1^4*01 2 and EA without loops and not directed, then \E' \ = 0(E ) = 0{E ) = 0(V + E's), and the theorem follows. A A S Note that we cannot do without the 0(V) term in general. For example, if V = {(x, 0) : x = 0 , 1 , 2 , . . . , n}, 8 = 0.5, and A = 28, then Gs(V) has no edges at all, while GA(V) has n edges. However, this is only true if Gs(V) is not connected, as shown by the following corollary. | C o r o l l a r y 3.18.1 Let 8 < A be two nonnegative distance thresholds. If G$(V) = (V, Es) and GA(V) = (V,EA) are unit distance graphs generated by the same set V of sites, and Gs(V) is connected, then \EA\ = 0(E$). Chapter 3. Unit Disk Graphs 76 Proof: The corollary follows from the theorem since | V | = 0(E$) for connected graphs I Gs = (V,E ). s A Plane-Sweep Algorithm To simplify the notation for Algorithm A D J - P L A N E - S W E E P (Table 3.5), assume a unit distance threshold S — 1. Algorithm A D J - P L A N E - S W E E P maintains three indices p, q, and r; and two sets L and Bar of points. The set L is a one-dimensional array of sites, indexed from 1 to | V | , and p, o, and r are indices into L; for convenience, write (x ,y ) = L . p p p Array L stores a lexicographically sorted list of the sites in V. That is, p < q implies x < x , or x = x and y < y . p q p q p The array L supports two operations: q L.build(V), which constructs the lexicographically sorted list; and L,-, which returns the site indexed by i. For each p 6 V, define the set Bar = {q : q £ V, q < p, and x — 1 < x }. p p q A D J - P L A N E - S W E E P reuses storage by dropping the subscript, thereby representing each such set with the single data structure Bar. See Figure 3.6 for a typical event in the plane-sweep. Algorithm A D J - P L A N E - S W E E P examines each site in L from left to right using the index p. It maintains the invariant that indices r and p delimit the contents of the set Bar. To do so, it increases r until x — 1 < x . In the process, it removes all p r sites that have dropped out of the bar. Correctness Let G(V) = (V, E) be the unit disk graph generated by V and suppose that (L , L ) G E. By definition, | | L — L \\ < 1. Suppose, without loss of generality, that p q p q q < p. Therefore q will be in the Bar when the algorithm encounters p since \x — x \ < 1. p The algorithm therefore correctly reports edge (L ,L ) p q q at Step 9 when it examines p. Furthermore, the test in Step 8 ensures that it reports only edges in G(V). Chapter 3. Unit Disk Graphs 77 • • • • • P • m • a 1 " • 1 »* • Figure 3.6: Algorithm A D J - P L A N E - S W E E P examines site p Table 3.5: Algorithm: A D J - P L A N E - S W E E P ( V ) [Construct the list of edges for the unit disk graph G(V) generated by V by sweeping the plane.] Input: A set V of sites. Output: The edges E of the unit disk graph G(V) = (V, E) generated by V. 0 1 2 3 4 5 6 7 8 L.build(V) p <r- r <- 1 while p < \V\ /* examine L */ do while r < p and x < x - 1 / * Bring Bar up to date */ do Bar <— Bar \ {r} r <- r + 1 for each site q 6 fiar such that y £ [y — 1, y + 1] do if ||L„-Z,g|| < 1 9 then E ^ E U {(L , L )} p r p g 10 Bar <- 5 a r U {p} 11 p-(-p+l 12 return E p q p p Chapter 3. Unit Disk Graphs Complexity 78 This algorithm can be implemented to run in 0(V log V -f E) time. The preprocessing operation L.build(V) just sorts the sites in 0 ( V l o g V ) time. Since the algorithm inserts each site into the Bar exactly once and removes each site at most once, it makes 0(V) insertions and deletions. The implementation represents the Bar as a balanced tree, a red-black tree for example [Sed83], sorted by y-coordinate. Inserting (Step 10) or deleting (Step 5) a site therefore takes 0(log V ) time for a total of 0(V log V ) time. Balanced trees support the extraction of sites in Step 7 in O(log V + I ) p time, where I is the number of sites in the unit interval about y [Sed83]. Examining p p all V intervals therefore takes o(viogv+£;/p) =i P time. The sites examined by Step 7 are all within y/2 of p (see Figure 3.6 again). Therefore E = i I < \E^\ where G^(V) p P = ( V , E ^ ) . By Theorem 3.18, it follows that: \v\ J2l =i P = 0(V + E). P The entire algorithm therefore takes 0(V log V ) + 0(V + E) = 0(V log V + E) time. We have established the following theorem. Theorem 3.19 Algorithm ADJ-PLANE-SWEEP returns the edges of the unit disk graph G(V) = (V, E) generated by a set V of points in 0(VlogV + E) time. A Delaunay Triangulation Algorithm The next algorithm is due to Dickerson and Drysdale [DD90]. It has the advantage that it allows a preprocessing stage, which is time-critical, and which is independent of the distance threshold 5. This preprocessing stage takes 0 ( V l o g V ) time. The algorithm can then report the edges in Gs(V) in 0(V + E) additional time. Briefly, the algorithm Chapter 3. Unit Disk Graphs 79 performs a depth-first search on the thresholded Delaunay triangulation TDT(V)—the Delaunay triangulation of V less any edges that are longer than 8—from every vertex p G V. The algorithm stops the current branch whenever it visits a vertex that is more than 8 units from p. The algorithm reports an edge from p at all other visited vertices. Table 3.6 provides more details. Table 3.6: Algorithm: A D J - D E L A U N A Y ( V , 8) [Construct G (V) thresholded Delaunay triangulation] S by searching a Input: A set V of sites and a distance threshold 8. Output: The edges Es of the unit disk graph Gs(V) = (V, Es) generated by V. 0 1 2 3 4 5 6 7 8 Construct the Delaunay triangulation DT(V) of V. Tm(V)<-DT(V)\{{p,q):\\p-q\\>6} E f- 0 for every vertex p G V / * examine p */ do depth first search T D T ( V ) from p, but stop each branch when the current site is farther than 8 from p. for each visited vertex q do if | | p - q\\ < 8 then E ^ E U{{p,q)} return Es § Correctness s s Let (p, q) be an edge of the unit disk graph generated by V. Then there is a path from p to q, in the Delaunay triangulation of V, such that every site on the path is within 8 units of p. To see this, consider the line segment between p and q. This line segment intersects several adjacent cells in the Voronoi diagram of the sites V. The sequence (p = O i , O2, • • •, 0 k = q) of sites corresponding to these Voronoi cells is therefore a path in the Delaunay triangulation by the duality of the Delaunay triangulation and the Voronoi diagram (see Section 2.4.1). Now consider any site (Voronoi center) O in t this sequence, and let x be any point on the part of the segment intersecting the Voronoi Chapter 3. Unit Disk Graphs 80 Figure 3.7: The disk through p and q contains Voronoi center Oi cell corresponding to 0, (see Figure 3.7). By the definition of Voronoi diagram, x is closer to Oi than to any other site in V. It follows that the circle about x and through Oi (that is, of radius — x||) does not contain any other site in V. In particular, it does not contain p or q (unless Oi equals p or q respectively). The circle with diametric points p and q therefore contains the circle about x and so contains Oi also. Since in addition \\p — q\\ < 5, the site Oi is within 8 units of p and q and of all other sites Oj in the path. That is, ( 0 1 ; 0 , • • •, Ok) is a path from p to q in the thresholded Delaunay 2 triangulation. Consequently, Step 7 will report the edge (p, q) when it examines p. Complexity Let G — (V ,E ) p P P be the connected component (of the thresholded De- launay triangulation TDT(V)) that contains p. Suppose that Step 4 visits a vertex q so that q € V . p Since Step 1 thresholds the Delaunay triangulation, q must be within 8 of its parent in the depth first search. This parent must be within S of p since Step 4 Chapter 3. Unit Disk Graphs 81 cuts off depth first search when the distance from p to the current site exceeds 8. Therefore, q is within 28 of p by the triangle inequality. It follows that (p, q) G E%s where G2siy ) = (V ,E%$). p Since G is connected, Corollary 3.18.1 applies to show that P El = 0(E ). P & p Since £ v \ E \ = \E\, it follows that £ P p e p£l/ \ E % \ = 0(E) so that Step 6 S executes 0(E) times. The Delaunay triangulation can be constructed in 0(V log V) time [PS85], and thresholded in 0(V) time (the number of edges of a Delaunay triangulation is linear in the number of sites). However, Volker Turau has discovered a way to implicitly threshold the Delaunay triangulation in the preprocessing step [Tur91], thereby saving the 0(V) thresholding cost and the Q(V) cost of examining each vertex in Step 3. Represent the Delaunay triangulation as an adjacency list. List every vertex p in nondecreasing order of the length of the shortest edge incident with p. List every neighbour q of each vertex p in nondecreasing order of the length of edge (p,q). Then, for any given threshold 8, Step 3 can examine the vertices in order, stopping when it encounters a vertex with every incident edge longer than 8. In this way, it examines only vertices that are not isolated in Gs (and at most one more). Similarly, Step 4 examines edges out of q in order, stopping when it encounters an edge longer than 8 (charge the cost of detecting a long edge to visiting q). The following theorem summarizes. T h e o r e m 3.20 ADJ-DELAUNAY ([DD90, Tur91]) Given a set V of points in the plane, algorithm takes 0(V \ogV) preprocessing time and, given a thresholds, returns the edges of the unit disk graph Gs(V) = (V, E) in 0(E) additional time. The discussion above implies that the connected components of a unit disk graph are equivalently the connected components of the underlying thresholded Delaunay triangulation. These connected components can therefore be extracted in linear time by depth Chapter 3. Unit Disk Graphs 82 first searching the thresholded Delaunay triangulation. Theorem 3.21 The connected components of a unit disk graph G$(V) can be found in 0(V log V) time, given a set V of points in the plane. Other Work There are other solutions to the fixed-radius all-nearest neighbour problem in the literature. Bentley, Stanat, and Williams [BSW77] have developed a solution that involves partitioning the plane into a grid of square cells, much like the proof oi Theorem 3.18. They presented their algorithm in terms of the metric in fc-dimensional space, but it is not difficult to modify it to work with the Li metric in the plane. Again, Theorem 3.18 explains the computational complexity of their algorithm. However, the time required to access the cells containing sites in their algorithms is also a factor in the computational complexity. Bentley et al. mention three possible ways to implement this set of cells, leading to three different time bounds for the complete algorithm, as the following table summarizes. Implementation of Occupied Cells Time Complexity hash table 0(V + E) average case balanced tree 0(V log V + E) worst case two-dimensional array 0(V + E) worst case The two-dimensional array solution actually allocates space for all cells, occupied or not, that intersect the bounding rectangle of the sites. Since the 16*1 sites may have an arbitrarily large range of coordinates, the two-dimensional array may require arbitrarily large space. The hash table or the balanced tree solutions, on the other hand, require only a linear amount of space. Subsequent to (and independent of) the development .of Algorithm A D J - P L A N E S W E E P , Lenhof and Smid [LS92, LS94] described a similar algorithm that runs in Chapter 3. Unit Disk Graphs Problem chromatic number vertex cover independent set domination independent domination connected domination total domination 83 Unit Disk Performance Ratio Arbitrary Graph Performance Ratio 3 3/2 3 5 5 10 10 0(V(G)^l^f) [Hal90] 2 [GJ79] not constant [ALM+92] O(log V) [Joh74] not constant [Irv91] ? ? Table 3.7: Performance ratios for approximation agorithms on unit disk graphs 0( V l o g V + E) time. Their approach is in effect a combination of our plane-sweep algorithm and the cell method described in the last paragraph. This combination makes it easier to adapt to higher dimensions than the pure plane-sweep algorithm. One attractive feature of their presentation is that they have recorded an animation of their algorithm on an easily-obtained videotape [LS94]. 3.3 NP-Complete Problems Restricted to Unit Disk Graphs Many well-known NP-complete problems on arbitrary graphs, in particular chromatic number, vertex cover, independent set, domination, independent domination, and connected domination [GJ79] remain NP-complete for unit disk graphs. Clark, Colbourn, and Johnson provide reductions for all of these problems in their recent paper [CCJ90]. Remarkably, all of these problems have efficient approximation algorithms. These algorithms, due to Marathe, Breu, Hunt, Ravi, and Rosenkrantz [MHR92, M B H 9 5 ] , achieve + the performance ratios in Table 3.7, which compares them with the best-known performance ratios for arbitrary graphs. Section 3.3.3 presents the details for the chromatic number problem. 84 Chapter 3. Unit Disk Graphs Clark et al. notice that "For all of the problems mentioned here, the complexities for 2 unit disk graphs and for planar graphs agree." We saw in Chapter 1 that there are some tantalizing connections between planar graphs and unit disk graphs. Nevertheless, the observation by Clark et al. may be misleading in its generality. In fact, the complexities of these problems agree for unit disk graphs and for planar graphs with maximum degree 4. Conjecture 3.22 If a problem V is NP-complete for planar graphs with maximum degree 4, then V is NP-complete for unit disk graphs, too. Discussion For example, every grid graph is a planar graph with no degree exceeding 4. If a problem is NP-complete for grid graphs then it is clearly NP-complete for unit disk graphs, which include grid graphs as a special case. For example, the problem D O M I N A T I N G S E T has this characteristic [CCJ90]. But there seem to be stronger connections. If a problem is NP-complete for planar graphs with maximum degree 4, then there is a "plan of attack" for proving that the problem is also NP-complete for unit disk graphs. The idea is to embed the planar graph instance in a grid graph, then simulate the embedded edges with a string of disks. The nature of the simulation naturally depends on the problem under consideration. This "plan of attack" is unfortunately not sufficiently well-defined to yield an easily applied theorem. Instead, the next subsection applies the idea to an illustrative example, namely I N D E P E N D E N T SET. The NP-completeness proof for C H R O M A T I C N U M B E R on unit disk graphs (Section 3.3.3) provides another example. Clark et al. [CCJ90], who provide an explicit reduction for V E R T E X C O V E R rather than I N D E P E N D E N T SET, provide even more examples. Besides these NP-complete problems, Clark et al. also consider the maximum clique problem, which is polynomial for both planar and unit disk graphs. See Section 3.3.2 for more details. 2 Chapter 3. Unit Disk Graphs 3.3.1 85 Independent Set A n independent set, also called a stable set in a graph is a set of vertices no two of which are adjacent. The maximum independent set problem is to find an independent set of greatest cardinality. This fundamental problem is very well known; the corresponding decision problem is given below, and is taken verbatim from Garey and Johnson's book [GJ79]. [GT20].INDEPENDENT SET I N S T A N C E : Graph G = (V, E), positive integer K < \V\. Q U E S T I O N : Does G contain an independent set of size K or more, i.e., a subset V C V such that \V'\ > K and such that no two vertices in V are joined by an edge in El Theorem 3.23 ([CCJ90]) INDEPENDENT under the L\, Li, and L^ SET is NP-complete for unit disk graphs metrics. Proof: The problem is in N P since I N D E P E N D E N T SET is NP-complete for arbitrary graphs [GJ79]. Let us reduce I N D E P E N D E N T SET, which remains NP-complete [GJ79] for planar cubic graphs, to I N D E P E N D E N T SET for unit disk graphs. To this end, let G pc and k be an instance of I N D E P E N D E N T SET on a planar cubic graph. Begin by embedding the instance in a grid graph; this is done only to leave enough room between vertices and edges for the next step. Let Gdu be the grid graph induced by the vertex set {(i,j) : 0 < i < I, 0 < j < J}. Valiant [Val81] shows how to embed, without crossovers, any planar graph of degree 4 (or less) with n vertices into Gd 3 . 3rit n His polynomial time method is simple: given any embedding of the graph in the plane, strip off one vertex at a time, from the "perimeter" of the embedding. Embed these vertices in reverse order into the grid. The rath vertex is typically embedded as shown in Figure 3.8. Chapter 3. Unit Disk Graphs 86 Embedding of first m — 1 vertices Figure 3.8: Embedding the mth vertex [after [Val81]]. Next, simulate the vertices of the planar graph with disks, and simulate the edges of the planar graph with a string of an even number of disks. We can use the grid embedding to make this concrete. A l l disks in the layout have diameter 1/3. Center the disks at the points P determined as follows. We must simulate three kinds of grid graph components: nodes, pseudo-nodes, and segments. Here, nodes are those grid graph vertices in the embedding that correspond to vertices of the planar cubic graph and pseudo-nodes are those that do not. Segments are grid graph edges in the embedding. Figure 3.9 shows how to simulate each of these components with disks. The figure shows two types of pseudo-nodes, those that bend and those that do not, even though they are simulated in the same way. In terms of coordinates, simulate • the node with a disk centered at (i,j), • the segment [(i,j), (i ± 1, j)] with two disks, centered at (i ± |, j) and (z ± §, j ) , • the segment [(i,j), ± 1)] with two disks, centered at (i,j ± | ) and (i,j ± |), 87 Chapter 3. Unit Disk Graphs Q node •CO* segment non-bending psuedo-node # QQ bending psuedo-node • w Figure 3.9: Components for simulating grid embeddings • the pseudo-node at ( i , j ) by putting a disk at ( z ± | , j ) for each embedding fragment of the form [(i,j), (i of the form [(i,j), (i,j ± 1, j)], and a disk at (i,j ± | ) for each embedding fragment ± 1)]. Figure 3.10 simulates the embedding of a small graph (5 vertices, 6 edges). Note that every edge of the planar cubic graph is simulated with an even number of disks, as required. Let n denote the number of nodes, p the number of pseudo-nodes, and s the number of segments in the embedding. The size of the simulation is polynomial in the size of the planar cubic graph since, by the properties of Valiant's embedding, n + p + s < (3|V|) + 2(3|V| ) + 2(3|V| - 1)(3|V|) = 2 The planar cubic graph G pc 2 has an independent set I pc 0(V ) 2 of size k or more if and only if the unit disk graph G d = (V, E) has an independent set I i of size k' > k -f p + s. u U( The following definitions and observation aid in seeing this. Say that a disk in the realization of G d is selected if it is in the independent set I ^. Say that an edge in G u u pc is saturated if one half of the disks that simulate it are selected. Equivalently, an edge is saturated if exactly one disk is selected from each segment or pseudo-node simulating the edge. Figure 3.11 shows a saturated edge along with a selected node disk. The following Chapter 3. Unit Disk Graphs 88 Figure 3.10: The embedding has 5 nodes, 3 bending pseudo-nodes, and 3 non-bending pseudo-nodes. For easier identification, the figure outlines in bold the disks that simulate nodes, and shows the underlying grid graph embedding. Figure 3.11: A saturated edge and a selected node disk Chapter 3. Unit Disk Graphs 89 observation follows from the construction of the simulation. Observation 3.24 An edge in the planar cubic graph G pc can be saturated if and only if at most one of its node disks is selected. Now suppose that I is an independent set of k vertices in G . Select the node disks pc pc corresponding to I . By the observation above, we can now saturate every edge of G pc pc by selecting exactly one disk from each segment and pseudo-node in such a way that no two disks overlap. This process yields k' non-overlapping disks, which make up I d as u required. Conversely, suppose that G d(P) has an independent set of k' disks, and let I d be the u u maximum independent set that maximizes the number of saturated edges. Then every selected node disk v is adjacent only to saturated edges. For otherwise the number of saturated edges could be increased: remove v and the less than e/2 disks in the adjacent unsaturated edge from I , and replace them with the e/2 disks that saturate the edge, ug as shown in Figure 3.12. By the observation, I , the set of vertices in G corresponding pc pc to node disks in I d, is an independent set. Since the edges can contribute at most p + s u disks to the k! disks in I d, it follows that k' < \I \+ p-\-s. That is, \I \ > k' —p — s = k, u pc pc as required. Squares rotated by 45 degrees can substitute for disks in the above proof. If the grid graph is first rotated by 45 degrees, then upright squares can substitute for the disks, also. Therefore the proof is valid for disks under the L2 metric. | Corollary 3.24.1 L\, L2, and and L\ metrics, as well as the VERTEX COVER is NP-complete for unit disk graphs under the metrics. Proof: V E R T E X COVER has the same complexity as INDEPENDENT SET problem with respect to restrictions on the graph [GJ79]. | Chapter 3. Unit Disk Graphs 90 Figure 3.12: Saturating an unsaturated edge. The bold circles on the left form a maximal independent set of disks from the edge. However, the edge can be saturated by redistributing one of the node disks into the edge, as shown on the right. 3.3.2 M a x i m u m Clique Finding a maximum clique in an arbitrary graph is a well-known NP-complete problem [GJ79]. This problem is also closely related to finding a maximum independent set, since a clique in a graph is an independent set in its complement. We have already seen that I N D E P E N D E N T SET is NP-complete for unit disk graphs (Section 3.3.1). Nevertheless, we will see in this section that a maximum clique in a unit disk graph can be found in polynomial time, given a realization of the graph. Let G = (V, E) be a unit disk graph and let / : V —> R 2 be a realization of G. To simplify the notation, let us assume that vertex names are synonymous with their realizations; that is, v — f(v) for every vertex t i f V . Although this practice might lead to ambiguity, the role of a vertex will always be clear from context. First note that if C is a maximum clique with more than one vertex in G, then it has a pair of sites p and q that are farther apart than any other pair in C. The distance A between p and q must Chapter 3. Unit Disk Graphs 91 naturally satisfy A < 1. Furthermore, all sites in C must be within A units of p and q. That is, let the lune through points p and q be the set of points in the region Rp, , where q R = {x : x £ R and \\x — p\\ < A and ||x — q\\ < A } 2 p<q as shown in Figure 3.13. Then C C R ,q, and in particular, C C L , P Pt9 where L PA = is the discrete lune through p and q. V fi R p>q Figure 3.13: The lune through a pair of sites. A maximum clique containing p and q is therefore a maximum clique in the induced subgraph G(L ). p<q We can now compute a maximum clique in G(L ) Ptq a maximum independent set in the graph's complement G(L ), p>q by computing since these sets are identical. Clark, Colbourn, and Johnson [CCJ90] prove that G(L ) Piq G(L ) Ptq is cobipartite, that is, that is bipartite. This is easy to see. The line through p and q partitions the lune through p and q into two halves, say an upper half and a lower half. It is easy to verify that each half has diameter A , which is at most 1. Therefore, any edge in the complement must join a vertex in one half with a vertex in the other. Clark et al. show how to extract Chapter 3. Unit Disk Graphs 92 a maximum independent set from a maximum matching in G. Furthermore, a maximum matching in a bipartite graph can be found in 0 ( V ) time ([HK73], see for example 2 5 [PS82] pages 225-226). One algorithm for finding a maximum clique in a unit disk graph G(V) = (V, E), therefore, is to examine all \E\ adjacent pairs of vertices in V. compute G(L g) in 0(V ) 2 Pt subgraph G(L ) in 0(V ' ) 2 5 p>q 0(V ' ) 4 5 For each pair {j>, q}, time. Finally, compute a maximum independent set of the time. The complete algorithm therefore runs in 0(V ' E) 2 5 = time. This proves the following theorem. T h e o r e m 3.25 ( [ C C J 9 0 ] ) One can find a maximum clique of a unit disk graph G = (V, E) in 0 ( V ' ) time, given a realization. 4 5 We can actually do better if we exploit the realization. The following algorithm is similar to one developed by Aggarwal et al. [AIKS89] for finding k points, from n points in the plane, with minimum diameter. Aggarwal et al. proved independently of [CCJ90] that G(L ) PA is bipartite. They then use an algorithm due to Imai and Asano [IA86], together with an efficient representation of G(L ) Ptq to find a maximum independent set in G(L , ) due to Hershberger and Suri [HS89], in 0 ( V l o g V ) time. The algorithm in 1 5 p q the previous paragraph, together with the observations in this paragraph, therefore takes a total time of 0(V log V). 35 Another result due to Imai and Asano [IA83] is an algorithm that finds a maximum clique of an intersection graph of rectangles in 0 ( V l o g V ) time. Since a unit disk graph under Li and is an intersection graph of squares, their algorithm applies here, also. The following theorem summarizes the preceding discussion. T h e o r e m 3.26 Given a realization, one can find a maximum clique in a unit disk graph G = (V,E) in 0 ( V ' l o g V ) time under the L metric and in 0 ( V l o g V ) time under the 3 5 2 L\ and metrics. Chapter 3. Unit Disk Graphs 93 Is it possible to find a maximum clique in a unit disk graph without a realization? For example, Graf ([Gra,95] pages 35-36) interprets [CCJ90] to conclude that L , p q = N(p) f l N(q), thereby obviating the need for a realization. Unfortunately, this conclusion is unwarranted if A < 1. The intersection of neighbourhoods N(p) fl N(q) is indeed enclosed by a (geometric) lune, but this lune is the intersection of two unit-radius disks. As shown in Figure 3.14, this unit-radius lune is larger than the lune through p and q, and the graph induced on its sites may not be cobipartite. Figure 3.14: The unit-lune defined by a pair of sites, together with the smaller lune through the pair of sites. Perhaps if p and q have the greatest separation of any pair in some clique, then the subgraph induced by N(p) D N(q), although not a cobipartite lune, is nevertheless still cobipartite (for other reasons). Then the maximum clique algorithm could be easily modified to work without a realization. This conjecture also is not true, as shown by the Chapter 3. Unit Disk Graphs 94 more detailed counterexample in Figure 3.15. The question "Can the maximum clique of a unit disk graph be computed in polynomial time without access to a realization?" therefore remains open. 3.3.3 Chromatic Number To colour a graph, assign a positive integer (a colour) to each vertex in the graph, such that no two adjacent vertices receive the same colour. The minimum colour problem is to colour a graph using the least number of colours. This least number of colours is called the chromatic number of the graph. The related decision problem, G R A P H K - C O L O U R A B I L I T Y , is NP-complete for arbitrary graphs [GJ79]. We will see in this section that it remains NP-complete when restricted to unit disk graphs. Section §2.1.4 presented an illustrative application to radio frequency spectrum management due to Hale [Hal80]. Hale states that the colouring problem for unit disk graphs was shown to be NP-complete by J . B . Orlin in April of 1980, but does not provide any further details or references. Since then it has been proved by Burr [Bur82] and by Clark, Colbourn, and Johnson [CCJ90]. A n independent proof due to the author appears below. It follows the general framework outlined earlier, of reducing from the same problem in planar graphs with degree at most four. G R A P H K - C O L O U R A B I L I T Y (Problem GT4 in [GJ79]) I N S T A N C E : Graph G = (V,E), positive integer K < \V\. . Q U E S T I O N : Is G A'-colourable, that is, does there exist a function c : V —> { 1 , 2 , . . . , A'} such that c(u) ^ c(v) whenever (u, v) 6 El T h e o r e m 3.27 ( O r l i n 1980 [Hal80, B u r 8 2 , C C J 9 0 ] ) GRAPH is NJ*-complete for unit disk graphs, even for K = 3. K-COLOURABILITY Chapter 3. Unit Disk Graphs 95 Figure 3.15: G(N(p) Pi N(q)) is not always cobipartite. The figure shows unit-radius arcs centered at a, 6, and c. For clarity, the figure does not show an edge between p and q, even though these vertices are adjacent. Site p is exactly unit distance from sites a and c. Similarly, q is exactly unit distance from a and b. Therefore, {a,b, c} C N(p) D N(q). The remaining sites (not shown in the figure) fall into one of two halves. The upper half lies in the lune, just above the unit-radius arcs from both b and c. The lower half also lies in the lune, just below the unit-radius arc from a. These additional sites are placed such that p and q have the greatest separation. By this construction, all points in the lune form a clique. In fact, they form a maximum clique; vertex a cannot be part of a maximum clique, since its presence would exclude the entire lower half. Similarly, neither b nor c can be part of a maximum clique, since the presence of either one would exclude the entire upper half. Finally, note that G(N(p) 0 N(q)) is not cobipartite since {a, b, c} induces a triangle in its complement. Chapter 3. Unit Disk Graphs Proof: The problem is in N P since it is in N P for arbitrary graphs. 96 NP-hardness follows by a reduction from G R A P H 3 - C O L O U R A B I L I T Y restricted to planar graphs having no vertex degree exceeding 4 [GJ79]. Let H = (V, E) be an instance of G R A P H 3 - C O L O U R A B I L I T Y . Figure 3.16 shows an example graph H. Begin, as usual, by em- Figure 3.16: A planar graph with degree at most 4. bedding H into a square grid in quadratic time and space using Valiant's method (§3.3.1). This embedding assigns integer coordinates to each vertex in H. Such an embedding is shown in Figure 3.17, where the vertices of H are drawn as concentric circles. The embedding introduces new vertices, which we will call pseudo-vertices, and which Figure 3.17 shows as single circles. Valiant's embedding typically dilates an edge in H (i.e., in E) into several unit length edges. For each edge in E , arbitrarily select one of the resulting edges and call it a "real" edge. Figure 3.17 shows these as dotted line segments. Call the remaining unit-length edges, "pseudo-edges"; Figure 3.17 shows these as solid line segments. Next, multiply all coordinates by 12, in effect refining the grid. We are now ready to construct an instance of a unit disk graph G^P) generated by a set of points P. Let P Chapter 3. Unit Disk Graphs 97 Figure 3.17: The graph from Figure 3.16 embedded in the grid. include points with the coordinates of all vertices, both real and pseudo. In addition, P includes points corresponding to the edges. Simulate edges with the points (subgraphs) in Figure 3.18. Note that any 3-colouring of pseudo-edges results in vertices with the Pseudo-edges cx^^^>c<^^^>o Edges Figure 3.18: Simulations for edges and pseudo-edges. Note that, in any 3-colouring, the endpoints of real edges must get different colours, and the endpoints of pseudo-edges must get the same colour. same colour, and any 3-colouring of real edges results in vertices with different colours. Pseudo-edges may therefore be conveniently thought of as extensions of the incident real vertices. Furthermore, the vertices adjacent to real edges can be coloured by any pair of non-identical colours (in the absence of other constraints). Figure 3.19 shows Chapter 3. Unit Disk Graphs 98 Figure 3.19: A n instance of unit disk graph 3-colourability. This figure shows "real" vertices as concentric circles. It shows "real" edges as open circles, and "pseudo-edges" as solid disks. a complete transformation of the graph in Figure 3.16. Note that this construction introduces additional graph edges, which Figure 3.19 depicts as dotted line segments. These are artifacts of the "drawing". In fact, the vertical pairs of points in Figure 3.18 can be arbitrarily close together (but then they would would not be easily distinguishable in the drawing), thereby avoiding the connections in Figure 3.19. Nevertheless, it is easy to see that if the graph with these edges removed can be 3-coloured, then so can the entire graph. If c : V —> {1,2,3} is a 3-colouring of G, then c restricted to the real vertices is a 3-colouring of H, since the two kinds of edge component enforce different colours for adjacent real vertices. Similarly, if c : V —> {1, 2, 3} is a 3-colouring of H, then c can be extended to the vertices of G. Hence G is 3-colourable if and only if H is 3-colourable. I Approximation Algorithms Even though G R A P H K - C O L O U R A B I L I T Y remains NP-complete for unit disk graphs (Theorem 3.27), we.can use the greedy colouring algorithm to colour a unit disk graph Chapter 3. Unit Disk Graphs 99 with no more than three times the minimum number of colours. If we are required to colour each vertex exactly when it is presented to us "on-line", then the greedy algorithm still manages to use at most five times the minimum. Note that, for arbitrary graphs G, Lund and Yannakakis [LY93] have shown that there is some constant e > 0 such that no polynomial-time graph colouring algorithm has a performance ratio R < \V(G)\ e (unless P = NP). It particular, for arbitrary graphs, unlike unit disk graphs, R cannot be a constant. Much of this subsection appears in a joint paper with Marathe, Hunt, Ravi, and Rosenkrantz [MBH+95]. In particular, most unattributed lemmas appear in [MBH 95] + also. The well-known greedy colouring algorithm simply colours each vertex with the first available colour. The algorithm colours each vertex in some order, so assume that the set of vertices V is totally ordered. For clarity of analysis and exposition, assume that each edge of the graph is directed from earlier to later vertices in the order of V. Table 3.8 presents the algorithm in detail. Table 3.8: Algorithm: G R E E D Y ( G ) [Colour G sequentially with the first available colour] Input: A totally ordered, directed unit disk graph G -= (V,A) Output: The number of colours used to colour G. Side Effects: colourfu] is the colour of each vertex. 1 2 3 for v <— first vertex in V to last vertex in V do colour^] <— m i n ( Z \ {colour[u] : (u,v) £ A}) return max {colour^] : v £ V} Lemma 3.28 + Algorithm GREEDY colours (arbitrary) graphs with no more than one plus the maximum indegree colours. That is, GREEDY(G) < A - (G) + 1. J 7l 100 Chapter 3. Unit Disk Graphs P r o o f : The algorithm maintains the invariant that any assigned colour is at most Aj- + l . n The invariant holds trivially at the beginning. Thereafter, vertex v has indegree at most Ai and outdegree 0, so vertex v too can be coloured with one of the A j + 1 colours not n n used by its neighbours. | C o r o l l a r y 3.28.1 Algorithm GREEDY colours (arbitrary) graphs with no more than one plus the maximum degree colours. That is, GREEDY(G) < A(G) -f 1. A n On-Line Algorithm In order to analyze the behaviour of Algorithm G R E E D Y on unit disk graphs, we need to relate its degree to its chromatic number. One way to do this is by relating the degree of a unit disk graph to its maximum clique size, and relating this to its chromatic number. This results in Theorem 3.30 below. L e m m a 3.29 The maximum clique size of a unit disk graph G is greater than one sixth of its maximum degree. That is, w(G) > LA(G)/6J + 2. P r o o f : Let v be a vertex with the greatest degree. Its neighbours lie in the unit radius disk centered on the vertex. Therefore more than one sixth, at least [ A / 6 ] + 1 of these neighbours, lie in some 60 degree unit sector. Since such a sector has unit diameter, these neighbours together with the vertex v form a completely connected subgraph. A maximum clique must be at least as large. T h e o r e m 3.30 Algorithm GREEDY | colours unit disk graphs with less than six times the maximum clique size. That is, GREEDY(G) < 6u(G) — 6. P r o o f : Lemma 3.29 implies that ui > [A/6J + 2 > A / 6 + 1 so that A < 6a> — 6. Since both A and u) are integers, A < Qui — 7. By Corollary 3.28.1, we have GREEDY(G) < A + l < 6 c u - 7 + l = 6 u > - 6 . Chapter 3. Unit Disk Graphs 101 I Corollary 3.30.1 Algorithm GREEDY colours unit disk graphs with less than six times the optimal number of colours. That is, GREEDY(G) < 6x(G) — 6. Proof: This follows from Theorem 3.30 since x > ^> for all graphs. | However, this corollary is overly pessimistic. Using the following lemma from [MBH 95], + Graf [Gra95] obtains a tighter bound on the chromatic number, thereby showing (Corollary 3.32.1) that Algorithm G R E E D Y performs even better than stated by Corollary 3.30.1. L e m m a 3.31 Let G be a unit disk graph. Any independent set in the neighbourhood of a vertex in G has at most five vertices. Proof: If the lemma were false, then some vertex would be the hub of an induced star K i e - , thereby contradicting Lemma 3.1, which says that there can be no such star in a } unit disk graph. | L e m m a 3.32 ([Gra95]) The chromatic number of a unit disk graph G is greater than one fifth of its maximum degree. That is, x(G) ^ l"A(G)/5] + 1Proof: Let v be any vertex in a unit disk graph G = (V,E). B y Lemma 3.31, at most five vertices adjacent to v can get the same colour. Therefore x(G(Ad](v)) > [|Adj(u)|/5]. Since v is adjacent to every vertex in its neighbourhood, it must be coloured differently than its neighbours. That is, x(G(N(u))) = x(G(Adj(u))) + 1 (recall that N(u) = Adj(u) U {v}). Consequently, (G) > x(G(N(u))) = x(G(Adj(«))) + 1 > riAdj( )|/5l + 1. v X The lemma follows if we choose v to have the maximum degree. Corollary 3.32.1 ([Gra95]) Algorithm GREEDY | colours a unit disk graph with less than five times its chromatic number. That is, GREEDY(G) < 5x(G) — 4. Chapter 3. Unit Disk Graphs 102 P r o o f : Lemma 3.32 states that (G) > [A(G)/5l + 1 > A(G)/5 + 1, so that A(G) < X 5 {G) - 5. B y Corollary 3.28.1, we have G R E E D Y ( G ) < A + l < 5 x - 5 + l = 5 x - 4 . X I A n Off-Line A l g o r i t h m In an "off-line" setting, we have the luxury of examining the entire graph before colouring any vertices. We will continue to exploit Algorithm G R E E D Y , but we will do so by reordering the vertices to our advantage. Essentially, we will create an order for the vertices so that no vertex has indegree greater than three times the graph's chromatic number. Say that (the vertex set of) a unit disk graph G is lexicographically ordered if x/(u) < xj[y) (or xj[u) — xj(y) and yj(u) < y/(v)) implies u < v, for some realization / : V —> R . Graf attributes the first use of this order for colouring unit disk graphs to 2 Peeters [Pee91]. L e m m a 3.33 ([Pee91, M B H 9 5 , Gra95]) The maximum clique size of a lexicograph+ ically ordered unit disk graph is greater than one third of the maximum indegree. That is, u(G)>\A (G)/3]+l. in P r o o f : Let v be a vertex with the greatest indegree. Its (indegree) neighbours lie in the left unit-radius semicircle centered on the vertex. Therefore at least one third, [A,-„/3], of these neighbours lie in a 60 degree unit sector. Since such a sector has unit diameter, these neighbours, together with the vertex v, form a completely connected subgraph. The maximum clique must be at least as large. | T h e o r e m 3.34 ([Pee91, M B H + 9 5 , Gra95]) Algorithm GREEDY colours lexicograph- ically ordered unit disk graphs with less than three times the maximum clique size. That is, GREEDY(G) < 3u(G) - 2. Chapter 3. Unit Disk Graphs 103 P r o o f : Lemma 3.33 implies that u > [A/3] + 1 > A / 3 + 1 so that A > 3w - 3. B y Lemma 3.28, we have G R E E D Y ( G ) < A + l < 3 a > - 3 + l = 3 w - 2 . | C o r o l l a r y 3.34.1 ( [ M B H 9 5 ] ) Algorithm GREEDY colours lexicographically ordered + triangle-free unit disk graphs with at most four colours. P r o o f : The maximum clique size of a triangle-free graph is at most 2. | C o r o l l a r y 3.34.2 ([Pee91, M B H + 9 5 , Gra95]) Algorithm GREEDY colours lexicographically ordered unit disk graphs with less than three times the optimal number of colours. That is, GREEDY(G) < 3*(G) - 2. P r o o f : This follows from Theorem 3.34 since x > u f ° all graphs. r | Note that we required a realization to lexicographically order the vertices. We can dispense with the realization as follows. Graf points out that Algorithm G R E E D Y will perform at least as well given any vertex ordering that achieves a maximum indegree no greater than that of the lexicographic order. In particular, he mentions that Matula [MB83] has shown that the smallest-last ordering minimizes the maximum indegree over all vertex orderings. The vertices {vi,V2, • • • ,v } of a graph are said to be in n smallest-last order if vi has minimum degree in G({ui, v ,..., v{\) for all i. There is an 2 easy algorithm for finding a smallest-last ordering: find a minimum degree vertex v in the graph G = (V,E), recursively smallest-last order G(V \ {v}), and append v to the end of the sequence. Matula [MB83] shows how to implement this algorithm in 0(V + E) time with 0(V) additional space. Graf's PhD thesis [Gra95] also presents a more sophisticated algorithm (for colouring unit disk graphs) that still uses a realization, and still has a theoretical performance ratio Chapter 3. Unit Disk Graphs 104 of 3, but which performs well in practice. See also [MBH+95] for a different algorithm that achieves the same performance ratio of 3, but does not require a realization. In closing this section on colouring, recall that all triangle-free disk graphs are planar (Theorem 3.4). Therefore such graphs can be coloured with four colours by the famous four-colour theorem [AH76]. This improves on Lemma 5.2 in [MBH+95], which states that six colours suffice for triangle-free disk graphs. 3.4 Unit Disk Graph Recognition is N P - H a r d This section proves that recognizing unit disk graphs is NP-hard. Equivalently, it shows that determining if a graph has sphericity 2 or less, even if the graph is planar or is known to have sphericity at most 3, is NP-hard. In fact, this section gives a polynomialtime reduction from S A T I S F I A B I L I T Y to a more general problem, that of recognizing p-bounded disk graphs, which involve disks of restricted sizes. It begins by describing the reduction for p-bounded coin graphs, where the disks have pairwise-disjoint interiors. We will see that this reduction can be extended to three dimensions, thereby showing that unit sphere graph recognition, or determining if a graph has sphericity 3 or less, is also NP-hard. Section 3.4.1 defines S A T I S F I A B I L I T Y and p-bounded disk and coin graphs. Thereafter, Sections 3.4.2 through 3.4.9 show how to reduce S A T I S F I A B I L I T Y to the problem of recognizing p-bounded coin graphs. Finally, Section 3.4.10 shows how to extend the result to other problems, including the already-mentioned problem of recognizing unit disk graphs. Chapter 3. Unit Disk Graphs 3.4.1 105 Coin Graphs A coin is a closed disk in the plane. A graph G is called a coin graph if G is the intersection graph of a set of interior-disjoint coins [Sac94]. Remarkably, finite coin graphs are precisely the finite planar graphs [Sac94], and can therefore be recognized in linear time (see [BL76] for example). In fact, every plane graph G has a coin realization f(G) such that (vi,v , 2 • • •, Vk) is a clockwise face in G if and only if {f(vi),f(v ),..., 2 f(vk)) is a clockwise face in f(G). In this section, however, we are interested in the complexity of recognizing graphs than can be realized with coins of bounded size. A set of disks is p-bounded if every disk in the set has diameter between 1 and p inclusive. We will prove that / 9 - B O U N D E D C O I N G R A P H R E C O G N I T I O N is NP-hard. A special case of this problem is rec- ognizing penny graphs, where all disks have unit diameter. Penny graphs where all unit disks must be centered at integer coordinates are equivalently grid graphs (§2.3.3), which are also a subclass of unit disk graphs. Recall from Section 2.3.3 that GRID G R A P H R E C O G N I T I O N is NP-complete [BC87], even for grid graphs that are binary trees [Gre89]. We will have occasion to deal with the location and the radius of disks separately. To ease notation, say that / : V —> R 2 (locations) and r : V —, R (disk radii) constitute a disk realization (f,r) of a graph G — (V, E) if (u,v) £ E if and only if ||/(u) — /(u)|| < r(u)+r(v). Then a disk realization (/, r) is a coin realization if \\f(u)—f(v)|| > r(u)+r(v) for all u and v in V, adjacent or not, and it is p-bounded if 1 < 2r(v) < p for all v £ V. This section shows that the following parameterized recognition problem is NP-hard for any fixed p > 1. p-BOUNDED COIN G R A P H RECOGNITION INSTANCE: A graph G = (V, E). Chapter 3. Unit Disk Graphs 106 Q U E S T I O N : Is G the intersection graph of a set of closed, interior-disjoint disks whose diameters fall in the range [l,p], that is, does G have a p-bounded coin realization? Since coin graphs are planar, they do not include K5. Since any intersection graph class must contain all complete graphs, this means that coin graphs are not the intersection graph class of any family of sets [Sch85], in particular not of any family of disks. On the other hand, this section's reduction of S A T I S F I A B I L I T Y to p - B O U N D E D C O I N G R A P H R E C O G N I T I O N extends easily to allow overlapping disks as well. That is, recognizing p-bounded disk intersection graphs (equivalently the intersection graph class of p-bounded disks) is also NP-hard for any fixed p > 1. The special case p = 1 of this latter problem (namely UNIT DISK G R A P H R E C O G N I T I O N ) has been reported separately [BK93]. p - B O U N D E D DISK G R A P H R E C O G N I T I O N I N S T A N C E : A graph G = (V, E). Q U E S T I O N : Is G the intersection graph of a set of closed disks whose diameters fall in the range [l,p], that is, does G have a p-bounded disk realization? The problem C N F S A T I S F I A B I L I T Y defined below is a common basis for N P completeness proofs [Coo71, GJ79]. Let U = {ui,u , • • • ,u } 2 m be a set of Boolean vari- ables. A clause c = {/i, l ,..., 4} is a set of literals, which are negated (e.g., u-) and 2 t unnegated (e.g., U{) variables from U. A set C of clauses is intended to represent the conjunctive normal form Boolean formula Chapter 3. Unit Disk Graphs 107 A truth assignment is a function t : U -» { T R U E , F A L S E } . In terms of literals, U{ is T R U E if and only if t(u ) = T R U E , and % is T R U E if and only if *(«,•) = F A L S E . A clause is satisfied by t if at least one /- £ c is T R U E . Finally, a satisfying truth assignment t for C is one that simultaneously satisfies all the clauses in a set C. [ L O l , [GJ79]] C N F INSTANCE: SATISFIABILITY A set U = {ui, a set C = {ci, QUESTION: Theorem u ,..., 2 of Boolean variables and u} m of clauses over U. C 2 , . . . , Cn} Is there a satisfying truth assignment for Cl 3.35 p-BOUNDED COIN GRAPH RECOGNITION is NP-hard for any fixed p > 1. Given an instance C of S A T I S F I A B I L I T Y , we will construct a graph Gc = Proof: (Vci Ec) such that Gc has a realization if and only if C is satisfiable. Assume without 3 loss of generality (see comments for S A T I S F I A B I L I T Y in [GJ79]) that each clause in C contains at most three literals ( | Q | < 3) and that each variable appears in at most three clauses. Note that this is not the same as 3SAT in which every clause has exactly three literals, and each variable appears in an unrestricted number of clauses (though 3SAT remains NP-complete if every variable appears in at most five clauses [GJ79]). We will build Gc in several stages. First, in Section 3.4.2, we will construct a bipartite graph G S AT C that corresponds closely to the instance C of S A T I S F I A B I L I T Y . We will define a notion of orientability for this graph, and prove that it is orientable if and only if C is satisfiable (Lemma 3.37). Then, in Section 3.4.3, we will draw this graph on the square grid. This natural drawing on the grid maintains the intuitive structure of the S A T I S F I A B I L I T Y problem. It also prevents edge drawings from "interfering" with 3 F o r brevity, and unless stated otherwise, the remainder of this section abbreviates "p-bounded coin graph realization" as "realization". Chapter 3. Unit Disk Graphs 108 each other by keeping them rectilinear and crossing them only at right angles. We will define a notion of orientability for this drawing. This serves to express the graph as a composition of smaller graphs, each of which is a primitive for orientation. The drawing is orientable if and only if the underlying graph is orientable (Lemma 3.39). Next, we will skew the grid so that it is part of the triangular grid. This will allow us to build and connect components by exploiting a hexagonal packing. Finally, we will form Gc in Section 3.4.4 by simulating components of the skewed grid drawing. Lemma 3.42 shows that Gc has a realization if and only if the underlying grid drawing is orientable. We finish by showing that the entire reduction can be executed in polynomial time. 3.4.2 | A G r a p h T h a t Simulates S A T I S F I A B I L I T Y Our first step is to construct a bipartite graph G AT C from the instance C of SATIS- F I A B I L I T Y as follows. The vertices of the graph correspond to the clauses, variables, and negated variables of the S A T I S F I A B I L I T Y instance C. There is an edge between a literal vertex and a clause vertex if the literal appears in the clause. More formally, G S AT C = (V ,E§ ), SAT AT C where: VS AT = {c:ceC} U {u+ :ueU} U {u~ : u £ U} E$ AT = {(c,u ) : ce C,u £ c} U {(c,u~) : c £ C,u £ c}. + D e f i n i t i o n 3.36 The graph G AT C is orientable if its edges can be directed such that, (1) for each clause vertex, outdegree(c) > 1 and, (2) for each pair of literal vertices, indegree(u ) = 0 or indegree(u~) = 0. | + The graph G AT C models the testing of a truth assignment for S A T I S F I A B I L I T Y by directing its edges. Intuitively, an edge directed from c to u + (resp. u~) means that clause c has selected literal u (resp. u) to satisfy it. That is, clause c requests that t{u) = T R U E (resp. t{u) = F A L S E ) . Chapter 3. Unit Disk Graphs Lemma 3 . 3 7 109 The set of clauses C is satisfiable if and only if the bipartite graph G AT C is orientable. Proof: If t satisfies C7, then orient G AT u + by directing every edge incident on u + C + if t(u) = T R U E , or away from u towards otherwise. Similarly, direct every edge incident on u~ towards u~ if t(u) = F A L S E , or away from u~ otherwise. Then outdegree(c) > 1 for every clause c, since c must be satisfied. Furthermore, either indegree(u ) = 0 or + indegree(u~) = 0 for every variable u, since no truth assignment can set both a literal and its complement T R U E . Therefore G AT C Conversely, if G is orientable if C is satisfiable. has been oriented, then set t(u) = T R U E if any edge (c, u ) AT + C is directed towards u . + Similarly set t(u) = F A L S E if any edge (c,u~) is directed towards u~. Then t sets each variable either T R U E or F A L S E since indegree(u ) = 0 + or indegree(u ) = 0 for all variables u. Furthermore, t must satisfy every clause c since _ outdegree(c) > 1 for every vertex c. 3.4.3 | Drawing the Graph on the Grid Our next step is to draw the graph G AT C on the grid as shown in Figure 3.20. Each of the (6|£/| + 1) x (3|C| + 2) grid vertices in this drawing is either unused, or is associated with a unique component of the drawing. Each component is enclosed by a unit square centered on its own grid vertex. The drawing is made up of three groups of components: communication components, literals, and clauses. There are, in turn, three groups of communication components: wires, corners, and crossovers. A wire is a unit length line segment passing through a grid vertex, a corner is two half-length line segments meeting at right angles at a grid vertex, and a crossover is two unit-length line segments crossing at right angles on a grid vertex. There are therefore two types of wire components (horizontal and vertical), four types of corners, and one type of crossover. Chapter 3. Unit Disk Graphs c 5 c 4 110 C3 c 2 Cl Figure 3.20: A S A T I S F I A B I L I T Y graph drawn on the grid. The graph corresponds to the S A T I S F I A B I L I T Y instance ([/, C), where U = {ui, u ,113, u }, C = {ci, c , C3, C4, C5}, and ci = { u , u } , c = { u i , u , u } , c = { u i , u } , c = {ui}, and c = { u , u } . The clauses and the literals are drawn as squares. The variables are embedded as adjacent pairs and so are drawn as rectangles. Each clause and each literal component has three terminals. Note that the area of the grid is (6\U\ + 1) x (3|C| + 2). 2 2 4 2 2 3 3 3 4 4 2 5 2 4 Chapter 3. Unit Disk Graphs 111 Each component in the drawing has two to four terminals, which are centered on a side of the unit square enclosing the component. The terminal on the top (or north) side of the unit square is called the T terminal. Similarly, the terminals on the bottom, left, and right are called the B, L, and R terminals respectively. Wires and corners have two terminals each, crossovers and literals have four, and clauses have three. Two components in the drawing are adjacent if they have coincident terminals. The terminal between two adjacent literals is called the (common) interliteral terminal; the others are called external terminals. Figure 3.20 depicts the set of all terminals as small circles. A n orientation of a terminal is a direction, North, South, East, or West. Say that a terminal T (respectively B, L, R) is directed away from its component if it is oriented North (respectively South, West, East) and is directed towards its component otherwise. D e f i n i t i o n 3.38 A grid drawing is orientable if all terminals can be oriented subject to the following four conditions. d r a w l : T and B terminals must be directed North or South, draw2: L and R terminals must be directed East or West, draw3: every wire, corner, crossover line segment, and clause must have at least one terminal directed away from it, draw4: If a literal has its interliteral terminal directed towards it, then all other (external) terminals must be directed away from it. I A corollary of conditions draw4 and draw2 is that if a drawing is orientable, then every variable has a literal component with all external terminals directed away from it. Figure 3.21 shows an orientation of a portion of Figure 3.20. Chapter 3. Unit Disk Graphs 112 I: 11 : i < i < : • • 1I • : • L t u{ I t 1 t u u 1 2 u 2 Figure 3.21: A n oriented grid drawing. The directions are drawn as arrows. Note that the path from u to c\ has a wire component that has both terminals directed away from it. 2 Lemma 3.39 A grid drawing is orientable if and only if the underlying bipartite graph is orientable. Proof: Suppose we have an orientation for G . AT C Then orient the terminals along each path in the grid drawing so that they are consistent with the orientation of the 4 corresponding edge in EQ . AT This ensures that every wire, corner, and crossover line segment has precisely one terminal directed away from it. It also ensures that each clause has one terminal directed away from it, since the clause vertices have outdegree at least one. Finally, every variable has a literal component with all external terminals directed away from it since one of the literal vertices has zero indegree in G ; AT C direct the interliteral terminal towards this literal. Now suppose that the grid drawing has been oriented. Condition draw3 ensures that Those terminals not on a path need not concern us; they may be arbitrarily oriented, say away from the component. 4 Chapter 3. Unit Disk Graphs 113 any path in the drawing corresponding to an edge in EQ AT contains at most one wire, corner, or crossover line segment with both terminals directed away from the component. One terminal of such a component can be redirected by reversing the direction of all terminals in the path from it to the literal. Doing so keeps all conditions satisfied since this operation does not change the orientation of any clause terminals, and it directs any external literal terminals away from the literal, in keeping with condition draw4. Condition draw3 then ensures that all terminals along the path are oriented consistently with some orientation for the corresponding edge. Under this orientation, all clause vertices have outdegree at least one, since the corresponding terminal is directed away from the clause. Furthermore, condition draw4 ensures that indegree(u ) = 0 or + indegree(u~) = 0. I Corollary 3.39.1 A grid drawing is orientable if and only if the underlying instance of SATISFIABILITY is satisfiable. Skewing the Grid It would be easier to simulate the grid drawing components with coin subgraphs if G AT C had been embedded in a triangular grid instead of a square grid. This is because coins (disks) of the same size naturally pack hexagonally. We will exploit this packing for the two extreme sizes for the disks, that is, for diameter 1 and p. Hexagons also have a higher connectivity (six) with their neighbours than do squares (four), allowing us to construct more compact components. Both of these advantages will be evident in the forthcoming constructions. We chose to embed G AT C on a square grid to capture the intuition behind the bipartite S A T I S F I A B I L I T Y graph. Fortunately, it is easy to turn the square grid into a triangular one by "skewing" it as follows. If we imagine that the square grid is generated by two basis vectors (1,0) and (0,1), then we can skew the grid by replacing 114 Chapter 3. Unit Disk Graphs Figure 3.22: A skewed version of the oriented grid drawing from Figure 3.21. these with the new basis vectors (1,0) and (—1/2, \/3/2). The result of skewing the drawing from Figure 3.21 is shown in Figure 3.22. To aid visibility, the figure does not show grid lines with positive diagonal slope, but imagine that they are there to complete the triangular grid. 3.4.4 Simulating the Drawing with Coins We are now ready to construct Gc- To do so, we create a graph component for each skewed grid drawing component: wire, corner, crossover, literal, and clause. Section 3.4.8 provides the details. To specify the graph, we will describe a realization of each of its components, and then describe how the subgraphs are to be connected. Therefore, before giving detailed descriptions of the various graph components, we must examine the building blocks from which they are constructed. cycles, called "cages". The main building blocks are The construction joins two cages at a shared adjacent triple of vertices to create larger components. The remaining building blocks are clusters of vertices called "flippers". Flippers are associated with the vertex triple shared by two Chapter 3. Unit Disk Graphs 115 cages. In any realization, all the vertices in a flipper are forced to lie in one of the two incident cages. To ensure this consistent embedding, the vertices of a flipper are connected among themselves. Flippers come in three different sizes measured as a fraction of a cage's capacity: 1, 1/2, and 1/4. These sizes, and the capacity of a cage, allow us to rule out certain embeddings. Figure 3.23 shows schematically how cages and flippers are related. The next sub- Figure 3.23: Schematic drawings for cages and flippers. This schematic shows two joined cages. The one on the left contains two quarter flippers and a half flipper. The one on the right contains a full flipper, and has another attached full flipper that has been displaced. The labels on the flippers indicate their asymptotic portion of the hexagonal capacity. Unlabelled flippers are quarter flippers. Note the dimpled connecting corners, as well as one dimpled nonconnecting corner. section provides detailed instruction for constructing cages and flippers, and proves the required properties. The schematic shows a realization of a subgraph, but we are really constructing the subgraphs themselves. Therefore, let the schematics depict also the underlying coin graph. The realizations therefore serve both to specify the graph, and to show how the graph could be realized. A flipper embedded inside a cage diminishes the capacity of the cage for additional flippers. It thereby displaces other flippers, which may otherwise have been embedded inside the cage. The forthcoming construction (§3.4.7) for Gc ensures that a flipper can only be embedded in one of two adjacent cages. A displaced flipper therefore displaces other flippers from whatever cage it is embedded in. This is the basic mechanism for Chapter 3. Unit Disk Graphs 116 propagating information in a realization of GcConstructing Cages Cages will always have the same number of vertices, which depends to some extent on the diameter p of the largest disk. However, this number will be a multiple of six, so that a cage can be realized as a string of disks whose centres lie on a regular hexagon aligned with the triangular grid, as shown in Figure 3.24. Say that such a realization is Figure 3.24: The hexagonal realization of a cage. hexagonal. In the construction that follows, we join cages at the corners of such hexagonal realizations, as shown in Figure 3.25. Clearly, both cages cannot be strictly hexagonal in such a construction. To solve this problem, we choose to dimple a corner by moving the corner disk towards the centre of one of the hexagons. Naturally, the corner may be dimpled towards either of its two hexagons. Clearly, we can dimple a corner even if it is not shared with another cage; we will attach flippers to corners in this way. Define the hexagonal capacity of a cage as the maximum number of interior-disjoint disks that can be packed hexagonally into a hexagonal realization of a cage, as shown in Figure 3.26. Note that the capacity depends only on the number of cage vertices. Chapter 3. Unit Disk Graphs 117 Figure 3.25: Joining cages. The corner of the cage on the left is "dimpled". The alternative hexagon realization, in which the corner is dimpled to the right, is also permitted. Figure 3.26: A hexagonal realization of a cage packed hexagonally with unit-diameter disks. The cage disks all have maximum diameter p. Chapter 3. Unit Disk Graphs 3.4.5 118 Fabricating Flippers We are now ready to fabricate flippers for cages. We will do so "asymptotically". Perhaps this is somewhat unusual, but the idea is simple: fabricate a flipper for an arbitrary cage size, and then notice that the size of the flipper approaches an ideal value as the cage size increases. Therefore, although our flipper never actually attains this value, we will see that it attains a suitable value. Full Flippers In any realization, a nipper must intersect (touch) the cage only at one corner, even if some of the other corners are dimpled. To ensure that this is the case, dimple in all corners of the cage. Fabricate a full flipper as follows. Pack the dimpled cage with the largest hexagon of unit disks in contact with the desired corner. Make sure that the nipper is not in contact with any other parts of the cage, including the dimpled corners, as shown in Figure 3.27. Figure 3.27: Fabricating full flippers The number of disks in a full flipper approaches the hexagonal capacity of the cage as the size of the cage increases. This is because the size of any disk becomes negligible in comparison with the sides of the cage. In particular, the gap between the flipper and the cage becomes negligible. Note that, even though the required cage size may be large, Chapter 3. Unit Disk Graphs 119 it does not depend on the size of the S A T I S F I A B I L I T Y instance. Half Flippers There are two kinds of half flippers. The fabrication of quarter flippers, described in the next paragraph, results in one kind. To fabricate the other kind, notice that the line segment through the hexagon in Figure 3.28. (a) divides the area of the hexagon into two equal areas. Construct a half'flipperfrom this drawing and a full flipper by removing any Figure 3.28: Fabricating a half flipper disks hit by the line segment, as well as the half hexagon not in contact with the cage. Figure 3.28.(b) shows two half flippers constructed in this way. As the size of the cage (and the size of the packing) increases, the number of disks in the half flipper approaches one half of the hexagonal capacity. Quarter Flippers Similarly, the line segment through the hexagon in Figure 3.29.(a) divides the area of the hexagon into two regions. The smaller region has one quarter of the hexagon's area, and the larger region has three quarters the area. Fabricate a flipper that approaches 1/4 of the hexagonal capacity from this drawing by removing from a full flipper any disks hit by the line segment, as well as the three quarters hexagon not in contact with Chapter 3. Unit Disk Graphs 120 L (b) Figure 3.29: Dividing a hexagon into a quarter and three-quarters. The length L of the short side of the small trapezoid is (y/lO — 2)/4, which ensures that the area of the trapezoid is one-quarter that of the hexagon with unit sides. the cage. Similarly, fabricate a flipper that approaches 3/4 of the hexagonal capacity by removing any disks hit by the line segment, as well as the one quarter hexagon not in contact with the cage. Figure 3.29.(b) shows both such flippers. As the cage size increases, the number of disks in the small section approaches one quarter the hexagonal capacity, and the number of disks in the other section approaches three quarters of the hexagonal capacity. In the same way, fabricate another kind of half flipper by adding a second segment to the hexagon, symmetric with the first as shown in Figure 3.30.(a). Figure 3.30.(b) shows the result. 3.4.6 Capacity Arguments The flipper fabrications concentrated solely on the hexagonal capacity of a cage. In fact, these capacities are close to optimal. Define the unconstrained capacity of a cage as the maximum number of interior-disjoint disks that can be packed into any realization of a cage. Again, the capacity depends only on the number of cage vertices. We may as well assume that all disks in a maximum packing have unit diameter, since replacing any Chapter 3. Unit Disk Graphs 121 L (b) (a) Figure 3.30: Dividing a hexagon into two quarters and a half larger disks with unit disks results in an interior-disjoint packing with the same number of disks (and possibly room for more). With the help of the following lemma, we will be able to prove that some embeddings cannot be realized. Lemma 3.40 (The Capacity Lemma) The. unconstrained capacity of all sufficiently large cages is less than 12/TT 2 (PZ 1.216J times its hexagonal capacity. Proof: We will construct an asymptotic value for the hexagonal capacity Ch of a cage, and a (rather conservative) upper bound for its unconstrained capacity C . We will then u see that C < (12/TT )C7^. 2 u First, consider a hexagonal realization of a cage, and pack it also hexagonally, see Figure 3.26 again. As the size of the cage increases, its perimeter P approaches that of 5 its corresponding hexagonal packing. That is, P = 6s in the limit, where s is the length of a hexagon side. Note that s is one less than the number of unit disks on one of the hexagon's sides. It is easy to verify by induction on s that the total number of disks in the packing, which is the hexagonal capacity Ch of the cage, is given by Equation 3.6. T h e perimeter of a string of disks is just the perimeter of the polygon through its disk centres. The perimeter of a set of disks is the perimeter of the convex hull of its centres. 5 Chapter 3. Unit Disk Graphs 122 To construct an upper bound on the unconstrained capacity C , notice that the u interior of a cage can never be completely covered with interior-disjoint unit disks, since unit disks do not tile the plane. Therefore C is less than the maximum internal area, u taken over all possible realizations of the cage, divided by the area of the unit disks. As the size of a cage increases, its internal area approaches from below the area of the polygon through its disk centres. The circle has maximum area over all polygons with the same perimeter. Therefore, the realization of a cage as a set of maximum-size disks with cocircular centres achieves, at the limit, the maximum internal area. As noted, this area is less than the area of the circle through its disk centres. Calculate this circle's area as follows. First note that the circumference c of the circle is the same as the perimeter P = 6s of the hexagonal realization. Therefore the radius r of the circle is r = P/2% = 3S/TT-, so that its area A is A = 7rr = 7r(35/7r) = 9s /n. 2 2 2 Since the area of a unit-diameter disk is 7r/4, it follows that C u < A TT/4 9S /TT 2 TT/4 36s 2 (3.7) TT 2 Combining Inequalities 3.7 and 3.6 yields the following inequality, which proves the lemma. Cu C 36S /TT _ 12 2 < h 3S 2 2 ~ TT 2 Chapter 3. Unit Disk Graphs 123 Corollary 3.40.1 In any realization, no sufficiently large cage can contain a subset of flippers whose total nominal size exceeds 12/n . 2 Note that this corollary does not exploit the fact that a hexagonal disk packing is asymptotically optimal [CS88]. By virtue of this corollary, and our earlier requirement for hexagonal realizations, the main building block for the ensuing construction is a cage whose size (number of vertices) is a sufficiently large multiple of six. To emphasize the asymptotic nature of these cages, the rest of this NP-hardness reduction abbreviates cages and flippers by the schematics shown previously in Figure 3.23. 3.4.7 The Skeleton of the Graph G c The following lemma, which applies to arbitrary disk intersection graphs as well as coin graphs, shows that the inside of a realization of a cycle is well defined. Lemma 3.41 A realization of a vertex-induced cycle is a plane graph. Proof: If the realization were not a plane graph, then two line segments would cross somewhere. Then, by Lemma 3.3, the endpoints of the segment would induce a triangle in the graph. This contradicts the fact that cages are triangle-free. | The skeleton of the graph under construction will be composed of many cages "hooked together", as presented already in Figure 3.25. Lemma 3.3 and its corollary guarantees that cages do not cross or overlap each other in any realization. In addition, the attached flippers and the capacity of the cages keeps cages from containing each other. This connection strategy therefore ensures that, in any realization, the clockwise order of the edges about every cage is determined by the order of the edges about any cage in the connected graph. It is therefore useful to think of the embedding of the skeleton of the graph, that is, the cages without flipper vertices, to be invariant under all realizations. Chapter 3. Unit Disk Graphs 124 Different realizations simply allow flippers to "flip" from one cage into another. Flippers must be in one of their two incident cages, by virtue of their construction and Lemma 3.3. The component definitions which follow will clarify this construction. The properties described above allow realizations of unit disk graphs to simulate the orientability of the grid drawing, depending on which cage encloses which flippers. In addition, we must ensure that the skeleton of the graph, that is, the graph induced on the cages, is always realizable. In particular, the components must "fit together". For example, they must stretch between two grid vertices (from Figure 3.20). To achieve this requirement, each component joins together several cages. For example, the forthcoming wire component consists of five cages. The number five comes from the realization scheme described in Section 3.4.9. 3.4.8 The Components of the Graph Gc Each of the graph components has two or more terminals—labelled T, B, L, or R—that correspond to the grid drawing terminals. Each terminal is a three-vertex corner of a cage with an attached full flipper. For example, the three-vertex corners belonging to terminals L and R are circled in Figure 3.31 below. To construct Gc, connect every pair of adjacent components together by identifying the appropriate terminals. Terminal T 6 (resp. B, L, R) should be identified with an adjacent B (resp. T, R, L) terminal. You will find that the example presented in Section 3.4.9 clarifies this process. Wires The graph in Figure 3.31 implements the horizontal wire component as a string of five cages joined by corners (refer back to Figure 3.25). 6 Two graph components are adjacent if the associated grid drawing components are adjacent. Chapter 3. Unit Disk Graphs 125 Figure 3.31: The horizontal wire component: drawn with both terminals oriented East. The terminals are indicated by small circles.' Remember that the terminals include the flippers. The grid square enclosing the wire component is drawn as a dotted parallelogram. Chapter 3. Unit Disk Graphs 126 Say that the T (resp. B, L, R) terminal is oriented South (resp. North, East, West) if its flipper is embedded inside its cage, and that it is oriented North (resp. South, West, East) otherwise. The orientation of the terminals shown in Figure 3.31, or in any of the following figures, is not the only possible orientation. However, the properties of the cages ensure that, for any realization, if the L terminal is oriented East, then its R terminal is also oriented East. Similarly, if the R terminal is oriented West, then its L terminal is also oriented West. This ensures that at least one terminal is directed away from the wire. Note that it is also possible for the L and R terminals to be simultaneously oriented West and East respectively. The vertical wire component is shown in Figure 3.32. Note that although the realizations are different, and the terminals are labelled differently, the (unlabelled) horizontal and vertical wire component subgraphs are isomorphic. Again, for any realization, if either terminal is oriented inwards, then the other one must be oriented outwards. Corners As can be seen from Figure 3.33, there are four kinds of corners, and their graphs are also strings of five cages. Again, the properties of cages ensure that at least one terminal is directed away from each corner in any realization. Crossovers Of all components used in this reduction, the crossover component is the most difficult to understand. Its schematic is shown in Figure 3.34. We need to convince ourselves that paired terminals (that is, T and B, or L and R) cannot be simultaneously oriented towards the component, but that all other orientations are possible. The heart of the crossover is the ring of cages labelled (a, 6, c, d, e, / ) in Figure 3.34. The flippers associated with a set of cages are those that are shared by two cages of 127 Chapter 3. Unit Disk Graphs B Figure 3.32: The vertical wire component: drawn with both terminals oriented North. Chapter 3. Unit Disk Graphs 128 QOG> Figure 3.33: The corner components. They are drawn with the L terminals oriented West, the R terminals oriented East, the T terminals oriented Southland the B terminals oriented North. Note that not all four are isomorphic, since on two of them, some cages are connected but do not share nippers. Chapter 3. Unit Disk Graphs 129 Figure 3.34: The crossover component. The T and B terminals are drawn oriented North and the L and R terminals are drawn oriented West. The ring of cages (a, 6, c, d, e, / ) h drawn oriented counterclockwise. Chapter 3. Unit Disk Graphs 130 the set. In any realization, the flippers associated with the ring can take on one of two orientations: counterclockwise, as shown, in Figure 3.34, or clockwise. This is because the number (6) of cages and associated nippers is the same. B y Corollary 3.40.1, no two nippers can be in the same cage. Consequently, every cage of the ring must contain exactly one of its shared nippers. Note that this means that the three-quarters nipper in the central cage k must remain in this cage for all realizations. Figure 3.34 emphasizes this fact by showing two connections for this nipper, but of course one will suffice. The crossover allows two channels to cross without interference. The horizontal channel transmits its information via the horizontal chain of cages, and the diagonal channel transmits its information via the ring. Let us examine the horizontal channel in action. Since cages b, k, and e must each contain a three-quarters flipper, none of them can contain two additional quarter flippers, by Corollary 3.40.1. This means that the quarter flippers associated with the horizontal cages (h, 6, k, e, j) can take on one of two orientations, west or east. The west orientation, shown in Figure 3.34, displaces the full flipper from cage h, and the east orientation displaces the full flipper from cage j. Conversely, if terminal R is oriented West, then it forces the west orientation on (h, b, k, e,j), and if terminal L is oriented East, then it forces the east orientation on (h,b,k,e,j). Let us now examine the diagonal channel in action. If the ring (a,b,c,d,e, f) is oriented counterclockwise as shown, then the full flipper in cage a displaces the quarter flipper into cage g. If it is oriented clockwise, then the three-quarters flipper displaces the half flipper from cage d. Conversely, if terminal B is oriented North as shown, then it forces the counterclockwise orientation on the ring, and if terminal T is oriented South, then it forces the clockwise orientation on the ring. Finally, the orientation of the ring, and the orientation of the horizontal channel, are independent. To see this, create the four possible orientations of the crossover by "swivelling" the flippers on their articulation points in Figure 3.34. Figure 3.39 later in this section shows all four orientations in use. Chapter 3. Unit Disk Graphs 131 Literals The positive literal component is shown in Figure 3.35. Its heart is the central cage, T fl Figure 3.35: The positive literal component. The L and R terminals are drawn oriented East, the T terminal is drawn oriented South, and the B terminal is drawn oriented North. drawn containing two quarter flippers and a half flipper. This component's key property is that for any realization, if the R terminal is oriented West, so that the terminal's flipper is in the literal's cage, then a full flipper must also be in the central cage, which means that all other terminals must be directed away from the component. A symmetric property holds for the negative literal component, shown in Figure 3.36. Note that the (unlabelled) positive and negative literal subgraphs are isomorphic. This is easier to see if you rotate one of the diagrams by 180 degrees. Chapter 3. Unit Disk Graphs 132 Figure 3.36: The negative literal component. The L and R terminals are drawn oriented East, the T terminal is drawn oriented North, and the B terminal is drawn oriented South. Chapter 3. Unit Disk Graphs 133 Clauses The clause testing component is shown in Figure 3.37. Its heart is again the central cage, T Figure 3.37: Clause component: drawn with the T terminal oriented South, the B terminal oriented North, and the R terminal oriented East. the one containing two half flippers in the figure. Since this cage can contain at most two half flippers by Corollary 3.40.1, it must be that at least one terminal is oriented away from it. If a terminal is not used in the grid drawing, that is, if there is no adjacent wire, corner, or crossover, then "cap" the corresponding graph component terminal by adding a small ring of cages with full flippers. The T terminal in Figure 3.38 is capped in this way. This cap ensures that one of the full flippers from the ring occupies the terminal's cage. This full cage acts as if the terminal were oriented towards the component, thereby Chapter 3. Unit Disk Graphs Chapter 3. Unit Disk Graphs 135 forcing one of the remaining terminals to be oriented away . 7 3.4.9 Building and Realizing Gc Now that all components have been described, we can present an example showing how components are connected. Recall that to connect two components, we simply identify the terminals at the desired connection point. Figure 3.39 shows how components are connected to simulate the skewed grid drawing from Figure 3.22. Coincidentally, the drawing in Figure 3.39 is oriented the same way as Figure 3.22, but remember that the object under construction is a graph, not a realization. To reiterate: we used realizations to specify graph components, but we need not appeal to realizations at all when connecting components. Lemma 3.42 The graph Gc has a realization if and only if the underlying grid drawing is orientable. Proof: Given a realization, orient the grid drawing terminals exactly as the realization terminals. The definition of orientation for realization terminals ensures that conditions drawl and draw2 are met. The nature of the wire, corner, crossover, and clause components ensures that condition draw3 is met. Finally, the nature of the literal components ensures that condition draw4 is met. That is, the grid drawing is orientable if Gc has a realization. Now assume that the terminals of the grid drawing have been oriented. From this we will construct a realization for Gc- For each component in the grid drawing, construct the corresponding component realization, oriented exactly as the grid drawing component, centered at the origin. The discussion accompanying the description of each graph Note that we could have simply "pinned" the unused flipper into its cage by dimpling in all corners and bending the cage such that all corners contact the nipper. It may not be possible to bend the cage for other potential uses of this reduction, for example, if we further restricted all cage disks to lie on the hexagonal grid. 7 Chapter 3. Unit Disk Graphs 136 Figure 3.39: How to connect components. This. "landscaped" figure (view it from the right) shows how to simulate the portion of the skewed grid drawing shown in Figure 3.22. There is a wire with both terminals directed outwards in Figure 3.21 and Figure 3.22. Do you see the empty cage corresponding to this wire? Chapter 3. Unit Disk Graphs 137 component above implies that this can always be done. Now magnify the skewed grid such that the distance between grid coordinates is five hexagons. Then translate each oriented component realization to its grid location. This procedure results in duplicated disks (points) corresponding to terminals. Remove one set; they were only duplicated for clarity of exposition of each component. I L e m m a 3.43 SATISFIABILITY can be reduced to p-BOUNDED COIN GRAPH RECOG- NITION in polynomial time, for anyfixedp. P r o o f : The grid drawing has area (Q\U\ +1) x (3|C| + 2), and therefore at most this many components, since a unit square encloses each component. Each component of Gc has a small constant number of cages and flippers. Each cage and nipper, on the other hand, has some, possible large, number of vertices and edges. But this number depends only on the ratio of disk diameters p, and not on the size of the S A T I S F I A B I L I T Y instance. Since the size of the S A T I S F I A B I L I T Y instance is a polynomial function of \U\ and | C | , the entire recognition instance can be built in polynomial time. 3.4.10 | Extending Coin Graph Recognition D i s k Intersection G r a p h s We can easily modify the reduction for p - B O U N D E D C O I N G R A P H R E C O G N I T I O N to p - B O U N D E D DISK G R A P H R E C O G N I T I O N as follows. First note that the cages are already suitable disk intersection graphs in that their realizations cannot contain more area by virtue of their disks having the freedom to overlap. The flippers pose only slightly more difficulty. Clearly, the realizations of current flippers may occupy less area by allowing their disks to overlap, thereby possibly leaving room for more flippers in a cage than we would like. The solution is to make the flippers out of independent vertices. Chapter 3. Unit Disk Graphs 138 In this way they cannot be compressed smaller than (or even equal to) their packing size without coming into contact with one another. In their current construction, the flippers do not contact each other nor the cage (except at one attachment point). Therefore we have room to uniformly scale each flipper slightly while leaving the contact point fixed. This expansion disconnects the constituent disks from one another, as Figure 3.40.(a) shows in exaggerated proportions. (a) (b) Figure 3.40: Expanding flippers to make the vertices independent. The flippers in the cage on the left have been expanded to make the vertices independent. The expanded flippers in the cage on the right have been "bound together" with the addition of many new disks. Although these new disks have been drawn as an independent set, there is no need for them to be independent. Clearly, the number of disks in such an expanded flipper still approaches its asymptotic portion of the cage's capacity. We still need to hold the flipper together somehow, to ensure that it is completely embedded in some cage. We can easily accomplish this task by adding as many more disks to the flipper as we like, being careful not to intersect the cage nor any other flippers in the construction, as shown in Figure 3.40.(b). This Chapter 3. Unit Disk Graphs 139 modified reduction proves the following theorem. T h e o r e m 3 . 4 4 p-BOUNDED DISK GRAPH RECOGNITION is NP-hard for any fixed value p > 1. Corollary 3.44.1 UNIT DISK GRAPH RECOGNITION is NP-hard. M a n h a t t a n and C h e s s b o a r d M e t r i c s Disks are bounded by squares under the Manhattan (L\) and the chessboard (Loo) metrics. We can easily modify the reduction for p - B O U N D E D C O I N G R A P H R E C O G N I T I O N (and the subsequent relaxation to arbitrary intersection) to p - B O U N D E D S Q U A R E G R A P H R E C O G N I T I O N by skewing the grid differently and using cages that are diamonds rather than hexagons. To illustrate, assume that the squares are aligned with the coordinate axes. The new reduction is identical to p - B O U N D E D C O I N G R A P H R E C O G N I T I O N up to the point that the reduction draws the bipartite graph on the square grid. Cages are diamonds, and are still joined at the corners by shared vertex triples, as shown in Figure 3.41. Figure 3.41: Joining square cages. Compare with Figure 3.25. Chapter 3. Unit Disk Graphs The unit 140 disks (squares) tile the plane in a square packing; this packing also constructs solid flippers leaving no internal gaps. The components are necessarily constructed differently, but the same principles apply. The modified reduction establishes the following theorem. T h e o r e m 3.45 p-BOUNDED COIN GRAPH fixed value p > 1 under the L\, L2, and RECOGNITION is NP-hard for any metrics. The extension to disk intersection graphs used for Theorem 3.44 applies here also. T h e o r e m 3.46 p-BOUNDED DISK GRAPH RECOGNITION value p > 1 under the L\, L , and 2 C o r o l l a r y 3.46.1 p-BOUNDED any fixed value is NP-hard for any fixed metrics. SQUARE GRAPH RECOGNITION is NP-hard for p>l. C o r o l l a r y 3.46.2 UNIT SQUARE GRAPH RECOGNITION is NP-hard. Therefore, the smallest dimension K, for which a graph G is the intersection graph of /^-dimensional unit hypercubes is called the cubicity of the graph [Rob68b]. This definition leads immediately to the following problem. K-CUBICITY I N S T A N C E : Graph G = (V, E), positive integer K. Q U E S T I O N : Does G have cubicity at most KI The complexity of 2 - C U B I C I T Y was a long-standing open question [Rob68b, Coz92]. It follows from Corollary 3.46.2 that A"-CUBICITY is NP-hard, even for K = 2. The Introduction mentions that graphs with cubicity 1 are called indifference graphs and can be recognized in polynomial time. That is, A ' - C U B I C I T Y is solvable in polynomial time for K =1. Also, Yannakakis [Yan82] showed that 3 - C U B I C I T Y is N P - h a r d . Chapter 3. Unit Disk Graphs 141 Corollary 3.46.3 2-CUBICITY is NP-hard. Conjecture 3.47 K-CUBICITY is NP-hard for allfixedK greater than 1. T h r e e Dimensions The reduction can also be modified to three dimensions. A k-dimensional ball is the set of points within some radius of a point (the ball's centre) in A>dimensional Euclidean space. Hence disks are two-dimensional balls, and coins are two-dimensional interior-disjoint balls. The basic building blocks for the three-dimensional reduction are again flippers in cages, but this time the cages are three-dimensional regular octahedra. Again, derive an upper bound on the capacity of a cage by a spherical volume argument. Derive a lower bound on its octahedral capacity by packing the interior in a hexagonal lattice, which is a rotated face-centered cubic lattice. Note that it does not matter whether face-centered cubic is "optimal" (though it is the densest lattice packing in three dimensions [CS88]), merely that its capacity forms a small constant ratio with the spherical-volume upper bound. Embed the S A T I S F I A B I L I T Y graph in the three-dimensional triangular grid as follows. Begin by embedding the clauses and variables in a two-dimensional square grid, as before. Think of this as a horizontal layer, with z = 1. Now, add more horizontal layers to the grid for a total of 3|C| layers, so that each occurrence of a literal in a clause has its own layer. Draw the bipartite graph corresponding to S A T I S F I A B I L I T Y on the three-dimensional grid by routing a literal to a clause. First route from the literal to the layer corresponding to the clause, using the third dimension. Then route over to the clause's (x,y) coordinates on its dedicated grid layer. Conclude by routing to the clause using the third dimension. In this way, no wires interfere so that the construction simulates a natural layout of the bipartite S A T I S F I A B I L I T Y graph without using cross-over Chapter 3. Unit Disk Graphs components. 142 Next, derive a tetrahedral three-dimensional grid by skewing the square grid. Finally, simulate the components with the octahedral cages. Note that these cages, unlike their two-dimensional analogues, have "holes in the mesh", which may allow flippers to "escape". Patch these holes with smaller spheres placed into the holes, possibly leaving some much smaller holes. Simply continue this process until all holes are smaller than the unit spheres. T h e o r e m 3.48 In two or three dimensions, p-BOUNDED BALL GRAPH TION and p-BOUNDED TOUCHING-BALL GRAPH RECOGNITION RECOGNI- are NP-hard for any fixed p. Conjecture 3.49 TOUCHING-BALL p-BOUNDED BALL GRAPH RECOGNITION GRAPH RECOGNITION and p-BOUNDED are NP-hard for all fixed p and for all fixed K greater than 1. Two unit balls intersect if and only if their boundaries, which are spheres, intersect. Therefore, the smallest dimension K, for which a graph G is the intersection graph of A'-dimensional unit balls, is called the sphericity of the graph. This definition leads immediately to the following problem. K-SPHERICITY INSTANCE: Graph G = (V, E), positive integer K. QUESTION: Does G have sphericity at most KI The complexity of 3-SPHERICITY was an open question due to Havel [Hav82a, Hav82b, HKC83] arising from studies of molecular conformation. It follows from Theorem 3.48 that K - S P H E R I C I T Y is NP-hard, even for K = 2 or K = 3. Again, recall from the Introduction that graphs with sphericity 1 are called indifference graphs and can be Chapter 3. Unit Disk Graphs 143 recognized in polynomial time. That is, i ^ - S P H E R I C I T Y is solvable in polynomial time for K = 1. T h e o r e m 3.50 K-SPHERICITY is NP-hard, even for K = 2 and K = 3. Conjecture 3.51 K-SPHERICITY 3.4.11 is NP-hard for allfixedK greater than 1. Miscellaneous Properties The reduction embeds the bipartite graph corresponding to S A T I S F I A B I L I T Y in a very straightforward manner, making it easy for the reader to recall the structure of the drawing. This clarity comes at a small price, however, namely the need for crossover components. We could have constructed a reduction that avoids them. Kratochvil [Kra94] has recently introduced a special case of S A T I S F I A B I L I T Y , called 4 - B O U N D E D P L A N A R 3 - C O N N E C T E D 3-SAT, and shown that it is NP-complete. In this special case, every clause contains exactly three variables, every variable appears in at most four clauses, and the bipartite graph of clauses to variables is planar and 3-connected. We could have reduced this new problem to p - B O U N D E D COIN G R A P H S , as follows. Since the bipartite graph is planar and has degree at most four, Valiant's procedure (see Section 3.3.1) will embed it in the square grid, with no crossovers, in polynomial time. The rest of the reduction would be nearly identical to the one presented here, differing only in that it does not require crossovers, and that the literal and clause components may have to have different shapes to accommodate the different incident edges. We already noted that coin graphs are planar. On the other hand, no such restriction holds for disk graphs. However, note that an instance of the p - B O U N D E D DISK G R A P H R E C O G N I T I O N constructed by the reduction in this chapter is planar. This is true whether or not it has a realization, since it is always possible to embed (in the traditional sense of drawing a graph on the plane) all flippers inside their incident cages without Chapter 3. Unit Disk Graphs 144 crossing edges by making them sufficiently small. That is, p - B O U N D E D DISK G R A P H R E C O G N I T I O N remains NP-hard even if the graph is planar. A n instance of p - B O U N D E D C O I N G R A P H R E C O G N I T I O N constructed by the reduction has a 3-dimensional realization. To see this, embed the cages in the (horizontal) plane, as usual. Then embed each flipper directly above its incident vertex on the cage using the third dimension. Align all the flippers to ensure that flippers on a common cage remain independent of one another. That is, pick some plane normal to the horizontal and, when embedding a flipper, make all of its points equidistant from that plane. Since the cages are all spaced by the large hexagonal grid, the flippers from different cages will be, too, and will consequently be independent. This implies, for example, that 2-SPHERICITY remains NP-hard even if the graph has sphericity at most 3. We can express C O I N G R A P H R E C O G N I T I O N and DISK G R A P H R E C O G N I T I O N as existentially-quantified formulae in the first order theory of the reals (c/. [Can88]) as follows. Let G = (V, E) be a graph where V = {1, 2 , . . . , n}. Say that {f v R is a set of (possible) disk locations. Similarly, say that {r 2 : v £ V} C : v £ V} C R is a set of v (possible) disk radii. Then G is a coin graph if and only if 3/i3/ . . . 3f 3r{3r 2 n 2 ... 3r n P c o i n ( f i , f, 2 • • •, fn, n, r, • • •, 2 r) n KPE(fi,f2,---,fn,ri,r ,...,r ) 2 n where P in(fi,f2,---,fn,r ,r ,...,r ) C0 1 2 = n f\ \\f u - f \\ v = r u + r v (u,v)eE and Pe(/i,/2,...,/n,ri,r ,...,r ) = 2 n /\ | | / - /„|| > r u u + r„. (3.8) (u,v)e~E Since the existential theory of the reals is decidable in P S P A C E [Can88], it follows that C O I N G R A P H R E C O G N I T I O N is in P S P A C E . 8 This should come as no surprise, since coin graphs can be recognized in linear time, as mentioned earlier. 8 Chapter 3. Unit Disk Graphs 145 We can add a predicate P to constrain the radii of the disks. In particular, given a p value p, let P (ri,r ,...,r ) P 2 = /\ 1 < r < p. n (3.9) v vev Then G is a p-bounded coin graph if and only if 3/ 3/ ...3/ 3r 3r ...3 1 2 n 1 2 Ai^(/i,/2,---,/n,ri,r ,...,r ) 2 n A P ( r i , r , . . . ,r ). P n 2 It follows that p - B O U N D E D COIN G R A P H R E C O G N I T I O N is in P S P A C E . Similarly, G is a disk graph if and only if 3 / i 3 / . . . 3 / „ 3 r i 3 r . . . 3r 2 n 2 Pdisk(fi,f2, r ,..., • • •, / n , 2 A PE(/I, h, r l 5 r) n r ,..., r„) 2 where i dt»ik(/i,/2,---,/n,»"i,r2,...,r ) = 3 n f\ \\f - f \\ < r + r u v u v (u,v)eE and PE is defined by Equation 3.8. It follows that DISK G R A P H R E C O G N I T I O N is in P S P A C E . Again, we can add predicate P (Equation 3.9). Then G is a p-bounded disk p graph if and only if 3 / i 3 / . . . 3 / 3 r i 3 r ...3r 2 n 2 n Pdisk{f n , r , • • •, r ) • • • , fn, n 2 A.PB(/i,/ ,...,/ ,ri,r ,...,r ) 2 A P (ri,r ,... p 2 n 2 n ,r ). n It follows that p - B O U N D E D DISK G R A P H R E C O G N I T I O N is in P S P A C E . Chapter 4 Cocomparability Graphs Every r-strip graph is a cocomparability graph for all r £ [0,-\/3/2], as we established in Theorem 3.7. Therefore, the class of strip graphs naturally inherits the properties of, as well as any algorithms on, the class of cocomparability graphs. This chapter develops (in Section 4.2) polynomial time algorithms for several domination problems on cocomparability graphs. This chapter also establishes properties of cocomparability graphs that will be used later in the thesis to develop algorithms on strip graphs and two-level graphs. In particular, transitive orientations of the nonedges of strip graphs play a significant role in their characterization, as we will see in Chapter 5 and Chapter 6. Section 4.3 therefore explores the possible transitive orientations for the complements of cocomparability graphs. The following brief introduction characterizes cocomparability graphs in terms of a linear order on the vertices of a graph. It also presents an algorithm for finding such an order. This characterization leads to efficient algorithms for several domination problems, which form the subject of Section 4.2. These algorithms, of course, are applicable to strip graphs and two-level graphs. 4.1 Introduction Recall from Section 2.3 that a comparability graph is an undirected graph that has a transitive orientation, and that a graph is a cocomparability graph if its nonedges are 146 Chapter 4. Cocomparability Graphs 147 transitively orientable (that is, if it is the complement of a comparability graph). Cocomparability graphs can be characterized in terms of possible linear orders on their vertices. In this chapter, we will see how this characterization leads to efficient algorithms. Definition 4.1 A spanning order (V, <) of a graph G = (V, E) is a linear order on the vertices V of G such that, for any three vertices u < v < w, if u and w are adjacent, then v is adjacent to either u or w (or both). | Figure 4.1 shows a small cocomparability graph and a spanning order on its vertices. 1 2 3 4 5 6 7 8 9 Figure 4.1: A cocomparability graph on nine vertices. The vertices are labelled in spanning order. We will see that the vertices of every cocomparability graph can be labelled in spanning order (Lemma 4.2), and that every graph whose vertices can be labelled in spanning order is a cocomparability graph (Theorem 4.3). Damaschke [Dam92] says this is wellknown, and he states the result without proof. Nevertheless, your intuition may be strengthened by working through the following simple proofs. In essence, Theorem 4.3 says that the restriction of a spanning order to the complementary edges is a transitive orientation. L e m m a 4.2 ([Dam92]) Let G = (V,E) be a cocomparability graph. Every linear ex- tension of a transitive orientation of the complement of G is a spanning order of G. Proof: Let G = (V, E) be a cocomparability graph. That is, its complement G = (V, E) is a comparability graph. Let G = (V, E) be a transitive orientation of G, and consider Chapter 4. Cocomparability Graphs 148 any linear extension (V, <) of G. This is a spanning order of G. To see this, consider any three vertices u < v < w such that (u,w) G E but (u,v) fc E and (v,w) fc E. Then, by definition, (u,v) G E and (v,w) G E. By transitivity, (u,w) G E, and therefore (u,w) fc E, a contradiction. | T h e o r e m 4.3 ([Dam92]) A graph is a cocomparability graph if and only if it has a spanning order. P r o o f : Every cocomparability graph has a spanning order by Lemma 4.2. Conversely, suppose a graph G = (V, E) has a spanning order. Construct a directed graph G = (V,E) such that (u,v) G E if and only if (u,v) fc E and u < v. This graph is a transitive orientation of G, for if (u,v) G E and (v,w) G E, then u < v < w and (u,v) fc E and (v,w) fc E. Therefore u and w could not be adjacent; otherwise —* the spanning ordering property would be violated. That is, (u,w) EE. comparability graph, and G is a cocomparability graph. So G is a | D e f i n i t i o n 4.4 A linearly-ordered graph G = (V,E,<) is a graph (V,E) and a linear order (V, <). A spanning-ordered graph G = (V,E,<) is a (necessarily cocomparability) graph (V, E) and a spanning order (V, <). | The algorithm below generates a spanning-ordered graph (several of the following sections require this) from a cocomparability graph. This algorithm may return a linearlyordered graph even if G is not a cocomparability graph. This property allows us to use this linearly ordered graph, for example in the subsequent Steiner set algorithm (Section 4.2.5), to avoid having to recognize cocomparability graphs, a step that would add G(M(V)) time [Spi85]. ' T h e o r e m 4.5 Given an arbitrary graph G, Algorithm OCC returns a spanning-ordered cocomparability graph if G is a cocomparability graph, or it returns a linearly-ordered Chapter 4. Cocomparability Graphs 149 Table 4.1: Algorithm: OCC(G) [spanning Ordered Cocomparability Graph] Input: A graph G = (V, E). Output: A linearly-ordered graph, or a message stating that G is not a cocomparability graph. 1 2 3 4 5 6 G f- the complement of G. G <r- T R A N S I T I V E L Y - O R I E N T ( G ) if the directed graph G does not contain a cycle, then order the vertices of G by topologically sorting G. return the now linearly-ordered graph G = (V, E, <). else return " G is not a cocomparability graph." graph, or it prints a message stating that G is not a cocomparability graph, in 0(V ) 2 time. Proof: Implement Step 2 with Spinrad's transitive orientation algorithm [Spi85], which will orient any undirected graph. The resulting directed graph is transitive if and only if G is a cocomparability graph [Spi85]. This graph is clearly not transitive if it contains a cycle; this observation justifies Step 3. If G is a cocomparability graph, the linearlyordered graph in Step 5 is a spanning-ordered graph by Lemma 4.2. It is straightforward to implement Step 1 to run in 0(V ) 2 rithm also takes 0(V ) 2 time. Spinrad's algo- time [Spi85]. Step 4 can be implemented to run in 0(V + E) time ([CLR90] pages 485-488) using depth first search. Step 4 can simultaneously test for cycles in G, since such a cycle exists if and only if depth first search discovers a "back edge" (one directed to an already-visited vertex). This obviates the need for an explicit Step 3. I A graph is said to be chordal if it does not contain any induced cycles with four or more edges, that is, every such cycle has a "chord". Neither comparability graphs Chapter 4. Cocomparability Graphs 150 nor cocomparability graphs are necessarily chordal. In fact, the chordal cocomparability graphs are exactly the interval graphs [GH64]. However, cocomparability graphs are in some sense almost chordal. This is a simple consequence of spanning orders. Theorem 4.6 ([Gal67]) Cocomparability graphs do not have induced cycles with five or more edges. Proof: Let G = (V, E) be a cocomparability graph, and let C be any cycle with five or more edges, and therefore at least five vertices, in G. Consider now a spanning order (V, <) , which must exist for G by Theorem 4.3. Let s be the least vertex in C in this order, and t the greatest vertex in C. Then C forms two paths from s to t, as shown in Figure 4.2. There must be three vertices a < b < c such that b lies on one path, (a, c) b b b Figure 4.2: Every 5-cycle in a cocomparability graph has a chord: three cases in left-to-right order. is an edge on the other path, and b is not adjacent to a or c (that is, (a,b) (6, c) ^ E). This contradicts the properties of a spanning order. A related idea is that of a dominating path. E and | A path P = (s,...,t) in a graph G = (V, E) is dominating if every graph vertex is either equal or adjacent to a path vertex. Lemma 4.7 A path P in a spanning-ordered cocomparability graph dominates all vertices between the least vertex in P and the greatest vertex in P. Chapter 4. Cocomparability Graphs 151 Proof: A path in any graph dominates the vertices on the path. So let v be a vertex in G = (V, E, <), not in the path P , between the least vertex / and the greatest vertex t in P (that is, I < v < t). Then there exists some edge (u,w) of the path such that l<u<v<w<t. By the properties of the spanning order, v is adjacent to either u or w, so the path dominates v. Corollary 4.7.1 | A path in a spanning-ordered cocomparability graph dominates all vertices between its endpoints. 4.2 Algorithms for Dominating and Steiner Set Problems This section describes polynomial time algorithms for finding optimal dominating sets and Steiner sets in cocomparability graphs. The following table of contents lists the subsections in which each algorithm is developed. A n algorithm for this set is presented in Subsection minimum cardinality connected dominating set (MCCDS) §4.2.1 minimum cardinality dominating set (MCDS) §4.2.2 minimum cardinality total dominating set (MCTDS) §4.2.3 minimum weight independent dominating set (MWIDS) §4.2.4 minimum weight Steiner set (MWSS) §4.2.5 Until recently [KS93], it was not known if these problems on cocomparability graphs were solvable in polynomial time. Every algorithm in this section has a better run time complexity, and is designed using a very different method, than the corresponding dynamic programming algorithm of Kratsch and Stewart [KS93]. Subsequently, Daniel Liang [Lia94] has achieved the same run time complexities as the algorithms in this section; his algorithms use dynamic programming and are similar to those of Kratsch and Stewart. A joint paper with Liang is in preparation. Chapter 4. Cocomparability Graphs 152 Table 4.2 summarizes the results of this section and compares the running times of algorithms for interval graphs and permutation graphs, both of which are subclasses of cocomparability graphs. Recall that interval graphs are exactly the chordal cocomparability graphs. Dominating sets for interval graphs have received considerable attention [RR88b] and, in fact, linear algorithms for several dominating set problems are known. These algorithms, however, also exploit additional properties of interval graphs, such as chordality. The complexity of these problems on other kinds of perfect graphs appear in the literature and are succinctly surveyed by Corneil and Stewart [CS90b]. A particularly relevant observation from this survey is that all of these problems are NP-complete for comparability graphs, the complements of cocomparability graphs. Table 4.2 assumes that a spanning order is available for the cocomparability graph algorithms, and that a defining permutation is available for the permutation graph algorithms. In both cases, these can be created in 0(V ) 2 time (see [Spi85] and Algo- rithm OCC in Table 4.1), but notice that doing so would introduce an 0(V ) 2 term to some of these algorithms. Incidentally, we may assume that our input graphs are connected, otherwise we can run the algorithms on the connected components and take the union of the solutions. In particular, this means | V | = 0(E). Problem \ Graph MCCDS MCDS MCTDS MWIDS MWSS Cocomparability 0(VE) 0(VE ) 0(VE ) 0(V - ) 0(V log V + E) 2 2 2 376 Permutation 0(V + E) [AR92] 0(V log log V) [TH90] 0(V + VE) [CS90b] 0(V ) [BK87] 0(V log V + E) [AR92] 2 2 Interval 0(V + E) 0(V + E) 0(V + E) 0(V + E) [RR88b] [RR88b] [RR88b] [RR88b] Table 4.2: Complexity of Domination Problems Section 4.2.1 covers connected domination. Section 4.2.2 then develops an algorithm for finding a dominating set by exploiting the structure of a minimum cardinality connected dominating set. Subsequently, Section 4.2.3 reduces the problem of finding a total Chapter 4. Cocomparability Graphs 153 dominating set to that of finding a dominating set. The algorithm for finding a minimum weighted independent dominating set utilizes a new 0(M(V)) time algorithm for finding a minimum (or maximum) weight maximal clique in a comparability graph. Both algorithms are presented in Section 4.2.4. The Steiner set algorithm M W S S - C C presented in Section 4.2.5 is particularly flexible: given an arbitrary graph, the algorithm will either find a minimum weight Steiner set, or it will print a message stating that the graph is not a cocomparability graph. That is, the 0 ( M ( V ) ) time recognition step is not required. Section 4.2.6 is on the applicability of these algorithms to realizations for three well known subclasses of cocomparability graphs. It shows that the standard realizations of permutation, interval, and indifference graphs admit easily extracted spanning orders, and that the algorithms therefore run unchanged on these representations. 4.2.1 Connected D o m i n a t i n g Sets This section describes a polynomial time algorithm for finding a minimum cardinality connected dominating set (MCCDS) in a cocomparability graph. Recall that a connected dominating set in a graph is a subset of vertices that induces a connected subgraph, and that is adjacent to every other vertex in the graph. If a vertex in a linearly-ordered graph dominates all lesser vertices (in the linear order), refer to it as a left dominator. Similarly, refer to a vertex that dominates all greater vertices as & right dominator. Let V~(G) denote the set of left dominators in the linearly-ordered graph G. Similarly let V (G) denote the set of right dominators. We + will not write the graph argument if it is implicit (that is, we write V {G) = V + + if G is understood). Also let V~(S) (respectively V (S)) denote the set of left dominators + Chapter 4. Cocomparability Graphs 154 (respectively right dominators) in the linearly-ordered graph induced by the linearlyordered subset S of vertices V. More formally, V-(G) {v : (u,v) £ E(G) for all vertices u < v}, and V (G) {v : (u, v) £ E(G) for all vertices u > v}. + Corollary 4.7.1 implies that every path from a vertex in V~ to a vertex in V + forms a connected dominating set. The following lemma implies that such a path could serve as an M C C D S if an M C C D S does not have exactly two vertices. In the forthcoming material, let | P | denote the number of vertices in the set P, even if P is a path or similar structure. Lemma 4.8 Let M be a connected dominating set in a spanning-ordered cocomparability graph G. Then there exists a path P from V" to V + such that (i) \P\ < \M\, or (ii) \P\ = 3 and \M\ = 2. Proof: Case 1: M contains vertices u £ V~ and w £ V. + Since M induces a connected subgraph, there is a path P from u to w using only vertices in M. Therefore \P\ < \M\. Case 2 : M does not contain any vertices from V~ but contains a vertex w £ V. + Let Ui be the least (in the spanning order) vertex in V. Trivially, U i £ V~ and so U i fc M. Since M is a dominating set, u\ is adjacent to some vertex v\ £ M. See Figure 4.3. Since v\ fc V~, there is a least vertex u < Vi that is not adjacent to v\. It must be 2 that u £ V~ since every vertex u < u is adjacent to u . To see this, note that such a 2 2 2 vertex u is adjacent to Vi since u is the least vertex not adjacent to v\. Then u < u < v\ 2 implies that u is adjacent to u according to the spanning order. 2 2 Chapter 4. Cocomparability Graphs 155 but contains a vertex w £ Figure 4.3: M does not contain any vertices from V Again, u is adjacent to some vertex v £ M. 2 2 V. + Note that v ^ vi since u is not 2 adjacent to v\. Without loss of generality, suppose that P' = 2 . . . , w) is the shortest path from either v\ or v to w in the subgraph induced by M (otherwise relabel the 2 vertices by exchanging subscript labels 1 and 2). This path exists since M is connected. The path cannot contain v for, if it did, the path from v would be shorter. Therefore 2 < |M\{u2}| 2 = | M | —1. We can now create path P by appending Ui to the beginning of P'. It follows that \P\ = \P'\ + 1 < \M\. C a s e 3: M contains a vertex w € V~ but does not contain any vertices from V. + This proof is symmetric to that for Case 2. Since M does not contain any vertices from V , we can find distinct vertices + £ V + and u 6 V + 4 that are adjacent to distinct vertices U3 and V4 in M respectively (see Figure 4.4). We can now construct a shortest path P from w to 113 or u so that, again, \P\ < \M\. 4 C a s e 4: M contains vertices from neither V~ nor V. + As for Case 2, we can find distinct vertices u\ € V~ and u £ V~ that are adjacent to 2 distinct vertices v\ and v in M respectively (see Figure 4.5). And as for Case 3, we can 2 find distinct vertices 113 £ V + and u £ V + 4 that are adjacent to distinct vertices U3 and v in M respectively (see Figure 4.5). Without loss of generality, let P' = (y\,..., v ) be 4 3 156 Chapter 4. Cocomparability Graphs Figure 4.4: M contains a vertex w £ V but does not contain any vertices from Figure 4.5: M contains vertices from neither V nor V. + V. + Chapter 4. Cocomparability Graphs 157 the shortest path, from either Vi or v to either v or v , in the subgraph induced by M 2 3 4 (otherwise relabel the vertices). As before, this path cannot contain v , and it cannot 2 contain v either. 4 If Vi = u , then P = 3 = v ,u ) is a path in G that dominates G by the (ui,vi 3 3 dominating properties of U i and u and by Lemma 4.7. Then | P | = 3. It cannot be that 3 \M\ = 1, since otherwise the sole vertex would be in both V~ and V . Therefore either + \P\ < \M\ or | M | = 2. On the other hand, if Vi ^ u , then v ^ v , otherwise P' = (v ) would have been 3 2 4 2 the shortest path. Therefore \P'\ < \M \ {v ,v }\ 2 4 = \M\ — 2. We can now create path P by appending Ui to the beginning of P', and u to the end of P'. It follows that 3 \P\ = \P'\ + 2 < | M | . | Figure 4.6 shows a graph with \P\ = 3 and \M\ = 2 . The left-to-right order of the Figure 4.6: Lemma 4.8.(ii) A graph with | P | = 3 and \M\ = 2. vertices is clearly a spanning order. The two dark vertices form a connected dominating set, yet the shortest path from V~ to V + has three vertices. Theorem 4.9 Let G be a connected spanning-ordered cocomparability graph, and let P be a shortest path from V~ to V . Either P is a minimum cardinality connected dominating + set, or \P\ = 3 and G is dominated by a single edge. Proof: Let P be a shortest path from V~ to V . The path P is clearly connected, and + it is dominating by the definitions of V~ and V , and by Lemma 4.7. + Chapter 4. Cocomparability Graphs 158 Now let M be a minimum cardinality connected dominating set of G. Then by Lemma 4.8, either \P\ < | M | , and therefore P is a minimum cardinality connected dominating set, or \P\ = 3 and \M\ = 2, so that G is dominated by a single edge. | Table 4.3: Algorithm: M C C D S - O C C ( G ) [Minimum Car dinality Connected Dominating Set for spanning-Ordered Cocomparability Graphs] Input: A connected spanning-ordered cocomparability jraph G = (V,E) Output: A minimum connected dominating set of G ? 1 2 3 4 5 6 7 8 9 V~ {v : v dominates all lesser vertices } V <— {v : v dominates all greater vertices } P <r- the shortest path from V~ to V in G if|P|=3 then for all edges (u,v) G E do if every vertex w G V is adjacent to u or v then P <- {u,v} break return P. + + Theorem 4.10 Algorithm MCCDS-OCC computes a minimum cardinality connected dominating set of a connected spanning-ordered cocomparability graph G — (V,E, <) in 0(VE) time. Proof: The correctness of the algorithm follows immediately from Theorem 4.9. To analyze the run-time complexity of the algorithm, assume that the input graph is represented by an adjacency list and adjacency matrix. Step 1 can be executed in 0(V + E) time by making use of the linear-order and the adjacency matrix. To test if a vertex is a left-dominator, we check all lesser vertices in order, stopping immediately if a vertex is not adjacent (i.e., not dominated). In this way every edge is visited at most once, and each vertex examines at most one non-adjacent Chapter 4. Cocomparability Graphs 159 Table 4.4: Algorithm: M C C D S - C C ( G ) [Minimum Cardinality Connected Dominating Set for Cocomparability Graphs] Input: A cocomparability graph G = (V, E). Output: A minimum cardinality connected dominating set, or a message stating that no connected dominating set exists. 1 2 3 4 if G is connected, then G <r- OCC(G) return M C C D S - O C C ( G ) else return "No connected dominating set exists." vertex. Similarly, Step 2 can be executed in 0(V + E) time by checking all greater vertices. Step 3 can be implemented by adding a new "source" vertex s and a new "target" vertex t that is adjacent to the vertices in V~ and V + respectively. Step 3 can then be executed in 0(V + E) time by running breadth first search starting at s. Finally, Step 6 runs in 0(V) time for a total of 0(VE) Theorem 4 . 1 1 time since it is called for each edge. Given a cocomparability graph G, Algorithm MCCDS-CC | computes a minimum cardinality connected dominating set, or prints a message stating that no connected dominating set exists, in 0(VE) time. Proof: Step 4 is correct since there is clearly no connected dominating set if G is not connected. On the other hand, if G is connected, V itself forms a connected dominating set. Step 2 correctly orders the vertices V of G by Theorem 4.5, so the set returned by Step 3 is a minimum cardinality connected dominating set by Theorem 4.10. Step 1 takes 0(V + E) using depth first search, Step 2 takes 0(V ) 2 orem 4.5, and Step 3 takes 0(VE) time by The- time by Theorem 4.10. If G is connected, then \E\ > | V | — 1. Therefore, if the algorithm executes Steps 2 and 3, then it must be that 0(V ) 2 = 0{VE). The total time taken is therefore 0(V + E + VE) = 0(VE). I Chapter 4. Cocomparability Graphs 4.2.2 160 Minimum Cardinality Dominating Sets We now know how to find a minimum cardinality connected dominating set in a cocomparability graph. On the other hand, there may be an even smaller set that dominates the graph but that does not induce a connected subgraph. This is the ordinary dominating set problem—to find a (not necessarily connected) minimum cardinality dominating set (MCDS) in a graph—which we now address. Let G = (V, E, <) be a spanning-ordered graph. To simplify the treatment of special cases, this section assumes that V has been augmented with two additional vertices s and t. These vertices 5 = 0 and t = \V\ + 1 are not adjacent to any vertices. We will find an M C D S in G by finding a shortest path in an auxiliary digraph G' = ( V ' , A ' ) , which we will refer to as a d-auxiliary graph There is a node in V for each vertex in V, and two nodes in V for each undirected edge in E. More precisely, V = Vin = Vout = VUV UV , m where out {e;„ : e £ E} and {e t • e e E}. ou The arc set A' depends only on the spanning-ordered graph G. However, the reader may find its presentation at this point somewhat mysterious, so we will instead present A' in conjunction with its properties. For now, let us just say that A' is the disjoint union of six sets of directed arcs A' = A U Ai U A U A U A U A . 0 2 3 A 5 These sets are defined by the forthcoming Equations 4.10 through 4.15. Let M be a minimum cardinality dominating set of G. Write fc+i M= \JP U i=0 Chapter 4. Cocomparability Graphs 161 where each induced subgraph G(Pi) is a connected component of the induced subgraph G(M). Recall that N ( p ) = N(P,-, G) denotes the vertices dominated by P,- in G. Clearly, Pi is a minimum cardinality connected dominating set of the subgraph induced by N(P ). 2 By Theorem 4.9, we may assume that Pi is either a shortest path (/,-,...,r,-) from a left dominator /; £ V~(N(P,)) to a right dominator r; £ V ( N ( P ) ) , or a single edge + 8 Pi = (h,fi). We may further assume that < r,- in the spanning order for all paths P;. We can clearly do so if P - = (/,• = r,-) or if P, = (/,-, r;). For longer paths P = (/j,.. . , r;), t 4 we must have U < ri, otherwise U and r,- would be adjacent by the definition of left and right dominators, and (/;,r;) would be a shorter path than Pi. Furthermore, these paths do not overlap in the spanning order. That is, no vertex v £ Pi falls between the least and greatest vertices of any other path Pj. This is because such a vertex v would be dominated by Pj according to Lemma 4.7, contradicting the fact that G(Pi) and G(Pj) are connected components of G(M). We may therefore assume that lo < r < li < r-i < • • • < l 0 k+1 < r k+1 in the spanning order. Note that, since the vertices s and t are not adjacent to any vertices, PQ = (lo = ro = s) and P +i = (l +i = r i k k k+ = t). Define a paths dominator to be a set M that satisfies all of the above properties. We have established the following property of spanning-ordered graphs. P r o p e r t y 4.12 Every spanning-ordered graph has a paths dominator. We are now ready to derive the arcs of the d-auxiliary digraph. In order to do so, however, we will need the following technical lemma that explains why all vertices between two paths are dominated by the endpoints of the paths. L e m m a 4.13 Let v be a vertex between paths in a paths dominator M, that is, r < v < t Chapter 4. Cocomparability Graphs 162 for some i. Then v is adjacent to at least one endpoint of at least one of the two bracketing paths. More precisely, 1. If neither Pi nor Pj+i is an edge, then v is adjacent to r%- or Zj i. + 2. If Pi+i is an edge but Pi is not, then v is adjacent to ri, U+i, or r,- i. + 3. If Pi is an edge but Pi+i is not, then v is adjacent to li, ri, or li+\. 4- If both Pi and P j +1 are edges, then v is adjacent to li, ri, orr,- i. + Proof: Since M is a dominating set, the vertex v is adjacent to some vertex u £ M. If u £ Pi, then we are done since either r,- £ V (N(Pj)) or Pj = (/j,r,-). Similarly, we are + done if it £ Pj+i, since either l i+1 £ V~(N(P )) i+1 or P = i+1 (l ,r ). i+1 i+1 Otherwise u is in some other path Pj so that u < ri and (u,r,) £ £7, or Zj+i < iz and (u,li ) +1 £ Z2, since P; and Pj do not overlap in the spanning order. In the first case, where u < ri < v, there is an edge between u and v, but (u, r,-) £ E. Therefore (r,-, v) £ E by the spanning order. Similarly, in the second case, (Z i,u) £ E. | J+ We want to define the arcs A' of the d-auxiliary graph G' so that for every paths dominator M, there is a path P' from s to t in G ' with the same number of vertices as M. Essentially, we want P' to simulate the sequence S = (s = l = r , Z i , . . . , r i , . . . , Zj,..., r j , . . . , l 0 0 k+1 = r i = t), k+ where (U,..., r,-) is the path Pj. More precisely, let a : V —> V denote the significance of a vertex in G', defined by t v if v'£ V u if v' = ei , where e = (u,v) and u < v v if v' 1 n e , where e = (u,v) and u < v. out Chapter 4. Cocomparability Graphs 163 We want the significance of path P' — (s — p'i,p' , • • • ,p' ) to be 5", that is, we want 2 S = Wl), n ^(P )> • • • , (Pn) = 0. a 2 or more compactly S = c(P'), by a traditional abuse of notation. To achieve this, we need an arc from u' to v' in G' if o~(u') and o~(v') are consecutive in S. We will use dominating properties to determine which nodes should be adjacent. To this end, let u and v be two consecutive vertices in the sequence S. If u and v belong to some path P,-, then (u,v) £ E, and by the spanning order, {u,v} dominates all vertices between u and v. Therefore define A \ U A to be the set of arcs whose endpoints 2 dominate all vertices in between. The set A A = 2 is just the reversal of A \ . More precisely, {(u, u) : u,v € V, u <v, and for all i £ V, = A\ 2 u < i <v implies (i,u) £ E or (i,v) £ P } (4-10) {(v,u):(u,v)€A!}. (4.11) If u and v do not belong to a path, then u = r - and u = t for some paths P and s Pi+\. We must consider four cases, depending on whether P,- or P j i is an edge. + Case 1: Neither Pi nor P i is an edge. 8 + In this case, {r -,/ i} dominates all vertices in between by Lemma 4.13.1. Note that 8 J+ (r;,/;+i)£ A . x Case 2: P,- = ( / ; , r +1 +1 The set {r;} U !+1 ) = e is an edge but P,- is not. r , } dominates all vertices between r,- and +1 by Lemma 4.13.2. In this case, we want an arc from r; to e . More precisely, jn A 3 = {(w, e,- ) : to £ V, e = (u, u) £ n E, w < u < v, and for all i £ w <i <u implies (i,u) £ E, (i,v) £ or (i,w) £ i?}. V, (4-12) Also, we wish to ensure that any path in G' through e; also includes e . To do so, we n out define the arcs AQ between such pairs. For every edge e £ E, this will be the only arc Chapter 4. Cocomparability Graphs 164 from e{ and the only arc to e . More precisely, n out Ao = {( e £ E}. (4.13) Case 3: P = (Z,-,rj) = e is an edge but Pj+i is not. 8 The set {/,-, rj} U {Zj+i} dominates all vertices between r - and Zj+i by Lemma 4.13.3. 2 In this case, we want an arc from e out A 4 to Z j . More precisely, +1 = {(e , iu) : w G V, e = ( « , » ) e £ , u < v < w, and for all i £ V, out v <i <w implies (z',tt) G i£, (z,f) G i?, or (i,w) G £ } . Again, the arcs in A ensure that any path in G' through e Q includes e . out Case 3: Both P,- = (Zj,r -) = e and P t ! + 1 (4-14) !n = ( Z i , r , i ) = / are edges. 8+ + The set {Z,-, r,-}U{Z,- i, r,- i} dominates all vertices between r - and Z;+i by Lemma 4.13.4. + + In this case, we want an arc from e t out A5 to /,- . More precisely, n = { ( e , /i„) : e = (it, u), f = (w,x) £ E, u < v < w < x, and for all i G V, oui v < i <w implies (i,u) £ E, (i,v) £ E, (i,w) £ E, or (i,x) £ E}. (4.15) This completes our description of the arc sets Ao through A 5 in A'. The preceding discussion establishes the following lemma. Lemma 4.14 For every paths dominator M of a spanning-ordered graph, there is a path P' in G' that satisfies \P'\ < \M\. The reader may suspect from our construction that every path in G' also corresponds to a dominating set in G. The following lemma confirms this suspicion. Lemma 4.15 Let P' be a path from s to t in G'. The vertices ofV corresponding to the nodes of P' dominate G. Chapter 4. Cocomparability Graphs 165 Proof: Let S = {o~(v) : v £ P'} be the set of vertices corresponding to the nodes in the path P', and let j be an arbitrary vertex in V. We claim that 5" dominates j. If j E 5 , then we are done. Otherwise, s < j < t in the spanning order, so there 1 exists a pair of vertices i and k in P' such that (i, k) £ A' and either o~(i) < j < cr(k) or a(k) < j < <r(i). If (i, k) £ Ao, then (o~(i), cr(fc)) £ so j is dominated by cr(z') or cr(k) by the spanning order. If (i,k) £ A i or (i,k) £ A then (j,a(i)) £ E or (j,a(k)) £ E by the definition of 2 the sets. If (i, A:) £ A3, then (i, k) = (to, e, ) for some vertex u; and edge e = (u, u) that satisfies n w < j < u < v. Therefore j is adjacent to u, u, or u; by the definition of A3. Since node ei has outdegree 1 in G', it must be that e n out £ P'. Therefore v = cr(e ) £ S and, out since we already know that u = (j(e, ) = cr(A:) and w = o~(i) are in S, it follows that j is n dominated by S. If (i,k) £ A 4 , then (i,k) — (e ,w) for some vertex w and edge e = (u,v) such that out u < v < j < w. Therefore j is adjacent to u, v, or 10 by the definition of A 4 . Since node e out has indegree 1 in G', it must be that e;„ £ P'. Therefore u = cr(e,- ) £ 5* and, n since we already know that v = o~(e t) = o~(i) and w — o~(k) are in 5, it follows that j ou is dominated by S. Finally, if (i, A;) £ A 5 , then (i, A;) = (e , /;„) for some edges e = (u, u) and / = (w, x) out such that u<v<j<w<x. of A . Since node e 5 ein £ P' and / o u t oui Therefore j is adjacent to u, v, w, or x by the definition has indegree 1 and node / j n has outdegree 1 in G', it must be that £ P'. Therefore u = cr(e „) £ S and x = cr(f ) 4 out £ 5* and, since we already know that v = o~(e ) = a(i) and w = cr(/,- ) = c(k) are in S , it follows that j 1 oui is dominated by S. Theorem 4.16 n | The set of vertices corresponding to the nodes in a shortest path from s Chapter 4. Cocomparability Graphs 166 to t in G' is a minimum cardinality dominating set. P r o o f : Such a set is dominating by Lemma 4.15 and of minimum cardinality by Lemma 4.14. I Let us now examine a straightforward algorithm for constructing the d-auxiliary digraph G'. To enhance the legibility of the algorithm, we will construct a subalgorithm for each of the arc sets Ao through A$. A n implementation of this algorithm could combine the subalgorithms to capitalize on loops that are shared by more than one subalgorithm. The most straightforward of the subalgorithms is the one for Ao- It clearly executes in 0(E) time. Table 4.5: A l g o r i t h m : AO-MCDS-OCC(G) [Construct arc set A ] 0 Input: A spanning-ordered graph G = (V, E, <). Output: The arc set A (Equation 4.13) 0 1 2 3 4 A <- 0 for a l l edges e € E where e = (u, v) and u < v do A f- A U {(e return A 0 0 0 0 To construct the arcs for A\, we only need to determine which pairs dominate all vertices in between. This is certainly true for the endpoints of edges in G. Otherwise, Algorithm A 1 - M C D S - 0 C C (Table 4.6) tests if a vertex is not dominated by the pair. Step 2 calls Step 4 0(V ) 2 times and calls Step 5 0(E) times. Step 5 calls Step 6 0(V) times. Therefore Algorithm A l - M C D S - O C C runs in 0(V 2 that there are 0(V ) 2 + VE) = 0(V ) 3 time. Note arcs in A\. To construct the arcs for A 3 , we need to determine which pairs of vertices and edges dominate everything in between. Again, Algorithm A 3 - M C D S - O C C (Table 4.7) tests if a vertex is not dominated by the pair. Step 2 calls Step 3 0(E) times, which calls Step 5 Chapter 4. Co-comparability Graphs 167 Table 4.6: Algorithm: Al-MCDS-OCC(G') [Construct arc set Ay) Input: A spanning-ordered graph G = (V, E, <). Output: The arc set A (Equation 4.10) x 1 2 3 4 5 6 7 8 Ay <- 0 for all pairs of vertices u, v € V where u < v do Ay <- A i U {(tt,u)} if(u,u)g£ for all z such that u < i < v if (i,u) fc E and (i,v) fc E then Ay <- Ay\ {(u,v)} return A i 0(V) times, which calls Step 6 0(V) times. Therefore Algorithm A 3 - M C D S - O C C runs in 0(V E) 2 time. Note that there are 0{VE) arcs in A . 3 Table 4.7: Algorithm: A3-MCDS-OCC(G) [Construct arc set A ] 3 Input: A spanning-ordered graph G = (V, E, <). Output: The arc set A (Equation 4.12) 3 1 2 3 4 5 6 7 8 A <- 0 for all edges e £ E where e = («, v) and u < u do for all vertices w such that w < u < v do A <- A U { ( t o , e ) } for all vertices z such that w < i < u do if (i,iw) ^ (z',u) ^ and ( i,v)fcE then A «- A \ {(to, e >)} return A 3 3 3 in 3 3 ir 3 Algorithm A 4 - M C D S - O C C (Table 4.8) is symmetric with Algorithm A 3 - M C D S - O C C . It therefore also runs in 0(V E) 2 time, and A 4 has 0(VE) arcs. In Algorithm A 5 - M C D S - O C C (Table 4.9), Step 2 calls Step 3 0(E) times, which calls Chapter 4. Cocomparability Graphs 168 Table 4.8: Algorithm: A4-MCDS-OCC(G) [Construct arc set A ] 4 Input: A spanning-ordered graph G = (V, E, <). Output: The arc set A (Equation 4.14) 4 1 2 3 4 5 6 7 8 A f- 0 for all edges e £ E where e = (u, v) and u < v do for all vertices w such that v < w do A < - A U {(e ,u;)} for all vertices i such that v < i < w do if (i,u) £ E, (i,v) E, and (i,w) £ E then A A \ { ( e , ^)} return A 4 4 4 oui 4 4 oui 4 Step 5 0(E) times, which calls the constant-time Step 6 step 0(V) Algorithm A 5 - M C D S - 0 C C executes in 0(VE ) 2 times. Therefore time. Note that there are 0(E ) 2 arcs in A. 5 Table 4.9: Algorithm: A 5 - M C D S - 0 C C ( G ) [Construct arc set A ] 5 Input: A spanning-ordered graph G = (V, E, <). Output: The arc set A (Equation 4.15) 5 1 2 3 4 5 6 7 8 A 4-0 for all edges e £ E where e = (u, v) and u < v do for all edges f £ E where / = (w, x) and u < do A <- A U { ( e , / , • „ ) } for all vertices i such that v < i < do if (i,u) ^ E, (i,v) ^ E, then A <- A \ {(e return A 5 5 5 v <w <x out 5 5 w (i,w) £ E, and (i,x) £ E , f )} out in 5 Lemma 4.17 Algorithm Aux-MCDS-OCC (Table \.10) constructs the d-auxiliary graph in 0(VE ) time. 2 Chapter 4. Cocomparability Graphs 169 Table 4.10: Algorithm: A u x - M C D S - O C C ( G ) [d-Auxiliary Graph for Minimum Cardinality Dominating Set for spanning-Ordered Cocomparability Graphs] Input: A spanning-ordered graph G = (V, E, <). Output: The d-auxiliary digraph G' = (V, A'). 1 2 3 4 5 6 7 8 9 V <- V U Ei U E n out A <- A O - M C D S - O C C ( G ) A i f- A l - M C D S - O C C ( G ) A 4-Ar A 4-A 3 - M C D S - O C C ( G ) A 4-A 4 - M C D S - O C C ( G ) A 4-A 5 - M C D S - O C C ( G ) A ' 4-A U A i U A U A U A U A return G' = ( V , A') 0 1 2 3 4 5 0 2 3 4 5 Proof: It is straightforward to verify that the algorithm correctly constructs arc sets Ao through A . Of course, the algorithm refers to these sets for clarity only. A n implemen5 tation would just add the arcs directly to the set A'. Implement the input and output graphs as adjacency matrices. Testing if two vertices are adjacent in G, or adding an arc to G' therefore take constant time. Step 1 amounts to allocating memory for an 0((V + 2E) x (V + 2E)) matrix, and initializing it in 0(V 2 + E) 2 time. It is easy to verify that Step 7 dominates the running time of the algorithm and takes at most 0(VE ) 2 time from the discussion above. | Theorem 4.18 Algorithm MCDS-OCC finds a minimum cardinality dominating set of a spanning-ordered cocomparability graph in 0(VE ) time. 2 Proof: The algorithm is correct by Theorem 4.16. Lemma 4.17. Step 1 takes 0(VE ) 2 Step 2 can be implemented to run in 0(V' ) 2 = 0(V 2 time by + E ) time us2 ing breadth first search[CLR90], and Step 3 clearly runs in 0(V) time. Step 1 dominates the run time of the algorithm, so the theorem follows. | Chapter 4. Co-comparability Graphs 170 Table 4.11: Algorithm: MCDS-OCC(G') [Minimum Cardinality Dominating Set for spanning-Ordered Cocomparability Graphs] Input: A spanning-ordered graph G = (V, E, <). Output: A minimum cardinality dominating set of G. 1 2 G' <- MCDS-OCC-Aux(G) P ' 4— a shortest path from s to t in G'. 3 S <- {<r(v) : u G P'} ' 4 return 5 . 1 4.2.3 Total Dominating Sets Recall from the introduction (§1.3.2) that a total dominating set of a graph G = (V, E) is a subset D C V such that every vertex in V is adjacent to some vertex in D. Contrast this with an ordinary dominating set, which either contains oris adjacent to every graph vertex. The total domination problem is to find a total dominating set of minimum cardinality. This section presents an efficient algorithm for total domination in cocomparability graphs. It does this by reducing the problem to (ordinary) domination in cocomparability graphs. Given an arbitrary graph G, we begin by constructing an (undirected) auxiliary graph G' that we will refer to as a t-auxiliary graph. We will see that if G is a cocomparability graph, then so is G'. Furthermore, there is a minimum cardinality dominating set M of G' that corresponds to a minimum cardinality total dominating set of G. That is, M solves the total domination problem on G. Definition 4.19 Let G = (V, E) be an arbitrary graph. The t-auxiliary graph G' is two copies of the graph G. In addition, two vertices in different copies are adjacent if the corresponding vertices in G are adjacent. More formally, G' is defined by the following 171 Chapter 4. Cocomparability Graphs equations. G' = ( V , E') where V = E' = E UE U E V = {v : v G V } V = {u : u G V} E = E = {{u ,v ):(u,v)eE} = {(u\v ) : (u,v) e E} 1 2 1 2 E 12 V UV l 2 1 2 12 1 2 {(u , 1 1 U ):( , )eE} W 2 U 2 2 I To illustrate this definition, Figure 4.7 shows the t-auxiliary graph of the graph in Figure 4.1. For the rest of this subsection, define the significance o~(v') of a vertex in V V 1 Figure 4.7: Reducing total domination to domination. This is the t-auxiliary graph of the cocomparability graph in Figure 4.1. The vertices V are on the top, and the vertices v are on the bottom. Similarly, the edges E are on the top and the edges E are on the bottom. The edges E go between the two layers of vertices. 1 2 1 2 12 to be the corresponding vertex in V. More formally, let a : V —> V be a function that satisfies <j{y ) = cr(v ) = v for all vertices v G V. l 2 We can now make three simple observations. Note that Observations 4.21 and 4.22 can be viewed as corollaries of Observation 4.20. Chapter 4. Cocomparability Graphs 172 Observation 4.20 Every pair of vertices u',v' £ V satisfies (u',v') £ E' if and only if (a{u'),a(v')) £ E. Observation 4.21 Vertices v and v are not adjacent in G' for every v £ V. 1 2 Observation 4.22 A vertex w' £ G' is adjacent to v if and only if w' is adjacent to 1 v. That is, Adj(V,G") = Adj(u ,G") for every v £ V. 2 2 Lemma 4.23 The t-auxiliary graph of a cocomparability graph is also a cocomparability graph. Proof: Let G = (V, E) be a cocomparability graph, and let G' = (V, E') be its tauxiliary graph using the notation in Definition 4.19. If (V, <) is a spanning order of G, then the linear order ( V , -<), where u' -< v if and only if cr(u') < cr(u'), or u' = v 1 1 and v' = v for some v £ V, is a spanning order of G'. To see this, let a -< b -< c 2 be three vertices in G' such that a and c are adjacent. Then o~(a) < cr{b) < a(c), and (a(a),a(c)) £ E by Observation 4.20. Therefore, if cr(6) is equal to one of o~(a) or cr(c), then it is adjacent to the other. On the other hand, if a(b) is distinct from o~(a) and <r(c), then a(b) is also adjacent to <r(a) or <r(c) by the spanning order on G. Therefore b is adjacent to a or c by Observation 4.20. If follows from Lemma 4.3 that G' is a cocomparability graph. Suppose now that M M 1 | 1 2 C V U V is a dominating set of G ' . Then there is a subset 1 2 C V that is also a dominating set of G', and that satisfies |Af 1 < | M | . We will 1 1 see shortly (Lemma 4.27) that a(M ) is a total dominating set for G. But first, we need 1 to see how to construct M vertices from M 1 from a dominating set M 2 1 2 then lift v to v . Otherwise, v £ M 2 1 2 . We will do this by "lifting" n V into V . Let v be an arbitrary vertex in M 1 2 1 1 1 2 1 2 1 2 fl V . If v fc M 2 1 1 2 , . Since G has no isolated vertices, v must have a 1 neighbour w £ V . In this case, lift v to vertex to (any such neighbour will do). More 1 1 2 1 173 Chapter 4. Co-comparability Graphs formally, let M 1 = / ( M ) where / : V —> V is defined by the following equation. 1 2 1 v 1 if v' = v 1 iiv' = v and v £ M f(v') = I v w 1 2 1 if t>' = v , v £ M 2 (4.16) 12 1 1 2 , and (v ,™ ) £ E 1 1 1 For example, the circled vertices in Figure 4.8 form a dominating set (actually a Figure 4.8: The effect of function / on a minimum cardinality dominating set. minimum cardinality dominating set) of the graph in Figure 4.7. The arrows in Figure 4.8 show the effect of the function / . Since / maps vertices already in the set V to 1 themselves, the figure does not show arrows from (or to) these vertices. Observation 4.24 IfV € M 1 2 or v e M , then v e / ( M ) . 2 12 1 1 2 Observation 4.25 |Af 1 < | M | . 1 1 2 Proof: The observation follows since / (Equation 4.16) is a function. L e m m a 4.26 | Let G' be the t-auxiliary graph of a cocomparability graph G with no isolated vertices. If M 12 is a dominating set of G', then M = / ( M ) is a dominating l 1 2 set of G'. Proof: Let v' be an arbitrary vertex in V. vertex v' is adjacent to some vertex u' E M 1 2 Since M 1 2 is a dominating set, either (1) , or (2) v' £ M . Case 1: v' is adjacent to some vertex u' £ M 12 1 2 (see Figure 4.9). Chapter 4. Cocomparability Graphs 174 Figure 4.9: Case 1: Vertex v' must be adjacent to u G M . The circled vertex is in M . 1 1 1 2 Either u' — u or u' = u . Therefore v' is adjacent to u by Observation 4.22, and 1 2 1 u G M by Observation 4.24. It follows that v' is dominated by M . 1 1 Case 1 2.1: v' G M 1 2 and v <£ M 1 (see Figure 4.10). 12 u 1 v' = v u' = u 2 2 Figure 4.10: Case 2.1: Case 1 applies again. The circled vertices are in M 1 2 . Since v is not in M , vertex v must be adjacent to (dominated by) some vertex l u' G M 1 2 1 2 1 . Therefore v' = v is also adjacent to u' by Observation 4.22, and the previous 2 case applies. Case 2.2: v' G M 1 2 and v G M 1 1 2 (see Figure 4.11). Figure 4.11: Case 2.2: Vertex v' is adjacent to a neighbour w of u , both of which are in f(M ). The circled vertices are in M . 1 12 1 1 2 If v' — v , then we are done. Otherwise, v' = v and, by Equation 4.16, f(v') — w , 1 2 1 Chapter 4. Co-comparability Graphs where w 175 £ V is some neighbour of v . 1 1 servation 4.22. Vertex v 1 2 Therefore v' is dominated by M /K) £ / ( M ) . 1 is also adjacent to w 1 = / ( M ) since w 1 2 1 by Ob- = f(v') and | 1 2 Corollary 4.26.1 If M 12 is a minimum cardinality dominating set of a cocompara- bility graph G with no isolated vertices, then M 1 — f(M ) is a minimum cardinality 12 dominating set of G'. Proof: Immediate from the lemma and Observation 4.25. I Lemma 4.27 Let G = (V, E) be a cocomparability graph with no isolated vertices. If M 1 C V 1 is a minimum cardinality dominating set of the t-auxiliary graph G', then o ^ M ) is a minimum cardinality total dominating set of G. 1 Proof: To see that a(M ) 1 in V. is a total dominating set for G, let v be an arbitrary vertex Then v is adjacent to some vertex u 2 does not contain any vertices from V . 2 1 £ M , since M 1 1 dominates v but M 2 1 Therefore v = cr(v ) is adjacent to o-(u ) by 2 l Observation 4.20. Since <r(u ) £ cr(M ), it follows that u ( M ) is a total dominating set 1 l 1 of G. To see that a(M ) l is of minimum cardinality, let T be a minimum cardinality total dominating set of G. By definition, every vertex in V is adjacent to some vertex in T. Let T be the subset of V that corresponds to T. That is, let T = {t : t £ T } . Clearly, 1 1 every vertex in v l £ V 1 1 is adjacent to some vertex in T . 1 Now consider an arbitrary 1 vertex v £ V . This vertex v is adjacent to some vertex in T since v is adjacent to 2 2 2 1 1 some vertex in T and Adj(u , G') = Adj(u , G') by Observation 4.22. Therefore T is an 1 1 2 1 (ordinary) dominating set of G', and \<r{M )\ = \M \ < IT ] = \T\ by Corollary 4.26.1. x X 1 I Lemma 4.28 Algorithm MCTDS-OCC (Table J..2.3) prints a message stating that no total dominating set exists if and only if no total dominating set exists. Chapter 4. Cocomparability Graphs 176 Table 4.12: Algorithm: MCTDS-O.CC(G) [Minimum Cardinality Total Dominating Set in spanning-Ordered Cocomparability Graphs] Input: A spanning ordered cocomparability graph G. Output: A minimum cardinality total dominating set M of G, or a message stating that no total dominating set exists. 1 2 3 4 5 6 if G has no isolated vertices, then Construct the spanning-ordered t-auxiliary graph G'. M «- MCDS-OCC(G") M 4- {fiy) : v € M } as defined by Equation 4.16. return a(M ). else return "No total dominating set exists." 1 2 1 1 2 1 Proof: A n isolated vertex of G cannot be total dominated, therefore no total dominating set exists in this case. On the other hand, G(V) total dominates G(V) if there are no isolated vertices, hence a total dominating set exists in this case. This condition is tested in Step 1. | Theorem 4.29 Algorithm MCTDS-OCC returns a minimum cardinality total dominating set of a spanning-ordered cocomparability graph if and only if one exists in 0(VE ) time. Proof: The algorithm returns a set if and only if a minimum cardinality total dominating set exists by Lemma 4.28. The t-auxiliary graph G' constructed in Step 2 is a spanningordered graph by Lemma 4.23. Therefore the set M 1 2 constructed in Step 3 is a minimum cardinality dominating set by Theorem 4.18. Since G does not have any isolated vertices, the set M constructed in Step 4 is a minimum cardinality dominating set by Lemma 4.26. 1 Finally, t r ( M ) is a minimum cardinality total dominating set by Lemma 4.27. 1 To achieve the stated run time, represent all graphs with adjacency lists. Then Step 1 can be checked in 0(V) time. To construct the t-auxiliary graph in Step 2, begin 2 Chapter 4. Cocomparability Graphs 177 by copying the graph in 0(V + E) time. Then construct E' by examining every edge (u,v) <G E in 0(V + E) time and adding the edges (u ^ ), 1 constant time. There are 2\E\ edges in E , and 12 1 (u ,v ), and (u ,v ) in 2 2 l 2 edges in each of E and £ , for a 1 2 total of 4\E\ edges in E'. That is, G' has 0 ( £ ' ) edges, and since there are 2 | V | vertices in V , graph G" has 0(V) vertices. Therefore, Step 3 can be executed in 0(VE ) 2 time by Theorem 4.18. Finally, the output in Steps 4 and 5 can be constructed in 0(V) time by examining each vertex in V and using the first available neighbour when one is needed. Step 3 is the time critical step and accounts for the complexity of the algorithm. 4.2.4 | Weighted Independent Dominating Sets Until now, the problems in this section entailed finding minimum cardinality subgraphs. This section and the next (§4.2.5) generalizes this type of optimization problem by finding minimum weight subgraphs in graphs with weighted vertices. The weighted versions of the problems studied so far, namely minimum weight connected dominating set, minimum weight dominating set, and minimum weight total dominating set, all on cocomparability graphs, have been shown to be NP-complete by Maw Shang Chang [Cha94]. This section presents an efficient polynomial-time algorithm for finding a minimum weight independent dominating set in a weighted cocomparability graph. It does so by reducing the problem to finding a minimum weight maximal clique in a comparability 1 graph. It then exhibits a new efficient algorithm for finding a minimum weight maximal clique in a comparability graph. Could we not negate all weights and find a maximum weight clique? Yes, certainly, but are standard maximum weight clique algorithms, for example the one in [Gol80], applicable here? They are not, because they are content to find a maximum weight clique, not necessarily a maximal one. 1 Recall that a clique is a complete subgraph. A maximum weight clique is also a maximal 178 Chapter 4. Cocomparability Graphs clique if its weights are positive. However, a clique found by such an algorithm would not contain any vertices with negative weights, even though such a clique might not be maximal. This is because the weight of any subgraph can be increased by removing any negative weight vertices. On the other hand, the new algorithm presented in this section can also find a maximum weight maximal clique if the weights are first negated. Let us begin by exploring some relevant properties of independent dominating sets. Observation 4.30 An independent set is a dominating set if and only if it is a maximal independent set. Proof: Let I be an independent set. If I is a dominating set, then every vertex not in I is adjacent to some vertex in I. Therefore, I is a maximal independent set. Conversely, if I is a maximal independent set, every vertex not in I must be adjacent to some vertex of I, and therefore is dominated by I. vertices in 7, it is a dominating set. Since I trivially dominates all | Observation 4.31 A set is independent in a graph if and only if it is completely connected in the complement of the graph, and a set is maximal independent in a graph if and only if it is a maximal clique in the complement. The two observations above imply that we can find independent dominating sets by looking for maximal cliques in the complement. The complement of a cocomparability graph is, of course, a comparability graph. The next lemma shows what maximal cliques look like in comparability graphs. It requires the following definition from Section 1.3.1 (where it is phrased more generally in terms of relations). Definition 4.32 A transitive reduction of a directed graph G is any directed graph, with Chapter 4. Cocomparability Graphs 179 the least number of edges, whose transitive closure is isomorphic to the transitive closure of G. | Under this most general definition, a transitive reduction need not even be a subgraph of G. If, however, G is finite and acyclic, then the transitive reduction is a unique subgraph and may be obtained by systematically removing all transitively implied edges from G [AGU72]. Therefore the notion of the transitive reduction of a transitively oriented comparability graph is well defined. Lemma 4.33 The maximal cliques in a comparability graph are exactly the maximal paths in the transitive reduction of any transitive orientation of the graph. Proof: Let G = (V, E) be a comparability graph, and let T = (V, A) be any transitive orientation of G. Let the linear order (V, <) be any linear extension of T. Let C be any maximal clique of the comparability graph G. To see that C is a maximal (directed) path in the transitive reduction of T, let u and v be two vertices in C such that u < v. Then (u, v) G A. Therefore the vertices of C , taken in their linear order, form a path in T. Furthermore, every arc (u,v) of this path must be in the transitive reduction of T. If it were not, there would be a path from u to v in T with at least one intermediate vertex, w. By the linear order, u < w < v, so that w fc C. But by the transitivity of T, w would be adjacent in G to every vertex in C. That is, C U {w} would be completely connected in G, contradicting the maximality of C. Finally, every path in T, and therefore in the transitive reduction also, is a completely connected subgraph of G by transitivity. Therefore C is a maximal path in T since any superpath of C would contradict the maximality of C in G. Conversely, let P = (pi,... ,p ) be a maximal path in the transitive reduction of T. k Then P is a clique in G by transitivity, and pi < p < • • • < Pk- Suppose that P is not a 2 maximal clique in G. Then there exists a vertex v G V \ P that is adjacent in G to every Chapter 4. Cocomparability Graphs 180 vertex in P . If v < p i , then there is an arc from v to pi in T. Therefore there is a path from v to pi in the transitive reduction of T. This contradicts the assumption that P is a maximal path. If v > Pk, then a similar contradiction arises. Finally, if pi < v < p , k then there are two vertices u and w in P such that u < v < w. Therefore there are arcs from u to v, and from v to w, in T. But this contradicts the assumption that (u,w) is an arc in the transitive reduction of T. | These lemmas have set the stage for the polynomial time algorithm below. They show that independent dominating sets in cocomparability graphs are precisely the paths from minimal elements to maximal elements in the transitive reduction of a transitive orientation of the complement of the graph. To simplify the handling of special cases , augment the transitively oriented graph 2 with two sentinel vertices, s = 0 and t = \V\ + 1, that have 0 weight. Add an arc from s to every other vertex (including £), and add an arc to t from every other vertex (including s). Therefore 5 is the only minimal element and t is the only maximal element. Note that s and t must appear in every maximal clique C and that C \ {s,t} is a maximal clique in the unaugmented graph. We want only the minimum weight maximal clique, that is, the minimum weight path from s to t. The details of the algorithm appear in Table 4.2.4. Theorem 4.34 Algorithm MWMC-C finds a minimum weight maximal clique in a weighted comparability graph G = (V, E,w) in 0(M(V)) time. Proof: Correctness follows from Lemma 4.33 and the discussion concerning augmenting the digraph. Step 1 runs in 0(V ) 2 time [Spi85], and Step 2 runs in 0(V) time. Since the augmented We can achieve the same effect by augmenting the transitive reduction R with s and t. In this case we would add arcs only from s to minimal elements of R and from maximal elements of R to t. Instead, we have chosen to let the transitive reduction step find the minimal and maximal elements for us. 2 Chapter 4. Cocomparability Graphs 181 Table 4.13: Algorithm: M W M C - C ( G ) [Minimum Weight Maximal Clique for Comparability Graphs] Input: A weighted comparability graph G. Output: A minimum weight maximal clique in G. T 4— a transitive orientation of G. augment T with 5 = 0 and t = | V | + 1. R 4— the transitive reduction of T. C f- the least weight path from s to t in R. return C \ {s, t}. 1 2 3 4 5 T is already transitively closed, the transitively implied edges are given by T . We can 2 find this by creating the adjacency matrix for T and multiplying this by itself in 0(M(V)) time. Then R = T\T 2 can be computed in 0(V ) time, and so Step 3 runs in 0(M(V)) 2 time . Let the weight of an arc (u,v) S R be w((u,v)) = w(u). Then the edge weight of 3 a path from 5 to t is equal to its vertex weight since w(s) = w(t) = 0. Therefore Step 4 can be implemented to run in 0(V + E) time since R is a directed acyclic graph [CLR90]. The entire algorithm therefore runs in 0(M(V)) time. | We are now ready to construct algorithm M W I D S - C C for finding an optimal independent dominating set in a cocomparability graph, as shown in Table 4.14. Theorem 4.35 Algorithm MWIDS-CC finds a minimum weight independent dominating set in a weighted cocomparability graph G = (V,E,w) in 0(M(V)) time. Proof: Correctness follows from Observation 4.30, Observation 4.31, and Theorem 4.34. Step 1 runs in 0(V ) time, and Step 2 runs in 0(M(V)) time (Theorem 4.34). 2 | The transitive reduction of an acyclic digraph D = (V, A) can actually be computed in O(kR) = 0(VR) = 0(V A) time [Sim88], where k is the number of paths in a path decomposition of D. Since R is not reflected in the output of Algorithm MWMC-C, this proof uses the 0(M(V)) = 0{V ) bound. 3 2376 Chapter 4. Cocomparability Graphs 182 Table 4.14: Algorithm: MWIDS-CC(G) [Minimum Weight Independent Dominating Set for Cocomparability Graphs] Input: A weighted cocomparability graph G. Output: A minimum weight independent dominating set of G. 1 2 3 G <— the complement of G. I <- M W M C - G ( G ) return /. 4.2.5 Weighted Steiner Sets This section describes a polynomial time algorithm for finding a minimum weight Steiner set (MWSS) in a cocomparability graph. This algorithm can be implemented to run in 0(V log V + E) time on a vertex-weighted spanning-ordered cocomparability graph G = (V, E, <, w). The algorithm terminates in 0(V ) time even if a spanning order is 2 not available. Furthermore, given an arbitrary graph, the algorithm will either find a minimum weight Steiner set, or it will be print a message stating that the graph is not a cocomparability graph. That is, the algorithm does not need to recognize cocomparability graphs, a step that would add 0(M(V)) to the run-time complexity. These results simplify and generalize the permutation graph algorithms obtained by Colbourn and Stewart [CS90a] (0(V ) time) and by Arvind and Rangan [AR92] 3 ( 0 ( V l o g V + E) time). They also extend an 0(V + E) algorithm for minimum cardinality Steiner sets in cocomparability graphs due to Colbourn and Lubiw (described in [KS93]). Definition 4.36 Let G = (V, E, w) be a graph with nonnegatively weighted vertices. Let R C V be a "required" set of vertices in G. A Steiner set (of G and R) is a set S of vertices such that (1) S C V \ R and (2) the subgraph G(S U R) induced in G by S U R Chapter 4. Co-comparability Graphs 183 is connected. The weight w(S) of a set of vertices S is defined, as usual, to be the sum of the weights of its elements. Assume without loss of generality that w(v) = 0 for all vertices v £ R. The weighted Steiner set problem is to find a minimum weight Steiner set in such a vertex weighted graph. Finally, if G is linearly ordered, let s = min R be the least point in R and t = max R be the greatest point in R. L e m m a 4.37 | Let P be a path from s to t in a spanning-ordered cocomparability graph. Then S = P \ R is a Steiner set. Proof: Since S C V \ R, we only need to show that S + R is connected. First note that S + R = P U R. Since P is connected, it suffices to show that every vertex v £ R \ P is adjacent to some vertex in P. This follows from Lemma 4.7. L e m m a 4.38 | Let G be an arbitrary weighted graph G = (V,E,w) and R C V be a required set. Let P be a least weight path from some vertex u £ R to some vertex v £ R. If S is a Steiner set of G and R, and S C P, then S is a minimum weight Steiner set. Proof: Let S' be a minimum weight Steiner set of G and R. Since the subgraph induced by S' U R is connected, there is a path P' from u to v in this subgraph, and w(P') < w(S' U R). Since P is a least weight path, w(P) < w(P'). Now w(S' U R) = w(S') since w(v) = 0 if v £ R. Finally, w(S) < w(P) since S C P. It follows that w(S) < w(P) < w(P') < w(S' U R) = w(S'). That is, S is also a minimum weight Steiner set. T h e o r e m 4.39 | Let P be a least weight path from s to t in a spanning-ordered cocom- parability graph G. Then S = P \ R is a minimum weight Steiner set. Proof: The set S is a Steiner set by Lemma 4.37 and therefore a minimum weight Steiner set by Lemma 4.38. I One way to use this result for an arbitrary graph is to first check if G is a cocomparability graph, then construct a spanning order, and find a least weight path. The best Chapter 4. Cocomparability Graphs 184 known upper bound for recognizing an order n cocomparability graph is the same as that for n x n matrix multiplication [Spi85]. Since this bound is currently 0(n ' ) 2 376 [CW87], recognition is the limiting step in this approach. Spinrad [Spi85] shows that the complexity of recognizing comparability graphs and transitive digraphs is the same. Therefore, 4 we are no better off by assuming a linearly ordered graph as input, since recognizing a spanning-ordered graph would entail recognizing the transitively oriented complement. Fortunately, there is another approach, which does not require recognition. Table 4.15: Algorithm: M W S S - O C C ( G , R) [Minimum Weight Steiner Set for spanning-Ordered Cocomparability Graphs] Input: A linearly-ordered vertex-weighted graph G = (V, E,<,w) and a required set of vertices R C V. Output: A minimum weight Steiner set S, or a message stating that no Steiner set exists, or a message stating that G is not a spanning-ordered cocomparability graph. 1 2 3 4 5 6 7 8 9 10 11 if R is empty, then return the empty set halt. if R is not a subset of a connected component of G, then return "No Steiner set exists." halt. F f - a least weight path from min R to max R in G. S <- P\R if the subgraph induced by S + R is connected, then return S else return " G is not a spanning-ordered cocomparability graph." Lemma 4.40 Given a linearly-ordered graph G and required vertices R, Algorithm More precisely, if transitive digraphs can be recognized in 0(f(V)) time, then comparability graphs (and therefore also cocomparability graphs) can be recognized in 0(f(V) + V ) time. Conversely, if comparability graphs can be recognized in 0(f(n)) time, then transitive digraphs can be recognized in 0(f(n) + E) time. 4 2 Chapter 4. Cocomparability Graphs MWSS-OCC 185 (Table 4-2.5) prints a message stating that no Steiner set exists if and only if no Steiner set exists. Proof: A Steiner set exists if and only if the required vertices R can be augmented to induce a connected subgraph. This is true if and only if the vertices of R all lie in the same connected component of G. This condition is checked in Step 4. L e m m a 4.41 MWSS-OCC | Given a linearly-ordered graph G and required vertices R, if Algorithm returns a set S, then S is a minimum weight Steiner set. Proof: Suppose the algorithm returns a set S. This can only happen in Steps 2 and 10. If S is returned by Step 2, then R is empty. A minimum weight Steiner set can therefore also be empty since all vertex weights are nonnegative. If S is returned by Step 10, then the subgraph induced by 5" + R is connected. So S is a Steiner set by definition, and therefore a minimum weight Steiner set by Lemma 4.38. I T h e o r e m 4.42 Given a spanning-ordered cocomparability graph G and required set R CV, Algorithm MWSS-OCC returns a minimum weight Steiner set of G and R if and only if it exists. Proof: If a minimum weight Steiner set does not exist, then no Steiner set exists since the graph is finite. By Lemma 4.40, a message is printed and the algorithm halts at Step 3. Suppose, on the other hand, that such a set does exist. If R is empty, a suitable minimum weight Steiner set, the empty set, is returned by Step 2. Otherwise, the set S = P\R constructed in Step 8 is a minimum weight Steiner set by Theorem 4.39. That is, the subgraph induced by S + R is connected. So S is correctly returned by Step 10. I Chapter 4. Cocomparability Graphs 186 Theorem 4.43 Given any linearly-ordered graph G = (V, E, <, w), Algorithm MWSSOCC runs in 0(V log V + E) time. Proof: Use linked lists to represent all sets, and represent the graph as an adjacencylist. Then Step 1 can be executed in constant time. Step 4 can be implemented by marking all vertices in the same connected component as the first vertex in R using a single phase of depth first search in 0(E) time. It then suffices to check, in O(R) time, that all vertices in R are marked. Step 4 therefore executes in 0(V + E) time. The extreme vertices mini? and max 7? can easily be found in O(R) = 0(V) time. Step 7 uses Dijkstra's algorithm with a Fibonacci heap priority queue [CLR90] to find a least weight path between min R and max R in 0(V log V + E) time. Dijkstra's algorithm expects an edge-weighted digraph as input. So, implicitly set the weight of a directed edge to be w((u,v)) = w(u). Since w(m'mR) = w(maxR) = 0, the edge weight of a simple path from mini? to maxi? is equal to its vertex weight. Step 8, setting S = P\R, can be computed in 0(P + R) = 0(V) time. For example, the algorithm could mark all vertices in R and let S be the set of unmarked vertices in P. Finally, Step 9 represents the induced subgraph in 0(S + R) = 0(V) time by marking the inducing vertices in G. It then tests the induced subgraph for connectivity in 0(V+E) time by depth first searching the marked vertices. | Although Algorithm M W S S - O C C may work—find minimum weight Steiner sets— for some arbitrary linearly-ordered graphs and sets of required vertices, the class of graphs for which it works for all sets of required vertices is exactly the spanning-ordered cocomparability graphs. This is restated by the following lemma. Chapter 4. Cocomparability Graphs Lemma 4 . 4 4 187 For every linearly-ordered graph that is not a spanning-ordered cocom- parability graph, there exists a required set such that Algorithm MWSS-OCC prints the message stating that the graph is not a spanning-ordered cocomparability graph. Proof: Let G = (V, E, <,w) be a linearly-ordered graph that is not a spanning-ordered graph. Then there exists three vertices a < b < c that violate the spanning order, that is, (a,c) £ E but (a, b) fc E and (6,c) fc E. Let R = {a,o,c}. Algorithm M W S S - O C C will find the least weight path P = (min R, max R) = (a, b) in Step 7, and it will construct the empty set S in Step 8. But the subgraph induced by S + R = R is not connected since b is not adjacent to either a or c. Hence the message will be printed in Step 11. | We now have enough tools to find a minimum weight Steiner set in a cocomparability graph. Again, the input to the algorithm will be an arbitrary graph; the algorithm does not require a recognition step. Table 4.16: Algorithm: M W S S - C C ( G , R) [Minimum Weight Steiner Set for Cocomparability Graphs] Input: A weighted graph G = (V, E, w) and a required set of vertices Output: A minimum weight Steiner set 5", or a message stating that no Steiner set exists, or a message stating that G is not a cocomparability graph. 1 2 RC.V. G <- OCC(G) return M W S S - O C C ( G , R) Theorem 4 . 4 5 Given a weighted graph G and a required set of vertices R, Algorithm MWSS-CC (Table 4-2.5) computes a minimum weight Steiner set, or prints a message stating that no Steiner set exists, or prints a message stating that G is not a cocomparability graph, in 0(V ) 2 time. Chapter 4. Cocomparability Graphs 188 Proof: By Theorem 4.5, Step 1 either returns a linearly-ordered graph, or correctly prints a message stating that G is not a cocomparability graph. If Step 2 returns a set S, then S is a minimum weight Steiner set by Lemma 4.41. If it prints a message stating that no Steiner set exists, then no Steiner set exists by Lemma 4.40. Finally, if it prints a message stating that G is not a spanning-ordered cocomparability graph, then G is also not a cocomparability graph for, if it were, it would have been spanning-ordered by Step 1. Step 1 takes 0(V ) 2 Theorem 4.43. 4.2.6 time by Theorem 4.5, and Step 2 takes 0(V\ogV + E) time by I Applications We can use the algorithms for spanning-ordered graphs to solve the corresponding problems for permutation graphs, interval graphs, and indifference graphs, given permutation, interval, or indifference realizations of the graphs. These graphs are all cocomparability graphs, and as shown here, a spanning order can easily be extracted from their realizations. Theorem 4.46 All spanning-ordered cocomparability graph algorithms work without change for permutation graphs given a permutation realization linearly ordered by vertex label. Proof: Let G = (V, E) be a permutation graph, and let the labelling of the vertices and 7T be a permutation realization. That is, n is a permutation of { 1 , 2 , . . . , ra} such that (u,v) 6 E if and only if [u — i>)(7r (u) — 7T (u)) < 0. Then the vertex labelling is a _1 -1 spanning order. To see this, let u < v < w be three vertices such that u and w are adjacent in G. It follows that (u — ti>)(7r (w) — 7r (io)) < 0, which implies that 7 r ( u ) > _1 -1 _1 -IT~ (W) 1 since Chapter 4. Cocomparability Graphs 189 u < w. Either 7r (i>) < 7r (u) or 7 r ( u ) > 7 r ( u ) . If 7r (u) < 7r (u), then (u,v) £ _E -1 _1 -1 _1 _1 _1 since u < v. Otherwise, 7r (u) > 7 r ( u ) and 7r (u) > ir~ (w) since (tf,u;) € _1 _1 _1 1 Therefore 7r (u) > 7r (u;) so that (v,w) £ E. That is, u and u are adjacent, or v and _1 _1 u; are adjacent. | T h e o r e m 4.47 All spanning-ordered cocomparability graph algorithms work without change for interval graphs given a set of intervals in nondecreasing order of left endpoint. P r o o f : Such a linear ordering of intervals is a spanning order. Let u < v < w be three intervals such that u and w are adjacent. Then the left endpoint of w must be to the left of the right endpoint of u. Therefore the left endpoint of v lies between the left endpoint of u and the right endpoint of u. That is, u and v are adjacent. | T h e o r e m 4.48 All spanning-ordered cocomparability graph algorithms work without change for T-strip graphs, given a set of points in order of nondecreasing x-coordinate, for all r 6 [ 0 , 7 3 / 2 ] . P r o o f : Such a linear ordering of points is a spanning order. Let / : V —> { 0 , r } be a strip realization. Let u < v < w be three points such that u and w are adjacent. Then by the definition of r-strip graphs, Xf(w) — xj(u) < 1. This implies that either l( ) x v ~ f( ) x u < 1/2 or xj(w) — xj(v) < 1/2. If the former, then \\f(v)-f(u)\\ 2 = (x (v)-x (u)Y-r(y (v)-y (u)Y f < 1/4+ r < l/4 + (V3/2) = 1. f f f 2 2 That is, u and v are adjacent. On the other hand, if Xf(w) — xj{y) < 1/2, then v and w are adjacent. | Chapter 4. Co-comparability Graphs 190 Corollary 4.48.1 All spanning-ordered cocomparability graph algorithms work without change for indifference graphs given a set of points in nondecreasing order. Proof: Indifference graphs are 0-strip graphs. 4.3 | Transitive Orientation, Implication Classes, and D o m i n a t i n g Paths This section explores the possible transitive orientations for the nonedges of cocomparability graphs. Chapter 5 and Chapter 6 use the transitive orientations of the complements of r-strip graphs and two-level graphs in characterizing these classes of graphs. For example, Chapter 6 uses the results of this section to show that two-level graphs have essentially one such orientation that is compatible with a given assignment of y-coordinates for the vertices. Subsection 4.3.1 establishes some basic properties of transitive orientations in cocomparability graphs. In particular, it shows how the orientations of some nonedges "force" the orientation of others. With this background, Subsection ,4.3.2 then studies cocomparability graphs that have induced dominating paths with four or more vertices. 4.3.1 Definitions and Basic Properties The following notation follows that of Golumbic ([Gol80] pages 105-148), where it is used for comparability graphs. Since r-strip graphs are cocomparability graphs, this section modifies Golumbic's notation for the complement of comparability graphs. Let G = (V, E) be an undirected graph. Define the complementary arcs (nonedges) E to be the set of distinct ordered pairs not in E, that is, E = {(u,v) : M / D and (u,v) £ E}. Definition 4.49 Write (a, 6)T(c, d), and say that arc (a, 6) directly forces arc (c, cf), if 191 Chapter 4. Cocomparability Graphs 1. a = c and (6, d) E, or 2. b = d and (a, c) ^ That is, T is a binary relation on E. Say that (a,b) forces (c,d), and write (a,b)T*(c,d), if there exists a sequence of arcs (a forcing chain of length k > 0) such that (a, b) = (a ,b )T(a ,b )T • • • T(a ,b ) = (c,d). 0 0 1 That is, T* is the transitive closure of T. 1 k k | Note that T is reflexive and symmetric. Note also that (a,6)T(c, d) if and only if (b,a)T(d,c). The following lemma explains the intent of these definitions. Lemma 4.50 Let G = (V, E) be a cocomparability graph and G = (V, E) be a transitive orientation of G. If(a,b) forces (c,d), then (a, b) £ E if and only if (c, of) £ E. Proof: The lemma follows by induction on the length k of the forcing chain. The base case k = 0 is trivial. For the inductive case, consider the forcing chain (a, b) - (a ,6 )r(ai, b^T • • • T(a -i, b _ )T(a , b ) = (c, d), 0 0 k k and assume (a ,b ) £ E if and only if (a -i,b _i) 0 0 k either a _i = a and (b -i,b ) fc k and (b -i,b ) k k k <£ E, or k 1 k £ E. k k Since = b and (a _i,a ) k k k (a ^i,b -i)T(a ,b ), k k k £ E. If a _ k x k = a £ E, then (0^-1,6^-1) £ Z? if and only if (a ,b ) £ E. For otherwise, k transitivity of E implies (b -i,b ) £ E or k £ Z2, and therefore b ) £ Z?; see Figure 4.12. Similarly, if b _i = b and ( a ^ - i , ^ ) ^ Z2, then (a -i,b -i) £ Z? if and only if (a ,b ) £ Z£. It follows that (ao,&o) € Z? if and only if (a ,b ) EE. | k k k k k k k k k k k k Note that V* is an equivalence relation, i.e., reflexive, symmetric, and transitive. It therefore partitions E into equivalence classes that we refer to as implication classes. Let [e] denote the implication class generated by e £ E. The following theorems will be useful later, when orienting two-level graphs in Chapter 6. Chapter 4. Cocomparability Graphs 192 Figure 4.12: (a,k-i,bk-i) £ E if and only if (a^,^) £ E. T h e o r e m 4.51 ([Gol80], page 107) Let A be an implication class of [the complementary arcs of] an undirected graph G. If G has a transitive orientation F, then either F fl (A U A~ ) = A or F n (A U A' ) l 1 and, in either case, A 0 A = A' 1 - 1 = 0. T h e o r e m 4.52 ([Gol80], page 122) Let G = (V, E) be a graph. Then G is a cocomparability graph if and only if [e] fl [ e ] = 0 for all e £ E. _1 To illustrate Theorem 4.52 in action, let us reprove Theorem 4.6 (from the introduction to this chapter). A n examination of both proofs will also associate the notion of forcing chains with the notion of spanning order. T h e o r e m 4.6 ( § 4 . 1 ) Cocomparability graphs do not have induced cycles with five or more edges. Proof: Let (u v ,..., v , Vy) be an induced cycle in a graph G, where n > 5, as shown 1? 2 n in Figure 4.13. Then (vy,vs) £ E and (v ,vy) £ [(^1,^3)], as demonstrated by the forcing 3 chain (vy,V )T(vy,V )r 3 4 . . . T(vy , V _y ) Y(v , V _y)T(v , V _y)r(v , Therefore [(^1,^3)] H [ ( ^ I , ^ ) ] Theorem 4.52. | n -1 2 n 2 n 2 V )r(v , n 3 V )r(v , n 3 Vy). is not empty, and G is not a cocomparability graph by Chapter 4. Cocomparability Graphs 193 Figure 4.13: A n induced cycle on n > 5 vertices. The arrows show that (vi, Vs)T*(v , 3 4.3.2 Vi). Transitive Orientation and Dominating Paths When there is a long dominating path in a graph, every nonedge either has its orientation forced by the nonedge joining the path's endpoints, or belongs to a nearly-oriented square or claw. Recall that a path is chordless if it is simple and if its vertices are adjacent in the graph only if they are adjacent in the path. For example, consider the connected T-strip graph (0 < T < y/3/2) generated by some set of points in a strip. A shortest path from the leftmost point to the rightmost point in the strip is chordless, otherwise there would be a shorter path. Furthermore, if the leftmost and rightmost points are more than three Euclidean units apart, then the path has at least three edges (and at least four vertices). The complementary arc between the endpoints of a chordless path force all other complementary arcs with endpoints on the path, as shown by the following lemma. This easy lemma will be so useful to us that we will often use it without reference. Lemma 4.53 (The Path Lemma) If (s = po,Pi, • • • ,Pk = t) is a chordless path in an arbitrary graph, then (s,t) forces (pi,Pj) whenever i < j. Proof: Since the pi are distinct and adjacent only to their neighbours in the path, there Chapter 4. Cocomparability Graphs 194 is a sequence of arcs (M) = (s,p )T(s,p - )r---T(s,p )r(s,pj) k k 1 j+1 1 so that (s,t) forces (s,pj), as shown in Figure 4.14. There is also a sequence of arcs (S,PJ) = (/^,Pi)r(pi,pj)r---r(p,-_ ,p )r(p,-,p ), 1 j j so that (s,pj) forces (pi,Pj). The lemma follows since T* is transitive. S = Po o>- ! HD | t = Pk Figure 4.14: The endpoints of a chordless path force the chords in the complement. Definition 4.54 A colour class of a graph G is the symmetric closure of an implication class. That is, if [a] is an implication class of G = (V, E), where a G E, then [a] = [a]U[a]" is a colour class. 1 | The following theorem relates colour classes to cocomparability graphs. Theorem 4.55 ([Gol80], page 109) Each [undirected subgraph induced by a] colour class of a graph G either has exactly two transitive orientations, one being the reversal of the other, or has no transitive orientation. If in G there is a colour class having no transitive orientation, then G fails to be a cocomparability graph. Chapter 4. Co-comparability Graphs 195 It is sometimes the case that a graph has only one colour class. If such a graph is a cocomparability graph, then it is said to be uniquely complement orientable . This section 5 deals with graphs that are not so strongly constrained. We will see (Theorem 4.57) that if a graph contains a sufficiently long chordless dominating path, then every complementary arc is either forced or captured—trapped in a small, otherwise forced subgraph. That is, the graph has an implication class such that every other arc is captured by it. The following definition is more precise. Definition 4.56 Let G = (V,E) be a graph, and let (s,t) be an arc in its complement G = (V, E). Say that (s, t) captures (it, v) if (it, v) G E is part of one of the three induced subgraphs in Figure 4.15, where the directed nonedges are forced by (s,t). v | V .Q Figure 4.15: (s,t) captures (u,v). Theorem 4.57 (The Capture Theorem) Let G = (V,E) be a connected graph, and let P = ( s , . . . ,t) be a chordless dominating path in G. If P has at least four vertices, then for all (u,v) G E, either (s,t) forces (u,v); (s,t) forces (v,u); or (s,t) captures (u,v). Golumbic [Gol80] would refer to the complement, which is a comparability graph, as uniquely parI have chosen not to use this term since it is easily confused with the spanning order, which is a linear order. 5 tially orderable. Chapter 4. Cocomparability Graphs 196 Proof: Linearly order the vertices in P according to their distance from s (so that s is the least vertex and t the greatest). Let it' be the least vertex in P that dominates it, as shown in Figure 4.16. It may be that it' = it, but in any event (it, it') ^ E. u v Figure 4.16: Definition of it' and v'. Assume without loss of generality that v is not dominated by any vertex in P less than u' (otherwise swap labels it and v and recompute it'). Let v' be the greatest vertex in P that dominates v. Note that v' is not less than it'. Again, it may be that v' = v, but in any event (v,v') (fc E. However, u ^ v', since (it,i>) £ E but (it, it') ^ E. Similarly, v ^ it'. The definitions and assumptions above also pertain to Lemmas 4.58 through 4.61. There are three alternatives: (it', v') £ E, (u', v') £ E, or u' = v'. The following three lemmas prove the theorem: if (it', u') £ E, then Lemma 4.58 applies; if (it', i/) £ E, then Lemma 4.60 applies; and if v! = v', then Lemma 4.61 applies. | Chapter 4. Cocomparability Graphs 197 L e m m a 4.58 Let G = (V, E) be a connected graph, and let P = (s,..., i) be a chordless dominating path in G. If P has at least four vertices, then for all (u, v) G E for which (u',v') G E, either (s,t) forces (u,v), or (s,t) captures (u,v). Proof: Case 1: (u',v) G E. Then (s, t)F*(u', v')T(u', v)T(u, v), so that (s,t) forces (u,v). o• s u v 0 •59 - 6"- o u' Case 2: (u,v') G E. Then (s, t)T*(u', v')F(u, v')T(u, v), so again, (s,t) forces (u,v). u 0. o 5 v •O 6 t u Case 3: (u',v) £ E and (u,v') <£ E. Then since (u,v) G E, u' ^ u and v' ^ v. Therefore {u,v,u\ v'} induces a square in G, and (s,t) captures (u,v). u o s I v Chapter 4. Cocomparability Graphs 198 Lemma 4 . 5 9 Let G = (V, E) be a connected graph, and let P = ( s , . . . , t) be a chordless dominating path in G. If P has at least four vertices, then for all (u,v) G E for which (u',v') G E and u' = s, either (s,t) forces (u,v); (s,t) forces (v,u); or (s,t) captures (u,v). Proof: Since u' = s and P has at least four vertices, P — (s — u',v',v",v"',. . . ,t). Let us proceed by case. Case 1: (u,v") <£E. In this case, (s,t) forces (v,u) since (s,t)T*(v',v"')T(v,v'")T(v,v")T(v,u). Case 2 : (u,v") G E and (u,v')fcE. Then {v',u,v,v"} induces a claw in G. Furthermore, (s, t)F*(u', v")V(u, v") and (s,t)r*(v',v"')T(v,v'")T(v,v"), so (s,t) captures (u,v). U V Chapter 4. Cocomparability Graphs 199 Case 3: (u,v") G E and (u,v') G £. Here, (s,t) forces (u,u) since (s, t)V*(u', v")T(u, u")r(u, v')F(u, v) u v Cy. *Q 3> -o • u •o I C o r o l l a r y 4.59.1 Let G = (V, E) be a connected graph, and let P = (s,...,t) be a maximum dominating path in G. If P has at least four vertices, then for all (u,v) G E for which (u',v') G E and v' = t, either (s,t) forces (u,v); (s,t) forces (v,u); or (s,t) captures (u, v). Proof: The lemma applies if we reverse path P , swap labels s and t, and swap labels u and v. | L e m m a 4.60 Let G = (V, E) be a connected graph, and let P — (s,..., t) be a chordless dominating path in G. If P has at least four vertices, then for all (u, v) G E for which (u',v') G E, either (s,t) forces (u,v); (s,t) forces (v,u); or (s,t) captures (u,v). Proof: If u' = 5 or v' = t, then Lemma 4.59 or its corollary applies, and we are done. So assume P = (s,...,it",u', v', v",... ,t). Note that (u", v) G E since v is not dominated by any vertex less than u'. Case 1: (u',v) G E. Here (s,t) forces (u,v) since (s,t)T*(u",v')r(u",v)T(u',v)T(u,v). U V 0 o Chapter 4. Cocomparability Graphs 200 Case 2 : (u', v)fcE~and (u, v') fc E. It cannot be that v! = u since (u,v) £ E, but (it', u) fc E. Therefore {u',u", u,v} induces a claw in G. Furthermore, (s,t)T*(u",v')T(u",v), and (s,t)T*(u",v')T(u",u). Therefore, (s,t) captures (u,u). u v Case 3: (u',v)fcE, (u,v') € E, and (u,v") € E. Again, (s,t) forces (u,v) since u o (s,t)T*(u',v")T(u,v")r(u,v')T(u,v). v o o Case 4: (u',v)fcE, (u,v ) e E, and (u,v")fcE. f Here, (s,t) forces (v,u) since o s (s,t)T*(u',v")T(v,v")r(v,u). u v o u" I Lemma 4.61 Let G = (V, E) be a connected graph, and let P — (s,... , i ) be a chordless dominating path in G. If P has at least four vertices, then for all (u,v) £ E for which u' = v', either (s,t) forces (u,v); (s,t) forces (v,u); or (s,t) captures (u,v). Chapter 4. Cocomparability Graphs 201 Proof: Since P has at least four vertices, either u' is at least two edges from 5 in P , or v' is at least two edges from t. We can assume the latter, since the claim for the other possibility follows from symmetry. Again, let us proceed by case. Case 1: (u, v") £ E. Here (s, t)T*(v', v'")T(v, v'")T(v, v")T(v, u), so (s,t) forces (u,u). U o s V o u Case 2 : (u,v") E E and (u,v"') <£ E. Again, (s,t) forces (v,u) since (s,t)T*(v',v"')r(v,v'")T(v,u). u o s u o Case 3 : (u,v") G E and (u,v"') G E. Clearly, u 7^ u' since (u,v) G Z? but (u,u') (fc E. Similarly, v ^ v'. Therefore, \u' = v',u,v,v"} induces a claw in G. Furthermore, (5, t)T*(v', v'")T(u, v"')Y(u, v") and (s,t)r*(v',v'")V(v,v'")T(y,v"). Therefore (s,<) captures (u,u). o s I Chapter 4. Cocomparability Graphs 4.3.3 Implications for Cocomparability 202 Graphs Let G = (V, E) be a connected cocomparability graph, and let G = (V, A) be any transitive orientation of E. If (po,Pi, • • • ,Pk) is a shortest path in G from a source p in 0 G to a sink p in G, then P is dominating. For, if v is any undominated vertex, then k (po, v)T(pi,v)T • • • T(pk,v). So either po is not a source or p is not a sink. Furthermore, k such a path is chordless, simply because it is a shortest path. This argument establishes that every connected cocomparability graph has a chordless dominating path. It is instructive to see that this result also follows from the spanning order characterization of cocomparability graphs. A connected cocomparability graph has a spanning order by Theorem 4.3. Since the graph is connected, there is a shortest path from its least vertex to its greatest vertex. This path is dominating by Lemma 4.7. Chapter 5 Strip Graphs Recall from Definition 1.3 that a graph G = (V, E) is a T-strip graph if there is a function (a r-strip realization) / : V —> R x [0, r] such that (u, v) € E if and only if ||/(u) — /(t>)|| < 1. A graph is a strip graph if it is a -\/3/2-strip graph. Recall that every \/3/2-strip graph is a cocomparability graph (Theorem 3.7) but that for every r > \/3/2 there is a r-strip graph that is not a cocomparability graph (Theorem 3.8). In this chapter, we will see how algorithms can exploit a strip-realization for strip graphs. In particular, Section 5.1 develops an algorithm for finding optimal Steiner sets whose run-time is independent of the number of edges. The rest of this chapter is concerned with characterizing strip graphs; one facet of this is creating a realization given a graph. Section 5.2 characterizes strip graphs as those that have only positive-weight cycles in a corresponding digraph. The algorithm for constructing this digraph assumes knowledge of the y-coordinates of all vertices, as well as the left-to-right order of the realization of nonedges. Section 5.3 immediately applies this characterization to small stars, and shows that, for example, is a r-strip graph for some but not all r . Section 5.4 shows how the characterization distinguishes between indifference graphs and other strip graphs. Specifically, it shows that a strip graph is not an indifference graph precisely if it contains a claw or a square. Finally, Section 5.5 characterizes trees in strip-graphs, showing that all such trees are equivalently caterpillars of degree at most 4. Let us begin with a brief example. We will see later (Property 5.21) that the bound 203 204 Chapter 5. Strip Graphs in this example is tight, that is, that K it4 E x a m p l e 5.1 J^ 1)4 is not a T-strip graph for any r < ^ 5 / 8 . is a r-strip graph for all r > v/5/8. Proof: Let {a, b, c, d} be the independent set of vertices in the star A ' i , and let h be the ) 4 star's "hub". Let d be any value satisfying y^5/8 < d < min{y^5/4, r } . In particular, y y if ^ 5 / 8 < r < ^ / 5 / 4 , then d„ = r will suffice. Define 4 = ^ ( 4 - d )/9. Then the 2 y assig nment / : V 4 R x ( T ] is a strip realization for Ki , where r > ^ 5 / 8 , and j4 /(a) = (0,d ) /(&) = (4,0) /(C) = (2d ,dy) f(d) = (34,0) /(/*) = y x (34/2,^/2) Figure 5.1 shows the resulting strip realization when d = T — 0.8. The construction y a c b Figure 5.1: K i>4 d is a 0.8-strip graph. ensures that ||/(a) - /(d)|| = 2 so that \\f(a) - f(h)\\ = \\f(h) - f(d)\\ = 1. To see this, note that \\f(a)-f(d)\\ 2 = {Zd f + dl x = 4. Chapter 5. Strip Graphs 205 The construction also ensures that — f{h)\\ = \\f(h) — /(c)|| < 1 since \\m-f(h)\\ = 2 (djzy 4- d + di 2 4-9 + y = (4 + 37d )/36 < 1 2 if d < (36 - 4)/37 = 32/37. 2 Conversely, the construction ensures that ||/(a) — f(b)\\ = \\f(b) — /(c)|| = ||/(c) /(d)|| > 1 since ||/(a)-/( )|| = 2 0 = d +d 2 2 x y 4- d 2 9 4 + 8d y 2 9 > 1 if d > (9 - 4)/8 = 5/8. Finally, the construction ensures that ||/(a) - /(c) || = ||/(6) 2 y /(d)|| > 1 since ll/(*)-/(c)ir= = (24 2 4-d y = 4 9 2 > i f d 5.1 2 < ^ = 5/4. 1 | Exploiting a Geometric Model Since strip graphs are both unit disk graphs and cocomparability graphs, we can combine algorithms from both classes of graphs. We will see how do this by solving the Chapter 5. Strip Graphs 206 minimum weight Steiner set problem on strip graphs in 0 ( V l o g V) time, given a geometric representation. This result improves on the 0(V\ogV + E) time bound for the more general cocomparability graphs in Chapter 4. In fact, we will simply implement the cocomparability algorithm using the unit disk graph data structure from Chapter 3. 5.1.1 Review of Cocomparability Results The following algorithm and terms from Chapter 4 are reproduced here to keep the present discussion self-contained. Let G = (V,E,w) be a graph with nonnegatively weighted vertices. Let R C V be a "required" set of vertices in G. A Steiner set (of G and R) is a set of vertices S C V \ R such that the subgraph induced in G by S U R is connected. The weight w(S) of a set of vertices S is defined, as usual, to be the sum of the weights of its elements. Assume without loss of generality that w(v) — 0 for all vertices v £ R. The weighted Steiner set problem is to find a minimum weight Steiner set in such a vertex weighted graph. T h e o r e m 4.42 [Chapter 4] Given a spanning-ordered cocomparability graph G and required set R C V, algorithm M W S S - O C C returns a minimum weight Steiner set of G and R if and only if it exists. T h e o r e m 4.43 [Chapter 4] Given any linearly-ordered graph G = (V, E,<,w), algo- rithm M W S S - O C C runs in 0(V log V + E) time. 5.1.2 A p p l i c a t i o n to Strip Graphs We want to modify this algorithm to work for strip graphs. The bottleneck in Algorithm M W S S - O C C is finding a lightest path in Step 7. This is precisely the operation that Algorithm M I N - P A T H from Chapter 3 was designed to handle for unit disk graphs. A strip graph is of course a unit disk graph where all vertex points are confined to an Chapter 5. Strip Graphs 207 Table 5.1: Algorithm: M W S S - O C C ( G , R) [Minimum Weight Steiner Set for spanning-Ordered Cocomparability Graphs] Input: A linearly-ordered vertex-weighted graph G = (V, E, <, w) and a required set of vertices R CV. Output: A minimum weight Steiner set S, or a message stating that no Steiner set exists, or a message stating that G is not a spanning-ordered cocomparability graph. 1 2 3 4 5 6 7 8 9 10 11 if R is empty, then return the empty set halt. if R is not a subset of a connected component of G, then return "No Steiner set exists." halt. P <— a least weight path from min R to max R in G. S <- P\R if the subgraph induced by S + R is connected, then return S else return " G is not a spanning-ordered cocomparability graph." Chapter 5. Strip Graphs 208 infinite strip r units thick. Assume the vertices are linearly ordered along the axis of the strip, left to right in this case. This order is a spanning order, by the following lemma. Contrast this lemma with Lemma 3.6, which states that the compatible orientation (as opposed to linear order) associated with any strip realization of a graph is a transitive orientation. Lemma 5.2 Every left-to-right-ordered strip graph is a spanning-ordered cocomparability graph. Proof: Let / : V —> [0, r] be a r-strip realization of a graph G = (V,E), where r 6 [0,^/3/2]. Let i i , v, and w be three vertices where u and w are adjacent, and Xj(u) < f( ) x v < xj(w). Since f(u) and f(w) are at most unit distance apart, their projections, x/(u) and x/(w), on the x-axis are at most unit distance apart, too. Since xj(v) lies between xj(u) and xj(w), it must lie within half a unit of either xj(u) or xj(w), say xj(u), without loss of generality. Therefore the square of the distance between f(u) and f(v) is given by (x ( )-x (v)f f U f + (yj( )- (v)f U yf < (l/2) +r 2 2 < (1/2) +(x/3/2) = 1. 2 That is, u and v are adjacent, and the vertex order is a spanning order. 2 | Create Algorithm MWSS-S (Minimum Weight Steiner Set on Strip Graphs) by removing Steps 9 through 11 from Algorithm M W S S - O C C , and by inserting Step 0, which sorts the strip graph vertices from left to right (i.e., by x-coordinate). Theorem 5.3 Given a strip graph G, represented as a set of points in a strip, and required vertices R, Algorithm MWSS-S returns a minimum weight Steiner set if and only if it exists, and runs in O ( V l o g V ) time. Chapter 5. Strip Graphs 209 Proof: Correctness follows from Theorem 4.42 and Lemma 5.2. Steps 9 through 11 are not required by Lemma 5.2. Represent all sets as arrays with V elements; linked lists and arrays are easily interconverted where required in 0(V) time. Step 0 takes 0(VlogV) time, and Step 1 takes 0(V) time. Step 4 can be implemented by marking all vertices in the same connected component as the first vertex in R using a single phase of depth first search in 0(VlogV) (Theorem 3.16). time It then suffices to check, in O(R) time, that all vertices in R are marked. Step 4 therefore executes in 0 ( V l o g V) time. The extreme vertices mini? and maxi? can easily be found in O(R) = 0(V) time. Step 7 uses algorithm M I N - P A T H (Table 3.3) to find a least weight path between mini? and maxi?, which takes 0 ( V l o g V) time by Theorem 3.14. Step 8, setting S = P \ R, can be computed in 0(V) time by filling in the array for S. I 5.2 Characterization V i a Cycles in Weighted Digraphs Let G = (V, E) be a r-strip graph, and let / : V —> R x [0, r] be a realization of G. Let us suppose that we know the y-coordinates of / ( V ) . Then we know something about the x-dimension between pairs of vertices, as clarified by the following definition and its property. Definition 5.4 For every pair of vertices u,v 6 V , call a = y \ l — (yj{u) — yj{y)) 2 UiV the critical x-dimension corresponding to the pair. Note that, if 0 < r < \/3/2, then 1/2 < a UtV < 1 for all pairs u,v. | Chapter 5. Strip Graphs 210 Property 5 . 5 Let G = (V, E) be a r-strip graph, and let f : V -» R x [0,r] 6e a realization of G. For every distinct pair u,v G V, (u,v) £ E if and only if xf(u) - xj(v) < a (5-17) uv and xj(v) - xj(u) < cx . (5-18) uv Proof: B y Definition 5.4, (u,v)€E if and only if - / ( u ) | | < 1, if and only if |x/(w) - x (v)\ + \y (u) - y (v)\ 2 2 f f f < 1, if and only if \xj(u) — xj(y)\ < a . uv I Suppose also that we know the left-to-right order of the endpoints of each nonedge. Note that this is weaker than knowing the left-to-right order of all of the vertices. That is, let (V, E) be the strict partial order where (u,v) G E if and only if (u,v) G E and xj(u) < Xf(v). Note that E is an orientation of E. Property 5 . 6 For every pair u,v G V, (u,v) G E if and only if x (v) - x (u) > a f f uv equivalently, if and only if x (u) - xj(v) < -a . f uv (5.19) 211 Chapter 5. Strip Graphs Proof: By Property 5.5, (u,v) £ E if and only if \xj[u) — xj(y) \ > a . uv | Note that inequalities 5.17 through 5.19 generate a system of \E\ + \E\ + ( | V | - | V | - \E\) = \V\ - \V\ + \E\ 2 2 difference constraints. Let us make some of these notions more formal. Definition 5.7 A (T) levelled graph G = (V, E,l) is a graph G — (V,E) and a levelling function I : V —>• [0, r] that maps vertices to y-coordinates. | Definition 5.8 A levelled graph G = (V,E,l) is a levelled r-strip graph if there exists a r-strip realization / : V —> R x [0,r] for G such that y/(v) = l(v), for every vertex v £ V. | Recall from Chapter 1 that an oriented graph is a directed graph G = (V, A) where A is asymmetric. Also from Chapter 1, an orientation of an undirected graph G = (V, E) is an oriented subgraph H = (V, A) where E = A + A" (the arc set A is also called an 1 orientation of the edge set E). Definition 5.9 A complement oriented graph G = (V, E, E) is a graph G = (V, E) and an orientation G = (V, E) of the complement G = (V, E). | Definition 5.10 A complement oriented graph G = (V,E,E) is a complement oriented r-strip graph if there exists a r-strip realization / : V —> R x [0, r] for G such that xj(v) < Xf(v) whenever (u,v) £ E. | By the above discussion, a strip graph can be levelled and complement oriented such that Inequalities 5.17 through 5.19 are satisfied. Conversely, if the inequalities corresponding to a levelled, complement oriented graph are satisfied by some assignment, then that assignment, together with the levelling, is also a strip realization. We have established the following theorem: Chapter 5. Strip Graphs Theorem 5.11 212 Given a levelled, complement oriented graph G = (V,E,l,E), let B be the corresponding system of Q(V ) difference constraints (5.17 through 5.19). A function 2 f is a strip realization for G if and only if {x u : f(u) = (x , l(u))} is a feasible solution u for B. Corollary 5.11.1 A graph is a r-strip graph if and only if it can be r-levelled and oriented such that the corresponding system of difference constraints has a solution. 5.2.1 Solving Systems of Difference Constraints According to Theorem 5.11, we can recognize levelled, complement oriented, r-strip graphs by generating and solving a system of inequalities. This section develops an algorithm that solves systems of mixed difference constraints such as Inequalities 5.17 through 5.19. We will begin by describing Bellman's solution of nonstrict difference constraints [Bel58], and then extend his methodology to include strict inequalities. The extension is self-contained, so Bellman's results will be described but not proved. Bellman's Solution The following terminology follows [CLR90]. A system of difference constraints is a set of m inequalities (on n variables) of the form Xj — x - < bk, where 1 < i,j t 1 < k < m. A vector of values x = ( x i , . . . ,x ) n < n and is a feasible solution of a system of difference constraints if it satisfies the system. If x; — Xj < b is a constraint in the k system, then all other constraints x - — Xj < bi, where 6/ > bk, are redundant in terms of 4 feasible solutions. Therefore we may assume that any system has at most one constraint of the form Xj — x,- < b , and at most one constraint of the form x,- — Xj < bi, for each pair k i,j. The corresponding constraint digraph is a weighted directed graph D = (V, A, w) Chapter 5. Strip Graphs 213 where: V = {vo,v . .. A = {(vi, Vj) : Xj — X{ < bk is a constraint} U {{vo, V{) : 1 < i < n} u ,v }, n w(vi,Vj) = bk if Xj — Xi < bk is a constraint w(vo,Vi) = 0 where 1 < i < n The weight of a path (or cycle) in D is the sum of the weights of its arcs. Let 8(u,v) denote the least weight of any path from u to v in D. T h e o r e m 5.12 ([CLR90], page 542) Given a system of difference constraints, let D be the corresponding constraint digraph. If D contains no negative-weight cycles, then x = (8(v ,vi),8(y ,v ),... 0 0 2 ,8(v ,v )) 0 n is a feasible solution for the system. If D contains a negative-weight cycle, then there is no feasible solution for the system. A d d i n g Strict Inequalities Let us begin by generalizing the notion of difference constraints. Let Xj — X{ < bk denote a constraint of the form Xj — X{ < bk or Xj — X{ < bk- A system of mixed difference constraints is a set of m inequalities (on n variables) of the form Xj — Xi < bk, where 1 < i,j < n a n d 1 < k < m. Again, we can assume that there is at most one constraint Xj — Xi < bk and at most one Xi — Xj < bi for each pair The corresponding mixed constraint digraph is a weighted directed graph D = (V, A, w) where: V - { u , u i , . . . , u } , 0 n Chapter 5. Strip Graphs A 214 — {(i>,-, Vj) : Xj xi < bk is a constraint} U — {(v ,Vi) : 1 < i < bk if Xj — Xi 0 n} is a constraint w(vi,Vj) = <bk w(yo, Vi) = 0 where 1 < i < n A loose constraint is one with a strict inequality; the other constraints are tight. A loose arc is one corresponding to a loose constraint, and a loose cycle is one containing a loose arc. L e m m a 5 . 1 3 Given a system B of mixed difference sponding mixed constraint negative-weight digraph. constraints, If B has a feasible solution, let D be the correthen D contains no cycles, and all loose cycles have positive weight. Proof: Suppose that B has a feasible solution, and let C = directed cycle in D with p > 1. Let — Xi < (c ,Ci,. 0 . . , c _ i , c ) be any p 0 be the constraint corresponding to (c;, C j + i ) . By construction and the feasibility of the solution, ti>(c,, c ) = 8+1 >x,- — Xi. +1 Therefore, the weight of the cycle satisfies p—l p—l ^w(ci,c i) i + = i=0 i-0 p-1 i'=0 = -x + x = o, 0 0 where subscript arithmetic is modulo p. That is, every cycle has nonnegative weight. If C contains at least one loose arc, then the inequality is strict. That is, every loose cycle has positive weight. | The proof and extended statement of the converse of Lemma 5.13 require the following notions. Let D = (V, A, w) be the weighted digraph corresponding to a set B of mixed Chapter 5. Strip Graphs 215 difference constraints. Our goal is to create a digraph for a system of tight difference constraints that has a feasible solution if and only if B has a feasible solution. To do so, we first convert loose arcs to tight arcs by inserting a necessary "space" A into the constraints. If D has no loose cycles, define A to be any positive constant. Otherwise, let Co be a least-weight loose cycle, and let A be any value that satisifies 0<A<^1. (5.20) Now create a new directed graph D' from D by subtracting A from the weight of every loose arc. D e f i n i t i o n 5.14 The tightened constraint digraph corresponding to D = (V,A,w) is the weighted digraph D' = (V, A,w') where w(u,v) — A if (u,v) is a loose arc w'(u, v) = ^ [ w(u,v) if (u,v) is a tight arc. I T h e o r e m 5.15 Given a system B of mixed difference constraints, let D be the corre- sponding mixed constraint digraph, and let D' be the corresponding tightened constraint digraph. If D contains no negative-weight cycles, and all loose cycles have positive weight, then x = {x u : u £ V and x u = 5'(vo,u)} is a feasible solution of B. If D contains a negative-weight cycle, or a loose cycle with non-positive weight, then there is no feasible solution for the system B. P r o o f : The tightened constraint digraph D' has no negative-weight cycles. To see this, let C be a cycle in D'. If C is not loose, then it has the same nonnegative weight in D' that it has in D. Otherwise, assume it has j loose arcs. Then, since j < | V | — 1, "w\C) =. w(C)-j\ Chapter 5. Strip Graphs 216 . w(Cp) w(C)-j > w(Co) = 0. Vi-i w(C ) 0 Therefore the least path weight S'(u, v) from u to v in D' is well defined. Now let (u, v) be any arc in D'. Then path from VQ through lightest path from Vo u to to v v 0 (with weight (with weight < S'(v , v) S'(vo, u) + w'(u, + w'(u,v)) S'(vo,u) v), for otherwise the would be lighter than the It follows that S'(vo,v)). x - x = S'(v ,v) - S'(v ,u) < w'(u,v). v Therefore x — x v u u 0 0 < w(u, v) if (u, v) is loose, and x — x < w(u, v) otherwise. It follows v u that x is a feasible solution of B. The second claim follows immediately from Lemma 5.13. I 5.2.2 Constraint Digraphs Corresponding to r-Strip Graphs For strip graphs, it is convenient to go directly to the corresponding constraint digraph by combining Theorem 5.11 and Theorem 5.15 as follows. Definition 5.16 The (mixed constraint) digraph corresponding to a levelled, complement oriented graph G = (V, E, I, E) is a weighted, directed graph D = (Vp, A, w) where: D V A A v + U {v } 0 U A" U {{v ,v) :veV} 0 A+ {(u,v) A~ {(u,v) : {v,u) e E} : (u,v) € E] Chapter 5. Strip Graphs 217 The weight w(u,v) of each directed arc (u,v) in D is: ct uv w(u,v) -a™ 0 where ct uv — (l(u) — = yj\ l(v)) ). 2 if (u,v) € if <G A ~ (u,v) if u = A + VQ See Figure 5.2 for a small example. | Figure 5.2: The weighted digraph (b) corresponding to the star (a). The eight arcs with positive weight in Figure (b) are shown as solid arrows. Note that there are two solid arrows between every pair of vertices that are adjacent in Figure (a). The six arcs with negative weight in Figure (b) are shown as dotted arrows. Note that there is exactly one dotted arrow between every distinct pair of vertices that are not adjacent in Figure (a). The solid arrows all have weight a ' = y j \ — ( r / 2 ) . The horizontal dotted arrows all have weight — 1 = — 0 . The diagonal dotted arrows all have weight — a = — y / l — r . 2 2 Arcs in A + 2 are called positive, and arcs in A~ are called negative. Note that, for each edge in E, there are two oppositely directed arcs in A + with the same positive weight. Note also that the negative arcs A~ in D are exactly the loose arcs. So, if C is a cycle in D with no loose arcs, then it must have positive weight. Theorem 5.17 Given a r-levelled, complement oriented graph G, let D be the cor- responding mixed constraint digraph, and let D' be the corresponding tightened constraint digraph. If every cycle in D has positive weight, then f : V —± R , where 2 Chapter 5. Strip Graphs 218 f(u) = (S'(u),l(u)) for all u £ V, is a strip-realization ofG. If D contains a nonpositiveweight cycle, then there is no strip-realization with the given levelling and complement orientation. Proof: Let B be the corresponding system of 0(V ) difference constraints (5.17 through 2 5.19). B y Theorem 5.11, / is a strip realization for G if and only if \x u : f(u) — (x ,y(u))} u is a feasible solution for B. The digraph D corresponding to the levelled and complement oriented graph G also corresponds to this system of constraints B. If every cycle in D is positive, {x : x = S'(v ,u) and u £ V} is a feasible solution of B by Theorem 5.15. u u Q Finally, if D contains a nonpositive-weight cycle C , then C must be loose. By Theorem 5.15, there is no feasible solution for B, and the theorem follows by Theorem 5.11. I Corollary 5.17.1 A graph is a r-strip graph if and only if it can be r-levelled and complement oriented such that every cycle in its corresponding digraph has positive weight. 5.2.3 A n 0(V ) Algorithm for Laying Out Levelled, Complement Oriented, 3 Strip Graphs Theorem 5.17 promises an algorithm to lay out a strip graph once it has been levelled and complement oriented. Algorithm S T R I P - L A Y O U T is a straightforward implementation of the ideas behind the theorem. Theorem 5.18 Algorithm STRIP-LAYOUT recognizes and produces a r-strip realization for a levelled, complement oriented graph G = (V,E,l,E) in 0(V ) time. 3 —* Proof: Given a levelled, complement oriented graph G — (V,EJ,E), Step 1 can build an re x n matrix representation of the corresponding mixed constraint digraph D = Chapter 5. Strip Graphs 219 Table 5.2: A l g o r i t h m : S T R I P - L A Y O U T ( G ) [Levelled, Complement Oriented, Strip Graph Recognition] Input: A levelled, complement oriented graph G = (V, E, I, E) and a real number r . O u t p u t : A shortest least-weight cycle in D and a realization / : V —> R x [0, T] if G is a T-strip graph, or evidence (a negative cycle in D) that G is not a r-strip graph. 0 1 2 3 4 5 6 7 8 9 V D <- V U {v } 0 <— the digraph corresponding to G. {6(u,v):u,v G V } 4 - F L O Y D - W A R S H A L L ( D ) u;o = min{5(t>, u) : f G V } r e t u r n the cycle in D corresponding to IUO. ifw >0 t h e n A <-u;o/(|V| - 1) D' = (VD,A,W') 4 - the tightened digraph corresponding to G. {<£'(«, u) : u, v G Vb} ^ - F L O Y D - W A R S H A L L ( D' ) r e t u r n function / , where f(v) = (5'(v v)J(v)) for all v G V . D = ( V D , A , W) D o 0l Chapter 5. Strip Graphs (VD,A,W) in O(Vp) = 220 time. Let us assume that w(v,v) = oo for all v £ Vo- 0(V ) 2 Step 2 can then run the dynamic programming Floyd-Warshall all-pairs shortest-paths algorithm ([CLR90] pages 558-565) on D(V) in 0(V ) time. Step 3 can then set w = 3 0 mm{8(v,v) : v £ V} from the result of Step 2 in 0(V) additional time. Implement the Floyd-Warshall algorithm to maintain, for all pairs u, v, the predecessor p(u, v) of v in the (computed) shortest path from u to v. This does does not increase the asymptotic run time, but allows Step 4 to extract the cycle corresponding to Wo in linear time ([Tar83] pages 94-95). The Floyd-Warshall algorithm has the property that this cycle is negative if Wo < 0, in which case G has no layout compatible with its levelling and complement'orientation, again by Theorem 5.17. If w > 0, then D has no negative cycles, and S(u,v) correctly represents the least 0 path-weight from u to v for all such pairs. In particular, w is the weight of a least0 weight cycle in D, and A in Step 6 satisfies Inequality 5.20. Step 7 can now construct the tightened constraint digraph D' = (VD, A, w') corresponding to D in 0(VD + A) = 0(V ) 2 time. Finally, Step 8 again executes the Floyd-Warshall algorithm in 0(V ) time. The 1 3 entire recognition and layout algorithm for levelled, complement oriented strip graphs therefore runs in 0(V ) time. | 3 5.3 Stars in S t r i p - G r a p h s As an example of the weighted cycle mechanism of the previous section, this section shows which stars are r-strip graphs as the thickness r of the strip varies. P r o p e r t y 5.19 The star K~i is not a r-strip graph for any i5 r Since the time-critical step in this algorithm is Step 2, it suffices for Step 8 to execute in 0(V ) time. If you have a faster way to find the lightest cycle in Step 2, then you should also use a faster algorithm for Step 8. One such algorithm is the Bellman-Ford algorithm for the single-source least path-weight problem ([CLR90] pages 532-544). The Bellman-Ford algorithm runs in 0(VA) = 0(V ) time, which is faster for sparse graphs. 1 3 3 Chapter 5. Strip Graphs 221 Proof: Consider any levelling and complement orientation of K\$. Its 5 independent vertices are then linearly ordered, say a<b<c<d<e. Then C = (h, e, d, c, 6, a, h) is a cycle in the corresponding digraph, where h is the "hub" of the star. This cycle has weight w(C) = Q>he — < 1-1/2-1/2-1/2-1/2 Oted — CX.dc ~ &cb ~ + &ba « a A +1 = 0 since, for all arcs (u,v), \/\ — r < a < 1 and \ / l — r = yj\ — (3/4) = 1/2. Hence 2 2 uv A+,5 is not a strip graph by Theorem 5.17. Property 5 . 2 0 The star | is not a r-strip graph for any r < y 5 / 9 . Proof: Again, consider any levelling and complement orientation of A+ such that )4 C = (h, d, c, b, a, h) is a cycle in the corresponding digraph where a < b < c < d are the independent vertices and h is the hub. This cycle has nonpositive weight w(C) = o>hd - < 1-2/3-2/3-2/3 +1 Oidc - a - cb a ba + a ah = 0 since, for all arcs (u, t>), \ A — r < a 2 < 1 and \ / l — r = yjl — (5/9) = 2/3. 2 uv | We saw in Example 5.1 that A+ is a strip graph for all strips of thickness greater j4 than y/5/8, and in the previous property, that K ii4 is not embedable in strips thinner than ^ 5 / 9 . Is one of these bounds tight? As it turns out, the r > ^ 5 / 8 bound is tight. The weighted cycle mechanism from the previous section does not provide enough power to prove this by itself. We must therefore resort to more ad hoc arguments. Chapter 5. Strip Graphs 222 Property 5 . 2 1 The star K it4 is not a r-strip graph for any r < y5/8. Proof: The diameter of any set of points realizing A+ must be at most 2 since every i4 pair of vertices is joined by a path of length at most 2. In particular, any realization of the four (independent) leaves must have diameter at most 2. However, we will see that 5/8-realization of four independent vertices has diameter greater than 2. any To this end, let {a, b, c, al} be a set of points that realizes four independent vertices in a y/5/8-strip. Without loss of generality, we may assume that x(a) < x(b) < x(c) < x(d), so that \\a — d\\ is the diameter. Therefore x(b) — x(a) > yjl — (5/8) = ^/3/8 > 1/2, and this relation also holds for x(c) — x(b) and x(d) — x(c). It follows that x(d) — x(a) > 3-^3/8. We may also assume that a and d minimize \\a — d\\, and that b and c maximize ||fe — c|| (over all possible realizations). Then all points in {a,b, c, d} lie on the boundaries of the strip. To see this, suppose first that a does not lie on the boundary, as shown in Figure 5.3. Then we can perturb a such that the resulting realization has a smaller diameter \\a — d\\, -0 Figure 5.3: If point a is not The figure shows two arcs, b lies below segment ad so delimits the points that are b on the boundary, then rotate it about b to decrease \\a — d\\. centered at b and d, and passing through a. In the figure, rotate a clockwise along the arc about b. The arc about d farther from d from those that are closer to d. as follows. If b lies on or below the line segment ad, as shown in Figure 5.3, then rotate a clockwise about 6, thereby moving a closer to d. This process does not change the distance \\a — b\\ > .1, so that x(b) — x(a) remains greater than yJs/S. It follows that Chapter 5. Strip Graphs 223 x(c) — x(a) = (x(c) — x(b)) + (x(b) — x(a)) > 1/2 -f 1/2 = 1, so that a and c remain independent. By a symmetric argument (reflect the points about the horizontal), if b lies above segment ad, then decrease the diameter by rotating a counterclockwise about b. Similarly, if d does not lie on the boundary, then decrease the diameter by rotating it about c, either clockwise or counterclockwise, depending on whether c lies above or below segment ad, respectively. Now suppose that b does not lie on the boundary. If b lies on or below the line segment ac, as shown in Figure 5.4, then rotate b clockwise about a, thereby moving b farther from Figure 5.4: If point b is not The figure shows two arcs, b lies below segment ac, so delimits the points that are on the boundary, then rotate it about a to increase ||6 — c||. centered at a and c, and passing through b. In the figure, rotate b clockwise along the arc about a. The arc about c farther from c from those that are closer to c. c. Again, this process does not change the distance \\a — b\\ > 1, so that a and b remain independent. Also x(d) — x(b) = (x(d) — x(c)) + (x(c) — x(b)) > 1/2+1/2 = 1, so that 6 and d remain independent. By a symmetric argument (reflect the points about the horizontal again), if b lies above segment ac, then increase ||6 — c|| by rotating b counterclockwise about a. Similarly, if c does not lie on the boundary, then increase ||6 — c\\ by rotating it about d, either clockwise or counterclockwise, depending on whether c lies below or above segment bd, respectively. Chapter 5. Strip Graphs 224 Now that we know that {a,b,c,d} lies on the boundary, we must analyze the possibilities. Suppose a and d lie on different levels. Then the distance between them satisfies ||« - d|| > (3x/378) + (5/8) = 2 2 2 2 so that the diameter of the point set is greater than 2. On the other hand, suppose that a and d lie on the same level. Then the points in at least one pair (a, 6), (6, c), or (c, d) must also lie on the same level (as each other). The x-distance between this pair is the same as the distance between the pair, which must be greater than 1. Therefore the x-distance between a and d satisfies: x(d) - x(a) > (2^3/8) + 1 > 2.22 so the diameter is again greater than 2. | The following theorem summarizes Example 5.1 and Property 5.21. Theorem 5.22 The star K~i is a r-strip graph precisely when r > >4 Property 5.23 The star Ki i4 is not an L\ r-strip graph for any r < 1/2. Proof: This proof is analogous and nearly identical to that of Property 5.21, so it is worded as similarly as possible to emphasize this analogy. Again, we will show that any four independent points {a,b, c, d} under the L\ metric in a strip at most 1/2unit thick has diameter greater than 2. Again assume without loss of generality that x(a) < x(b) < x(c) < x(d). Therefore x(b) — x(a) > 1 — (1/2) = 1/2, and this relation also holds for x(c) — x(b) and x(d) — x(c). It follows that x(d) — x(a) > 3(1/2). This time, assume that a and d minimize the x-span x(d)—x(a), and that b and c maximize x(c) — x(b) (over all possible realizations). Then all points in {a,b, c, d} lie on the boundary of the strip. Chapter 5. Strip Graphs 225 o d Figure 5.5: If point a is not on the boundary, then rotate it about b to decrease x(d) — x(a) while not decreasing \\a — d\\\. The figure shows two arcs, centered at b and d, and passing through a. In the figure, b lies below a so rotate a clockwise along the arc about b. The arc about d delimits the points that are farther from d from those that are closer to d. To see this, suppose first that a does not lie on the boundary, as shown in Figure 5.5. Then we can perturb a such that the resulting realization has a smaller value x(d) — x(a), as follows. If b lies at or below y(a), as shown in Figure 5.5, then rotate a clockwise about b, thereby moving a closer to d in the x-dimension. Note that this may decrease the L\ distance between a and d, or it may leave it unchanged. However, this process does not change the distance \\a — b\\i > 1, so that x(b) — x(a) remains greater than 1/2. It follows that x(c) — x(a) = x(c) — x(b) + (x(b) — x(a)) > 1/2 + 1/2 = 1, so that a and c remain independent. By a symmetric argument (reflect the points about the horizontal), if b lies above a, then decrease the x-span by rotating a counterclockwise about b. Similarly, if d does not lie on the boundary, then decrease the x-span by rotating it about c, either clockwise or counterclockwise, depending on whether c lies above or below d, respectively. Now suppose that b does not lie on the boundary. If b lies at or below y(a), as shown in Figure 5.6, then rotate b clockwise about a, thereby moving b farther from c. Note that this may increase the L\ distance between b and c, or it may leave it unchanged. Again, this process does not change the distance \\a — b\\ > 1, so that a and b remain independent. Also x(d) — x(b) = x(d) — x(c) + (x(c) — x(b)) > 1/2 + 1/2 = 1, so that b and d remain independent. By a symmetric argument (reflect the points about the horizontal Chapter 5. Strip Graphs 226 o ao d Figure 5.6: If point b is not on the boundary, then rotate it about a to increase x(c) — x(b). The figure shows two arcs, centered at a and c, and passing through b. In the figure, b lies below segment ac, so rotate b clockwise along the arc about a. The arc about c delimits the points that are farther from c from those that are closer to c. again), if b lies above point d, then increase x(c) — x(b) by rotating b counterclockwise about a. Similarly, if c does not lie on the boundary, then increase x(c) — x(b) by rotating it about d, either clockwise or counterclockwise, depending on whether c lies below or above point d, respectively. Now that we know that {a, b, c, d} lies on the boundary again, we must analyze the possibilities. Suppose a and d lie on different levels. Then the distance between them satisfies | | a - d | | i > 3(1/2) + (1/2) = 2 so that the diameter of the point set is greater than 2. On the other hand, suppose that a and d lie on the same level. Then the points in at least one pair, (a, b), (b,c), or (c, d) must also lie on the same level (as each other). The x-distance between this pair is the same as the distance between the pair, which must be greater than 1. That is, the x-distance between a and d satisfies: x{d) - x(a) > 2(1/2) + 1 = 2 so the diameter is again greater than 2. Theorem 5.24 The star | (claw) is a r-strip graph precisely when r > 0. Chapter 5. Strip Graphs 227 Proof: The claw is easy to realize if r > 0 as shown in Figure 5.7. However it is not -e- -e- Figure 5.7: A claw in a thin strip a 0-strip (indifference) graph by Theorem 2.3.4. We can prove this directly, using the weighted cycle mechanism. Consider any orientation of A ^ such that C = (h,c,b,a,h) is a cycle in the corresponding digraph where a < b < c are the independent vertices and h is the hub. This cycle has nonpositive weight w(C) — a hc = = since, for all arcs (if, u), ct cb ba ah 1-1-1+1 0 = y/l — r = \ / l — 0 = 1. 2 UjV 5.4 —a —a + a I Distinguishing Strip Graphs and Indifference Graphs The weighted digraph corresponding to a r-strip was defined previously (Definition 5.16). This section continues to examine cycles in these weighted digraphs. Let us say that a strip graph is proper if it is not a strip graph for r = 0, that is, if it is not an indifference graph. This section defines the notion of a dangerous cycle, and shows that there is a dangerous cycle in every weighted digraph that corresponds to a proper strip graph. We will see that if such a digraph has a dangerous cycle, then it has one with four arcs. Consequently proper strip graphs contain either a square or a claw, since a dangerous 4-cycle must correspond to one or the other. Chapter 5. Strip Graphs 228 A graph or digraph is signed if there is a positive (+) or negative ( —) sign associated with each edge or arc of the graph. In this section, it is often easier to think of our weighted digraphs as signed, depending on whether the arc weight is positive or negative. Definition 5.25 A cycle in a signed digraph is dangerous if it contains at least as many negative arcs as positive arcs, that is, if ^ > 1, where n is the number of negative cycle arcs and p is the number of positive cycle arcs. 5.4.1 | Dangerous 4-Cycles Lemma 5.26 graph G.IfC Let D be the digraph corresponding to a levelled, complement oriented is a positive, dangerous cycle in D, then C has at least four arcs. Proof: By construction, D has no loops and therefore no 1-cycles, dangerous or otherwise. Similarly, 2-cycles correspond to edges of G, and therefore have two positive arcs. Finally, if C = (a,b,c) were a dangerous 3-cycle (where at most arc (a,b) is positive), then it would have weight w(C) < a b — ctbc — d a < 1-1/2-1/2 = 0. This contradicts the fact that C has positive weight. ca | We already know by Theorem 3.7 that every strip graph is a cocomparability graph. However, Lemma 5.26 further illuminates this property, as the following alternative proof illustrates. Theorem 3.7 (Chapter 3) Strip graphs form a subclass of cocomparability graphs. Chapter 5. Strip Graphs 229 Proof: We need to show that the complement of a strip graph can be transitively oriented. If G is a strip graph, then by Theorem 5.17 it can be levelled and complement oriented such that its corresponding digraph has only positive cycles. This orientation is transitive, for otherwise the corresponding directed graph would have a dangerous triangle, contradicting Lemma 5.26. | L e m m a 5.27 Let D be the directed graph corresponding to a levelled, complement ori- ented strip graph G. If D has no dangerous cycles, then G is an indifference graph (a one-level graph). Proof: Write D = (V,A,w) and define a new weighted digraph D = (V, A,w ) where 0 0 1 if w(u, v) > 0 w (u,v)=l 0 -1 \f (u,v)<0 w 0 if w(u, v) = 0 i.e., if u = VQ Now consider any cycle C in Do (and therefore also in D). Since C is not dangerous, p > n. Therefore, Wo{C) = p — n > 0. Hence D has only positive cycles. Since Do 0 corresponds to G relevelled so that y(v) = 0 for all vertices v G V, it follows that G is an indifference graph, that is, a 0-strip graph, by Corollary 5.17.1. | By the previous lemma, the digraph of every proper strip graph has a dangerous cycle. This dangerous cycle must have at least four arcs by Lemma 5.26. You may therefore wonder how large the smallest such dangerous cycle could be. This is answered by the following lemma. L e m m a 5.28 If the digraph corresponding to a levelled, complement oriented graph has a positive dangerous cycle, then it has a dangerous cycle with four arcs. Proof: Let D be the directed graph corresponding to a levelled, complement oriented graph G = (V, E). Let C be a dangerous cycle in D with the least number of arcs. We Chapter 5. Strip Graphs 230 may assume that C is simple, for otherwise C can be decomposed into two cycles, at least one of which is dangerous. By Lemma 5.26, C has at least four arcs. Since C is dangerous, it has at least one negative arc. On the other hand, if C had only negative arcs, its weight would be negative. Therefore C has at least one positive arc. In particular, it has a negative arc (£•, c) followed by a positive arc (c, of); see Figure 5.8. Let a precede b in C. Now, either (a,b) is positive or it is negative, and either (a, of) is an edge in G or it is not. This gives us four cases to consider: Case 1: (a, b) is positive and (a,d) 6 E. See Figure 5.8. a Figure 5.8: Case 1: (a, b) is positive, and (a, of) is positive. Since (a, of) is an edge in G, it follows that (a, of) is a positive arc in D. So replacing (a, 6, c, d) with (a, d) in C results in a dangerous cycle with fewer arcs, contradicting the 2 assumption that C is a shortest dangerous cycle. Case 2: (a, 6) is positive and (a,d) £ E. See Figure 5.9. Since (a, d) is not an edge of G, either (a, d) or (d, a) is a negative arc in D. If (a, d) is a negative arc in D, then replacing (a,b,c,d) with (a, of) in C results in a dangerous 3 cycle with fewer arcs, again contradicting the assumption that C is a shortest dangerous It has n — 1 negative arcs and p — 1 positive arcs. It has n negative arcs and p — 2 positive arcs. 2 3 Chapter 5. Strip Graphs 231 cycle. On the other hand, if (d, a) is a negative arc in D, then (a, 6, c, d, a) is a dangerous 4-cycle. Figure 5.9: Case 2: (a,b) is positive, and (a,d) or (d, a) is negative. Case 3: (a, 6) is negative and (a,d) 6 -E. See Figure 5.10. Since (a,d) is an edge in G , it follows that (d,a) is a positive arc in D. In this case, (a, 6, c, d, a) is a dangerous 4-cycle. Figure 5.10: Case 3: (a, b) is negative, and (d, a) is positive. Case 4: (a,b) is negative and (a,d) ^ See Figure 5.11. Either (a,d) or (d, a) is a negative arc in D. If (a, d) is a negative arc in D , then 232 Chapter 5. Strip Graphs replacing (a,6, c, d) with (a,d) in C results in a dangerous cycle with fewer arcs, again 4 contradicting the assumption that C is a shortest dangerous cycle. Finally, if (d, a) is a negative arc in D , then (a,b,c,d,a) is a dangerous 4-cycle. 5 a b c d Figure 5.11: Case 4: (a, b) is negative, and (a,d) or (d, a) is negative. I Lemma 5.29 Let D be the directed graph corresponding to a levelled, complement oriented graph G.IfC is a positive, dangerous 4-cycle in D, then C corresponds to a square or a claw in G. Proof: Let C = (a, b, c, d, a) be a positive, dangerous 4-cycle. It cannot have four negative arcs, denoted ( —, —, —, —), since such a cycle would have negative weight. Similarly, it cannot have 3 negative arcs and one positive arc, denoted (+, —, —, —), since its weight would be negative: w(C) = a ab - a bc - a cd - a da < 1 - 3(1/2) = - 1 / 2 . It follows that C has exactly two negative arcs and two positive arcs, isomorphic to either ( - , + , - , + ) or ( - , - , + , + ) . Suppose C = ( — ,+,—,+) as shown in Figure 5.12. B y the construction of D, the 4 5 It has n — 1 negative arcs and p — 1 positive arcs. It has 3 negative arcs and 1 positive arc. Such a cycle is not only dangerous, it is unrealizable. Chapter 5. Strip Graphs D 233 G Figure 5.12: ( — , + , — , + ) in D corresponds to a square in G. pairs (a, d) and (b,c) are edges in G, and (a, 6) and (c, d) are not. Now, arc (a,c) cannot be negative for, if it were, (a, c, d, a) would be a dangerous triangle, contradicting Lemma 5.26. Its opposite orientation, arc (c, a) also cannot be negative for, if it were, (a, 6, c, a) would be a dangerous triangle. Therefore (a,c) is positive and therefore in G. Similarly, arcs (6, d) and (d, b) are not negative, since they would imply dangerous triangles (a, b, d, a) and (6, c, d, 6). Therefore (6, <f) is in G , and G corresponds to a square. On the other hand, suppose C = ( — ,—,+,+) as shown in Figure 5.13. By the D G Figure 5.13: ( —, —, +, +) in D corresponds to a claw in G . construction of D, the pairs (a,d) and (c,d) are edges in G , and (a, 6) and (6, c) are not. Chapter 5. Strip Graphs 234 Now, edge (a, c) cannot be in G for, if it were, arc (c, a) would be positive in D, and (a, 6, c, a) would be a dangerous triangle. Similarly, arcs (6, d) and (d, 6) are not negative, since they would imply dangerous triangles (a,b,d,a) and (b,c,d,b). Therefore (b,d) is in G, and C corresponds to a claw. | Theorem 5.30 Any strip graph that is not also an indifference graph contains a square or a claw. Proof: Let G be a strip graph. It can therefore be levelled and complement oriented such that its corresponding directed graph D has only positive cycles. If G is not a one-level graph, then D has at least one dangerous cycle. B y Theorem 5.28, D contains a dangerous 4-cycle, which corresponds to a square or a claw by Lemma 5.29. 5.4.2 | Connection with Indifference Graph Characterization Another way of arriving at Theorem 5.30 is to examine the characterization of indifference graphs. Roberts characterized indifference graphs as claw-free interval graphs (Theorem 2.3.4). Also, Gilmore and Hoffman characterized interval graphs as chordal cocomparability graphs [GH64]. Therefore, indifference graphs are equivalently chordal, claw-free, cocomparability graphs. We know that all strip graphs are cocomparability graphs (Theorem 3.7). Hence, if a strip graph is not an indifference graph, it must either contain a claw or not be chordal. If it is not chordal, it must contain a square, since cocomparability graphs do not have induced cycles with more than four edges (Theorem 4.6). This higher-level proof clearly hides many of the details inherent in dangerous cycle proof of Theorem 5.30. In fact, we could prove Roberts's result (Theorem 2.3.4) using dangerous cycles. Nevertheless, the higher-level proof serves to relate strip graphs with other familiar results. Chapter 5. Strip Graphs 5.5 235 A Characterization of Trees in Strip Graphs What sort of trees are strip graphs? If a tree has any "body" to it, that is, if it contains the subtree in Figure 5.14, then it cannot be a strip graph. The leaves of this subtree have the o 9 Figure 5.14: The leaves of this tree form an asteroidal triple. property that between any pair of them, there is a path that avoids the neighbourhood of the third. A set of three vertices in a graph that has this property is called an asteroidal triple [LB62]. It is well known that all cocomparability graphs are asteroidaltriple free [Gal67]. This is an easy consequence of Corollary 4.7.1, that a path in a (scanning) ordered cocomparability graph dominates all vertices between its endpoints. Since all strip graphs are cocomparability graphs (Theorem 3.7), it follows that strip graphs are also asteroidal-triple free, and therefore free of the tree in Figure 5.14. Trees that are free of this tree (Figure 5.14) are sometimes called caterpillars: removing their leaves results in a path (the spine). This definition implies that every spine vertex has degree at least 2. But for purposes of exposition, assume that the spine is ordered and that no leaves are adjacent to the first and last vertices, i.e., they have degree 1. We already know that K^^ is not a strip graph (Theorem 5.19). Since strip graphs are hereditary (i.e., all induced subgraphs of a strip graph are themselves strip graphs), it Chapter 5. Strip Graphs 236 follows that any tree that contains an induced K i $ subgraph could not be a strip graph, t either. The only trees not ruled out by this brief analysis are caterpillars all of whose vertices have degree at most 4. Remarkably, all such trees are strip graphs, as shown by the following subsection. 5.5.1 A Universal Embedding for Caterpillars Any caterpillar with degree at most 4 is isomorphic to an induced subgraph of the infinite caterpillar shown in Figure 5.15. Any embedding of this infinite caterpillar also d 9 c O- 0 c -0- -O- 0 6 d ds 2 9 2 a-2 c -0- 6 «3 4 9 3 -0 c 4 9 a 4 Figure 5.15: The infinite degree-4 caterpillar specifies an embedding for an induced subgraph, and therefore for any caterpillar via its subgraph isomorphism. We will now see how to embed the infinite caterpillar. A l l points corresponding to vertices labelled c will lie strictly inside the strip, except for Co which lies on the upper level. Points corresponding to leaves labelled a will always lie on the lower level of the strip. Points corresponding to leaves labelled d will always lie on the upper level of the strip. The following technical definition will be useful before proceeding. Say that three points a, b, and c in the strip satisfy the iterative conditions if Chapter 5. Strip Graphs 237 (11) points a and b lie on the lower level, (12) point b is more than unit distance to the right of a, and (13) point c is less than unit distance from both a and b, as shown in Figure 5.16. In any such triple of points, b will be just a construction point, a h Figure 5.16: Points a, b, and c satisfy the iterative conditions. but point a will correspond to a leaf of the infinite caterpillar labelled a, and point c will correspond to an interior vertex (of degree 4) labelled c. The Initial Step To embed the infinite caterpillar, we will proceed iteratively, from left to right in the strip. To this end, place c on the upper level, at location (0,y/3/2). Place ai slightly 0 more than unit distance from c , on the lower level to the right, and by slightly more 0 than unit distance from ai, also on the lower level to the right. More concretely, place ai at (0.51,0) and bi at (1.52,0), as shown in Figure 5.17. We can then place c\ within unit distance of Co, ai, and by. Again, more concretely, place c\ at (0.75,0.5). Clearly, points ai, bi, and C i satisfy the iterative conditions. Chapter 5. Strip Graphs c 238 0 ai b x Figure 5.17: Embedding the first four vertices of the infinite degree-4 caterpillar in the strip. The Iterative Step We can always continue embedding the caterpillar from three points a, b, and c that satisfy the iterative conditions as follows. Place a new point d on the upper level, between a and 6, exactly unit distance from b, as shown in Figure 5.18. Note that x — x — 1/2 d a b h Figure 5.18: Placing point d, which corresponds to a leaf. since the thickness of the strip is y/%/2, and that x d > x + 1/2 by condition (i2). It a follows that d is more than unit distance from a. Then point c is within unit distance 6 of d. If it were not, \x — x \ would be greater than 1/2, so that either \x — x \ > 1 or c d c a \x — x \ > 1, which contradicts the proximity of point c to points a and b. It follows that c b Note well that this conclusion does not follow if the thickness of the strip is less than quently this construction is not applicable to thinner strips. 6 y/3/2. Conse- Chapter 5. Strip Graphs 239 vertices a and d are independent but adjacent to vertex c in the strip graph generated by points a, c, and d. We are now ready to construct a new set of points a', b', and d!. Let C(p) denote the unit radius circle about point p, where p is any point in the strip. By construction, C(d) intersects the lower level at point 6, as shown in Figure 5.19. a h Figure 5.19: The unit' circle about d intersects the lower level at point b. By the iterative conditions, C(c) intersects the lower level at a point x to the right of b, as shown in Figure 5.20. Therefore, there is an arc A of C(c) that (1) lies above the lower level, (2) lies to the right of the circle about c, (3) has positive length, and (4) has a tangent with finite positive slope at all points. Figure 5.20 shows arc A in bold. d Figure 5.20: The unit circle about c intersects the lower level at point x. Arc A is the bold part of C(c). Now place b' on the lower level to the right of x such that C(b') intersects arc A at its midpoint, as shown in Figure 5.21, although any point of intersection suffices. Chapter 5. Strip Graphs 240 The circle C(b') intersects the lower level at a point y to the right of point x since the a h h Figure 5.21: Circle C(b') intersects arc A at its midpoint, and it intersects the lower level at point y. tangent to C(b') is vertical at the lower level, but the tangent to C(c) has positive slope. Therefore let a' be the midpoint between x (on the left) and y (on the right), as shown in Figure 5.22, although any point between x and y will suffice. This ensures that a' and b' satisfy conditions (il) and (i2). Figure 5.22: Point c' is on C(c) and inside C(b') Finally, let c' be the point on A midway between the top of A and the intersection of A and C(b'), as shown in Figure 5.22, though any point on A that lies inside C[b') will suffice. Since c' is inside C(b'), it is within unit distance of b'. We need to show that c' is also within unit distance of a'. Since any continuous intersection of a circle (centered in the strip) with the strip (of width \/3/2) has diameter at most 1, it follows that arc A has diameter at most 1. As a consequence, c' is within unit distance of x. Therefore c' Chapter 5. Strip Graphs 241 is within unit distance of a', which lies between x and b', by convexity of the unit-radius disk about c'. In summary, a', and d satisfy the iterative conditions. Furthermore, a' is not adjacent to a or d since it lies to the right of 6, and it is not adjacent to c since it lies to the right of x. Similarly, c' is not adjacent to a or d since it lies outside of C(d). Figure 5.23 shows that portion of the caterpillar generated by points {a, c, d, a', c', a"}, d d' a a' Figure 5.23: The strip graph generated by {a, c, d, a', c', d'}. where d' is unit distance from b'. Note that d' is not adjacent to a, 6, or c. To see this, recall that points a, b and c have x-coordinates less than x i — 1/2, and that d' has an a x-coordinate greater than x i + 1/2. It follows that a, b and c have x-coordinates less a than Xd< — 1 and therefore lie more than unit distance from d'. We have established the following theorem. T h e o r e m 5.31 at most 4- A tree is a y/3/2-strip graph if and only if it is a caterpillar with degree Chapter 6 Two-Level Graphs This chapter studies two-level strip graphs, that is, graphs that have strip-realizations with only two distinct y-coordinates. Since the y-coordinates of arbitrary strip graphs can take on an infinite number of values, it is difficult to see the combinatorial aspects of the y-dimension. To emphasize these combinatorial aspects, we define a notion of fc-level graphs, in which the y-coordinates take on at most k distinct values. If k = 1, these one-level graphs are exactly the indifference graphs. For k — 2, the main object of attention in this chapter, each of the two "levels" can be thought of as an indifference graph. But still, two-level graphs are not indifference graphs. It therefore behooves us to to better understand the relation between indifference graphs and two-level graphs. We will make significant steps towards characterizing, recognizing, and laying out (realizing) two-level graphs. We will also see how to develop algorithms for this class of graphs. After a few definitions, we will look at some basic examples in Section 6.2. In particular, we will see that both the square and the claw are two-level graphs (although neither are indifference graphs), but that their realizations are highly constrained. This immediately applies to show that A+,4, and consequently any star with more than three leaves, is not a two-level graph. Finally, we will look at a small graph whose realization is completely constrained, that is, whose levels and complement orientation is completely determined. This small graph will be useful for designing larger graphs in which we wish to restrict the choice for the level of a vertex. Next, we will see that the geometric realization of A;-level graphs can be used to 242 Chapter 6. Two-Level Graphs 243 develop efficient algorithms. Section 6.3 illustrates this fact by developing an efficient algorithm for solving a dominating set problem. This problem, finding a minimum weight independent dominating set, was solved (less efficiently) in the more general context of cocomparability graphs by Chapter 4. The problem is equivalent to finding a minimum weight maximal clique in the complement of a two-level graph; this formulation yields the necessary insights for solving the problem. Section 6.4 examines the relation of two-level graphs with other classes of graphs. In particular, it places two-level graphs farther down a small hierarchy of previously studied perfect graphs that contains cocomparability graphs. We will see that a two-level graph under the Euclidean metric is also a two-level graph under the L\ "city block" metric. We will also see how to compute two illustrative parameters of two-level graphs, by showing that both the interval number and the boxicity of two-level graphs is at most two. Finally, we will see that the edges of a two-level graph can be bipartitioned such that one set induces an indifference graph and the other induces a bipartite permutation graph. The last section, Section 6.5, examines the problem of recognizing two-level graphs. We will begin by assuming that we know which level every vertex must be on (i.e., the graphs are striated), even though we might not know the y-coordinate of that level. We will see that the complements of striated two-level graphs are uniquely orientable. Striated &-level graphs, for k > 2, are not in general uniquely complement orientable, nor are two-level graphs that have not been striated. However, we will see that any transitive orientation of the complement of an unstriated two-level graph is compatible with some realization. Unfortunately, we will also see that, unlike indifference and cocomparability graphs, there is no forbidden ordered-triple characterization for two-level graphs. We will examine the structure of the class of two-level graphs as the thickness of the strip varies. In particular, we will see that the classes for any two distinct thicknesses are Chapter 6. Two-Level Graphs 244 incomparable. Nevertheless, if a graph is both a two-level Ti-strip graph, and a twolevel T2-strip graph, then it is a two-level r-strip graph for all values of r between r\ and r . The section concludes by showing how to recognize striated two-level graphs in 2 0 ( V l o g V) time with the mechanism developed for levelled, complement oriented strip 3 graphs. 6.1 Definitions Let G = (V, E) be a r-strip graph, and let / : V —> R x [0, r] be a realization of G. As usual, we write /(it) = (x j(u),y f(u)), and ct uv \Jl - (yf(u) — ~ Vf{ )) v 2 Definition 6.1 A r-strip graph G — (V,E) is a k-level (r-strip) graph if there is a set { y i , i/2, • • •, Vk} of real values where 0 = yi < y < • • • < yk = T, such that G has a 2 realization / satisfying y/(u) G { y i , y ,..., yk} for every vertex it E V. Say that vertex v 2 I is on level i , or on the ith level, if yj(v) — yiNote that a uv = a whenever v and w are on the same level. Sometimes we would uw like to require the vertices to be on certain levels, without actually saying what the yvalues of those levels are. To this end, let us define a notion of striation, which captures this intuition. Definition 6.2 A k-striation is a function s : V —> { 1 , 2 , . . . , A;}. A graph G = (V, E, s) is k-striated if it includes a fc-striation function s. A striated graph G = (V, E, s) is a striated k-level (r-strip) graph if there is a realization / : V —>• R 2 and a set of k y-values (striae) {j/i,y , • • • ,Vk} such that 0 = y < y < • • • < yk = r , and y (u) = x 2 every vertex u G V. 2 f y s ( u ) , for | Definition 6.3 If the endpoints of an edge in a striated graph (or levelled graph) are on the same stria (or level), call it a level edge, otherwise call it a cross edge. | 245 Chapter 6. Two-Level Graphs One-level graphs are of course (one-dimensional) indifference graphs; there is no harm in assuming that the unused y-coordinate of all vertices is 0, and that all edges are level edges. Two-level graphs, for which k = 2, are clearly included in these definitions. For example, if / is a two-level realization for G = (V, E), then vertex v E V is on level 1 if yj(v) = 0, and on level 2 if yj{v) — T. In addition, since two-level graphs are discussed extensively in this chapter, it is convenient to have the following definition. The intention behind this definition is given by Property 6.5 below. Definition 6 . 4 Let a = y/l — r be the critical x-dimension corresponding to the strip 2 thickness r. Note that, if 0 < r < y/3/2, then 1/2 < a < 1. Note also that, if the variable r is symbolic (its value has not been specified), then so is a. | Property 6 . 5 Let f be a two-level realization for G. For all vertices u and v on the same level, (u,v) £ E if and only if \xj(u) — xj(v)\ < 1. For all u and v on different levels, (u,v) £ E if and only if \xf(u) — xj(v)\ < a. In either case, (u,v) £ E if \x (u) - x (v)\ < a. f } Proof: If u and v are on the same level, then yj(u) — y/(v) = 0. It follows that (u, v)£E if and only if ||/(w) - <1 if and only if J{x (u) - x (v)) + (y/(u) - yj(v)) < 1 2 f 2 f if and only if J(xj(u) — xj(v)) < 1 2 if and only if \xj(u) — xj{v)\ < 1. Similarly, if u and v are on different levels, then \yj(u) — y/(v)\ — T. It follows that (u,v)£E if and only if - f(v)\\ < 1 if and only if J (x (u) - x (v)) + (y (u) - y (v)) 2 f 2 s f if and only if J(xj(u) — xj[y)) + r < 1 2 2 f < 1 Chapter 6. Two-Level Graphs 246 if and only if (x/(u) — xj(v)) + r < 1 2 2 if and only if \xf(u) — Xj[v)\ < V l — r 2 if and only if \x/(u) — Xf(v)\ < a. In either case (u, v) G E if \xj{u) — xj(v)\ < a since a < 1. 6.2 | Examples Consider some realization of a two-level graph G = (V, E). Any cycle in the complete graph K(V) on V (or any graph on V, for that matter) must have an even number of cross edges. This is because any cycle must begin and end on the same level. In particular, this is true of any directed cycle in the weighted digraph (Definition 5.16) corresponding to G, the left-to-right orientation, and this levelling. Cross arcs in the digraph have weight ± Q , and level arcs have weight ± 1 by Property 6.5. Recall that a = \ / l — r 2 and that 1/2 < a < 1. Furthermore, arcs in the digraph that correspond to edges in the graph have positive weight, and arcs that correspond to nonedges have negative weight. The next two lemmas rely on Corollary 5.17.1, that a graph is a r-strip graph if and only if it can be r-levelled and complement oriented such that every cycle in its corresponding weighted digraph has positive weight. Lemma 6.6 Let (a,b,c,d,a) be a chordless 4-cycle (a square) in a two-level graph G = (V,E). Then (a,d) and (6, c) are level edges, and the others are cross edges, for every two-level realization f of G for which xj(a) < xj(c) and xj(b) < Xf(d). That is, the orientation of a square determines its levels. Proof: Let the vertex set {a,b,c,d} induce a square in a two-level graph G as shown in Figure 6.1.(i). Let / be a two-level realization for which xj(a) < xj(c) and xj(b) < Chapter 6. Two-Level Graphs 247 b c b a b c a Y d c a Y + d 1 d (iii) 0) Figure 6.1: A n induced square in a complement oriented two-level graph, and a cycle in the corresponding weighted digraph. x/(d). Then (a,d,b,c,a) is a cycle in the weighted digraph corresponding to graph G and realization / . Arcs (a,d) and (b,c) correspond to edges in G and so have positive weight, while arcs (d, b) and (c, a) have negative weight, as shown in Figure 6.1.(ii)- The cycle must have an even number of cross arcs. However, it cannot have 0 or 4 cross arcs, since its weight would then be 0. Therefore it has exactly two cross arcs and two level arcs. The level arcs must be the positive arcs (a, d) and (6, c) as shown in Figure 6.1.(iii), since otherwise the cycle would have nonpositive weight. Lemma 6.7 Let G({a,b,c,d}) graph G — (V,E). | be an induced claw, where b is the "hub", in a two-level Then (a,b) and (6, c) are level edges, and (b,d) is a cross edge, for every two-level realization f of G for which xj(a) < xj(d) and x/(d) < xj(c). That is, the orientation of a claw determines its levels. Proof: Let the vertex set {a,b,c,d} induce a claw in a two-level graph G as shown in Figure 6.2.(i). Let / be a two-level realization for which £/(a) < x/(d) and xj(d) < xf(c). Then (a, b, c, d, a) is a cycle in the weighted digraph corresponding to graph G and realization / . Arcs (a, 6) and (6, c) correspond to edges in G and so have positive weight, 248 Chapter 6. Two-Level Graphs (i) (ii) (iii) Figure 6.2: A n induced claw in a complement oriented two-level graph, and a cycle in the corresponding weighted digraph. while arcs (c, d) and (d,a) have negative weight, as shown in Figure 6.2.(ii). The cycle must again have an even number of cross arcs, and again it cannot have 0 or 4 cross arcs, since its weight would then be 0. Therefore it has exactly two cross arcs and two level arcs. The level arcs must be the positive arcs (a, b) and (6, c) as shown in Figure 6.2.(iii), since otherwise the cycle would have nonpositive weight. Lemma 6.8 A+ ]4 | is not a two-level graph. Proof: Suppose there is a two-level realization for K i ^ . Either there is an induced claw with all vertices on the same level, or there is an induced claw with two leaf vertices on a level different from the hub's level. Neither case is allowed by Lemma 6.7. | Lemma 6.9 Let {a,b,c,d,e, /} induce the subgraph G' in Figure 6.3 in some two-level graph. Then any two-level realization orients and levels G' as shown in thefigure(orient all complement edges left-to-right). Proof: The subgraph G' is clearly a two-level graph by the realization shown in the figure. It is therefore a cocomparability graph. In fact, its complement is uniquely 249 Chapter 6. Two-Level Graphs Figure 6.3: A uniquely levelled, uniquely complement oriented, two-level graph. orientable. To see this, start with nonedge (a,f). Recall from Definition 4.49 that an arc (a,b) directly forces arc (c, d) (that is, (a,b)T(c,d)) if 1. a = c and (6, d) (fc E, or 2. b = d and (a, c) £ E. The following relations are immediate. (a,/) T (a,c) T (d,c) (a,/) T (a,e) («,/) r (6,/) («,/) r (d,/) (d,c) T (e,c) (d, ) r (d,6) c Therefore ( a , / ) forces the seven remaining nonedges. For example, (a,f)T(a,c)r(d,c)T(e,c). Consequently, if x(a) < x(f) for some realization, then x(a) < x(e) x(a) < < x(c), x(f), x(d) < x(b) x(d) < x(c). < x(f), Chapter 6. Two-Level Graphs 250 Now since (a, 6, d, e,a) and (6, c, e,/, 6) are chordless 4-cycles, two applications of Lemma 6.6 show that (a, 6), (d, e), (6, c), and (e,/) are level edges, and all others are cross edges. 6.3 | Exploiting a Geometric Realization This section develops a data structure that implicitly represents the oriented complement of a £:-level graph G = (V,E,E) given its realization f : V —¥ R . We will see that 2 this data structure also efficiently represents the transitive reduction (Definition 4.32) of the oriented complement G = (V,E). In fact, the forthcoming Theorem 6.22 proves that the transitive reduction (V,R) of G can be computed in 0 ( V l o g V + k V + R) 2 time. This compares with 0(M(V)), the best known time for the transitive reduction of arbitrary digraphs [AGU72], and 0(VR), the best known time for transitively oriented comparability graphs (§4.2.4). This section applies the data structure to solve the weighted independent dominating set problem on fc-level graphs in 0(k V + V ) time. In particular, it solves this prob2 2 lem on two-level graphs in quadratic time. This problem is equivalent to the weighted maximal clique problem on the complements of A;-level graphs. gorithms therefore improve on the 0(M(V)) For fixed k, these al- time algorithms for cocomparability and comparability graphs in Chapter 4. 6.3.1 fc-Level G r a p h s and t h e i r O r i e n t e d C o m p l e m e n t s D e f i n i t i o n 6.10 A digraph G = (V, E) is the oriented complement (of strip graph G = (V, E) and realization f)\iE = {(u,v) : (u,v) G E and £/(u) < Xf(v)}. | The next property follows immediately from this definition and that of a uv tion 5.4). (Defini- Chapter 6. Two-Level Graphs 251 P r o p e r t y 6.11 Let G = (V,E) be the oriented complement of a k-level graph G and realization f. The ordered pair (it, u) is an arc in E if and only if xj(v) — x/(u) > a . uv Another immediate corollary is due to k-level graphs also being strip graphs. P r o p e r t y 6.12 If G = (V,E) is the oriented complement of k-level graph G = (V, E) and realization f, then E is a transitive orientation of E. 6.3.2 A n I m p l i c i t R e p r e s e n t a t i o n of t h e O r i e n t e d C o m p l e m e n t This subsection shows how to create a representation of the oriented complement G = (V, E) given its realization / . The forthcoming algorithms are easier to express if we augment V with two sentinel vertices s,- and ti on each level i. To this end, let V' = V + {si : 1 < i < k} + ; : 1 < i < k}. Note that \V'\ = | V | + 2k — 0(V) since k < V. Ensure that each Sj is adjacent to every other vertex in G by locating it more than unit distance to the left of the leftmost vertex in V. That is, set xj(si) such that x/(si) < mm{xf(u) : u 6 V} — 1 for all i. Similarly, ensure that each ti is adjacent to every other vertex in G by locating it more than unit distance to the right of the rightmost vertex in V. That is, set £/(£;) such that Xf(ti) > max{xj(u) : u £ V} + 1 for all i. Assume that V is ordered by level, that is, it ^ v if and only if xj(u) < x/(v), or xj(u) = xj(v) and yj(u) < y/(v), for all vertices u,v £ V. The following observation is an immediate consequence of this assumption. O b s e r v a t i o n 6.13 Let u,v £ V be two vertices on the same level. If u -< v, then x(u) < x(v). Chapter 6. Two-Level Graphs 252 D e f i n i t i o n 6.14 Let V be a set of vertices ordered by level. Let L , p, and n be arrays, where L denotes the level of vertex u, p denotes the first (the premier) vertex of level i, v 2 and n-i denotes the number of vertices on level i. | The following straightforward algorithm computes these values in a single pass over V , once ordered. Notice that Si = pi and that ti = p ; + rii + 1. Notice also that x {pi + 1, pi + 2 , . . . , pi; + n,-} are the vertices from V on level i, and that ]Cf=i n,- = 2k + V = 0(V). Table 6.1: A l g o r i t h m : I N i T I A L I Z E - O R I E N T E D - C O M P L E M E N T ( V , / ) Input: The vertices V and a realization / of a fc-level graph G = (V, E). O u t p u t : Arrays L , pi, and n; (Definition 6.14) v 1 2 3 4 5 6 7 8 9 10 11 V <- V U { s , : l < i < f c } U { f , : l < ! < A;.} Order (relabel) V by level so that V = {1, 2 , . . . , | V ' | } . i <— 0 > i is the current level i/o< 1 > Another sentinel for v <- 1 to | V | do i f y/(u) > y; > Check if v is on a new level then z <— i + 1 n <- 0 Pi u L„ <- i rii <- n,- + 1 8 12 r e t u r n (L, p, n) L e m m a 6.15 Algorithm I N I T I A L I Z E - O R I E N T E D - C O M P L E M E N T ( V , / ) computes the arrays L, p, and n in 0(V log V) time. P r o o f : Correctness follows from Definition 6.14. Since the realization function y is onto, Step 9 sets pi every time Step 7 changes the level. Chapter 6. Two-Level Graphs 253 Step 2 is time critical, and takes 0(V'\ogV) = 0(VlogV) time. Steps 7, 8, and 9 are each executed k times. The other atomic steps in the loop are executed once for each I vertex in V. Definition 6.16 For every vertex u £ V and level 1 < i < k, define Fi[u] to be the least vertex on level i for which (u, £ E. | Figure 6.4 illustrates this notion for two levels of a graph. The presence of vertex ti Fi[u] Level i — Level j -— v <P--.° : o'., « " ' " " ° — 9 FiiFiiu]] — ° Fi[Fj[u]] U ©- ,,.fO ..«£>•'' A) F U Figure 6.4: Definition of array F: value F{[u] points to the first vertex on level i that is adjacent to u in the oriented complement graph. ensures that Fi[u] is always well defined. We can implement array F as a one-dimensional array containing k one-dimensional arrays of size n - each, where 1 < i < k. Recall that 2 £f = 1 m = 2k + V so that | F | = 0(k + (2k + V)) = 0(V). The arrays F and L constitute an implicit representation of ordered complement G with 0(V) size, as illustrated by the following simple observation. Lemma 6.17 Let G = (V, E) be an oriented complement graph. The ordered pair (u, v) —* is an arc in E if and only if Fi[u] •< v, where i = L . v Proof: If e E, then Ft[u] X v by Definition 6.16. Conversely, if Fi[u] •< v, then x(Fi[u\) < x(v) by Observation 6.13. Furthermore (u,Fi[u\) £ E by Definition 6.16, so x(u) + Q;„,F,[«] < %{Fi[u\) by Property 6.11. Finally 254 Chapter 6. Two-Level Graphs c*uv — « ,Fi[u] u ( s e e Definition 5.4) since v and Fi[u] are on the same level. It follows that x(u) + ct = uv x(u) + a Fi[u] Ut < x{Fi[u}) < x(v). Therefore (u,v) € E, also by Property 6.11. | The remaining algorithms in this section do not make explicit use of L , since they v know the level of every vertex. We conclude by showing that inequalities are preserved by "taking F of both sides", if both sides are on the same level. L e m m a 6.18 Let G = (V, E) be an oriented complement graph. For all levels i, ifu^v and u and v are on the same level, then Fi[u] ^ Fi[v]. P r o o f : Suppose u and v are on the same level j and that u X v. Then x(u) < x(y) by Observation 6.13. Now consider any level i. Since (u, Fj[u]) 6 E and u and v are on the same level, Property 6.11 implies that x(Fi[v]) — x(v) > a Fi[v] = Vi &u,Fi[v]- Combining these inequalities x(Fi[v]) - x(u) > x(Fi[v}) - x(v) > a [ ] U}Fi v implies that (it, i^[u]) G E by Property 6.11. Finally, F{[u] ^ Fi[v] by Lemma 6.17. 6.3.3 | A n A l g o r i t h m for C o n s t r u c t i n g the R e p r e s e n t a t i o n We are now ready to describe an algorithm for constructing the array F (Definition 6.16). We will begin by describing an algorithm that, given levels i and j, computes Fi[u] for every vertex it on level j. T h e o r e m 6.19 Given an oriented complement, represented by array p (Definition 6.14) and realization f, of a k-level strip graph, Algorithm TWO-LEVEL-F row of array F (Definition 6.16) in 0(n - + nj) time. t generates the ith Chapter 6. Two-Level Graphs 255 Table 6.2: Algorithm: T W O - L E V E L - F ( z , j , p, n, f) Input: Level numbers i and j, arrays p and n (Definition 6.14), and realization / of a A;-level graph. Output: The row F of array F (Definition 6.16). 8 1 + l 2 Fi[pj] <— v 3 for u <— pj + 4 do while 5 6 Fi[u] <7 1 to pj + rij ||/(«) < 1 do v <— v + 1 > Recall S{ = pi has no incoming arcs in G > Recall Sj = pj is adjacent to all vertices in G > u is on level j v return F; Proof: The algorithm computes Fi[u] for vertices u on level j. It does so by simultaneously scanning the j t h level with vertex u, and the ith level with vertex v, which is a candidate for F;[u]. Step 1 initiates the process of scanning v along level i by pointing v to the first "real" vertex on level i. Step 3 steps through each vertex u on level j. The algorithm maintains the invariant that v -< F,-[u], in particular at Step 3; this follows from Lemma 6.18. Steps 4 and 5 then scan v to the right until an arc (u,v) £ E is discovered. By the invariant, v is the first vertex on level i that is adjacent from vertex u, as required. To compute the run time, note that u is set rij times by Step 3, and v is set at most n, times by Step 5 (remember to count the sentinel U) for a total of iii + rij operations. More formally, the expression below is the number of times the algorithm executes Step 5; the sums correspond to Lines 3 and 4. We simply note that Step 5 is called Fi[u] — F»[u — 1] Chapter 6. Two-Level Graphs 256 times by Step 4, and that pi + 1 d: F{[u] ^ti = Pi + n,; + 1. Pj+nj Fi[u] E E u=pj+l v=Fi[u-l]+l Pj+Uj i U=Pj+l Pi +ra,;+ 1 - (p; + 1) I We are now ready to compute all of F. The algorithm below simply calls algorithm T W O - L E V E L - F as a subroutine for every pair of levels i and j. Table 6.3: Algorithm: G E N E R A T E - F ( V , / ) Input: Array V of vertices, and fc-level realization / - o f a fc-level graph. Output: The array F (Definition 6.16). 1 {L,p,n} <- I N I T I A L I Z E - O R I E N T E D - C O M P L E M E N T ( V , / ) 2 for j «— 1 to fc 3 do for i - f - 1 to fc 4 Fi <- T W O - L E V E L - F ( z , j , p,ra,/ ) 5 return F Theorem 6.20 Given an oriented complement of a k-level strip graph represented by a realization f, Algorithm GENERATE-F generates array F (Definition 6.16) in 0 ( V l o g V + kV) time. Proof: Correctness follows from Lemma 6.15 and Theorem 6.19. Step 1 takes 0(V log V) time by Lemma 6.15. B y Theorem 6.19, Step 4 takes 0(ra - + raj) time. The sum of the t number of vertices on each level over all levels is just the total number of vertices. This Chapter 6. Two-Level Graphs 257 observation yields the following expression for the total time due to Step 4. k k k k j=li=l i=it=l . = o(tv) 3=1 = O(kV). I Corollary 6 . 2 0 . 1 Given an oriented complement of a two-level graph represented by a realization f, Algorithm GENERATE-F generates array F (Definition 6.16) in 0(V log V) time. 6.3.4 A n Implicit Representation of the Transitive Reduction Interestingly, array F is also an implicit representation of the transitive reduction of the oriented complement. With the aid of Lemma 6.21 below, Algorithm k T R A N S (Table 6.4) generates, for any constant number k of levels, all arcs of the transitive reduction in constant time each, given the array F. Lemma 6 . 2 1 Let G = (V, E) be the oriented complement of a k-level graph, and let w be a vertex on level i. The ordered pair (u,w) is an arc in the transitive reduction of G if and only if Fi[u] -<w-< Fi[Fj[u\\ for all levels j. Proof: Suppose first that (it, w) is an arc in the transitive reduction of G. Then (it, w) € E, so that Fi[u] •< w by Lemma 6.17. Also, if F,-[Fj[it]] •< w for any level j , then (Fj[u],w) £ £ by Lemma 6.17, which together with (u,Fj[u\), would transitively imply (it,iy). Therefore w -< Fi[Fj[u]]. Conversely, suppose that (it, to) is not an arc in the transitive reduction of G. Then either (if, I D ) ^ E or (u,w) is transitively implied. If (u,w) £ E, then it; -< F,-[it] by 258 Chapter 6. Two-Level Graphs Lemma 6.17. On the other hand, suppose (u,w) is transitively implied by some chain of arcs (u,v),(v,vi),(vi,V2), • • • ,(vk,w) in E. Then (v,w) G E since G is a transitive orientation of G. Therefore (u,w) is transitively implied by (u,v) G E and (v,w) G E. Then ^ u; by Lemma 6.17. If j = L , as shown in Figure 6.5, then Fj[u] ^ u by v Level i — Level j — — — '••o""-*<r* t s F [u] v 3 Figure 6.5: Arc (u,w) is transitively implied by (u,v) and (v,w). Lemma 6.17, and taking F of both sides, •< F{[v] by Lemma 6.18. Therefore I FilFjiu]] z< Fi[v] X Table 6.4: Algorithm: k T R A N S ( V , / ) Input: The vertices V and a realization / of a fc-level graph G = (V,E). Output: The arcs in the transitive reduction of G , where G is the orientation of G that is compatible with / . 1 F <- G E N E R A T E - F ( V, f ) 2 for u G V 3 do for i <—1 to fc 4 do r <- m'm{Fi[Fj[u]] : 1 < j < fc} 5 for v Fi[u] to r -„ — 1 6 do return (u,v) iu 8 Theorem 6.22 Given a k-level strip graph, represented by vertices V and realization f, Algorithm kTRANS generates all arcs in the transitive reduction (V, R) of the graph's oriented complement in 0 ( V l o g V + k V + R) time. 2 Chapter 6. Two-Level Graphs 259 Proof: Correctness follows from Lemma 6.21 and Theorem 6.20. In particular, Step 6 is executed \R\ times. Step 1 takes 0(V\ogV + kV) by Theorem 6.20. Computing the minimum value of in Step 4 takes k operations. Since this step is called \V\k times, this accounts for 0(k V) operations. 2 Note that the same storage location can be used for all values r,- ; that is, we can u replace all variables r JU with a variable r. | Corollary 6.22.1 Given a two-level graph, represented by vertices V and realization f, Algorithm kTRANS generates all arcs in the transitive reduction (V, R) of the graph's oriented complement in 0(V log V + R) time. 6.3.5 Weighted Cliques and Independent Dominating Sets We are now ready to compute a minimum weight independent dominating set in a &-level graph. A n independent set is dominating if and only if it is maximal (Observation 4.30 in Chapter 4), and a set is maximal independent if and only if it is a maximal clique in the complement. We will therefore develop an algorithm that finds a minimum weight maximal clique in the complement of the fc-level graph. To do so, we will simply implement Algorithm M W M C - C , minimum weight maximal clique for comparability graphs from Table 4.34, to run in 0(V ) time, given the structure developed in this section. This 2 solves the domination problem since the graph representation V and / also represents the complement of the graph. For convenience, the algorithm is reproduced below. Theorem 6.23 Algorithm MWMC-k finds a minimum weight independent dominating set in (a minimum weight maximal clique in the complement of) a weighted k-level graph in 0(k V + V ) time. 2 2 Chapter 6. Two-Level Graphs 260 Table 6.5: Algorithm: M W M C - k ( V , / ) [Minimum Weight Maximal Clique in the complement of a A;-level graph] Input: The weighted vertices V and a realization / of a (vertex) weighted fc-level graph G = (V, E). Output: A minimum weight maximal clique in G. 1 2 3 4 5 T 4— a transitive orientation of G. augment T with 5 = 0 and t = | V | + 1. (V, R) <— the transitive reduction of T. C 4— a least weight path from s to t in (V, R). return C \ {s, t}. Proof: Since every k-level graph is a cocomparability graph, Theorem 4.34 in Chapter 4 establishes the correctness of the algorithm. Let G = (V, E) be the input fc-level graph, and T = (V, E) be its oriented complement. Then E is a transitive orientation of E by Property 6.12. Let s be any vertex s -, and let t s be any vertex U in Algorithm I N I T I A L I Z E - O R I E N T E D - C O M P L E M E N T , Step 1. Then implement Steps 1, 2, and 3 with a single call to Algorithm k T R A N S . This call takes 0(V log V+k V+R) time according to Theorem 6.22. As before (Algorithm M W M C - C in 2 Chapter 4), Step 4 executes in 0(V + R) time since R is a directed acyclic graph ([CLR90], page 536-538). The theorem follows since \R\ < \E\ = 0(V ). 2 I Let us now examine some of the consequences of Theorem 6.23. The parameter k does not figure in the complexity of the weighted clique algorithm if k is fixed, since it is consumed by the constants in the big-oh notation. In particular, the algorithm on two-level graphs has a better time complexity. Corollary 6.23.1 Algorithm MWMC-k finds a minimum weight independent dominating set in (a minimum weight maximal clique in the complement of) a weighted two-level graph in 0(V ) time. 2 Chapter 6. Two-Level Graphs Remark 261 The proof of Theorem 6.23 argues that \R\ < \E\ = 0 ( V ) , that is, that 2 the size of the transitive reduction is at most the number of arcs in the graph, which for one-level (indifference) graphs. The oriented complement of the indifference graph shown in Figure 6.6 is the complete bipartite graph K , ntn where n — \V\/2. Clearly, Figure 6.6: The oriented complement of this indifference graph is an oriented complete bipartite graph and is transitively reduced. this oriented complement has n arcs. Furthermore, no arc is transitively implied, so the 2 transitive reduction also has n = \V\ /4 arcs. 2 6.4 2 Relation to Indifference Graphs A one-level graph is clearly an indifference graph. A two-level graph is in some ways like two indifference graphs, one on each level. This initial observation can be misleading, though, since a two-level graph is not just the union of these two graphs. As discussed in Section 2.3.2, indifference have several characterizations and efficient algorithms for many problems. Since we are interested in these things on two-level graphs, it behooves us to study more closely how two-level graphs are related to indifference graphs. Recall (§2.3.2) that indifference graphs are equivalently claw-free interval graphs, that is, claw-free chordal cocomparability graphs. Since two-level graphs are strip graphs, they Chapter 6. Two-Level Graphs 262 are also cocomparability graphs. On the other hand, since C4 is a two-level graph, twolevel graphs are not chordal. Therefore they are not interval graphs. Contrast this with indifference graphs, which are in fact unit interval graphs. In this section, we will see that the class of two-level graphs is: • equivalently the intersection graphs of a set of triangles, which are themselves properly
- Library Home /
- Search Collections /
- Open Collections /
- Browse Collections /
- UBC Theses and Dissertations /
- Algorithmic aspects of constrained unit disk graphs
Open Collections
UBC Theses and Dissertations
Featured Collection
UBC Theses and Dissertations
Algorithmic aspects of constrained unit disk graphs Breu, Heinz 1996
pdf
Page Metadata
Item Metadata
Title | Algorithmic aspects of constrained unit disk graphs |
Creator |
Breu, Heinz |
Date Issued | 1996 |
Description | Computational problems on graphs often arise in two- or three-dimensional geometric contexts. Such problems include assigning channels to radio transmitters (graph colouring), physically routing traces on a printed circuit board (graph drawing), and modelling molecules. It is reasonable to expect that natural graph problems have more efficient solutions when restricted to such geometric graphs. Unfortunately, many familiar NPcomplete problems remain NP-complete on geometric graphs. Indifference graphs arise in a one-dimensional geometric context; they are the intersection graphs of unit intervals on the line. Many NP-complete problems on arbitrary graphs do have efficient solutions on indifference graphs. Yet these same problems remain NP-complete for the intersection graphs of unit disks in the plane (unit disk graphs), a natural two-dimensional generalization of indifference graphs. What accounts for this situation, and how can algorithms be designed to deal with it? To study these issues, this thesis identifies a range of subclasses of unit disk graphs in which the second spatial dimension is gradually, introduced. More specifically, τ-strip graphs "interpolate" between unit disk graphs and indifference graphs; they are the intersection graphs of unit-diameter disks whose centres are constrained to lie in a strip of thickness τ. This thesis studies algorithmic and structural aspects of varying the value τ for τ-strip graphs. The thesis takes significant steps towards characterizing, recognizing, and laying out strip graphs. We will also see how to develop algorithms for several problems on strip graphs, and how to exploit their geometric representation. In particular, we will see that problems become especially tractable when the strips are "thin" (τ is small) or "discrete" (the number of possible y-coordinates for the disks is small). Note again that indifference graphs are the thinnest (τ = 0) and most discrete (one y-coordinate) of the nontrivial τ-strip graphs. The immediate results of this research concern algorithms for a specific class of graphs. The real contribution of this research is the elucidation of when and where geometry can be exploited in the development of efficient graph theoretic algorithms. |
Extent | 15033516 bytes |
Genre |
Thesis/Dissertation |
Type |
Text |
File Format | application/pdf |
Language | eng |
Date Available | 2009-03-20 |
Provider | Vancouver : University of British Columbia Library |
Rights | For non-commercial purposes only, such as research, private study and education. Additional conditions apply, see Terms of Use https://open.library.ubc.ca/terms_of_use. |
DOI | 10.14288/1.0051600 |
URI | http://hdl.handle.net/2429/6282 |
Degree |
Doctor of Philosophy - PhD |
Program |
Computer Science |
Affiliation |
Science, Faculty of Computer Science, Department of |
Degree Grantor | University of British Columbia |
Graduation Date | 1996-05 |
Campus |
UBCV |
Scholarly Level | Graduate |
Aggregated Source Repository | DSpace |
Download
- Media
- 831-ubc_1996-090493.pdf [ 14.34MB ]
- Metadata
- JSON: 831-1.0051600.json
- JSON-LD: 831-1.0051600-ld.json
- RDF/XML (Pretty): 831-1.0051600-rdf.xml
- RDF/JSON: 831-1.0051600-rdf.json
- Turtle: 831-1.0051600-turtle.txt
- N-Triples: 831-1.0051600-rdf-ntriples.txt
- Original Record: 831-1.0051600-source.json
- Full Text
- 831-1.0051600-fulltext.txt
- Citation
- 831-1.0051600.ris