Extremal solutions to some art gallery and terminal-pairability problems

Tamás Róbert Mezei

Supervisor: Prof. Ervin Győri

Department of and its Applications Central European University

In partial fulfillment of the requirements for the degree of Doctor of Philosophy

Budapest, September 2017

I would like to dedicate this thesis to my family, without whose support this would never have been written.

Declaration

I hereby declare that except where specific reference is made to the work of others, the contents of this dissertation are original and have not been submitted in whole or in part for consideration for any other degree or qualification in this, or any other university. This dissertation is my own work and contains nothing which is the outcome of work done in collaboration with others, except as specified in the text.

Tamás Róbert Mezei Budapest, September 2017

Acknowledgments

I would like to thank Ervin Győri and Gábor Mészáros for suggesting the topics discussed in this thesis. I would also like to thank them for a fruitful collaboration. I am ever so grateful to Ervin for all he has taught me (and the great stories he told me!) during the many hours of supervision over the years. I am thankful to the examiners for their helpful comments.

Abstract

The thesis consists of two parts. In both parts, the problems studied are of significant interest, but are either NP-hard or unknown to be polynomially decidable. Realistically, this forces us to relax the objective of optimality or restrict the problem. As projected by the title, the chosen tool of this thesis is an extremal type approach. The lesson drawn by the proved in the thesis is that surprisingly small compromise is necessary on the efficacy of the solutions to make the approach work. The problems studied have several connections to other subjects (e.g., geometric algorithms, graph immersions, multi-commodity flow problem) and practical applications (e.g., VLSI design, image processing, routing traffic in networks). Therefore, even slightly improving constants in existing results is beneficial. The first part of the thesis is concerned with orthogonal art galleries. A sharp extremal bound is proved on partitioning orthogonal polygons into at most 8-vertex polygons using established techniques in the field of art gallery problems. This fills in the gap between already known results for partitioning into at most 6- and 10-vertex orthogonal polygons. Next, these techniques are further developed to prove a new type of extremal art gallery result. The novelty provided by this approach is that it establishes a connection between mobile and stationary guards. This has strong computational consequences, in fact, it provides the basis for an 8 - for guarding orthogonal polygons 3 with rectangular vision. In the second part, the graph theoretical concept of terminal-pairability is studied in complete and complete grid graphs. Once again, the extremal approach is conductive to discovering efficient methods to solve the problem. In the case of a complete base graph, the new demonstrated lower bound on the maximum degree of realizable demand graphs is 4 times higher than previous best results. The tech- niques developed are then used to solve the classical extremal edge number problem for the terminal-pairability problem in complete base graphs. x

The complete grid base graph lies on the other end of the spectrum in terms density amongst path-pairable graphs. It is shown that complete grid graphs are relatively efficient in routing edge-disjoint paths. In fact, as a corollary, the minimum maximum degree a path-pairable graph may have is lowered to 푂(log 푛) (prior studies show a lower bound of Ω(log 푛/ log log 푛)). Table of contents

List of figures xiii

List of tables xv

Preface 1

I Orthogonal art galleries 3

1 Introduction to orthogonal art galleries 5 1.1 Origins and summary of the new results ...... 5 1.2 Outline of Part I ...... 10 1.3 Definitions and preliminaries ...... 10

2 Partitioning orthogonal polygons 13 2.1 Introduction ...... 13 2.2 Definitions and preliminaries ...... 14 2.3 Tree structure ...... 16 2.4 Extending cuts and cut-systems ...... 17 2.5 Proof of Theorem 1.6 ...... 19

3 Mobile vs. point guards 35 3.1 Introduction ...... 35 3.2 Translating the problem into the language of graphs ...... 38 3.3 Proof of Theorem 3.1′ ...... 42 3.3.1 푀 is 2-connected ...... 42 3.3.2 푀 is connected, but not 2-connected ...... 55 3.3.3 푀 has more than one connected component...... 56 xii Table of contents

4 Algorithms and complexity 59 4.1 Partitioning orthogonal polygons ...... 60 4.2 Finding guard systems ...... 61

II Terminal-pairability (edge-disjoint path problem) 67

5 The terminal-pairability problem 69 5.1 Problem statement and origins ...... 69 5.2 Outline of Part II ...... 71

6 Complete base graphs 73 6.1 Proof of Theorem 6.4 ...... 75 6.2 Proof of Theorem 6.7 ...... 80

7 Complete grid base graphs 83 7.1 Introduction ...... 83 7.2 Proof of Theorem 7.1 ...... 84 7.3 Remarks ...... 86

8 Related subjects, algorithms and complexity 87 8.1 Immersions ...... 87 8.2 Algorithms and complexity ...... 89 8.2.1 Algorithmic versions of Theorem 6.4 and 7.1 ...... 90 8.2.2 Comparing our results to the state of the art ...... 93 8.3 Further base graphs ...... 93

References 95

Appendix A A note on models of computation and representations of graphs 101

Appendix B Algorithms on orthogonal polygons 103 List of figures

1.1 The tips of the tooth are only visible from pairwise disjoint regions; there- fore, a guard has to be placed in each tooth ...... 5 1.2 An orthogonal comb; a guard has to be placed for each tooth ...... 7 1.3 The dashed lines show a minimum cardinality partition into at most 8-vertex pieces ...... 9 1.4 After this transformation, those mobile guards whose maximal containing line segment do not intersect vertices of the rectilinear domain, are just as powerful as mobile guards that are not restricted in such a way...... 12

2.1 An L-shaped cut creating a partition into 8-vertex orthogonal polygons . . . 14 2.2 Examples for all types of cuts. Light gray areas are subsets of int(퐷)..... 15 2.3 푅 ∪ 푄 in all essentially different relative positions of 푅, 푄 ∈ 푉 (푇 ) (up to dilation and contraction of the segments of 푅 ∪ 푄 such that its angles are

preserved eventually), where {푅, 푄} ∈ 퐸(푇 ) and 푣TL(푅) ∈ 푄 ...... 18 2.4 The 4 cases of the proof...... 21 2.5 퐿 is a good cut ...... 22

2.6 deg(푅) ≥ 3 and 푅BL ≠ ∅ ...... 23

2.7 deg(푄) ≥ 3 and 푄BL ≠ ∅ ...... 25 2.8 푅 has one pocket ...... 26

2.9 The top side of 푅 = 푅1 ∪ 푅2 ∪ 푅3 is contained entirely by a neighboring rectangle...... 27

2.10 The rectilinear domain 푈 is shown in (a). The cuts 퐿1, 퐿2, 퐿3, shown in (b), form a good-cut system of 푈...... 28

2.11 The last 3 cases of the proof. Since 푒BR(푅) is a type 2 or 3 edge, cutting the rectilinear domain at 퐿 creates two rectilinear domains of 8-vertices. . . . . 32 2.12 The output of the algorithm on a rectilinear domain of 52 vertices...... 33 xiv List of figures

3.1 A comb with 10 teeth ...... 35 3.2 A polygon with holes — unlimited ratio...... 36 3.3 Vertical dotted lines: a minimum size vertical mobile guard system; Horizontal dot- ted lines: a minimum size horizontal mobile guard system; Solid disks: a minimum size point guard system...... 37 3.4 A rectilinear domain and its associated pixelation graph ...... 38 ′ ′ ″ 3.5 We have 푀퐻 = {ℎ1, ℎ2, ℎ3, ℎ4, ℎ5}, 푀퐻 = 푀퐻 − ℎ3 + ℎ3 + ℎ3 , and ′ 푀푉 = 푀푉 = {푣1, 푣2, 푣3, 푣4, 푣5, 푣6}. The thick line is the boundary of 퐷푀 . Each rectangle pixel is labeled according to the type of its corresponding edge of 푀′...... 44

5.1 Examples for terminal-pairability and path-pairability problems. Each ver- tex is labeled with the demand edges to which it is incident to...... 70

6.1 Lifting 2 edges of 푢푣 to 푧 and 푤 ...... 75 6.2 Resolving the multiplicities at 푣 ...... 75

6.3 A balanced lifting coloring, where 푥1, 푥2, 푥3 get pairwise different colors. . 77

6.4 A demand graph and a possible realization in 퐾6 ...... 82 List of tables

1.1 The extremal number of guards required to cover an 푛-vertex gallery . . . . 9

3.1 Translating the orthogonal art gallery problem to the pixelation graph . . . 41

4.1 Definitions of the sliding camera problems (MHSC and MSC)...... 62 4.2 Definitions of the Total and Dominating Set problem . . . 63 4.3 Definitions of the Point (푟-)guard problem ...... 65

8.1 Definition of the Maximum Edge-Disjoint Paths problem (MaxEDP).... 89

Preface

By merely reading the title of this work, the reader might wonder (and justifiably so) how the two main problems discussed in this thesis relate to each other. Well, I believe one of the main connection between them is my and Ervin’s taste in mathematics. Let me explain.

Both the art gallery and the terminal-pairability problems encumber a vast family of natural questions. This is a direct consequence of the intuitiveness of these problems: they are very abstract models of challenges that appear in the real world, therefore they lend themselves to innumerable variations. Unfortunately, the generality of these problems — their com- putational complexity is either NP-hard or unknown to be polynomial — prevents us from finding an optimal solution (a lazy excuse, I know).

However, this is no reason to give up. The logical next step (at least to us) is to relax the goal of seeking an optimal solution to finding a bound, that which a solution achieving is guaranteed to exist. Hence, the purpose of this thesis is to find such bounds that are either sharp (the orthogonal art gallery theorems in Part I), or up to a small constant sharp (the terminal-pairability theorems in Part II). This extremal approach is a main theme of this thesis.

A pleasant phenomenon accompanying this approach is that we are also able to find efficient algorithms that construct the above described solutions. Moreover, our theorems guarantee that these solutions are constant approximations of the optimal solution, and thus are even relevant in practice.

I am hoping this preface provides a satisfying explanation of the apparent dichotomy present in the title. Now, I invite you, dear reader, to join me in my 3-year journey into discrete , , algorithms, complexity, and in general.

Part I

Orthogonal art galleries

Chapter 1

Introduction to orthogonal art galleries

1.1 Origins and summary of the new results

The original art gallery problem was stated by Victor Klee in 1973 [Hon76]. He posed the following question: given a simple polygon of 푛 vertices, how many stationary guards are required to cover the interior of the polygon? To clarify, a point in the gallery is visible to the guard if the line segment spanned by the point and the guard lies in the closed gallery (line of sight vision). The problem was solved by Vašek Chvátal in 1975:

Theorem 1.1 (Chvátal [Chv75]). ⌊ 푛 ⌋ guards are sufficient and sometimes necessary to cover 3 a domain bounded by a simple closed polygon.

It is easy to see that at least ⌊ 푛 ⌋ guards are required, even if only the vertices of the polygon 3 must be covered:

Fig. 1.1 The tips of the tooth are only visible from pairwise disjoint regions; therefore, a guard has to be placed in each tooth 6 Introduction to orthogonal art galleries

The original proof by Chvátal used an inductive partitioning argument with 3 main cases and a couple of small subcases. Not much later, in 1978, Steve Fisk found such a beautiful proof of this theorem, that it is said to be “from the book” (see [AZ14]).

Proof of Theorem 1.1 [Fis78]. First, we prove the well-known fact that simple closed poly- gons can be triangulated, i.e., we can select 푛 − 3 pairs of vertices of the polygon, such that the line segments spanned by the pairs are in the polygon and these segments may only in- tersect in their endpoints. The proof is by induction. For 푛 = 3, the statement is trivial. By sweeping the plane with a line whose slope is different from the slope of every side of the polygon, we can find a convex vertex 푣2. Let 푣1 and 푣3 be its two neighbors.

• If the line segment 푣1푣3 is intersects the polygon in two points, we found a diagonal.

Proceed by induction on the polygon obtained by deleting 푣2 and adding 푣1푣3 as a new side.

• Otherwise, 퐿0 = {푣2} and 퐿1 = 푣1푣3. For 푡 ∈ (0, 1), let

퐿푡 = {(1 − 푡) ⋅ 푣2 + 푡 ⋅ 푥 ∶ 푥 ∈ 퐿1},

and take the minimum 푡 for which 퐿푡 intersects the polygon in more than 2 points. One

of these points must be a vertex 푦 of the polygon, which is not contained in 푣1푣2 ∪푣2푣3.

Clearly, 푣2푦 is a diagonal of the polygon, which cuts it into two pieces, say, of 푛1 and

푛2 vertices. As 푛1 +푛2 = 푛+2, and 푛1, 푛2 ≥ 3, we may proceed by induction to obtain

1 + (푛1 − 3) + (푛2 − 3) = 푛 − 3 diagonals.

To any triangulation of the (interior) of the polygon there is a corresponding planar graph 퐺, whose outer face has exactly 푛 points, but every other face of 퐺 is a triangle. Thus, the dual of this graph without the node corresponding to the outer face is a 3-regular tree. If 퐺 has 3 vertices, it is trivially 3-colorable. If 퐺 has more than 3 vertices, remove a degree 2 vertex (and its edges) of a face which is a leaf in the dual of 퐺. By induction, the obtained graph is 3-colorable, and we can easily extend the 3-coloring to the removed degree 2-vertex. The smallest color class 퐴 has size at most ⌊ 푛 ⌋. Clearly, the vertices in 퐴 cover the interior 3 of the polygon, as any triangle face has a vertex in 퐴.

Observe, that the proof produces an interesting partition of the domain bounded by the poly- gon: triangles sharing the same vertex from 퐴 form a fan (imagine a handheld one without gaps), which can trivially be covered by one guard. 1.1 Origins and summary of the new results 7

With the original problem of Chvátal solved, interest turned to different variations of the art gallery problem. One such version is when instead of a general polygon, the gallery is assumed to be bounded by an orthogonal polygon. In 1980, Kahn, Klawe, and Kleitman proved that

Theorem 1.2 (Kahn, Klawe, and Kleitman [KKK83]). ⌊ 푛 ⌋ guards are sufficient and some- 4 times necessary to cover a domain bounded by an orthogonal polygon (even on a Riemann surface whose singularities lie outside the polygon).

The sharp example is the orthogonal comb:

Fig. 1.2 An orthogonal comb; a guard has to be placed for each tooth

In fact, the trio proved the following deep geometric lemma.

Lemma 1.3 ([KKK83]). Any closed region bounded by a finite number of straight lines, each parallel to one of two orthogonal axes, has a convex quadrilateralization (even on a Riemann surface whose singularities lie outside the closed region).

To prove Theorem 1.2 using this lemma, they follow Fisk’s argument. We need to assume that the gallery is bounded by an orthogonal polygon (i.e., holes are prohibited), so that that the of its quadrilateralization (without the outer face) is a tree. Add the two diagonals to each quadrilateral face. Notice, that this graph is 4-colorable, as the degree 2 (3 with the diagonals) vertices of a quadrilateral face which is a leaf in the dual can always be properly colored. The smallest color class covers the gallery. As we noted earlier, the original proof of Lemma 1.3 uses deep geometrical insight, and its proof is about 10 pages long. However, Lubiw [Lub85] gives a sophisticated and much shorter proof by induction. Moreover, her proof is more general, as it includes certain poly- gons with holes, and it even leads to an efficient algorithm. Even though Lemma 1.3 applies to even orthogonal polygons with holes, we need simply connectedness to construct the 4-coloring whose existence proves Theorem 1.2. 8 Introduction to orthogonal art galleries

In the first half of the 1980’s, Győri and O’Rourke independently gave a simple and short proof of Theorem 1.2.

Theorem 1.4 (Győri [Győ86] and O’Rourke [ORo87, Thm. 2.5]). Every orthogonal polygon of 푛 vertices can be partitioned into ⌊ 푛 ⌋ orthogonal polygons of at most 6 vertices. 4 Theorem 1.4 is in some aspects a deeper result than that of Kahn, Klawe, and Kleitman, as any simple orthogonal polygon of 6 vertices can be covered by a stationary guard. Each proof so far shines light on an interesting phenomenon, which we will refer to as the “metatheorem”:

Metatheorem of art galleries. Each (orthogonal) art gallery theorem has an underlying partition theorem (into simple parts).

Although both Theorem 1.2 and Theorem 1.4 only apply to simply connected art galleries, Hoffman showed that the same bound holds for any closed region bounded by axis parallel line segments.

Theorem 1.5 (Hoffmann [Hof90]). Any orthogonal polygon with holes of a total of 푛 vertices can be partitioned into ⌊ 푛 ⌋ rectangular stars of at most 16 vertices. 4 Hoffmann’s theorem also verifies the metatheorem. Soon after this result, Hoffmann and Kaufmann [HK91] provided an efficient algorithm to construct such a partition. In Chapter 2, we present further evidence that the metatheorem holds, namely we prove the following partition theorem:

Theorem 1.6 (Győri and Mezei [GM16]). Any simple orthogonal polygon of 푛 vertices can be partitioned into at most ⌊ 3푛+4 ⌋ orthogonal polygons of at most 8 vertices. 16 A mobile guard is one who can patrol a line segment in the gallery, and it covers a point 푥 of the gallery if there is a point 푦 on its patrol such that the line segment [푥, 푦] is contained in the gallery. The upper bound of the mobile guard art gallery theorem for orthogonal polygons follows immediately from Theorem 1.6, as an orthogonal polygon of at most 8 vertices can be covered by a mobile guard.

Theorem 1.7 (Aggarwal [Agg84], [also in ORo87, Thm. 3.3]). ⌊ 3푛+4 ⌋ mobile guards are 16 sufficient for covering an 푛-vertex simple orthogonal polygon. 1.1 Origins and summary of the new results 9

Point guards Mobile guards 푛 푛 Simple polygons ⌊3⌋ ⌊4⌋ 푛 3푛 + 4 Simple orthogonal polygons ⌊4⌋ ⌊ 16 ⌋

Table 1.1 The extremal number of guards required to cover an 푛-vertex gallery

The lower bound for the previous two theorems is given by stringing together a series of swastikas (Fig. 1.3). Observe, that a mobile guard may cover some points of the end of an arm of a swastika for at most one arm. Therefore a mobile guard has to be put in each arm. For 푛 ≢ 0 (mod 16), a spiral has to attached to one of the arms. Theorem 1.6 is a stronger result than Theorem 1.7 and it is interesting on its own. It fits into the series of results in [Győ86; HK91; ORo87, Thm. 2.5; GHKS96] showing that orthogo- nal art gallery theorems are based on theorems on partitions into smaller (“one guardable”) pieces. Moreover, Theorem 1.6 directly implies the following corollary which strengthens the pre- vious theorem and answers two questions raised by O’Rourke [ORo87, Section 3.4].

Corollary 1.8 (Győri and Mezei [GM16]). ⌊ 3푛+4 ⌋ mobile guards are sufficient for cover- 16 ing an 푛-vertex simple orthogonal polygon such that the patrols of two guards do not pass through one another and visibility is only required at the endpoints of the patrols.

The results on guarding simple polygons and orthogonal polygons are summarized in Ta- ble 1.1. The proof of the sharp bound on mobile guards in simple polygons due to O’Rourke [ORo87, Thm. 3.1] also confirms the metatheorem. A that does not use complex geometric reasoning has already existed for three of the four bounds listed in Table 1.1. The until recently missing fourth such proof is that of Theorem 1.6.

Fig. 1.3 The dashed lines show a minimum cardinality partition into at most 8-vertex pieces 10 Introduction to orthogonal art galleries

Joseph O’Rourke pointed out in his 1987 book titled “Art gallery theorems and algo- rithms” [ORo87] that there is a mysterious 4 ∶ 3 ratio between the extremal number of point and mobile guards for art galleries given by both simple polygons and simple orthogonal polygons, as can be seen on Table 1.1.

1.2 Outline of Part I

After precisely defining the subjects of our study in Chapter 2, we introduce the concept of 푅-trees, which is a well-known tool in the literature. The proof of Theorem 1.6 follows. In Chapter 3 we show that this ratio between the efficacy of point and mobile guards is not only an extremal phenomenon in simple orthogonal polygons appearing for a fixed number of vertices. The magical ratio appears in an upper bound for the ratio of the minimum number of stationary guards covering the gallery and the minimum size of a special, restricted mobile guard cover. The results of Chapter 2 and 3 have been discovered in collaboration with my supervisor, Ervin Győri. In the last chapter of Part I of this thesis (Chapter 4) we discuss algorithmic versions of our proofs and the computational complexity of orthogonal art gallery problems in general.

1.3 Definitions and preliminaries

Our universe for the study of art galleries is the plane ℝ2.A polygon is defined by a cyclically ordered list of pairwise distinct vertices in the plane. It is drawn by joining each successive pair of vertices on the list by line segments, that only intersect in vertices of the polygon. The last requirement ensures that the closed domain bounded by the polygon is simply connected (to emphasize this, such polygons are often referred to as simple polygons in the literature). An orthogonal polygon is a polygon such that its line segments are alternatingly parallel to one of the axes of ℝ2. Consequently, its angles are 1 휋 (convex) or 3 휋 (reflex). 2 2 A rectilinear domain is a closed region of the plane (ℝ2) whose boundary is an orthogonal polygon, i.e., a closed polygon without self-intersection, so that each segment is parallel to one of the two axes. A rectilinear domain with holes is a rectilinear domain with pair- wise disjoint simple rectilinear domain holes. Its boundary is referred to as an orthogonal polygon with holes. The definitions imply that number of vertices of an orthogonal polygon (even with holes) is even. We denote the number of vertices of the polygon by 푛(푃 ), and define 푛(퐷) = 푛(푃 ), 1.3 Definitions and preliminaries 11 where 퐷 is the domain bounded by 푃 . Conversely, we write 푃 = 휕퐷. We want to emphasize that in our problems not just the walls, but also the interior of the gallery must be covered. In the proofs of the theorems, therefore, we are working on rectilinear domains, not orthogonal polygons, even though one defines the other uniquely, and vice versa. Whenever results about objects that are allowed to have holes are mentioned, it is explicitly stated. To avoid confusion, we state that throughout this part, vertices and sides refer to subsets of an orthogonal polygon or a rectilinear domain; whereas any graph will be defined on a set of nodes, of which some pairs are joined by some edges. Given a graph 퐺, the edge set 퐸(퐺) is a subset of the 2-element subsets of the vertices 푉 (퐺). Unless otherwise noted, we adhere to the same terminology in the subject of art galleries as O’Rourke [ORo87]. However, for technical reasons, sometimes we need to assume extra conditions over what is traditionally assumed. In Lemma 1.9, we prove that we may, without restricting the problem, require the assumptions typeset in italics in the following definitions. Two points 푥, 푦 in a domain 퐷 have line of sight vision, unrestricted vision, or simply just vision of each other if the line segment induced by 푥 and 푦 is contained in 퐷. A point guard in an art gallery 퐷 is a point 푦 ∈ 퐷. It has vision of a point 푥 ∈ 퐷 if the line segment 푥푦 is a subset of 퐷. The term “stationary guard” refers to the same meaning, and is used mostly in contrast with “mobile guards”. A mobile guard is a line segment 퐿 ⊂ 퐷. A point 푥 ∈ 퐷 is seen by the guard if there is a point 푦 ∈ 퐿 which has vision of 푦. Intuitively, a mobile guard is a point guard patrolling the line segment 퐿. The points covered by a guard is just another name for the set of points of 퐷 that are seen by the guard. A system of guards is a set of guards in 퐷 which cover 퐷, i.e., for any point 푥 ∈ 퐷, there is a guard in the system covering 푥. Two points 푥, 푦 in a rectilinear domain 퐷 have 푟-vision of each other (alternatively, 푥 is 푟-visible from 푦) if there exists an axis-aligned non-degenerate rectangle in 퐷 which con- tains both 푥 and 푦. This vision is natural to use in orthogonal art galleries instead of the more powerful line of sight vision. For example, 푟-vision is invariant on the transformation depicted on Fig. 1.4. A point 푟-guard is a point 푦 ∈ 퐷, such that the two maximal axis-parallel line segments in 퐷 containing 푦 do not intersect vertices of 퐷. A set of point guards 푟-cover 퐷 if any point 푥 ∈ 퐷 is 푟-visible from a member of the set. Such a set is called a point 푟-guard system. 12 Introduction to orthogonal art galleries

A vertical mobile 푟-guard is a vertical line segment in 퐷, such that the maximal line segment in 퐷 containing it does not intersect vertices of 퐷. Horizontal mobile guards are defined analogously. A mobile 푟-guard is either a vertical or a horizontal mobile 푟-guard. A mobile 푟-guard 푟-covers any point 푥 ∈ 퐷 for which there exists a point 푦 on its line segment such that 푥 is 푟-visible from 푦.

Lemma 1.9. Any rectilinear domain 퐷 can be transformed into another rectilinear domain 퐷′ so that the point guard 푟-cover, and the vertical/horizontal mobile guard 푟-cover problems in 퐷, without the restrictions typeset in italics, are equivalent to the respective problems, as per our definitions (i.e., with the restrictions), in 퐷′.

Fig. 1.4 After this transformation, those mobile guards whose maximal containing line segment do not intersect vertices of the rectilinear domain, are just as powerful as mobile guards that are not restricted in such a way.

Proof. Let 휀 be the minimal distance between any two horizontal line segments of 휕퐷. The transformation depicted in Fig. 1.4 in 퐷 takes a maximal horizontal line segment 퐿 in 퐷 which is touched from both above and below by the exterior of 퐷, and maps 퐷 to

퐷′ = 퐷 퐿 + (0, −휀/4)(0, 휀/4) , ⋃ ( ) where addition is taken in the Minkowski sense. There is a trivial correspondence between the point and mobile guards of 퐷 and 퐷′ such that taking this correspondence guard-wise transforms a guarding system of 퐷 (guards without the restrictions) into a guarding system of 퐷′ (guards with the restrictions), and vice versa. After performing this operation at every vertical and horizontal occurrence, we get a recti- linear domain 퐷″, in which any vertical or horizontal line segment is contained in a non- degenerate rectangle in 퐷″. Therefore, degenerate vision between any two points implies non-degenerate vision between the pair. Furthermore, the line segment of any mobile guard can be translated slightly along its normal (at least in one direction) while staying inside 퐷″, and this clearly does not change the set of points 푟-covered by the guard. Similarly, we can perturb the position of a point guard without changing the set of points of 퐷″ it 푟-covers. Chapter 2

Partitioning orthogonal polygons

2.1 Introduction

For the sake of completeness, we mention that any orthogonal polygon of 푛 vertices can be partitioned into at most ⌊ 푛 ⌋ − 1 rectangles, and this bound is sharp. In this case, the 2 interesting question is the minimum number of covering rectangles, see Chapter 4. Theorem 1.6 fills in a gap between two already established (sharp) results: in [Győ86] it is proved that orthogonal polygons can be partitioned into at most ⌊ 푛 ⌋ orthogonal polygons 4 of at most 6 vertices, and in [GHKS96] it is proved that any orthogonal polygon in general position (an orthogonal polygon without 2-cuts) can be partitioned into ⌊ 푛 ⌋ orthogonal poly- 6 gons of at most 10 vertices. However, we do not know of a sharp theorem about partitioning orthogonal polygons into orthogonal polygons of at most 12 vertices. Furthermore, for 푘 ≥ 4, not much is known about partitioning orthogonal polygons with holes into orthogonal polygons of at most 2푘 vertices. Per the “metatheorem,” the first step in this direction would be proving that an orthogonal polygon of 푛 vertices with ℎ holes can be partitioned into ⌊ 3푛+4ℎ+4 ⌋ orthogonal polygons of at most 8 vertices. This would 16 generalize the corresponding art gallery result in [GHKS96, Thm. 5.]. The proof of Theorem 1.6 is similar to the proofs of Theorem 1.4 in that it finds a suitable cut and then uses induction on the parts created by the cut. However, a cut along a line segment connecting two reflex vertices is no longer automatically good. We also rely heavily on a tree structure of the orthogonal polygon (Section 2.3). However, while O’Rourke’s proof of Theorem 1.4 only uses straight cuts, in our case this is not sufficient: Fig. 2.1 shows an orthogonal polygon of 14 vertices which cannot be cut into 2 orthogonal polygons of at most 8 vertices using cuts along straight lines. Therefore, we must consider L-shaped cuts too. 14 Partitioning orthogonal polygons

Fig. 2.1 An L-shaped cut creating a partition into 8-vertex orthogonal polygons

2.2 Definitions and preliminaries

Let 퐷, 퐷1, 퐷2 be rectilinear domains of 푛, 푛1, 푛2 vertices, respectively. If 퐷 = 퐷1 ∪ 퐷2, int(퐷1) ∩ int(퐷2) = ∅, 0 < 푛1, 푛2 and 푛1 + 푛2 ≤ 푛 + 2 are satisfied, we say that 퐷1, 퐷2 form an admissible partition of 퐷, which we denote by 퐷 = 퐷1 ⨄ 퐷2. Also, we call

퐿 = 퐷1 ∩퐷2 = 휕퐷1 ∩휕퐷2 a cut in this case. We may describe this relationship concisely by 푖 푖 퐿(퐷1, 퐷2). If, say, we have a number of cuts 퐿1, 퐿2, etc., then we usually write 퐿푖(퐷1, 퐷2). 푦 Generally, if a rectilinear domain is denoted by 퐷푥, then 푦 refers to a cut and 푥 ∈ {1, 2} is the label of the piece in the partition created by said cut. Furthermore, if

3푛 + 4 3푛 + 4 3푛 + 4 1 + 2 ≤ . (2.1) ⌊ 16 ⌋ ⌊ 16 ⌋ ⌊ 16 ⌋ is also satisfied, we say that 퐷1, 퐷2 form an induction-good partition of 퐷, and we call 퐿 a good cut.

Lemma 2.1. An admissible partition 퐷 = 퐷1 ⨄ 퐷2 is also and induction-good partition if

(a) 푛1 + 푛2 = 푛 + 2 and 푛1 ≡ 2, 8, or 14 (mod 16), or

(b) 푛1 + 푛2 = 푛 and 푛1 ≡ 0, 2, 6, 8, 12, or 14 (mod 16), or (c) 푛 ≢ 14 mod 16 and either

푛1 + 푛2 = 푛 and 푛1 ≡ 10 (mod 16), or

푛1 + 푛2 = 푛 + 2 and 푛1 ≡ 12 (mod 16).

Proof. Using the fact that the floor function satisfies the triangle inequality, the proof reduces to an easy case-by-case analysis, which we leave to the reader.

Any cut 퐿 falls into one of the following 3 categories (see Fig. 2.2):

(a) 1-cuts: 퐿 is a line segment, and exactly one of its endpoints is a (reflex) vertex of 퐷. 2.2 Definitions and preliminaries 15

(b) 2-cuts: 퐿 is a line segment, and both of its endpoints are (reflex) vertices of 퐷.

(c) L-cuts: 퐿 consists of two connected line segments, and both endpoints of 퐿 are (re- flex) vertices of 퐷.

Note that for 1-cuts and L-cuts the size of the parts satisfy 푛1 + 푛2 = 푛 + 2, while for 2-cuts

we have 푛1 + 푛2 = 푛.

✀ ✀

(a) 1-cut (b1) 2-cut ✀ ✀

(b2) 2-cut (c) L-cut

Fig. 2.2 Examples for all types of cuts. Light gray areas are subsets of int(퐷).

In the proof of Theorem 1.6 we are searching for an induction-good partition of 퐷. As a good cut defines an induction-good partition, it is sufficient to find a good cut. We could hope that a good cut of a rectilinear piece of 퐷 is extendable to a good cut of 퐷, but unfortunately a good cut of a rectilinear piece of 퐷 may only be an admissible cut with respect to 퐷 (if it is a cut of 퐷 at all). Lemma 2.1, however, allows us to look for cut-systems containing a good cut. Fortunately, it is sufficient to consider non-crossing, nested cut-systems of at most 3 cuts, defined as follows.

1 1 2 2 3 3 Definition 2.2 (Good cut-system). The cuts 퐿1(퐷1, 퐷2), 퐿2(퐷1, 퐷2) and 퐿3(퐷1, 퐷2) (pos- 1 2 3 sibly 퐿2 = 퐿3) constitute a good cut-system if 퐷1 ⊂ 퐷1 ⊆ 퐷1, and the set

푖 푖 {푛(퐷1) | 푖 ∈ {1, 2, 3}} ∪ {푛(퐷1) + 2 | 푖 ∈ {1, 2, 3} and 퐿푖 is a 2-cut}

contains three consecutive even elements modulo 16 (i.e., the union of their residue classes contains a subset of the form {푎, 푎 + 2, 푎 + 4} + 16ℤ). If this is the case we also define their 1 3 kernel as ker{퐿1, 퐿2, 퐿3} = (퐷1 − 퐿1) ∪ (퐷2 − 퐿3), which will be used in Lemma 2.10.

Lemma 2.1(a) and 2.1(b) immediately yield that any good cut-system contains a good cut. 16 Partitioning orthogonal polygons

Remark 2.3. It is easy to see that if a set of cuts satisfies this definition, then they obviously satisfy it in the reverse order too (the order of the generated parts is also switched). Actually, these are exactly the two orders in which they do so. Thus, the kernel is well-defined, and when speaking about a good cut-system it is often enough to specify the set of participating cuts.

2.3 Tree structure

Any reflex vertex of a rectilinear domain 퐷 defines a (1- or 2-) cut along a horizontal line segment whose interior is contained in int(퐷) and whose endpoints are the reflex vertex and another point on the boundary of 퐷. Next, we define a graph structure derived from 퐷, which is a standard tool in the literature, for example it is called the 푅-graph of an orthogo- nal polygon in [GHKS96]. A similar structure is used by O’Rourke to prove Theorem 1.4, see [ORo87, p. 76].

Definition 2.4 (Horizontal (vertical) 푅-tree). The horizontal (vertical) 푅-tree 푇 of a recti- linear domain 퐷 (or the orthogonal polygon 휕퐷 bounding it) is obtained as follows. First, partition 퐷 into a set of rectangles by cutting along all the horizontal (vertical) cuts of 퐷. Let 푉 (푇 ), the vertex set of 푇 be the set of resulting (internally disjoint) rectangles. Two rectangles of 푇 are connected by an edge in 퐸(푇 ) iff their boundaries intersect.

The graph 푇 is indeed a tree as its connectedness is trivial and since any cut creates two internally disjoint rectilinear domains, 푇 is also cycle-free. We can think of 푇 as a sort of dual of the planar graph determined by the union of 휕퐷 and its horizontal cuts. The nodes of 푇 represent rectangles of 퐷 and edges of 푇 represent horizontal 1- and 2-cuts. For this reason, we may refer to nodes of 푇 as rectangles. This nomenclature also helps in distinguishing between vertices of 퐷 (points) and nodes of 푇 . Moreover, for an edge 푒 ∈ 퐸(푇 ), we may denote the cut represented by 푒 by simply 푒, as the context should make it clear whether we are working in the graph 푇 or in the plane. Note that the vertical sides of rectangles are also edges of the orthogonal polygon bounding 퐷.

Definition 2.5. Let 푇 be the horizontal 푅-tree of 퐷. Define 푡 ∶ 퐸(푇 ) → ℤ as follows: given any edge {푅1, 푅2} ∈ 퐸(푇 ), let

푡({푅1, 푅2}) = 푛(푅1 ∪ 푅2) − 8. 2.4 Extending cuts and cut-systems 17

Observe that 0, if 푒 represents a 2-cut; 푡(푒) = { −2, if 푒 represents a 1-cut. The following claim is used throughout the chapter to count the number of vertices of a rectilinear piece of 퐷.

Claim 2.6. Let 푇 be the horizontal 푅-tree of 퐷. Then

푛(퐷) = 4|푉 (푇 )| + 푡(푒). ∑ 푒∈퐸(푇 )

Proof. The proof is straightforward.

Remark 2.7. Equality in the previous claim holds even if some of the rectangles of 푇 are cut into several rows (and the corresponding edges, for which the function 푡 takes −4, are added to 푇 ).

2.4 Extending cuts and cut-systems

The following two technical lemmas considerably simplify our analysis in Section 2.5, where many cases distinguished by the relative positions of reflex vertices of 퐷 on the boundary of a rectangle need to be handled. For a rectangle 푅 let us denote its top left, top right, bottom left, and bottom right vertices with 푣TL(푅), 푣TR(푅), 푣BL(푅), and 푣BR(푅), respectively. 18 Partitioning orthogonal polygons

푄 푄 푄 푣TR(푅) 푣TR(푅) 푣TL(푅) 푣TL(푅) 푅 푅 푣TR(푅) 푣TL(푅) 푅

(a) 푄 ⊆ 푅TL, and 푒TL(푅) is a (b) 푄 ⊆ 푅TL, 푒TL(푅) is a 1-cut, (c) 푄 ⊆ 푅TL, and 푒TL(푅) is a 1-cut and 푅TR = ∅ 2-cut

푄 푄 푣TR(푅) 푣TL(푅) 푅 푣TR(푅) 푣TL(푅) 푅

(d) 푅TL = 푅TR = ∅, 푅 is either (e) 푅TL = ∅, but 푄 ⊆ 푅TR a corridor or a pocket (see Section 2.5)

Fig. 2.3 푅 ∪ 푄 in all essentially different relative positions of 푅, 푄 ∈ 푉 (푇 ) (up to dilation and contraction of the segments of 푅 ∪ 푄 such that its angles are preserved eventually), where {푅, 푄} ∈ 퐸(푇 ) and 푣TL(푅) ∈ 푄

Definition 2.8. Let 푅, 푄 ∈ 푉 (푇 ) be arbitrary. We say that 푄 is adjacent to 푅 at 푣TL(푅), if 푣TL(푅) ∈ 푄 and 푣TL(푅) is not a vertex of the rectilinear domain 푅 ∪ 푄, or 푣TR(푅) ∉ 푄. Such situations are depicted on Figures 2.3a, 2.3b, and 2.3c. However, in the case of Fig. 2.3d and 2.3e we have 푣TR(푅) ∈ 푄 ⊈ 푅TL (= ∅).

If 푄 is adjacent to 푅 at 푣TL(푅), let 푒TL(푅) = {푅, 푄}; by cutting 퐷 along the dual of 푒TL(푅), i.e., 푅 ∩ 푄, we get two rectilinear domains, and we denote the part containing 푄 by 푅TL. If there is no such 푄, let 푒TL(푅) = ∅ and 푅TL = ∅. These relations can be defined analogously for top right (푅TR, 푒TR(푅)), bottom left (푅BL, 푒BL(푅)), and bottom right (푅BR, 푒BR(푅)).

Lemma 2.9. Let 푅 be an arbitrary rectangle such that 푅BL ≠ ∅. Let 푈 be the remaining portion of the rectilinear domain, i.e., 퐷 = 푅BL ⨄ 푈 is a partition into rectilinear domains.

Take an admissible partition 푈 = 푈1 ⨄ 푈2 such that 푣BL(푅) ∈ 푈1. We can extend this to an admissible partition of 퐷 where the two parts are 푈1 ∪ 푅BL and 푈2.

Proof. Let 푄1 = 푅 ∩ 푈1 and let 푄2 ∈ 푉 (푇 ) be the rectangle which is a subset of 푅BL and adjacent to 푅.

Observe that 푈1 and 푅BL only intersect on 푅’s bottom side, therefore their intersection is a line segment 퐿 and so 푈1 ∪ 푅BL is a rectilinear domain. Trivially, 퐷 = (푈1 ∪ 푅BL) ⨄ 푈2 is partition into rectilinear domains, so only admissibility remains to be checked. Let the horizontal 푅-tree of 푈 and 푅 be 푇 and 푇 , respectively. The horizontal 푅-tree 1 BL 푈1 푅BL of 푈 ∪ 푅 is 푇 + 푇 + {푄 , 푄 }, except if 푡({푄 , 푄 }) = −4. Either way, by referring 1 BL 푈1 푅BL 1 2 1 2 2.5 Proof of Theorem 1.6 19 to Remark 2.7 we can use Claim 2.6 to write that

푛(푈1 ∪ 푅BL) + 푛(푈2) − 푛(퐷) = 푛(푈1) + 푛(푅BL) + 푡({푄1, 푄2}) + 푛(푈2) − 푛(퐷) =

= (푛(푈1) + 푛(푈2) − 푛(푈)) + (푛(푈) + 푛(푅BL) − 푛(퐷)) + 푡({푄1, 푄2}) = (2.2)

= (푛(푈1) + 푛(푈2) − 푛(푈)) − 푡({푅, 푄2}) + 푡({푄1, 푄2}).

Now it is enough to prove that 푡({푄1, 푄2}) ≤ 푡({푅, 푄2}). If 푡({푅, 푄2}) = 0 this is trivial.

The remaining case is when 푡({푅, 푄2}) = −2. This means that 푣BL(푅) is not a vertex of

푅 ∪ 푄2, therefore it is not a vertex of 푄1 ∪ 푄2 either, implying that 푛(푄1 ∪ 푄2) < 8.

Lemma 2.10. Let 푅 ∈ 푉 (푇 ) be such that 푅BL ≠ ∅. Let 푈 be the other half of the rectilinear domain, i.e., 퐷 = 푅BL ⨄ 푈. If 푈 has a good cut-system ℒ such that 푣BL(푅) ∈ ker ℒ, then 퐷 also has a good cut-system.

푖 푖 Proof. Let us enumerate the elements of ℒ as 퐿푖 where 푖 ∈ 퐼. Take 퐿푖(푈1, 푈2) such that 푖 ′ 푖 푖 푖 푖 푣BL(푅) ∈ 푈1. Using Lemma 2.9 extend 퐿푖 to a cut 퐿푖 (퐷1, 퐷2) of 퐷 such that 푈2 = 퐷2. Equation (2.2) and the statement following it implies that

푖 푖 푖 푖 푛(퐷1) + 푛(퐷2) = 푛(퐷) + 2 ⟹ 푛(푈1) + 푛(푈2) = 푛(푈) + 2.

′ In other words, if 퐿푖 is a 2-cut then so is 퐿푖 . Therefore

푖 푖 {푛(푈2) | 푖 ∈ 퐼} ∪ {푛(푈2) + 2 | 푖 ∈ 퐼 and 퐿푖 is a 2-cut} ⊆ 푖 푖 ′ ⊆ {푛(퐷2) | 푖 ∈ 퐼} ∪ {푛(퐷2) + 2 | 푖 ∈ 퐼 and 퐿푖 is a 2-cut} ,

′ and by referring to Remark 2.3, we get that {퐿푖 | 푖 ∈ 퐼} is a good cut-system of 퐷.

2.5 Proof of Theorem 1.6

Let us recall the theorem to be proved.

Theorem 1.6 (Győri and Mezei [GM16]). Any simple orthogonal polygon of 푛 vertices can be partitioned into at most ⌊ 3푛+4 ⌋ orthogonal polygons of at most 8 vertices. 16 We will prove Theorem 1.6 by induction on the number of vertices. For 푛 ≤ 8 the theorem is trivial. 20 Partitioning orthogonal polygons

For 푛 > 8, let 퐷 be the rectilinear domain bounded by the orthogonal polygon wall of the gallery. We want to partition 퐷 into smaller rectilinear domains. It is enough to prove that 퐷 has a good cut. The rest of this proof is an extensive case study. Let 푇 be the horizontal 푅-tree of 퐷. We need two more definitions.

• A pocket in 푇 is a degree-1 rectangle 푅, whose only incident edge in 푇 is a 2-cut of 퐷, and this cut covers the entire top or bottom side of 푅.

• A corridor in 푇 is a rectangle 푅 of degree ≥ 2 in 푇 , which has an incident edge in 푇 which is a 2-cut of 퐷, and this cut covers the entire top or bottom side of 푅.

We distinguish 4 cases.

Case 1. 푇 is a path, Fig. 2.4(a); Case 2. 푇 has a corridor, Fig. 2.4(b); Case 3. 푇 does not have a corridor, but it has a pocket, Fig. 2.4(c); Case 4. None of the previous cases apply, Fig. 2.4(d). 2.5 Proof of Theorem 1.6 21

corridor

(a) 푇 is a path. (b) 푇 has a corridor.

pocket

pocket pocket

pocket

(c) 푇 does not have a corridor, but it has a (d) 푇 does not have a corridor or a pocket, pocket. and it is not a path.

Fig. 2.4 The 4 cases of the proof.

Case 1 푇 is a path Claim 2.11. If an edge incident to a degree-2 vertex 푅 of 푇 is a 2-cut of 퐷, then the incident edges of 푅 form a good cut-system.

Proof. Let the two incident edges of 푅 be 푒1 and 푒2. Let their generated partitions be 1 1 2 2 1 2 2 1 푒1(퐷1, 퐷2) and 푒2(퐷1, 퐷2), such that 푅 ⊆ 퐷2 ∩ 퐷1. Then 퐷1 = 퐷1 ∪ 푅, so

2 1 1 푛(퐷1) = 푛(퐷1) + 푛(푅) + 푡(푒1) = 푛(퐷1) + 4.

1 2 1 Definition 2.2 is satisfied by {푒1, 푒2}, as {푛(퐷1), 푛(퐷1)} ∪ {푛(퐷1) + 2} is a set of three consecutive even elements. 22 Partitioning orthogonal polygons

Claim 2.12. If there are two rectangles 푅1 and 푅2 which are adjacent degree-2 vertices of

푇 , then the union of the set of incident edges of 푅1 and 푅2 form a good cut-system.

Proof. Let the two components of 푇 − 푅1 − 푅2 be 푇1 and 푇2, so that 푒1, 푒2, 푓 ∈ 퐸(푇 ) joins

푇1 and 푅1, 푅1 and 푅2, 푅2 and 푇2, respectively. Obviously, ∪푉 (푇1) ⊂ (∪푉 (푇1)) ∪ 푅1 ⊂

(∪푉 (푇1)) ∪ 푅1 ∪ 푅2. If one of {푒1, 푒2, 푓} is a 2-cut, we are done by the previous claim. Otherwise

푛((∪푉 (푇1)) ∪ 푅1) = 푛(∪푉 (푇1)) + 푛(푅1) + 푡(푒1) = 푛(∪푉 (푇1)) + 2,

푛((∪푉 (푇1)) ∪ 푅1 ∪ 푅2) = 푛(∪푉 (푇1)) + 푛(푅1) + 푛(푅2) + 푡(푒1) + 푡(푓) = 푛(∪푉 (푇1)) + 4,

and so {푛(∪푉 (푇1)), 푛((∪푉 (푇1)) ∪ 푅1), 푛((∪푉 (푇1)) ∪ 푅1 ∪ 푅2)} are three consecutive even

elements. This concludes the proof that {푒1, 푒2, 푓} is a good cut-system of 퐷.

Suppose 푇 is a path. If 푇 is a path of length ≤ 3, such that each edge of it is a 1-cut, then 푛(퐷) ≤ 8. Also, if 푇 is path of length 2 and its only edge represents a 2-cut, then 푛(퐷) = 8. Otherwise, either Claim 2.11, or Claim 2.12 can be applied to provide a good cut-system of 퐷.

Case 2 푇 has a corridor Let 푒 = {푅′, 푅} ∈ 퐸(푇 ) be a horizontal 2-cut such that 푅′ is a wider rectangle than 푅, and 푒 푒 ′ 푒 deg(푅) ≥ 2. Let the generated partition be 푒(퐷1, 퐷2) such that 푅 ⊆ 퐷1. We can handle all possible cases as follows.

푒 푒 1. If 푛(퐷1) ≢ 4, 10 mod 16 or 푛(퐷2) ≢ 4, 10 mod 16, then 푒 is a good cut by Lemma 2.1(b).

2. If deg(푅) = 2, we find a good cut using Claim 2.11.

퐿 퐿 ′ 퐿 3. If 푅BL = ∅, then 퐿(퐷1 , 퐷2 ) such that 푅 ⊆ 퐷1 in Fig. 2.5 is a good cut, since 퐿 푒 푛(퐷1 ) = 푛(퐷1) + 4 − 0 ≡ 8, 14 mod 16.

푅′

✀ 푅 퐿

Fig. 2.5 퐿 is a good cut 2.5 Proof of Theorem 1.6 23

4. If 푅BL ≠ ∅ and deg(푅) ≥ 3, then let us consider the following five cuts of 퐷 (Fig. 2.6): 푒 푒 푒 퐿1(푅BL, 푅 ∪ 퐷1), 퐿2(푅BL ∪ 푄1, 푄2 ∪ 푄3 ∪ 퐷1), 퐿3(푅BL ∪ 푄1 ∪ 푄2, 푄3 ∪ 퐷1), 푒 푒 퐿4(푄3, 푅BL ∪ 푄1 ∪ 푄2 ∪ 퐷1), and 퐿5(푄3 ∪ 푄2, 푅BL ∪ 푄1 ∪ 퐷1).

푅′

푄1 푄2 푄3

푅BL

Fig. 2.6 deg(푅) ≥ 3 and 푅BL ≠ ∅

The first pieces of these partitions have the following number of vertices (respectively).

(a) 푛(푅BL)

(b) 푛(푅BL ∪ 푄1) = 푛(푅BL) + 푛(푄1) + (푡(푒BL(푅)) − 2) = 푛(푅BL) + 푡(푒BL(푅)) + 2

(c) 푛(푅BL ∪ 푄1 ∪ 푄2) = 푛(푅BL) + 푛(푄1 ∪ 푄2) + 푡(푒BL(푅)) = 푛(푅BL) + 푡(푒BL(푅)) + 4

(d) 푛(푄3)

(e) 푛(푄3 ∪ 푄2) = 푛(푄3) + 푛(푄2) − 2 = 푛(푄3) + 2

• If 푡(푒BL(푅)) = 0, then {퐿1, 퐿2, 퐿3} is a good cut-system, so one of them is a good cut.

• If 푡(푒BL(푅)) = −2, and none of the 5 cuts above are good cuts, then using

Lemma 2.1(b) on 퐿2 and 퐿3 gives 푛(푅BL) ≡ 4, 10 mod 16. The same argument

can be used on 퐿4 and 퐿5 to conclude that 푛(푄3) ≡ 4, 10 mod 16. However, previously we derived that

푒 푛(퐷2) ≡ 4, 10 mod 16,

푛(푅BL ∪ 푄1 ∪ 푄2 ∪ 푄3) = 푛(푅BL ∪ 푄1 ∪ 푄2) + 푛(푄3) − 2 =

= 푛(푅BL) + 푛(푄3) ≡ 4, 10 mod 16.

This is only possible if 푛(푅BL) ≡ 푛(푄3) ≡ 10 mod 16. Let 푒BL(푅) = {푅, 푆}. 24 Partitioning orthogonal polygons

′ – If deg(푆) = 2, then let 퐸(푇 ) ∋ 푒 ≠ 푒BL(푅) be the other edge of 푆. Let the ′ 푒′ 푒′ ′ 푒′ partition generated by it be 푒 (퐷1 , 퐷2 ) such that 푅 ⊆ 퐷1 . We have

푒′ ′ 푛(푅BL) = 푛(퐷2 ) + 푛(푆) + 푡(푒 ) 푒′ ′ ′ 푛(퐷2 ) = 푛(푅BL) − 4 − 푡(푒 ) ≡ 6 − 푡(푒 ) mod 16

′ 푒′ ′ Either 푒 is a 1-cut, in which case 푛(퐷2 ) ≡ 8 mod 16, or 푒 is a 2-cut, giving 푒′ ′ 푛(퐷2 ) ≡ 6 mod 16. In any case, Lemma 2.1 says that 푒 is a good cut.

– If deg(푆) = 3, then we can partition 퐷 as in Fig. 2.7. Since 푛(푄5 ∪ 푄6) =

4 + 푛(푄6) − 2, by Lemma 2.1(a) the only case when neither

푒 퐿6(푄5 ∪ 푄6, 푄4 ∪ 푅 ∪ 퐷1), nor 푒 퐿7(푄6, 푄4 ∪ 푄5 ∪ 푅 ∪ 퐷1)

is a good cut of 퐷 is when 푛(푄6) ≡ 4, 10 mod 16. Also,

10 ≡ 푛(푄4 ∪ 푄5 ∪ 푄6) = 푛(푄4) + 푛(푄5) + 푛(푄6) − 2 − 2 ≡

≡ 푛(푄4) + 푛(푄6) mod 16.

∗ If 푛(푄6) ≡ 10 mod 16, then 푛(푄4) ≡ 0 mod 16, hence

푛(푄4 ∪ 푄5 ∪ 푄11 ∪ 푄12) =

= 푛(푄4 ∪ 푄5) + 4 − 4 = 푛(푄4) + 푛(푄5) − 2 ≡ 2 mod 16,

푒 showing that 퐿8(푄4 ∪ 푄5 ∪ 푄11 ∪ 푄12, 푄6 ∪ 푄13 ∪ 푄2 ∪ 푄3 ∪ 퐷1) is a good cut.

∗ If 푛(푄6) ≡ 4 mod 16,

푛(푄6 ∪ 푄13 ∪ 푄2 ∪ 푄3) = 푛(푄6) + 푛(푄13 ∪ 푄2) + 푛(푄3) − 2 − 2 ≡

≡ 푛(푄6) + 10 ≡ 14 mod 16,

푒 therefore 퐿9(푄6 ∪ 푄13 ∪ 푄2 ∪ 푄3, 푄4 ∪ 푄5 ∪ 푄11 ∪ 푄12 ∪ 퐷1) is a good cut. 2.5 Proof of Theorem 1.6 25

푅′ 푅′

푄 푄 푄 푄 푄 11 12 13 2 3 9 퐿 ✀ 푄4 푄5 푄6

Fig. 2.7 deg(푄) ≥ 3 and 푄BL ≠ ∅

In each of the above subcases we found a good cut.

Case 3 There are no corridors in 푇 , but there is a pocket Let 푆 be a (horizontal) pocket. Also, let 푅 be the neighbor of 푆 in 푇 . If deg(푅) = 2, then Claim 2.11 provides a good cut-system of 퐷. However, if deg(푅) ≥ 3, we have two cases.

Case 3.1 If 푅 is adjacent to at least two pockets

Let 푈 be the union of 푅 and its adjacent pockets, and let 푇푈 be its vertical 푅-tree. It contains

at least 4 reflex vertices, therefore |푉 (푇푈 )| ≥ 3.

• If 푉 (푇푈 ) = 3, then |퐸(푇푈 )| = 2. Thus 푡(푒) = 0 for any 푒 ∈ 퐸(푇푈 ), and Claim 2.11 gives a good cut-system ℒ of 푈 such that all 4 vertices of 푅 are contained in ker ℒ.

• If 푉 (푇푈 ) ≥ 4, then Claim 2.12 gives a good cut-system ℒ of 푈 such that all 4 vertices of 푅 are contained in ker ℒ.

Since there are no corridors in 퐷, we have

퐷 = (((푈 ∪ 푅BL) ∪ 푅TL) ∪ 푅BR) ∪ 푅TR.

By applying Lemma 2.10 repeatedly, the good cut-system ℒ can be extended to a good cut-system of 퐷.

Case 3.2 If 푆 is the only pocket adjacent to 푅 We may assume without loss of generality that 푆 intersects the top side of 푅. Again, define 푈 as the union of 푅 and its adjacent pockets. 26 Partitioning orthogonal polygons

• If 푅TL ≠ ∅, let 푉 = 푈 ⨄ 푅TL. The cut-system {퐿1, 퐿2, 퐿3} in Fig. 2.8a is a good

cut-system of 푉 , and all 4 vertices of 푅 are contained in ker{퐿1, 퐿2, 퐿3}. By applying Lemma 2.10 repeatedly, we get a good cut-system of 퐷, for example, see Fig. 2.8b.

푅TL 푆 푣TR(푅) ✀ ✀ ✀ ✀ ✀ ✀ 퐿 퐿 퐿 3 2 1 푅 퐿 퐿 퐿 3 2 1

(a) {퐿1, 퐿2, 퐿3} is a good cut-system of 푉 = 푅 ∪ 푅 ∪ 푆 TL (b) The extended cuts

Fig. 2.8 푅 has one pocket

• If 푅TR ≠ ∅, the case can be solved analogously to the previous case.

1 1 2 2 • Otherwise 푅BL ≠ ∅ and 푅BR ≠ ∅. Let 퐿1(푈1 , 푈2 ) and 퐿2(푈1 , 푈2 ) be the vertical cuts (from right to left) defined by the two reflex vertices of 푈, such that 푣BR(푅) ∈ 1 2 푈1 ⊂ 푈1 . Let 푉 = 푅BL ⨄ 푈. As before, 퐿1 and 퐿2 can be extended to cuts of 푉 , ′ 1 1 ′ 2 2 3 say 퐿1(푈1 , 푉2 ), 퐿2(푈1 , 푉2 ). We claim that together with 푒BL(푅)(푈, 푉2 ), they form a 1 2 good cut-system ℒ of 푉 . This is obvious, as {푛(푈1 ), 푛(푈1 ), 푛(푈)} = {4, 6, 8}. Since 푣BR(푅) ∈ ker ℒ, 퐷 also has a good cut-system by Lemma 2.10.

Case 4 푇 is not a path and it does not contain either corridors or pockets By the assumptions of this case, any two adjacent rectangles are adjacent at one of their vertices, so the maximum degree in 푇 is 3 or 4. We distinguish between several subcases.

Case 4.1. There exists a rectangle of degree ≥ 3 such that its top or bottom side is entirely contained in one of its neighboring rectangles; Case 4.2. Every rectangle of degree ≥ 3 is such that its top and bottom sides are not entirely contained in any of their neighboring rectangles; Case 4.2.1. There exist at least two rectangles of degree ≥ 3; Case 4.2.2. There is exactly one rectangle of degree ≥ 3. 2.5 Proof of Theorem 1.6 27

푅TR

푅1 푅2 푅3

푅BL 푅BR

Fig. 2.9 The top side of 푅 = 푅1 ∪ 푅2 ∪ 푅3 is contained entirely by a neighboring rectangle.

Case 4.1 There exists a rectangle of degree ≥ 3 such that its top or bottom side is entirely contained in one of its neighboring rectangles Let 푅 be a rectangle and 푅′ its neighbor, such that the top or bottom side of 푅 is a subset of 휕푅′. Moreover, choose 푅 such that if we partition 퐷 by cutting 푒 = {푅, 푅′}, the part containing 푅 is minimal (in the set theoretic sense). Without loss of generality, the top side of 푅 is contained entirely by a neighboring rectangle ′ 푅 , and 푅TL = ∅. This is pictured in Fig. 2.9, where 푅 = 푅1 ∪ 푅2 ∪ 푅3. We can cut off

푅BL, 푅BL ∪ 푅1, and 푅BL ∪ 푅1 ∪ 푅2, whose number of vertices are respectively

1. 푛(푅BL),

2. 푛(푅BL ∪ 푅1) = 푛(푅BL) + 푛(푅1) + (푡(푒BL(푅)) − 2) = 푛(푅BL) + 푡(푒BL(푅)) + 2,

3. 푛(푅BL ∪ 푅1 ∪ 푅2) = 푛(푅BL) + 푛(푅1 ∪ 푅2) + 푡(푒BL(푅)) = 푛(푅BL) + 푡(푒BL(푅)) + 4.

If 푡(푒BL(푅)) = 0, then one of the 3 cuts is a good cut by Lemma 2.1(a).

Otherwise 푡(푒BL(푅)) = −2, thus, one of the 3 cuts is a good cut, or 푛(푅BL) ≡ 4, 10 mod 16.

Let 푆 be the rectangle for which 푒BL(푅) = {푅, 푆}. Since 푒BL(푅) is a 1-cut containing the top side of 푆, we cannot have deg(푆) = 3, as it contradicts the choice of 푅. We distinguish between two cases.

Case 4.1.1 deg(푆) = 1 ′ 1 Let 푈 = 푅 ∪푅∪푅BL∪푅BR, which is depicted on Fig. 2.10a. It is easy to see that 퐿1(푄1, 푈2 ), 2 3 퐿2(푄1 ∪ 푄2, 푈2 ), and 퐿3(푄1 ∪ 푄2 ∪ 푄3, 푈2 ) in Fig. 2.10b is a good cut-system of 푈. 28 Partitioning orthogonal polygons

푄 1 1 2 3 푅′ 퐿 퐿 퐿 ✀ ✀ ✀

푄2 푄3 푄4 푅

푆 푅BR 푅BR

(a) (b)

Fig. 2.10 The rectilinear domain 푈 is shown in (a). The cuts 퐿1, 퐿2, 퐿3, shown in (b), form a good-cut system of 푈.

As all 4 vertices of 푆 are contained in ker{퐿1, 퐿2, 퐿3}, we can extend this good cut-system

to 퐷 by reattaching 푆TL, 푆BL, 푆TR (if non-empty) via Lemma 2.10. Therefore, 퐷 has a good cut.

Case 4.1.2 deg(푆) = 2

Let 푓 be the edge of 푆 which is different from 푒BL(푅) = 푒TL(푆). Let the partition generated 푓 푓 푓 푓 by it be 푓(퐷1 , 퐷2 ), where 푆 ⊆ 퐷2 . We have 푛(퐷1 ) = 푛(푅BL) − 푛(푆) − 푡(푓).

푓 • If 푡(푓) = −2, then 푛(퐷1 ) ≡ 2, 8 mod 16, so 푓 is a good cut by Lemma 2.1(a). 푓 • If 푡(푓) = 0, then 푛(퐷1 ) ≡ 0, 6 mod 16, so 푓 is a good cut by Lemma 2.1(b).

Case 4.2 Every rectangle of degree ≥ 3 is such that its top and bottom sides are not entirely contained in any of their neighboring rectangles Let 푅 be a rectangle of degree ≥ 3 and 푒 = {푅, 푆} be one of its edges. Let the partition 푒 푒 푒 푒 generated by 푒 be 푒(퐷1, 퐷2), where 푅 ⊂ 퐷1 and 푆 ⊆ 퐷2. If 푒 is a 1-cut, then by the assumptions of this case deg(푆) ≤ 2.

푒 • If deg(푆) = 1 and 푡(푒) = −2, then 푛(퐷2) + 푡(푒) = 2.

푒 • If deg(푆) = 1 and 푡(푒) = 0, then 푛(퐷2) + 푡(푒) = 4.

• If deg(푆) = 2 and one of the edges of 푆 is a 0-cut, then 퐷 has a good cut by Claim 2.11.

• If deg(푆) = 2 and both edges of 푆, 푒 and (say) 푓 are 1-cuts: Let the partition generated 푓 푓 푓 푒 푓 by 푓 be 퐷 = 퐷1 ⨄ 퐷2 , such that 푆 ∈ 퐷1 . Then 푛(퐷2) = 푛(퐷2 ) + 푛(푆) + 푡(푓) = 푓 푓 푛(퐷2 ) + 2. Either one of 푒 and 푓 is a good cut, or by Lemma 2.1(a) we have 푛(퐷2 ) ≡ 2.5 Proof of Theorem 1.6 29

푒 푓 4, 10 mod 16. In other words, 푛(퐷2) + 푡(푒) ≡ 4, 10 mod 16. Similarly, 푛(퐷1 ) = 푒 푒 푒 푛(퐷1) + 4 − 2 = 푛(퐷1) + 2, so 푛(퐷1) ≡ 4, 10 mod 16.

• If deg(푆) ≥ 3, then 푡(푒) = 0. Either 푒 is a good cut, or by Lemma 2.1(b) we have 푒 푒 푛(퐷2) + 푡(푒) ≡ 4, 10 mod 16. Lemma 2.1(b) also implies 푛(퐷1) ≡ 4, 10 mod 16.

From now on, we assume that none of the edges of the neighbors of a degree ≥ 3 rectangle represent a good cut, so in particular, we have

푒 푛(퐷2) + 푡(푒) ≡ 2, 4, or 10 mod 16.

In addition to the simple analysis we have just conducted, we deduce an easy claim to be used in the following subcases.

Claim 2.13. Let 푅 ∈ 푉 (푇 ) be of degree ≥ 3 and suppose both 푅BR ≠ ∅ and 푅TR ≠ ∅.

Then 퐷 has two admissible cuts 퐿1 and 퐿2 such that they form a good cut-system or

(i) one of the parts generated by 퐿1 has size (푛(푅BR) + 푡(푒BR(푅))) + (푛(푅TR) + 푡(푒TR(푅))) + 2, and

(ii) one of the parts generated by 퐿2 has size (푛(푅BR) + 푡(푒BR(푅))) + (푛(푅TR) + 푡(푒TR(푅))) + 4.

1 1 2 2 Proof. Let 푈 = 푅 ∪ 푅BL ∪ 푅BR. Let 퐿1(푈1 , 푈2 ) and 퐿2(푈1 , 푈2 ) be the vertical cuts of 푈 defined by the two reflex vertices of 푈 that are on the boundary of 푅, such that 푣BR(푅) ∈ 1 2 푈1 ⊂ 푈1 . By Lemma 2.9, 퐿1 and 퐿2 can be extended to cuts of 푉 = 푅 ∪ 푅BL ∪ 푅BR ∪ 푅TR, ′ 1 1 ′ 2 2 ′ ′ say 퐿1(푉1 , 푈2 ), 퐿2(푉1 , 푈2 ). If one of 퐿1 or 퐿2 is a 2-cut, then similarly to Claim 2.11, one can verify they form a good cut-system of 푉 , which we can extend to 퐷. Otherwise

1 1 푛(푉1 ) = 푛(푅 ∩ 푈1 ) + 푛(푅BR) + 푛(푅TR) + (푡(푒BR(푅)) − 2) + 푡(푒TR(푅)) =

= (푛(푅BR) + 푡(푒BR(푅))) + (푛(푅TR) + 푡(푒TR(푅))) + 2, 2 2 푛(푉1 ) = 푛(푅 ∩ 푈1 ) + 푛(푅BR) + 푛(푅TR) + 푡(푒BR(푅)) + 푡(푒TR(푅)) =

= (푛(푅BR) + 푡(푒BR(푅))) + (푛(푅TR) + 푡(푒TR(푅))) + 4.

′ ′ Lastly, we extend 퐿1 and 퐿2 to 퐷 by reattaching 푅TL using Lemma 2.9. This step does not 1 2 affect the parts 푉1 and 푉1 , so we are done. 30 Partitioning orthogonal polygons

Case 4.2.1 There exist at least two rectangles of degree ≥ 3 In the subgraph 푇 ′ of 푇 which is the union of all paths of 푇 which connect two degree ≥ 3 rectangles, let 푅 be a leaf and 푒 = {푅, 푆} its edge in the subgraph. As defined in the beginning of Case 4.2, the set of incident edges of 푅 (in 푇 ) is {푒푖 | 1 ≤ 푖 ≤ deg(푅)}, and without loss of generality we may suppose that 푒 = 푒deg(푅). The analysis also implies that 푒푖 for all 1 ≤ 푖 ≤ deg(푅) − 1, we have 푛(퐷2 ) + 푡(푒푖) = 2, 4. 푒 By the assumptions of this case deg(푆) ≥ 2, therefore 푛(퐷1) ≡ 4 or 10 mod 16. If deg(푆) ≥ 3, let 푄 = 푆. Otherwise deg(푆) = 2, and let 푄 be the second neighbor of 푅 in 푇 ′. The degree of 푄 cannot be 1 by its choice. If deg(푄) = 2, then we find a good cut using Claim 2.12. In any case, we may suppose from now on that deg(푄) ≥ 3.

Let {푓푖 | 1 ≤ 푖 ≤ deg(푄)} be the set of incident edges of 푄 such that they generate the 푓푖 푓푖 푓푖 푓1 partitions 퐷 = 퐷1 ⨄ 퐷2 where 푅 ⊂ 퐷1 and 푄 ⊂ 퐷2 . We have

deg(푅)−1 푒 푛(퐷푒) = 푛(푅) + 푛(퐷 푖 ) + 푡(푒 ) ∈4 + {2, 4} + {2, 4} + {0, 2, 4} = 1 ∑ ( 2 푖 ) 푖=1 = {8, 10, 12, 14, 16},

푒 so the only possibility is 푛(퐷1) = 10.

• If deg(푆) ≥ 3, 푒 is a 2-cut (by the assumption of Case 4.2), so by Lemma 2.1(c), either

푒 is a good cut or 푛(퐷) ≡ 14 mod 16. Since 푄 = 푆 and 푒 = 푓1, we have

푓1 푒 푛(퐷1 ) + 푡(푓1) = 푛(퐷1) + 푡(푒) = 10, 푓1 푓1 푛(퐷2 ) = 푛(퐷) − 푛(퐷1 ) − 푡(푓1) ≡ 14 − 10 ≡ 4 mod 16.

• If deg(푆) = 2, either 푒 is a 1-cut or we find a good cut using Claim 2.11. Also,

푓1 = {푆, 푄} is a 1-cut too (otherwise apply Claim 2.11), so

푓1 푒 푛(퐷1 ) + 푡(푓1) = 푛(퐷1) + 푛(푆) + 푡(푒) + 푡(푓1) = 10.

푓1 By Lemma 2.1(c), either 푓1 is a good cut (as 푛(퐷1 ) = 12) or 푛(퐷) ≡ 14 mod 16. Thus 푓1 푓1 푛(퐷2 ) = 푛(퐷) − 푛(퐷1 ) − 푡(푓1) ≡ 14 − 12 + 2 ≡ 4 mod 16. 2.5 Proof of Theorem 1.6 31

We have

deg(푄) 푓 푓 푛(퐷) = 푛(푄) + 푛(퐷 1 ) + 푡(푓 ) + 푛(퐷 푖 ) + 푡(푓 ) ∈ ( 1 1 ) ∑ ( 2 푖 ) 푖=2 ∈ 14 + {2, 4, 10} + {2, 4, 10} + {0, 2, 4, 10} mod 16.

The only way we can get 14 mod 16 on the right-hand side is when deg(푄) = 4 and out of

푛(푄BL), 푛(푄BR), 푛(푄TL), 푛(푄TR) mod 16, one is 2, another is 4, and two are 10 mod 16. The last step in this case is to apply Claim 2.13 to 푄. If it does not give a good cut-system, then it gives an admissible cut where one of the parts has size congruent to 2 + 10 + 2 = 14 or 2 + 4 + 2 = 8 modulo 16, therefore we find a good cut anyway.

Case 4.2.2 There is exactly one rectangle of degree ≥ 3

Let 푅 be the rectangle of degree ≥ 3 in 푇 , and let {푒푖 | 1 ≤ 푖 ≤ deg(푅)} be the edges 푒푖 푒푖 푒푖 푒푖 of 푅, which generate the partitions 퐷 = 퐷1 ⨄ 퐷2 where 푅 ⊂ 퐷1 . Then 퐷2 is path for all 푖. If either Claim 2.11 or Claim 2.12 can be applied, 퐷 has a good cut. The remaining possibilities can be categorized into 3 types:

푒푖 푒푖 Type 1: 푡(푒푖) = −2, 푛(퐷2 ) = 4, and 푛(퐷2 ) + 푡(푒푖) = 2; 푒푖 푒푖 Type 2: 푡(푒푖) = −2, 푛(퐷2 ) = 4 + 4 − 2 = 6, and 푛(퐷2 ) + 푡(푒푖) = 4; 푒푖 푒푖 Type 3: 푡(푒푖) = 0, 푛(퐷2 ) = 4, and 푛(퐷2 ) + 푡(푒푖) = 4.

Without loss of generality 푅BR ≠ ∅ and 푅TR ≠ ∅. We will now use Claim 2.13. If it gives a good cut-system, we are done. Otherwise

• If exactly one of 푒BR(푅) and 푒TR(푅) is of type 1, apply Claim 13(i): it gives an admis- sible cut which cuts off a rectilinear domain of size 2 + 4 + 2 = 8, so 퐷 has a good cut.

• If both 푒BR(푅) and 푒TR(푅) are of type 1, apply Claim 13(ii): it gives an admissible cut which cuts off a rectilinear domain of size 2 + 2 + 4 = 8, so 퐷 has a good cut.

• If none of 푒BR(푅) and 푒TR(푅) are of type 1 and 푛(퐷) ≢ 14 (mod 16), apply Claim 13(i): it gives an admissible cut which cuts off a rectilinear domain of size 4 + 4 + 4 = 12, which is a good cut by Lemma 2.1(c). 32 Partitioning orthogonal polygons

Now we only need to deal with the case where 푛(퐷) = 14 and neither 푒BR(푅) nor 푒TR(푅) is of type 1. If 푅 still has two edges of type 1, again Claim 13(i) gives a good cut of 퐷. If 푅 has at most one edge of type 1, we have

deg(푅) 푒 14 = 푛(퐷) = 푛(푅)+ 푛(퐷 푖 )+푡(푒 ) ∈ 4+{2, 4}+{4}+{4}+{0, 4} = {14, 16, 18, 20}, ∑ ( 2 푖 ) 푖=1

and the only way we can get 14 on the right hand is when deg(푅) = 3 and both 푒BR(푅) and

푒TR(푅) are of type 2 or 3 while the third incident edge of 푅 is of type 1. We may assume

without loss of generality that the cut represented by 푒TR(푅) is longer than the cut represented

by 푒BR(푅).

• If 퐷 is vertically convex, its vertical 푅-tree is a path, so it has a good cut as deduced in Case 1.

• If 퐷 is not vertically convex, but 푒TR(푅) is a type 2 edge of 푅, such that the only ′ horizontal cut of 푅TR is shorter than the cut represented by 푒TR(푅), then 퐷 = 퐷 −

푅BR is vertically convex, and has (10 − 4)/2 = 3 reflex vertices. By Claim 2.11 or ′ Claim 2.12, 퐷 has a good cut-system such that its kernel contains 푣BR(푅), since its 푥-coordinate is maximal in 퐷′. Lemma 2.10 states that 퐷 also has a good cut-system.

• Otherwise we find that the top right part of 퐷 looks like to one of the cases in Fig. 2.11. It is easy to see that in all three pictures 퐿 is an admissible cut which generates two rectilinear domains of 8 vertices. 퐿 퐿 퐿 ✀ ✀ ✀

푅BR 푅BR 푅BR

(a) (b) (c)

Fig. 2.11 The last 3 cases of the proof. Since 푒BR(푅) is a type 2 or 3 edge, cutting the rectilinear domain at 퐿 creates two rectilinear domains of 8-vertices. 2.5 Proof of Theorem 1.6 33

The proof of Theorem 1.6 is complete. To complement the formal proof, we now demon- strate the algorithm on Fig. 2.12.

3 1 2 1 4

2 7

5

6

Fig. 2.12 The output of the algorithm on a rectilinear domain of 52 vertices.

First, we resolve a corridor via the 퐿-cut 1 , which creates two pieces of 20 and 34 (≡ 2 mod 16) vertices. Because of this cut, a new corridor emerges in the 20-vertex piece, so we cut the rectilinear domain at 2 , cutting off a piece of 8 vertices. The other piece of 14 vertices containing two pockets is further divided by 3 into two pieces of 6 and 8 vertices. Another pocket is dealt with by cut 4 , which divides the rectilinear domain into 8- and 28-vertex pieces. To the larger piece, Case 4.2 applies, and we find cut 5 , which produces 16- and 14-vertex pieces. The 16-vertex piece is cut into two 8-vertex pieces by 6 . Lastly, Fig. 2.11c of Case 4.2.2 applies to the 14-vertex piece, so cut 7 divides it into two 8-vertex pieces. We got lucky with cuts 2 and 6 in the sense that they both satisfy the inequality in (2.1) strictly. Hence, only 8 pieces are needed to partition the rectilinear domain of Fig. 2.12 into rectilinear domains of ≤ 8-vertex pieces, instead of the extremal upper bound of (3 ⋅ 52 + 4)/16 = 10.

Chapter 3

Mobile vs. point guards

3.1 Introduction

The main goal of this chapter is to explore the ratio between the numbers of mobile guards and points guards required to control an orthogonal polygon without holes. At first, this appears to be hopeless, as Fig. 3.1 shows a comb, which can be guarded by one mobile guard (whose patrol is shown by a dotted horizontal line). However, to cover the comb using point guards, one has to be placed for each tooth, so ten point guards are needed (marked by solid disks). Combs with arbitrarily high number of teeth clearly demonstrate that the minimum number of points guards required to control an orthogonal polygon cannot be bounded by the minimum size of a mobile guard system covering the comb.

Fig. 3.1 A comb with 10 teeth

Katz and Morgenstern [KM11] defined and studied the notion of “horizontal sliding cam- eras”. This notion is identical to what we call horizontal mobile 푟-guard (a horizontal mobile guard with rectangular vision). The main result of this chapter, Theorem 3.1, shows that a constant factor times the sum of the minimum sizes of a horizontal and a vertical mobile 푟-guard system can be used to estimate the minimum size of a point 푟-guard system. It is 36 Mobile vs. point guards

Fig. 3.2 A polygon with holes — unlimited ratio. surprising to have such a result after encountering the comb, but it is similarly unexpected that even this ratio cannot be bounded if the region may contain holes. Take, for example, Fig. 3.2, which generally contains 3푘2 +4푘+1 square holes (in the figure 푘 = 4). The regions covered by line of sight vision by the black dots are pairwise disjoint, because the distance between adjacent square holes is less than half of the length of a square hole’s side. Therefore, no two of the black dots can be covered by one point guard, so at least 푘2 point guards are necessary to control gallery. However, 2푘 + 2 horizontal mobile guards can easily cover the polygon, and the same holds for vertical mobile guards. In the next chapter, we show that a minimum size horizontal mobile 푟-guard system can be found in linear time (Theorem 4.4). This improves the result in [KM11], where it is shown that this problem can be solved in polynomial time.

Theorem 3.1 (Győri and Mezei [GM17]). Given a rectilinear domain 퐷 let 푚푉 be the min- imum size of a vertical mobile 푟-guard system of 퐷, let 푚퐻 be defined analogously for hori- zontal mobile 푟-guard systems, and finally let 푝 be the minimum size of a point 푟-guard system of 퐷. Then 4(푚 + 푚 − 1) 푉 퐻 ≥ 푝. ⌊ 3 ⌋

In case it is not confusing, the prefix “푟-” is omitted from now on. Before moving onto the proof of Theorem 3.1, we discuss the aspects of its sharpness.

For 푚푉 + 푚퐻 ≤ 6, sharpness of the theorem is shown by the examples in Fig. 3.3. The polygon in Fig. 3.3f can be easily generalized to one satisfying 푚푉 + 푚퐻 = 3푘 + 1 and

푝 = 4푘. For 푚푉 + 푚퐻 = 3푘 + 2 and 푚푉 + 푚퐻 = 3푘 + 3, we can attach 1 or 2 plus signs 3.1 Introduction 37

(a) 푚푉 + 푚퐻 = 2, 푝 = 1 (b) 푚푉 + 푚퐻 = 3, 푝 = 2 (c) 푚푉 + 푚퐻 = 4, 푝 = 4

(d) 푚푉 + 푚퐻 = 5, 푝 = 5 (e) 푚푉 + 푚퐻 = 6, 푝 = 6

(f) 푚푉 + 푚퐻 = 13, 푝 = 16 Fig. 3.3 Vertical dotted lines: a minimum size vertical mobile guard system; Horizontal dotted lines: a minimum size horizontal mobile guard system; Solid disks: a minimum size point guard system. to the previously constructed polygons, as shown in Fig. 3.3d and 3.3e. Thus Theorem 3.1 is sharp for any fixed value of 푚푉 + 푚퐻 . By stringing together a number of copies of the polygons in Fig. 3.3a and 3.3c in an L-shape

(Fig. 3.3f is a special case of this), we can construct rectilinear domains for any (푚퐻 , 푚푉 ) pair satisfying 푚푉 ≤ 2(푚퐻 − 1) and 푚퐻 ≤ 2(푚푉 − 1), such that the polygon satisfies

Theorem 3.1 sharply. The analysis in Section 3.2 immediately yields that if 푚푉 = 1 or

푚퐻 = 1, then 푚푉 + 푚퐻 − 1 is an upper bound for the minimum size of a point guard system (see Proposition 3.7), whose sharpness is shown by combs (Fig. 3.1). 38 Mobile vs. point guards

3.2 Translating the problem into the language of graphs

For graph theoretical notation and theorems used in this chapter (say, the block decomposi- tion of graphs), the reader is referred to [Die10]. Definition 3.2 (Chordal bipartite or bichordal graph, [GG78]). A graph 퐺 is chordal bipartite iff any cycle 퐶 of ≥ 6 vertices of 퐺 has a chord (that is 퐸(퐺[퐶]) ⫌ 퐸(퐶)).

Let 푆푉 be the set of internally disjoint rectangles we obtain by cutting vertically at each reflex vertex of a rectilinear domain 퐷. Similarly, let 푆퐻 be defined analogously for horizontal cuts of 퐷. We may refer to the elements of these sets as vertical and horizontal slices, respectively. Let 퐺 be the intersection graph of 푆퐻 and 푆푉 , i.e.,

퐺 = (푆퐻 ∪ 푆푉 , {{ℎ, 푣} ∶ ℎ ∈ 푆퐻 , 푣 ∈ 푆푉 , int(ℎ) ∩ int(푣) ≠ ∅}) .

In other words, a horizontal and a vertical slice are joined by an edge iff their interiors inter- sect; see Fig. 3.4. We may also refer to 퐺 as the pixelation graph of 퐷. Clearly, the set of pixels {∩푒 | 푒 ∈ 퐸(퐺)} is a cover of 퐷. Let us define 푐(푒) as the center of gravity of ∩푒 (the pixel determined by 푒).

ℎ0 ℎ1 ℎ2 ℎ3 ℎ4 ℎ5 ℎ6 ℎ6 ℎ5 ℎ4 ℎ3 ℎ0 ℎ1 ℎ2

푣1 푣2 푣3 푣4 푣5 푣6 푣7 푣8 푣1 푣2 푣3 푣4 푣5 푣6 푣7 푣8

Fig. 3.4 A rectilinear domain and its associated pixelation graph

The horizontal 푅-tree 푇퐻 of 퐷 defined in Section 2.3 is equal to

푇퐻 = (푆퐻 , {{ℎ1, ℎ2} ⊆ 푆퐻 ∶ ℎ1 ≠ ℎ2, ℎ1 ∩ ℎ2 ≠ ∅}) , i.e., 푇퐻 is the intersection graph of the horizontal slices of 퐷. Similarly, 푇푉 is the intersection graph of the vertical slices of 퐷. Lemma 3.3. 퐺 is a connected chordal bipartite graph. Proof. Connectedness of 퐷 immediately yields that 퐺 is connected too. Suppose 퐶 is a cycle of ≥ 6 vertices in 퐺. For each node of the cycle 퐶, connect the centers of gravity of its two incident edges with a line segment. This way we get an orthogonal polygon 푃 in 퐷. 3.2 Translating the problem into the language of graphs 39

If 푃 is self-intersecting, then the vertices which are represented by the two intersecting line segments are intersecting. This clearly corresponds to a chord of 퐶 in 퐺. If 푃 is simple, then the number of its vertices is |푉 (퐶)|, thus one of them is a reflex vertex, say 푐(푣1 ∩ ℎ1) is one. As 푃 lives in 퐷, its interior is a subset of 퐷 as well (here we use that 퐷 is simply connected). The simpleness of 푃 also implies that the vertical line segment intersecting 푐(푣1 ∩ ℎ1) after entering the interior of 푃 at 푐(푣1 ∩ ℎ1), intersects 푃 at least once more when it emerges, say at 푐(푣1 ∩ ℎ2). As this is not an intersection of the line segments corresponding to two vertices of 퐷, the edge {푣1, ℎ2} is a chord of 퐶.

It is worth mentioning that even if 퐷 is a rectilinear domain with rectilinear hole(s), 퐺 may still be chordal bipartite. Take, for example, [0, 3]2 ⧵ (1, 2)2; the graph associated to it has only one cycle, which is of length 4. We will use the following technical claim to translate 푟-vision of points of 퐷 into relations in 퐺.

Claim 3.4. Let 푒1, 푒2 ∈ 퐸(퐺), where 푒1 = {푣1, ℎ1}, 푒2 = {푣2, ℎ2}, 푣1, 푣2 ∈ 푆푉 , and

ℎ1, ℎ2 ∈ 푆퐻 . The points 푝1 ∈ int(∩푒1) and 푝2 ∈ int(∩푒2) have 푟-vision of each other in 퐷 iff 푒1 ∩ 푒2 ≠ ∅ or 푒1 ∪ 푒2 induces a 4-cycle in 퐺.

Proof. If 푣1 ∈ 푒1 ∩ 푒2, then 푝1, 푝2 ∈ 푣1, therefore 푝1 and 푝2 have 푟-vision of each other. If

ℎ1 ∈ 푒1 ∩ 푒2, the same holds. If {푣1, ℎ1, 푣2, ℎ2} induces a 4-cycle, then

Conv((푣1 ∩ ℎ1) ∪ (푣1 ∩ ℎ2)) ⊆ 푣1 ⊆ 퐷 by 푣1’s convexity. Moreover,

퐵 =Conv((푣1 ∩ ℎ1) ∪ (푣1 ∩ ℎ2)) ∪ Conv((푣1 ∩ ℎ2) ∪ (푣2 ∩ ℎ2))∪

∪Conv((푣2 ∩ ℎ2) ∪ (푣2 ∩ ℎ1)) ∪ Conv((푣2 ∩ ℎ1) ∪ (푣1 ∩ ℎ1)) is contained in 퐷. Since 퐷 is simply connected, we have Conv(퐵) ⊆ 퐷, which is a rectangle containing both 푝1 and 푝2.

In the other direction, suppose 푒1 ∩ 푒2 = ∅. If 푅 is an axis-aligned rectangle which contains both 푝1 and 푝2, then 푅 clearly intersects the interiors of each element of 푒1∪푒2, which implies that int(푣2) ∩ int(ℎ1) ≠ ∅ and int(푣1) ∩ int(ℎ2) ≠ ∅. Thus 푒1 ∪ 푒2 induces a cycle in 퐺.

This easily implies the following claim. 40 Mobile vs. point guards

Claim 3.5. Two points 푝1, 푝2 ∈ 퐷 have 푟-vision of each other iff ∃푒1, 푒2 ∈ 퐸(퐺) such that

푝1 ∈ ∩푒1, 푝2 ∈ ∩푒2, and either 푒1 ∩ 푒2 ≠ ∅ or 푒1 ∪ 푒2 induces a 4-cycle in 퐺.

These claims motivate the following definition.

Definition 3.6 (푟-vision of edges). For any 푒1, 푒2 ∈ 퐸(퐺) we say that 푒1 and 푒2 have 푟-vision of each other iff 푒1 ∩ 푒2 ≠ ∅ or there exists a 퐶4 in 퐺 which contains both 푒1 and 푒2.

Let 푍 ⊆ 퐸(퐺) be such that for any 푒0 ∈ 퐸(퐺) there exists an 푒1 ∈ 푍 so that 푒1 has 푟-vision of 푒0. According Claim 3.5, if we choose a point from int(∩푒1) for each 푒1 ∈ 푍, then we get a point 푟-guard system of 퐷.

Observe that any vertical mobile 푟-guard is contained in int(푣) for some 푣 ∈ 푆푉 (except ≤ 2 points of the patrol). Extending the line segment the mobile guard patrols increases the area that it covers, therefore we may assume that this line segment intersects each element of {int(∩푒) | 푣 ∈ 푒 ∈ 퐸(퐺)}, which only depends on some 푣 ∈ 푆푉 . Using Claim 3.5, we conclude that the set which such a mobile guard covers with 푟-vision is exactly ∪{ℎ ∈

푆퐻 | {ℎ, 푣} ∈ 퐸(퐺)}. The analogous statement holds for horizontal mobile guards as well.

Thus, a set of mobile guards of 퐷 can be represented by a set 푀푉 ⊆ 푆푉 . Clearly, 푀푉 covers 퐷 if and only if

퐷 = 푁 (푣) , which holds iff 푆 = 푁 (푣), ⋃ (⋃ 퐺 ) 퐻 ⋃ 퐺 푣∈푀푉 푣∈푀푉 or in other words, 푀푉 dominates each element of 푆퐻 in 퐺. Similarly, a horizontal mobile guard system has a representative set 푀퐻 ⊆ 푆퐻 , which dominates 푆푉 in 퐺. Equivalently,

푀퐻 ∪ 푀푉 is a totally dominating set of 퐺, i.e., a subset of 푉 (퐺) that dominates every node of 퐺 (even the nodes of 푀퐻 ∪ 푀푉 ). The same arguments imply that a mixed set of vertical and horizontal mobile 푟-guards is represented by a set of vertices of 푆 ⊆ 푉 (퐺). The set of guards is a covering system of guards of 퐷 if and only if every node 푉 (퐺) ⧵ 푆 has neighbor in 푆, i.e., 푆 is a dominating set in 퐺. Table 3.1 is the dictionary that lists the main notions of the original problem and their corresponding phrasing in the pixelation graph. As promised, the following claim has a very short proof using the definitions and claims of this section.

Proposition 3.7. If 푚푉 = 1 or 푚퐻 = 1, then 푝 ≤ 푚푉 + 푚퐻 − 1. 3.2 Translating the problem into the language of graphs 41

Orthogonal polygon Pixelation graph

Mobile guard Vertex

Point guard Edge

Simply connected Chordal bipartite (⇒, but ⇍)

푟-vision of two points 푒1 ∩ 푒2 ≠ ∅ or 퐺[푒1 ∪ 푒2] ≅ 퐶4

Horiz. mobile guard cover 푀퐻 ⊆ 푆퐻 dominating 푆푉

Covering system of mobile guards Dominating set

Table 3.1 Translating the orthogonal art gallery problem to the pixelation graph

Proof. Let 푍 be the set of edges of 퐺 induced by 푀퐻 ∪ 푀푉 . Clearly, 퐺[푀퐻 ∪ 푀푉 ] is a star, thus |푍| = |푀퐻 | + |푀푉 | − 1.

We claim that 푍 covers 퐸(퐺). There exist two slices, ℎ1 ∈ 푀퐻 and 푣1 ∈ 푀푉 , which are joined by an edge to 푣0 and ℎ0, respectively. Since 퐺[푀퐻 ∪ 푀푉 ] is a star, {푣1, ℎ1} ∈ 푍.

This edge has 푟-vision of 푒0, as either {푣1, ℎ1} intersects 푒0, or {푣0, ℎ0, 푣1, ℎ1} induces a 퐶4 in 푍.

Finally, we can state Theorem 3.1 in a stronger form, conveniently via graph theoretic con- cepts.

′ Theorem 3.1 . Let 퐴푉 be a set of internally disjoint axis-parallel rectangles of a rectilinear domain 퐷 (we call them vertical slices). Similarly, let 퐴퐻 be another set with the same property, whose elements we call the horizontal slices. Also, suppose that for any 푣 ∈ 퐴푉 , its top and bottom sides are a subset of 휕퐷, and for any ℎ ∈ 퐴퐻 , its left and right sides are a subset of 휕퐷. Furthermore, suppose that their intersection graph

퐺 = (퐴퐻 ∪ 퐴푉 , {{ℎ, 푣} ⊆ 퐴푉 ∪ 퐴퐻 ∶ int(푣) ∩ int(ℎ) ≠ ∅}) is connected.

If 푀푉 ⊆ 퐴푉 dominates 퐴퐻 in 퐺, and 푀퐻 ⊆ 퐴퐻 dominates 퐴푉 in 퐺, then there exists a set of edges 푍 ⊆ 퐸(퐺) such that any element of 퐸(퐺) is 푟-visible from some element of 푍, and 4 |푍| ≤ ⋅ (|푀 | + |푀 | − 1). 3 푉 퐻 42 Mobile vs. point guards

Now we are ready to prove the main theorem of this chapter.

3.3 Proof of Theorem 3.1′

Both 퐴퐻 and 퐴푉 can be extended to a partition of 퐷 (while preserving the assumptions of the theorem on them), so 퐺 is a subgraph induced by 퐴퐻 ∪ 퐴푉 in a chordal bipartite graph (see Lemma 3.3), thus 퐺 is chordal bipartite as well. Let 푀 = 퐺[푀푉 ∪ 푀퐻 ] be the subgraph induced by the dominating sets. Notice, that the bichordality of 퐺 is inherited by 푀.

Claim 3.9. If 푀 is connected, then any edge 푒0 = {ℎ0, 푣0} ∈ 퐸(퐺) is 푟-visible from some edge of 푀.

Proof. As 푁퐺(푀푉 ∪ 푀퐻 ) = 푉 (퐺), there exists two vertices, 푣1 ∈ 푀푉 and ℎ1 ∈ 푀퐻 , such that {푣1, ℎ0}, {푣0, ℎ1} ∈ 퐸(퐺).

If 푣0 ∈ 푀푉 or ℎ0 ∈ 푀퐻 , then {푣0, ℎ1} or {푣1, ℎ0} is in 퐸(푀).

Otherwise, there exists a path in 푀, whose endpoints are 푣1 and ℎ1, and this path and the edges {푣1, ℎ0},{ℎ0, 푣0},{푣0, ℎ1} form a cycle in 퐺. By the bichordality of 퐺, there exists a

퐶4 in 퐺 which contains an edge of 푀 and 푒0.

We distinguish 3 cases based on the level connectivity of 푀.

3.3.1 푀 is 2-connected

The 4 constant in the statement of Theorem 3.1′ is determined by this case. Knowing this, 3 it is not surprising that this is the longest and most complex case of the proof. If 퐸(푀) consists of a single edge 푒, then 푍 = {푒} is clearly a point guard system of 퐺 by Claim 3.9. Suppose now, that 푀 has more than two vertices. Any edge of 푀 is contained in a cycle of 푀, and by the bichordality property, there is such a cycle of length 4. It is easy to see that the convex hull of the pixels determined by the edges of a 퐶4 is a rectangle. Define

⎛ 4 ⎞ 퐷 = Conv ⎜ ∩푒 ⎟ . 푀 ⋃ ⎜⋃ 푖⎟ {푒1,푒2,푒3,푒4} is a 퐶4 in 푀 ⎝푖=1 ⎠

The simply connectedness of 퐷 implies that 퐷푀 ⊆ 퐷. 3.3 Proof of Theorem 3.1′ 43

Claim 3.10. For any slice 푠 ∈ 푉 (푀) the intersection of 푠 and 퐷푀 is connected.

Proof. Suppose that 푒1, 푒2 ∈ 퐸(푀) are such that ∩푒1 and ∩푒2 are in two different compo- nents of 푠 ∩ 퐷푀 . Since 푀 is 2-connected, there is a path connecting 푒1 ⧵ {푠} and 푒2 ⧵ {푠} in 푀 − 푠.

Take the shortest cycle in 푀 containing 푒1 and 푒2. If this cycle contains 4 edges, then the convex hull of their pixels is in 퐷푀 , which is a contradiction. Similarly, if the cycle contains more than 4 edges, the bichordality of 푀 implies that 푠 is joined to every second node of the cycle, which contradicts our assumption that 푠 ∩ 퐷푀 is disconnected.

Claim 3.11. For any slice 푠 ∈ 푉 (퐺), the intersection of int(푠) and 퐷푀 is connected.

Proof. If 푠 ∈ 푉 (푀), we are done by Claim 3.10. If 푠 ∈ 푉 (퐺) ⧵ 푉 (푀), let 푒1, 푒2 ∈ 퐸(퐺) be the two edges such that 푒1 ∩ 푒2 = {푠}, 휕(∩푒1) ⋂ 휕퐷푀 ≠ ∅, 휕(∩푒2) ⋂ 휕퐷푀 ≠ ∅. Then, we must have (푒1 ⋃ 푒2)⧵{푠} ⊆ 푉 (푀). Take the shortest path in 푀 joining 푒1 ⧵{푠} to 푒2 ⧵{푠}. The proof can be finished as that of the previous claim.

Let 퐵퐻 ⊂ 푀퐻 be the set of those slices whose top and bottom sides both intersect 휕퐷푀 in an uncountable number of points of ℝ2.

For technical reasons, we split each element of ℎ ∈ 퐵퐻 horizontally through 푐(ℎ) to get 2 ′ two isometric rectangles in ℝ ; let the set of the resulting refined horizontal slices be 퐵퐻 . Replace the elements of 퐴퐻 and 푀퐻 contained in 퐵퐻 with their corresponding two halves ′ in 퐵퐻 to get

퐴′ = 퐵′ 퐴 ⧵ 퐵 and 푀′ = 퐵′ 푀 ⧵ 퐵 , 퐻 퐻 ⋃ 퐻 퐻 퐻 퐻 ⋃ 퐻 퐻

′ ′ ′ respectively. Let 퐴푉 = 퐴푉 , 푀푉 = 푀푉 . Let 휏 be the function which maps ℎ ∈ 퐵퐻 to the ′ ′ ′ 휏(ℎ) ∈ 퐴퐻 for which ℎ ⊆ 휏(ℎ) holds, and let 휏 be the identity function on 퐴푉 ∪ 퐴퐻 ⧵ 퐵퐻 . ′ ′ ′ ′ Let 퐺 be the intersection graph of 퐴퐻 and 퐴푉 (as in the statement of Theorem 3.1 ). Also, ′ ′ ′ ′ −1 let 푀 = 퐺 [푀퐻 ∪ 푀푉 ] = 휏 (푀). Observe that 휏 naturally defines a graph homomor- phism 휏 ∶ 퐺′ → 퐺 (edges are mapped vertex-wise).

′ ′ ′ ′ ′ Claim 3.12. In 퐺 , the set 푀퐻 dominates 퐴푉 , and 푀푉 dominates 퐴퐻 . Furthermore, if 푍′ ⊆ 퐸(푀′) is a point guard system of 퐺′, then 푍 = 휏(푍′) ⊆ 퐸(푀) is a point guard system of 퐺. 44 Mobile vs. point guards

Proof. The first statement of this claim holds, since 휏 maps non-edges to non-edges, and ′ −1 ′ −1 both 푀퐻 = 휏 (푀퐻 ) and 푀푉 = 휏 (푀푉 ) by definition. As 휏 is a graph homomorphism, it preserves 푟-visibility, which implies the second statement of this claim.

′ ′ Notice, that 푀 is 2-connected and 퐷푀 = 퐷푀′ . An edge 푒 ∈ 퐸(푀 ) falls into one of the following 4 categories:

푣1 푣2 푣3 푣5 푣6

ℎ4 convex side convex convex convex ℎ5

푣4

″ side internal reflex side reflex side ℎ ℎ 3 3 ′ convex side internal internal internal reflex ℎ3

ℎ2 convex reflex internal internal side

ℎ1 convex side side convex

′ ′ ″ Fig. 3.5 We have 푀퐻 = {ℎ1, ℎ2, ℎ3, ℎ4, ℎ5}, 푀퐻 = 푀퐻 − ℎ3 + ℎ3 + ℎ3 , and ′ 푀푉 = 푀푉 = {푣1, 푣2, 푣3, 푣4, 푣5, 푣6}. The thick line is the boundary of 퐷푀 . Each rectangle pixel is labeled according to the type of its corresponding edge of 푀′.

Convex edge: 3 vertices of ∩푒 fall on 휕퐷푀 , e.g., the edge {ℎ2, 푣1} on Fig. 3.5; ″ Reflex edge: exactly 1 vertex of ∩푒 falls on 휕퐷푀 , e.g., {ℎ3 , 푣3} on Fig. 3.5;

Side edge: two neighboring vertices of ∩푒 fall on 휕퐷푀 , e.g., {ℎ1, 푣4} on Fig. 3.5;

Internal edge: zero vertices of ∩푒 fall on 퐷푀 , e.g., {ℎ2, 푣3} on Fig. 3.5.

Notice that on Fig. 3.5, the edge {ℎ3, 푣5} falls into neither of the previous categories, as two non-neighboring (diagonally opposite) vertices of pixel ℎ3 ∩ 푣5 fall on 퐷푀 . This clearly cannot happen with edges of 퐺′, but 퐺 may contain edges of this type. Observe that 휏 maps convex edges to convex edges, and side edges to side edges. Conversely, the preimages of a convex edge are a convex edge and a side edge (푀′ is 2-connected), the 3.3 Proof of Theorem 3.1′ 45 preimages of a side edge are two side edges, and the preimages of a reflex edge are a reflex edge and an internal edge. The following definition allow us to break our proof into smaller, transparent parts, which ultimately boils down to presenting a precise proof. It captures a condition which in certain circumstances allows us to conclude that a guard 푒1 can be replaced by 푒2 such that we still have complete coverage of 퐺′.

′ Definition 3.13. For any two edges 푒1, 푒2 ∈ 퐸(푀 ), where 푒1 = {푣1, ℎ1} and 푒2 = {푣2, ℎ2}, we write 푒2 → 푒1 (푒2 dominates 푒1) iff either

′ ′ ′ • 푒1 ∩ 푒2 ⊂ 퐴퐻 , and ∃ℎ3, ℎ4 ∈ 푀퐻 such that {푣1, 푣2, ℎ3, ℎ4} induces a 퐶4 in 푀 , and ℎ1 = ℎ2 is between ℎ3 and ℎ4; or

′ ′ ′ • 푒1 ∩ 푒2 ⊂ 퐴푉 , and ∃푣3, 푣4 ∈ 푀푉 such that {푣3, 푣4, ℎ1, ℎ2} induces a 퐶4 in 푀 , and 푣1 = 푣2 is between 푣3 and 푣4; or

′ ′ • 푒1 ∩ 푒2 = ∅, and ∃푣3 ∈ 푀푉 and ℎ3 ∈ 푀퐻 such that both {푣1, ℎ2, 푣2, ℎ3} and ′ {ℎ1, 푣3, ℎ2, 푣2} induces a 퐶4 in 푀 ; furthermore, 푣1 is between 푣2 and 푣3, and ℎ1 is

between ℎ2 and ℎ3.

We write 푒2 ↔ 푒1 iff both 푒2 → 푒1 and 푒1 → 푒2 hold. Note that ↔ is a symmetric, but generally intransitive relation.

″ ″ ″ For example, on Fig. 3.5, {ℎ1, 푣3} ↔ {ℎ3 , 푣3}, and {ℎ1, 푣2} → {ℎ3 , 푣3}. Also, {ℎ3 , 푣3} ↔ ″ ″ ′ {ℎ3 , 푣1}, but {ℎ3 , 푣3} ↛ {ℎ3, 푣1}. This is a technicality which makes the proofs easier, but ″ ′ does not cause any issues in the end, as 휏({ℎ3 , 푣1}) = 휏({ℎ3, 푣1}). We will search for a point guard system of 푀′ with very specific properties, which are described by the following definition.

Definition 3.14. Suppose 푍′ ⊆ 퐸(푀′) is such, that

1. 푍′ contains every convex edge of 푀,

′ ′ 2. for any non-internal edge 푒1 ∈ 퐸(푀) ⧵ 푍 , there exists some 푒2 ∈ 푍 for which

푒2 → 푒1, and

′ ′ 3. for each ℎ0 ∈ 퐴퐻 for which int(ℎ0) ∩ 퐷푀 ≠ ∅ holds, ∃{ℎ2, 푣2} ∈ 푍 such that ′ ′ {ℎ0, 푣2} ∈ 퐸(푀 ) and 푁푀′ (ℎ2) ⊇ 푁퐺′ (ℎ0) ⋂ 푀푉 .

If these three properties hold, we call 푍′ a hyperguard of 푀′. 46 Mobile vs. point guards

Lemma 3.15. Any hyperguard 푍′ of 푀′ is a point guard system of 퐺′, i.e., any edge of 퐺′ is 푟-visible from some element of 푍′.

′ Proof. Let 푒0 = {푣0, ℎ0} ∈ 퐸(퐺 ) be an arbitrary edge. By Claim 3.9, there exists an edge ′ 푒1 ∈ 퐸(푀 ) which has 푟-vision of 푒0, and we also suppose that 푒1 is chosen so that Euclidean distance dist(∩푒0, ∩푒1) is minimal. ′ ′ Trivially, if 푒1 ∈ 푍 (for example, if 푒1 is a convex edge of 푀 ), then 푒0 is 푟-visible from ′ 푒1. Assume now, that 푒1 ∉ 푍 .

′ ′ • If 푒1 is a reflex or side edge of 푀 , then ∃푒2 ∈ 푍 so that 푒2 → 푒1. We claim that 푒2 ′ has 푟-vision of 푒0 in 퐺 (this is the main motivation for Definition 3.13).

′ ′ 1. If 푒1 ∩ 푒2 ⊂ 퐴퐻 : by the choice of 푒1 and 푒2, 푣1 is joined to ℎ0, ℎ3, ℎ4 in 퐺 . The choice of 푒1 guarantees that 푣1 ∩ ℎ0 is between 푣1 ∩ ℎ3 and 푣1 ∩ ℎ4. Therefore ′ int(푣2 ∩ ℎ0) ≠ ∅, so {푣0, ℎ0, 푣2, ℎ1(= ℎ2)} induces a 퐶4 in 퐺 . ′ 2. If 푒1 ∩ 푒2 ⊂ 퐴푉 : the proof proceeds analogously to the previous case. ′ 3. If 푒1 ∩ 푒2 = ∅: by the choice of 푒1 and 푒2, 푣1 is joined to ℎ0, ℎ3, ℎ2 in 퐺 , and 푣1 ′ is joined to 푣0, 푣3, 푣2 in 퐺 . The choice of 푒1 guarantees that 푣1 ∩ ℎ0 is between

푣1 ∩ ℎ3 and 푣1 ∩ ℎ2, and that 푣0 ∩ ℎ1 is between 푣3 ∩ ℎ1 and 푣2 ∩ ℎ1. Therefore ′ int(푣2 ∩ ℎ0) ≠ ∅ and int(푣0 ∩ ℎ2) ≠ ∅, so {푣0, ℎ0, 푣2, ℎ2} induces a 퐶4 in 퐺 .

′ In any of the three cases, 푒0 is 푟-visible from 푒2 in 퐺 .

′ rd • If 푒1 is an internal edge of 푀 , then ∩푒0 ⊂ 퐷푀 . By the 3 property of hyperguards, ′ ′ ′ there ∃{ℎ2, 푣2} ∈ 푍 such that {ℎ0, 푣2} ∈ 퐸(푀 ) and 푁푀′ (ℎ2) ⊇ 푁퐺′ (ℎ0) ⋂ 푀푉 . An easy argument (use that 퐷푀 ⊂ 퐷 are both simply connected) gives that {푣0, ℎ2} ∈ ′ ′ ′ 퐸(퐺 ). Thus {푣0, ℎ2, 푣2, ℎ0} induces a 퐶4 in 퐺 , so 푒0 is 푟-visible from {푣2, ℎ2} ∈ 푍 .

We have verified the statement in every case, so the proof of this lemma is complete.

Notice, that the set of all convex, reflex, and side edges of 퐸(푀′) form a hyperguard of 푀′. By Lemma 3.15, this set is a point guard system of 퐺′, and Claim 3.12 implies that its 휏-image is a point guard system of 퐺. The cardinality of the 휏-image of this hyperguard is bounded by 2|푉 (푀)| − 4 (we will see this shortly), which is already a magnitude lower than what the trivial choice of 퐸(푀) would give (generally, |퐸(푀)| can be equal to Ω(|푉 (푀)|2)). Let the number of convex, side, and reflex edges in 푀′ be 푐′, 푠′, and 푟′, respectively. Claim 3.10 and 3.11 allow us to count these objects. 3.3 Proof of Theorem 3.1′ 47

′ 1. The number of reflex vertices of 퐷푀 is equal to 푟 : any reflex vertex is a vertex of a ′ reflex edge, and the way 푀 and 퐷푀 is constructed guarantees that exactly one vertex

of the pixel of a reflex edge is a reflex vertex of 퐷푀 .

′ 2. The number of convex vertices of 퐷푀 is equal to 푐 : any convex vertex is a vertex of

the pixel of a convex edge, and the way 퐷푀 is constructed guarantees that exactly one vertex of the pixel of a convex edge is a convex vertex.

3. The cardinality of 푉 (푀′) is 푐′ + 1 푠′: the first and last edge incident to any element 2 ′ ′ of 푉 (푀 ) ordered from left-to-right (for elements of 푀퐻 ) or from top-to-bottom (for ′ elements of 푀푉 ) is a convex or a side edge. Conversely, any convex edge is the first ′ ′ or last incident edge of exactly one element of 푀퐻 and one element of 푀푉 . A side edge is the first or last incident edge of exactly one element of 푉 (푀′).

′ 4. For any reflex edge 푒1 = {푣1, ℎ1} ∈ 퐸(푀 ), there is exactly one reflex or side edge in ′ 퐸(푀 ) which contains 푣1 and is in the ↔ relation with 푒1, and the same can be said

about ℎ1.

′ 5. Any side edge 푒1 ∈ 퐸(푀 ) is in ↔ relation with exactly one reflex or side edge which ′ it intersects. The intersection is the slice in 푉 (푀 ) on which 푒1 is a boundary edge.

We can now compute the size of the set of all convex, reflex, and side edges of 퐸(푀′):

푐′ + 푟′ + 푠′ = 2푐′ − 4 + 푠′ = 2|푉 (푀′)| − 4.

Furthermore, it is clear that taking the 휏-image of this set decreases its by cardinality by

2|퐵퐻 | (new reflex and side edges are created at both ends of slices in 퐵퐻 when splitting ′ them), and 2|푉 (푀 )| − 4 − 2|퐵퐻 | = 2|푉 (푀)| − 4, proving the claim from the previous page. Readers who are only interested in a result which is sharp up to a constant factor, may skip to Case 3.3.2. Further analysis of 푀′ allows us to lower the coefficient 2 to 4 . 3 Define the auxiliary graph 푋 as follows: let 푉 (푋) be the set of reflex and side edges of 푀′, and let 퐸(푋) = {{푒, 푓} ∶ 푒 ≠ 푓, 푒 ∩ 푓 ≠ ∅, 푒 ↔ 푓}.

By our observations, 푋 is the disjoint union of some cycles and 1 푠′ paths. This structure 2 allows us to select a hyperguard which contains a subset of the reflex and side edges of 푀′, instead of the whole set. 48 Mobile vs. point guards

3.3.1.1 Constructing a hyperguard 푍′ of 푀′.

We will define (푍′)∞ , a sequence of (set theoretically) increasing sequence of subsets of 푗 푗=0 ′ ∞ 퐸(푀 ), and (푋푗)푗=0, a decreasing sequence of induced subgraphs of 푋.

Additionally, we will define a function 푤푗 ∶ 푉 (푋) → {0, 1, 2}, and extend its domain to any subgraph 퐻 ⊆ 푋 by defining 푤푗(퐻) = ∑푒∈푉 (퐻) 푤푗(푒). The purpose of 푤푗, very vaguely, is that as 푍′ will contain every third node of 푋, we need to keep count of the modulo 3 remainders. Furthermore, 푤푗 serves as buffer in a(n implicitly defined) weight function (see inequality (3.2)).

For a set 퐸0 ⊆ 퐸(푋), let the indicator function of 퐸0 be

1, if 푒 ∈ 퐸 , 1 (푒) = 0 퐸0 { 0, if 푒 ∈ 퐸(푋) ⧵ 퐸0.

′ Let 푍0 = ∅ and 푋0 = 푋. By our previous observations, 푋 does not contain isolated nodes. Define 푤0 ∶ 푉 (푋) → {0, 1, 2} such that

1, if 푑 (푒) = 1, 푤 (푒) = 푋0 0 { 0, if 푑 (푒) = 0 or 2. 푋0

′ In each step, we will define 푍푗 , 푋푗, and 푤푗 so that

′ ′ • 푍푗−1 ⊆ 푍푗 , 푋푗 ⊆ 푋푗−1,

• {푒 ∈ 푉 (푋 ) | 푑 (푒) = 1} ⊆ 푤−1(1), 푗 푋푗 푗 • {푒 ∈ 푉 (푋 ) | 푑 (푒) = 0} = 푤−1(2), and 푗 푋푗 푗

′ ′ • ∀푒0 ∈ 푉 (푋) ⧵ 푉 (푋푗), either 푒0 ∈ 푍푗 , or ∃푒1 ∈ 푍푗 so that 푒1 → 푒0.

If these hold, then for any path component 푃푗 in 푋푗, we have 푤푗(푃푗) ≥ 2. 3.3 Proof of Theorem 3.1′ 49

Phase 1 Let the set of convex edges of 푀′ be 퐶′. Let

′ ′ 푆 = {푒 ∈ 푉 (푋) ∶ 휏(푒) is a side edge, ∃푓 ∈ 푉 (푋) 푒 ↔ 푓, 푒 ∩ 푓 ⊆ 퐵퐻 }, ′ ′ −1 −1 푇 = {푓 ∈ 푉 (푋) ∶ ∃푒 ∈ 푆 푓 ↔ 푒, 휏 (휏(푓)) ⧵ {푓} → 푁푋(휏 (휏(푒))) ⧵ {푓}}, 푈 ′ = 휏−1(휏(퐶′)) ⧵ 퐶′, 푄′ = {푒 , 푒 , 푒 , 푒 }. ⋃ 1 2 3 4 ′ ′ 푒1,푒4∈푆 ∪푈 푒2,푒3∈푉 (푋) 푒1↔푒2,푒2↔푒3,푒3↔푒4

Take

푍′ = 휏−1 휏(퐶′) 휏(푇 ′) , 1 ( ⋃ ) ′ ′ ′ ′ 푋1 = 푋 − 푇 − 푁푋(푇 ) − 푈 − 푁푋(푈 ),

푤 = 푤 − 1 ′ − 1 ′ + 1 ′ + 1 ′ . 1 0 푆 푈 ∑ 푁푋(푁푋(푓))⧵{푓}⧵푄 ∑ 푁푋(푁푋(푒))⧵{푒}⧵푄 푓∈푇 ′ 푒∈푈 ′

Phase 2 Take a cycle 푒 , 푒 , … , 푒 in 푋 (푘 ≥ 2, 푗 ≥ 1). This set of nodes of 푋 is the 1 2 2푘푗 푗 푗 푗 ′ edge set of a cycle of length 2푘푗 in 푀 .

• If 2푘푗 = 4, observe that 푒1 ↔ 푒2, 푒1 ↔ 푒4, 푒2 ↔ 푒3, 푒4 ↔ 푒3 together imply that

푒1 ↔ 푒3. Take

푍′ = {푒 } 푍′, 푗+1 1 ⋃ 푗

푋푗+1 = 푋푗 − {푒1, 푒2, 푒3, 푒4},

푤푗+1 = 푤푗.

′ • If 2푘푗 ≥ 6, the chordal bipartiteness of 푀 implies that without loss of generality ′ ′ there is a chord 푓 ∈ 퐸(푀 ) which forms a cycle with 푒1, 푒2, 푒3 in 푀 . Take

푍′ = {푓} 푍′, 푗+1 ⋃ 푗 푋 = 푋 − {푒 , 푒 , 푒 , 푒 , 푒 }, 푗+1 푗 2푘푗 1 2 3 4 1 1 푤푗+1 = 푤푗 + 푒 + 푒 . 5 2푘푗−1 50 Mobile vs. point guards

Iterate this step until 푋 is cycle-free. 푗1

Phase 3 Take a path 푒1, 푒2, … , 푒푘 in 푋푗 (for 푗 ≥ 푗1), such that

⎛ ⎡푘−1 ⎤⎞ 퐸 ⎜푀′ ⎢ 푒 ⎥⎟ ⧵ {푒 , … 푒 } ≠ ∅. ⎜ ⎢⋃ 푖⎥⎟ 2 푘−1 ⎝ ⎣푖=2 ⎦⎠

′ ′ Using the bichordality of 푀 , there exists a chord 푓 ∈ 퐸(푀 ) which forms a 퐶4 with

{푒푙−1, 푒푙, 푒푙+1}, where 3 ≤ 푙 ≤ 푘 − 2. It is easy to see that 푒푙−2 ↔ 푒푙−1 implies 푓 → 푒푙−2 and

푓 → 푒푙−1. Similarly, we have that 푓 → 푒푙+1 and 푓 → 푒푙+2. Also, 푓 → 푒푙−1 and 푓 → 푒푙+1 together imply 푓 → 푒푙. Therefore, we take

푍′ = {푓} 푍′, 푗+1 ⋃ 푗

푋푗+1 = 푋푗 − {푒푙−2, 푒푙−1, 푒푙, 푒푙+1, 푒푙+2}, 푤 = 푤 + 1 . 푗+1 푗 {dist푋(•,푒푙)=3}

Iterate this step until 푋 is free of the above defined paths. 푗2

′ Phase 4 The set 퐴퐻 is the subset of the nodes of a horizontal 푅-tree of 퐷. Let ℎroot ∈ ′ 퐴퐻 be an arbitrarily chosen node serving as the root of the horizontal 푅-tree. Process the ′ elements of 퐴퐻 in decreasing distance (measured in the horizontal 푅-tree) from ℎroot. ′ Suppose ℎ0 ∈ 퐴퐻 is the next horizontal slice to be processed. If int(ℎ0) ∩ 퐷푀 = ∅ or ′ ′ rd ′ ℎ0 ∈ 푀퐻 , then move on to the next slice of 퐴퐻 , as the 3 property of hyperguards for 푍 ′ is satisfied by any edge of 푀 incident to ℎ0. ′ ′ Suppose now, that ℎ0 ∉ 푀퐻 . It is easy to see that there exists a 퐶4 in 푀 whose edge set {푒1, 푒2, 푒3, 푒4} satisfies ⎛ 4 ⎞ ℎ ∩ 퐷 ⊂ Conv ⎜ ∩푒 ⎟ . 0 푀 ⎜⋃ 푖⎟ ⎝푖=1 ⎠

Without loss of generality, we may suppose that we choose the 퐶4 so that the convex hull of ′ the pixels of its edges is minimal. Then 푒푖 (for 푖 = 1, 2, 3, 4) is not an internal-edge of 푀 , as this would contradict the choice of the 퐶4. ′ ′ ′ rd If 푒푖 is a convex edge of 푀 , then it is already contained in 푍1 ⊂ 푍 , so it satisfies the 3 ′ property of hyperguards for 푍 and ℎ0, and we may skip to processing the next slice. If 푒푖 3.3 Proof of Theorem 3.1′ 51

′ ′ is a side edge of 푀 , then for any edge 푓 ∈ 푍 which satisfies 푓 → 푒푖, we have ∩푓 ⊂ 4 rd ′ Conv (⋃푖=1 ∩푒푖), so 푓 satisfies the 3 property of hyperguards for 푍 and ℎ0, and again, we may skip to processing the next slice.

′ Suppose now, that each 푒푖 (for 푖 = 1, 2, 3, 4) is a reflex edge of 푀 . Let

4 4 {ℎ , ℎ } = 푀′ 푒 and {푣 , 푣 } = 푀′ 푒 . 1 2 퐻 ⋂ ⋃ 푖 1 2 푉 ⋂ ⋃ 푖 푖=1 푖=1

The minimality of the chosen 퐶4 implies that {ℎ1, 푣1} ↔ {ℎ1, 푣2} and {ℎ2, 푣1} ↔ {ℎ2, 푣2}.

If {ℎ1, 푣1}, {ℎ1, 푣2} were removed in Phase 2 or Phase 3 in one step, then the edge by which ′ rd ′ 푍 is extended in the same step satisfies the 3 property of hyperguards for 푍 and ℎ0.

The same holds for {ℎ2, 푣1}, {ℎ2, 푣2}. In both cases, we may skip to the next slice to be processed.

Without loss of generality, we may suppose that ℎ1 is farther away from the root of the horizontal 푅-tree than ℎ2.

If {{ℎ1, 푣1}, {ℎ1, 푣2}} ∩ 푉 (푋푗) is non-empty, take the path component 푃푗 of 푋푗 containing this set; otherwise let 푃푗 be the empty graph. Observe, that Claim 3.11 implies that as a result of Phase 3, for any node 푒 ∈ 푉 (푃 ), its horizontal slice 푒 ∩ 푀퐻 is at least as far away from the root as ℎ1.

Split the path 푃푗 into two components 푃푗,1 and 푃푗,2 by deleting {ℎ1, 푣1} and {ℎ1, 푣2} (if one of them is not in 퐸(푋푗), then one of the components is empty), so that {ℎ1, 푣1} ∉ 푉 (푃푗,2) and {ℎ1, 푣2} ∉ 푉 (푃푗,1).

• If |푉 (푃푗,1)| ≢ 0 (mod 3) or |푉 (푃푗,2)| ≢ 0 (mod 3), then let 푌푗 be a dominating set of

푃푗 which contains {ℎ1, 푣1} or {ℎ1, 푣2}, and is minimal with respect to these conditions. Set

푍′ = 푌 푍′, 푗+1 푗 ⋃ 푗

푋푗+1 = 푋푗 − 푃푗,

0, if 푒 ∈ 푉 (푃푗), 푤푗+1(푒) = { 푤푗(푒) if 푒 ∉ 푉 (푃푗).

′ ′ Clearly, one of {ℎ1, 푣1} and {ℎ1, 푣2} is contained in 푌푗 ⊂ 푍푗+1 ⊆ 푍 , and it satisfies rd ′ the 3 property of hyperguards for 푍 and ℎ0. 52 Mobile vs. point guards

• If |푉 (푃푗,1)| ≡ |푉 (푃푗,2)| ≡ 0 (mod 3), then let 푌푗 be a minimal dominating set of 푃푗. ′ Moreover, if {{ℎ2, 푣1}, {ℎ2, 푣2}} ⋂(푉 (푋푗) ⋃ 푍푗 ) is non-empty, let 푓푗 be an element of it, otherwise set 푓푗 = {ℎ2, 푣1}. Take

푍′ = 푌 {푓 } 푍′, 푗+1 푗 ⋃ 푗 ⋃ 푗 푋 = 푋 − 푃 − {푓 } − 푁 ({푓 }), 푗+1 푗 푗 푗 푋푗 푗

⎧ 0, if 푒 ∈ 푉 (푃푗) ⋃ {{ℎ2, 푣1}, {ℎ2, 푣2}}, ⎪ 푤푗+1(푒) = ⎨ 푤푗(푒) + 1, if dist푋(푒, 푓푗) = 2, ⎪ ⎩ 푤푗(푒) otherwise.

rd ′ Observe, that 푓푗 satisfies the 3 property of hyperguards for 푍 and ℎ0.

′ ′ rd ′ In any case, some element of 푍푗+1 ⊆ 푍 satisfies the 3 property of hyperguards for 푍 and ′ ℎ0. Furthermore, this holds for any slice of 퐴퐻 between ℎ1 and ℎ2, so we skip processing these elements.

Phase 5 Lastly, we get 푋 which is the disjoint union of paths and isolated nodes (or it is 푗3 an empty graph). Take a component 푃푗 of 푋푗 (for some 푗 ≥ 푗3). Let 푌푗 be a dominating set of 푃푗 (if |푉 (푃푗)| = 1, then 푌푗 = 푉 (푃푗)). Take

푍′ = 푌 푍′, 푗+1 푗 ⋃ 푗

푋푗+1 = 푋푗 − 푃푗,

0, if 푒 ∈ 푉 (푃푗), 푤푗+1(푒) = { 푤푗(푒) if 푒 ∉ 푉 (푃푗).

By repeating this procedure, eventually 푋 is the empty graph for some 푗 ≥ 푗 . 푗4 4 3 Let 푍′ = 푍′ . This procedure is orchestrated in a way to guarantee that 푍′ is a hyperguard of 푗4 푀′, so only an upper estimate on the cardinality of 휏(푍′) needs to be calculated to complete the proof of Case 3.3.1.

3.3.1.2 Estimating the size of 푍 = 휏(푍′).

We have

′ ′ ′ ′ ′ ′ |푉 (푋0)| = 푟 + 푠 , 푤0(푋) = 푠 , |퐵퐻 | = |푇 | + |푈 |. 3.3 Proof of Theorem 3.1′ 53

′ ′ ′ ′ ′ ′ ′ By definition, |푍1| = 푐 + |푈 | + 2|푇 | and |휏(푍1)| = |푍1| − |퐵퐻 |. It is easy to check that

′ ′ |푉 (푋1)| + 푤1(푋) + 2|푈 | + 5|푇 | ≤ |푉 (푋0)| + 푤0(푋).

Therefore, we have

|푉 (푋 )| + 푤 (푋) |푉 (푋 )| + 푤 (푋) |푍′| + 1 1 ≤ 푐′ + |푈 ′| + 2|푇 ′| + 1 1 ≤ 1 3 3 |푉 (푋 )| + 푤 (푋) − 2|푈 ′| − 2|푇 ′| ≤ 푐′ + |퐵′ | + 0 0 ≤ (3.1) 퐻 3 푟′ + 2푠′ − 2|퐵′ | ≤ 푐′ + |퐵′ | + 퐻 . 퐻 3

We now show that

|푉 (푋푗+1)| + 푤푗+1(푋) |푉 (푋푗)| + 푤푗(푋) |푍′ | + ≤ |푍′| + . (3.2) 푗+1 3 푗 3 holds for any 푗 ≥ 1.

In Phase 2, we choose a node from each cycle of 푋1. Inequality (3.2) is preserved, since

′ ′ |푍푗+1| = |푍푗 | + 1, 1 |푉 (푋푗+1)| = |푉 (푋푗)| − 5 + {4}(푘푗), 1 푤푗+1(푋) ≤ 푤푗(푋) + 2 − 2 ⋅ {4}(푘푗).

In Phase 3, for every 푗2 > 푗 ≥ 푗1, we have

′ ′ |푍푗+1| = |푍푗 | + 1, |푉 (푋 )| = |푉 (푋 )| − 5, 푗+1 푗1

푤푗+1(푋) ≤ 푤푗(푋) + 2.

Let 푗3 > 푗 ≥ 푗2. If |푉 (푃푗,1)| ≢ 0 (mod 3) and |푉 (푃푗,2)| ≢ 2 (mod 3), then take a dominat- ing set of 푃푗 containing {푣1, ℎ1}. We have

|푉 (푃푗,1)| − 2 |푉 (푃푗,2)| − 1 |푌 | ≤ 1 + + ≤ 푗 ⌈ 3 ⌉ ⌈ 3 ⌉ |푉 (푃푗,1)| − 1 |푉 (푃푗,2)| |푉 (푃푗)| + 2 ≤ 1 + + = . 3 3 3 54 Mobile vs. point guards

Similarly, if |푉 (푃푗,1)| ≢ 2 (mod 3) and |푉 (푃푗,2)| ≢ 0 (mod 3), then there is a small domi- nating set of 푃푗 containing {ℎ1, 푣2}. Also, if both |푉 (푃푗,1)| ≡ 2 (mod 3) and |푉 (푃푗,2)| ≡ 2

(mod 3), then there is a small dominating set of 푃푗 containing {ℎ1, 푣2}. Thus, if |푉 (푃푗,1)| ≢

0 (mod 3) or |푉 (푃푗,2)| ≢ 0 (mod 3), then

|푉 (푃푗)| + 2 |푍′ | = |푍′| + |푌 | ≤ |푍′| + , 푗+1 푗 푗 푗 3 |푉 (푋 )| = |푉 (푋 )| − |푉 (푃 )|, 푗+1 푗1 푗

푤푗+1(푋) ≤ 푤푗(푋) − 2.

|푉 (푃 )| If both |푉 (푃 )| ≡ 0 (mod 3) and |푉 (푃 )| ≡ 0 (mod 3), then |푌 | = 푗 . Observe, 푗,1 푗,2 푗 3 that

{ℎ1, 푣1}, {ℎ1, 푣2}, {ℎ2, 푣1}, {ℎ2, 푣2} ∉ 푉 (푃푘) for any 푘 < 푗.

′ ′ If both {ℎ1, 푣1} ∉ 푍푗 and {ℎ1, 푣2} ∉ 푍푗 , but were removed in different steps, then when {ℎ1, 푣1} is removed in step 푘 we must have set 푤푘({ℎ1, 푣2}) = 1, which is the consequence of the previous observation. Thus, 푤푗({ℎ1, 푣2}) = 1. Similarly, we must have 푤푗({ℎ1, 푣1}) =

1. This reasoning holds for {ℎ2, 푣1} and {ℎ2, 푣2}, as well.

If 푃푗 is not the empty graph or 푓푗 ∈ 푍(푋푗), then inequality (3.2) trivially holds. If 푃푗 is the empty graph, then 푤푗({ℎ1, 푣1}) = 푤푗({ℎ1, 푣2}) = 1. If 푓푗 ∈ 푉 (푋푗), these 2 extra weights can be used to compensate for the new degree 1 vertices of 푋푗+1. If 푓푗 ∉ 푍(푋푗) ⋃ 푉 (푋푗), then even 푤푗({ℎ2, 푣1}) = 푤푗({ℎ2, 푣2}) = 1, and in total the 4 extra weights compensate for ′ adding 푓푗 to 푍푗+1.

In any case, inequality (3.2) holds for 푗3 > 푗 ≥ 푗2.

For any 푗4 > 푗 ≥ 푗3, we have

|푉 (푃푗)| |푉 (푃푗)| + 2 |푌 | ≤ ≤ 푗 ⌈ 3 ⌉ 3 and 푤푗(푃푗) = 2, so inequality (3.2) holds for 푗.

3.3.1.3 Summing it all up.

By definition, we have

|푍′| = |푍′ |, 푋 = ∅, 0 ≤ 푤 (푋). 푗4 푗4 푗4 3.3 Proof of Theorem 3.1′ 55

Inequality (3.2) is preserved from Phase 2 up to Phase 5, therefore

|푉 (푋푗 )| + 푤푗 (푋) |푉 (푋 )| + 푤 (푋) |푍′| ≤ |푍′ | + 4 4 ≤ |푍′| + 1 1 . 푗4 3 1 3

Lastly, using inequality (3.1), we get

′ ′ ′ ′ ′ ′ ′ ′ |푍| = |휏(푍 )| = |휏(푍 ⧵ 푍1)| + |휏(푍1)| ≤ |푍 ⧵ 푍1| + |푍1| − |퐵퐻 | = 푟′ + 2푠′ − 2|퐵′ | (푐′ − 4) + 2푠′ − 2|퐵′ | = |푍′| − |퐵′ | ≤ 푐′ + 퐻 = 푐′ + 퐻 = 퐻 3 3 1 4 푐′ + 푠′ − 4 − 2|퐵′ | ′ ′ ( 2 ) 퐻 4|푉 (푀 )| − 4 − 2|퐵 | = = 퐻 = 3 3 ′ ′ ′ ′ 4|푀 | + 4|푀 | − 4 − 2|퐵 | 4|푀퐻 | + 4|퐵퐻 | + 4|푀푉 | − 4 − 2|퐵 | = 퐻 푉 퐻 = 퐻 = 3 3 4(|푀 | + |푀 |) − 4 = 퐻 푉 , as desired. 3

3.3.2 푀 is connected, but not 2-connected

Let the 2-connected components (or blocks) of 푀 be 푀푖 for 푖 = 1, … , 푞. Since induced graphs of 퐺 inherit the chordal bipartite property, by Case 3.3.1, there exists a subset 푍푖 ⊆

퐸(푀푖), such that for any edge 푒0 ∈ 퐸(퐺[푁퐺(푀푖)]), there exists an edge 푒1 ∈ 푍푖 which has 푟-vision of 푒 in 퐺[푁(푀 )], and |푍 | ≤ 4 (|푉 (푀 )| − 1). Let 푍 = ∪푞 푍 . 0 푖 푖 3 푖 푖=1 푖 Since the intersection graph of the vertex sets of the 2-connected components is a tree (and any two components intersect in zero or one elements), we have

푞 4 4 (−푞 + |푉 (푀)| + (푞 − 1)) 4(|푉 (푀)| − 1) |푍| ≤ −푞 + |푉 (푀 )| = = . ∑ 푖 3 ( 푖=1 ) 3 3

Furthermore, given an arbitrary 푒0 = {푣0, ℎ0} ∈ 퐸(퐺), there exists a 푣1 ∈ 푀푉 and an

ℎ1 ∈ 푀퐻 such that {푣1, ℎ0}, {푣0, ℎ1} ∈ 퐸(퐺).

• If 푣0 ∈ 푀푉 or ℎ0 ∈ 푀퐻 , then {푣0, ℎ1} or {푣1, ℎ0} is in 퐸(푀).

• Otherwise, there exists a path in 푀 whose endpoints are 푣1 and ℎ1, and this path and

the edges {푣1, ℎ0},{ℎ0, 푣0},{푣0, ℎ1} form a cycle in 퐺. By the bichordality of 퐺, there

exists a 퐶4 in 퐺 which contains an edge of 푀 and 푒0. 56 Mobile vs. point guards

In any case, 푒0 is 푟-visible from some 푒1 ∈ 퐸(푀). As 푒1 is an edge of one of the 2-connected components 푀푖, we have 푒0 ⊂ 푁퐺(푀푖), therefore 푒0 ∈ 퐸(퐺[푁퐺(푀푖)]). Thus, some 푒2 ∈

푍푖 has 푟-vision of 푒0.

3.3.3 푀 has more than one connected component.

Let us take a decomposition of 푀 into connected components 푀푖 for 푖 = 1, … , 푡. 푡 Let 푁푖 = 푁(푀푖), so we have 푀푖 ⊆ 푁푖 and ∪푖=1푁푖 = 푉 (퐺). 푖−1 푡 For all 푖 > 1 let 푞푖 be the number of components of 퐺[∪푘=1푁푘 ⧵ ∪푘=푖푁푘] to which 푁푖 ⧵ 푡 푖 푡 ∪푘=푖+1푁푘 is joined in 퐺[∪푘=1푁푘 ⧵ ∪푘=푖+1푁푘]. Let 퐹푖,푗 be the set of edges joining 푁푖 ⧵ 푡 푡ℎ 푖−1 푡 푉 ∪푘=푖+1푁푘 to the 푗 component of 퐺[∪푘=1푁푘 ⧵ ∪푘=푖푁푘]. Furthermore, let 퐹푖,푗 = {푓 ∈ 퐻 퐹푖,푗 | 푓 ∩ 퐴푉 ∩ 푁푖 ≠ ∅} and 퐹푖,푗 = {푓 ∈ 퐹푖,푗 | 푓 ∩ 퐴퐻 ∩ 푁푖 ≠ ∅}.

푉 푉 Claim 3.16. For any two edges 푓1, 푓2 ∈ 퐹푖,푗 either 푓1 ∩ 푓2 ≠ ∅ or ∃푓3 ∈ 퐹푖,푗 such that 푓3 퐻 intersects both 푓1 and 푓2. The analogous statement holds for 퐹푖,푗 .

Proof. Suppose 푓1 and 푓2 are disjoint. Since 푀푖 is connected, there is a path in 퐺 whose endpoints are 푓1 ∩ 푁푖 and 푓2 ∩ 푁푖, while its internal points are in 푉 (푀푖); let the shortest 푡ℎ 푖−1 푡 such path be 푄1. There is also a path in the 푗 component of 퐺[∪푘=1푁푘 ⧵ ∪푘=푖푁푘] whose endpoints are 푓1 ⧵ 푁1 and 푓2 ⧵ 푁푖, let the shortest one be 푄2. 푖 푡 Now 푄1, 푓1, 푄2, 푓2 form a cycle in 퐺[∪푘=1푁푘 ⧵∪푘=푖+1푁푘], which is bipartite chordal. Since 푉 (푄2) ∩ 푁푖 = ∅, there cannot be a chord between 푉 (푀푖) ∩ 푉 (푄1) and 푉 (푄2). This implies that |푉 (푄1)| = 3 by its choice, and that either (푓1 ∩ 푁푖) ∪ (푓2 ⧵ 푁푖) or (푓2 ∩ 푁푖) ∪ (푓1 ⧵ 푁푖) is a chord.

푉 푉 퐻 퐻 Claim 3.17. For any two edges 푓 ∈ 퐹푖,푗 and 푓 ∈ 퐹푖,푗 , the two-element set

푉 퐻 (푓 ∩ 푁푖) ∪ (푓 ∩ 푁푖) is an edge of 퐺[푁푖].

Proof. Similar to the proof of Claim 3.16.

푉 푉 Let 푓푖,푗 ∈ 퐹푖,푗 be the element which intersects the maximum number of edges from 퐹푖,푗, and 퐻 퐻 choose 푓푖,푗 ∈ 퐹푖,푗 in the same way. If only one of these exist, let 푤푖,푗 be the existing one, 푉 퐻 otherwise let 푤푖,푗 = (푓푖,푗 ∩ 푁푖) ∪ (푓푖,푗 ∩ 푁푖) (as in Claim 3.17). Let us finally define

푊 = {푤푖,푗 | 푖 = 2, … , 푡 and 푗 = 1, … , 푞푖}. 3.3 Proof of Theorem 3.1′ 57

Claim 3.18. |푊 | = 푡 − 1.

푡 Proof. Observe that for every 푖 = 1, … , 푡, the subgraph 퐺[푁푖 ⧵ ∪푘=푖+1푁푘] is connected, 푡 푡 since 푀푖 ⊆ 푁푖 ⧵ ∪푘=푖+1푁푘 ⊆ 푁푖 = 푁(푀푖). Moreover, 퐺[∪푘=1푁푘] = 퐺 is connected, 푡 therefore 푡 − 1 = ∑푖=2 푞푖 = |푊 |.

By Case 3.3.2, there exists a subset 푍푖 ⊆ 퐸(푀푖), such that for any edge 푒0 ∈ 퐸(퐺[푁푖]) there exists an edge 푒 ∈ 푍 which has 푟-vision of 푒 in 퐺[푁 ], and |푍 | ≤ 4 (|푉 (푀 )| − 1). 1 푖 0 푖 푖 3 푖 푡 Let 푍 = 푊 ∪ (∪푖=1푍푖). An easy calculation gives that

푡 4|푉 (푀 )| − 4 4|푉 (푀)| − 4푡 + 3(푡 − 1) |푍| ≤ (푡 − 1) + 푖 ≤ ≤ ∑ 푖=1 3 3 4(|푀 | + |푀 | − 1) ≤ 퐻 푉 . 3

Take an arbitrary edge 푒0 = {푣0, ℎ0} ∈ 퐸(퐺). We have three cases.

푉 푉 1. If 푒0 ∈ 퐹푖,푗 for some 푖, 푗, then we claim that 푓푖,푗 ∩푒0 ≠ ∅. Suppose not; by Claim 3.16 푉 푉 푉 there exists 푓 ∈ 퐹푖,푗 which intersects both 푒0 and 푓푖,푗. For any edge 푒 ∈ 퐹푖,푗 intersect- 푉 ing 푓푖,푗 it either intersects 푓 too, or there is an edge intersecting both 푒 and 푓. Thus, 푉 푓 intersects at least as many edges as 푓푖,푗, plus it intersects 푒0 too, which contradicts 푉 the choice of 푓푖,푗.

푉 푉 퐻 If 푤푖 = 푓푖,푗, then 푤푖 trivially has 푟-vision of 푒0. If both 푓푖,푗 and 푓푖,푗 exist, we have two cases.

푉 • If 푣0 ∈ 푓푖,푗, then 푣0 ∈ 푤푖 too, so 푤푖 has 푟-vision of 푒0. 푉 퐻 • If ℎ0 ∈ 푓푖,푗, then Claim 3.17 yields that {푣0} ∪ (푓푖,푗 ∩ 푁푖) ∈ 퐸(퐺). Thus, 푉 퐻 {{푣0, ℎ0}, 푓푖,푗, 푤푖, {푣0} ∪ (푓푖,푗 ∩ 푁푖)} is the edge set of a 퐶4 in 퐺, so 푤푖 has 푟-vision of 푒0.

퐻 2. If 푒0 ∈ 퐹푖,푗 for some 푖, 푗, the same argument as above gives that 푤푖,푗 has 푟-vision of 푒0.

3. If neither of the previous two cases holds, then 푒0 ∈ 퐸(퐺[푁푖]) for some 푖, so some

element of 푍푖 has 푟-vision of it.

Thus, 푍 satisfies Theorem 3.1′, and the proof is complete.

Chapter 4

Algorithms and complexity

In this chapter, we develop algorithms based on the main theorems of the previous chapters. Also, the computational complexity of art gallery problems is discussed. It turns out that our algorithms are efficient, although a considerable amount of preparation and review of liter- ature is necessary. Given their efficiency, our algorithms have the potential to be applicable in practice, too. To achieve linear running times, we will rely on Chazelle’s triangulation algorithm. Al- though the algorithm of Kirkpatrick, Klawe, and Tarjan [KKT92] runs only in 푂(푛 log log 푛), it is not nearly as complex, which may be preferable in real world applications. Nonetheless, our algorithms run in linear time, given a triangulated input. As data structures, we represent polygons by the (cyclically) ordered, doubly linked lists of their vertices.

Theorem 4.1 (Chazelle [Cha91]). An 푛-vertex polygon can be triangulated in 푂(푛) time.

A common subroutine in our art gallery algorithms is the construction of 푅-trees (Sec- tion 2.3).

Proposition 4.2 (Győri, Hoffmann, Kriegel, and Shermer [GHKS96, Section 5]). The hor- izontal (vertical) 푅-tree of an orthogonal polygon 푃 can be constructed in linear time.

Proof. Algorithm B.3 produces the 푅-tree. The main part of this, Algorithm B.1, is an adaptation of the (in my opinion incomplete) algorithm of Fournier and Montuno [FM84, Algorithm 4b]. Suppose we are at the beginning of a loop (Step 18 in Algorithm B.2), and let 퐷 be the set of sides of 푃 that are contained in triangles already deleted from 푇 . For each diagonal 푑 drawn by the triangulation, in 푆[푑] we store a 푦-coordinate decreasing list of (the whole of or a segment of) the vertical sides of 푃 in 퐷 seen (via horizontal vision) by 푑. 60 Algorithms and complexity

Almost every step of the algorithm in the main loop (starting at Step 18) can be executed in 푂(1). The following steps require further consideration.

• Step 27 requires 푂(|푆[푠푣]| + |푆[푠푤]|) time. After this step, their elements are dis- carded.

• Steps 29-31 can be computed in 푂(|푅| + |푆[푠푤]|). The elements in 푅 and 푆[푠푤] are discarded.

• A similar result holds for Steps 33-35.

• Lastly, the for-loop starting following Step 37 completes |푆[푠푢]| cycles, after which

the contents of 푆[푠푢] are discarded.

At any point in the algorithm, let 푊 be the set of sides of ∪푇 . Observe, that

푆[푑] ⋃ 푑∈푊 contains every original side of the polygon at most twice. Every element is processed at most once by each of the previous highlighted steps, therefore Algorithm B.1 runs in 푂(푛). The rest of Algorithm B.3 is straightforward. Step 15 runs in 푂(1) as we store the orthogonal polygon pieces in doubly linked lists. Therefore Algorithm B.3 runs in linear time.

4.1 Partitioning orthogonal polygons

Liou, Tan, and Lee [LTL89] proved that an 푛-vertex rectilinear domains can be partitioned into the minimum number of rectangles in 푂(푛) (assuming the preprocessing step uses lin- ear time triangulation Theorem 4.1). An 푂(푛 log 푛) algorithm by Lopez and Mehta [LM96] produces an optimal partition of an 푛-vertex rectilinear domain into at most 6-vertex recti- linear domains. Both algorithms have important applications to computer graphics, image processing, and automated VLSI layout designs. However, beyond these cases, not much is known about the complexity of determining a minimum size partition of a rectilinear domain into at most 2푘-vertex rectilinear domains, when 푘 ≥ 4. Instead of insisting on finding a minimum size partition, we present an efficient algorithm to find a partition whose cardinality is not greater than the extremal optimum. 4.2 Finding guard systems 61

Theorem 4.3. An 푛-vertex orthogonal polygon can be partitioned into at most ⌊ 3푛+4 ⌋ or- 16 thogonal polygons of at most 8 vertices in linear time.

Proof. The proof Theorem 1.6 describes a recursive algorithm. Use Algorithm B.3 to con- struct the horizontal 푅-tree of 푃 , such that the edge list of a vertex is ordered by the 푥 coor- dinates of the corresponding cuts. Furthermore, compute the list of pockets, corridors, and special rectangles of Case 4.1. These structures can be maintained in 푂(1) for the partitions after finding and performing a cut in 푂(1).

The art gallery problem corresponding to partitioning into at most 8-vertex pieces is the MSC problem (see Table 4.1). The NP-hardness of finding a minimum cardinality partition of an orthogonal polygon into at most 8-vertex pieces is an open problem, similarly to the MSC problem discussed in the next section.

4.2 Finding guard systems

Finding a minimum cardinality horizontal mobile 푟-guard system, which is also known as the Minimum cardinality Horizontal Sliding Cameras or MHSC problem (Table 4.1), is known to be polynomial [KM11] in orthogonal polygons without holes. In orthogonal poly- gons with holes, the problem is NP-hard as shown by Biedl, Chan, Lee, Mehrabi, Montec- chiani, and Vosoughpour [BCLMMV16]. In their paper, a polynomial time constant factor approximation algorithm for the MHSC problem is described, too. As explained in Sec- tion 3.2, the MHSC problem translates to the Total Dominating Set problem (Table 4.2) in the pixelation graph (Section 3.2), which can be solved in polynomial time for chordal bipartite graphs [DMK90]. Finding a minimum cardinality mixed vertical and horizontal mobile 푟-guard system (also known as the Minimum cardinality Sliding Cameras or MSC problem) has been shown by Durocher and Mehrabi [DM13] to be NP-hard for orthogonal polygons with holes. For orthogonal polygons without holes, the problem translates to the Dominating Set problem in the pixelation graph. This reduction in itself has little use, as Müller and Brandstädt [MB87] have shown that Dominating Set is NP-complete even in chordal bipartite graphs. To our knowledge, the complexity of MSC is still an open question. There is, however, a polynomial time 3-approximation algorithm by Katz and Morgenstern [KM11] for the MSC problem for orthogonal polygons without holes. In case holes are allowed, [BCLMMV16] give a polynomial time constant factor approximation algorithm. 62 Algorithms and complexity

Minimum cardinality Sliding Cameras problem (MSC)

Input An orthogonal polygon 푃

A set 푀 of vertical and horizontal mobile 푟-guards Feasible solution covering the domain enclosed by 푃

Objective Minimize |푀|

Decision version Given (푃 , 푘), decide whether min |푀| ≤ 푘.

Minimum cardinality Horizontal Sliding Cameras problem (MHSC)

Input An orthogonal polygon 푃

A set 푀 of horizontal mobile 푟-guards Feasible solution 퐻 covering the domain enclosed by 푃

Objective Minimize |푀퐻 |

Decision version Given (푃 , 푘), decide whether min |푀퐻 | ≤ 푘.

Table 4.1 Definitions of the sliding camera problems (MHSC and MSC)

The algorithm for the MHSC problem in [KM11] relies on a polynomial algorithm solving the Clique Cover problem in chordal graphs. Our analysis of the 푅-tree structures and the pixelation graph allows us to reduce the polynomial running time to linear.

Theorem 4.4 (Győri and Mezei [GM17]). Algorithm B.4 finds a solution to the MHSC prob- lem in linear time.

Proof. By Proposition 4.2, both the horizontal 푅-tree 푇퐻 and the vertical 푅-tree 푇푉 of 퐷 can be constructed in linear time. The main idea of the algorithm is to only sparsely construct the pixelation graph 퐺 of 퐷.

Observe, that the neighborhood of a vertical slice in 퐺 is a path in 푇퐻 , and vice versa. Label each horizontal edge of 퐷 by the horizontal slice that contains it. Furthermore, label each vertical edge of each horizontal slice by the edge of 퐷 containing it; do this for the horizontal edges of vertical slices as well. This step also takes linear time. The endpoints 4.2 Finding guard systems 63

Dominating Set problem

Input A simple graph 퐺

A set 푆 ⊆ 푉 (퐺) which satisfies Feasible solution ∀푣 ∈ 푉 (퐺) ⧵ 푆 ∃푢 ∈ 푆 such that {푢, 푣} ∈ 퐸(퐺)

Objective Minimize |푆|

Decision version Given (퐺, 푘), decide whether min |푆| ≤ 푘.

Total Dominating Set problem

Input A simple graph 퐺

A set 푆 ⊆ 푉 (퐺) which satisfies Feasible solution ∀푣 ∈ 푉 (퐺) ∃푢 ∈ 푆 such that {푢, 푣} ∈ 퐸(퐺)

Objective Minimize |푆|

Decision version Given (퐺, 푘), decide whether min |푆| ≤ 푘.

Table 4.2 Definitions of the Total Dominating Set and Dominating Set problem of a path induced by the neighborhood of any node in 퐺 can be identified via these labels in 푂(1) time.

In Section 3.2, we showed that a horizontal guard system is a subset of 푉 (푇퐻 ) which in- tersects (covers) each element of ℱ퐻 = {푁퐺(푣) | 푣 ∈ 푉 (푇푉 )}. Dirac’s theorem [Fra13, p. 10] states that 휈, the maximum number of disjoint subtrees of the family, is equal to 휏, the minimum number of nodes covering each subtree of the family. Obviously, 휈 ≤ 휏. The other direction is proved using a greedy algorithm:

1. Choose an arbitrary node 푟 of 푇퐻 to serve as its root. The distance of a verti- cal slice 푣 ∈ 푉 (푇 ) from 푟 is dist (푣) = min dist(ℎ, 푟), and let ℎ (푣) = 푉 푟 ℎ∈푁퐺(푣) 푟 arg min dist(ℎ, 푟). ℎ∈푁퐺(푣) 64 Algorithms and complexity

2. Enumerate the elements of 푉 (푇푉 ) in decreasing order of their distance from 푟, let 푣 , 푣 , … , 푣 be such an indexing. Let 푆 = ∅. 1 2 |푉 (푇푉 )| 0

3. If 푁퐺(푣푖) is disjoint from the elements of {푁퐺(푣) | 푣 ∈ 푆푖−1}, let 푆푖 = 푆푖−1 ∪ {푣푖};

otherwise let 푆푖 = 푆푖−1.

We claim that {ℎ (푣) | 푣 ∈ 푆 } is a cover of ℱ . Suppose there exists 푣 ∈ 푉 (푇 ) 푟 |푉 (푇푉 )| 퐻 푗 푉 such that 푁퐺(푣푗) is not covered. Let 푖 be the smallest index such that 푣푖 ∈ 푆푖 and 푁퐺(푣푗) ∩

푁퐺(푣푖) ≠ ∅. Clearly, 푖 < 푗, therefore dist푟(푣푖) ≥ dist푟(푣푗). However, this means that

ℎ푟(푣푖) ∈ 푁퐺(푣푗). Now {ℎ (푣) | 푣 ∈ 푆 } is a cover of the same cardinality as the disjoint set system 푟 |푉 (푇푉 )| {푁 (푣) | 푣 ∈ 푆 }, proving that 휈 = 휏. 퐺 |푉 (푇푉 )|

Each neighborhood 푁퐺(푣) for 푣 ∈ 푉 (푇푉 ) induces a path in 푇퐻 . Therefore, the first part of the algorithm, including calculating dist푟(푣) and ℎ푟(푣) for each 푣, can be performed in 푂(푛) time, using the off-line lowest common ancestors algorithm of Gabow and Tarjan [GT85]. Calculating the distance decreasing order takes linear time via breadth-first search started from the root. In the 푖th step of the third part of the algorithm, we maintain for each node in 푉 (푇퐻 ) whether it is under an element of {ℎ푟(푣) | 푣 ∈ 푆푖}. Summed up for the |푉 (푇퐻 )| steps, this takes only linear time. 푁퐺(푣푖+1) is disjoint from the elements of {푁퐺(푣) | 푣 ∈ 푆푖} if and only if one of the ends of the path induced by 푁퐺(푣푖+1) is under one of the elements of {ℎ푟(푣) | 푣 ∈ 푆푖}, which now can be checked in constant time. Thus, the algorithm takes in total some constant factor times the size of the input time to run.

The computational complexity of the Point guard problem (see Table 4.3) in orthogonal polygons with or without holes has attracted significant interest since the inception of the problem. Schuchardt and Hecker [SH95] showed that even for orthogonal polygons (with- out holes), Point guard is NP-hard. However, a minimum cardinality Point 푟-guard sys- tem of an orthogonal polygon can be computed in 푂(푛̃ 17) time [WK07]. To our knowledge, the exponent of the running time is still in the double digits, which makes its use imprac- tical. Therefore, approximate solutions to the problem are still relevant. A linear-time 3- approximation algorithm is described in [LWŻ12].

Corollary 4.5. An 8 -approximation of the minimum size of a point guard system of an or- 3 thogonal polygon can be computed in linear time. 4.2 Finding guard systems 65

Point guard problem

Input An orthogonal polygon 푃 (which bounds the domain 퐷)

A subset of points 푋 ⊂ 퐷 satisfying Feasible solution ∀푦 ∈ 퐷 there exists 푥 ∈ 푋 such that 푥푦 ⊂ 퐷.

Objective Minimize |푋|

Decision version Given (푃 , 푘), decide whether min |푋| ≤ 푘.

Point 푟-guard problem

Input An orthogonal polygon 푃 (which bounds the domain 퐷)

A subset of points 푋 ⊂ 퐷 satisfying Feasible solution ∀푦 ∈ 퐷 there exists 푥 ∈ 푋 such that 푥 has 푟-vision of 푦 in 퐷.

Objective Minimize |푋|

Decision version Given (푃 , 푘), decide whether min |푋| ≤ 푘.

Table 4.3 Definitions of the Point (푟-)guard problem

Proof. Compute 푚푉 and 푚퐻 using the previous algorithm. By Theorem 3.1 and the trivial statement that both 푚 ≤ 푝 and 푚 ≤ 푝, we get that 4 ⋅ (푚 + 푚 ) is an 8 -approximation 퐻 푉 3 퐻 푉 3 for 푝.

Unfortunately, we can only compute the corresponding solution (guard system) in 푂(푛2), because the pixelation graph may have Ω(푛2) edges. I consider it an interesting open problem to reduce this running time to linear as well, so that it matches the algorithm of [LWŻ12].

Part II

Terminal-pairability (edge-disjoint path problem)

Chapter 5

The terminal-pairability problem

5.1 Problem statement and origins

We discuss the graph theoretic concept of terminal-pairability emerging from a practical networking problem introduced by Csaba, Faudree, Gyárfás, Lehel, and Schelp [CFGLS92], further studied by Faudree, Gyárfás, and Lehel [FGL92; Fau92; FGL99] and Kubicka, Ku- bicki, and Lehel [KKL99]. Given a simple undirected graph 퐺 = (푉 (퐺), 퐸(퐺)) and an undirected multigraph 퐷 = (푉 (퐷), 퐸(퐷)) on the same vertex set (푉 (퐷) = 푉 (퐺)), we say that 퐷 can be realized in 퐺 iff there exist edge-disjoint paths 푃1, … , 푃|퐸(퐷)| in 퐺 such that

푃푖 joins that endpoints of 푒푖 ∈ 퐸(퐷) for any 푖 = 1, 2, … , |퐸(퐷)|. We call 퐷 and its edges the demand graph and the demand edges of 퐺, respectively. Given 퐺 and a family ℱ of (demand)graphs defined on 푉 (퐺) we call 퐺 terminal-pairable with respect to ℱ if every demand graph in ℱ can be realized in 퐺. In particular, let |푉 (퐺)| be even and let ℳ consist of all perfect matchings of the complete graph on |푉 (퐺)| vertices; we call 퐺 a path-pairable graph if it is terminal-pairable with respect to ℳ. See Fig. 5.1 for an example of a terminal- and a path-pairability problem and their corresponding solutions. The way the terminal-pairability problem was originally formulated considered an instance of the problem to consist of 퐺 (the graph of the internal vertices) and a prescribed number of pairwise distinct terminal vertices attached to each vertex of 퐺. This graph extended with stars is called terminal-pairable if any matching of the terminal vertices has a realization. In our language, the family of demand graphs is of the form

{퐷 ∶ 푉 (퐷) = 푉 (퐺), ∀푣 ∈ 푉 (퐺) 푑퐷(푣) ≤ 푐(푣)} , 70 The terminal-pairability problem

5 1 1,2,4 2 3 3 5 4 3 1 5 3 3,4 2 2 3 1 1 3 1 1,2,3 2 1 2 2

(a) A terminal-pairability problem and its solution (b) A path-pairability problem and its solution

Fig. 5.1 Examples for terminal-pairability and path-pairability problems. Each vertex is labeled with the demand edges to which it is incident to. where 푐 ∶ 푉 (퐺) → ℕ describes the number of terminals incident to a vertex of 퐺. We call the process of substituting the demand edges by disjoint paths in 퐺 a realization of the demand graph.

Given a simple graph 퐺, one central question in the topic of terminal-pairability is the max- imum value of 푞 for which any demand graph in the set

{퐷 ∶ 푉 (퐷) = 푉 (퐺), ∀푣 ∈ 푉 (퐺) 푑퐷(푣) ≤ 푞} is realizable in 퐺. As at a given vertex 푣 ∈ 푉 (퐺) at most 푑퐺(푣) edge-disjoint paths can start, the minimum degree 훿(퐺) of the base graph provides an obvious upper bound on 푞. Often, a better upper bound on 푞 is obtained by choosing a 푞-regular multigraph 퐷, such that except

푒0 elements, edges of 퐷 can only be resolved into paths of length at least ℓ in 퐺. By the pigeonhole principle, we must have

1 ⋅ 푞 ⋅ |푉 (퐺)| − 푒 ⋅ ℓ ≤ 푒(퐺) − 푒 , (2 0) 0 or equivalently,

푑(퐺) 2푒 (ℓ − 1) 푞 ≤ + 0 . (5.1) ℓ |푉 (퐺)|

An improvement on this method is described by Girão and Mészáros [GiMé17] for 퐺 = 퐾푛. 5.2 Outline of Part II 71

5.2 Outline of Part II

In Chapter 6, the case 퐺 = 퐾푛 is studied in detail, where the best known lower bound on 푞 is determined (Theorem 6.4). Using the techniques of this proof, the exact extremal edge number of a demand graph realizable in 퐾푛 is obtained (Theorem 6.7). On the other end of the spectrum, a relatively sparse graph which is still path-pairable is sought after in Chapter 7. At the end of the chapter, some open problems are discussed. The results of Chapter 6 and 7 are a result of a fruitful collaboration with my supervisor, Ervin Győri, and Gábor Mészáros. Lastly, in Chapter 8, subjects related to terminal-pairability and the problem’s complexity are surveyed.

Chapter 6

Complete base graphs

Csaba, Faudree, Gyárfás, Lehel, and Schelp [CFGLS92] studied the extremal value of the maximum degree of the demand graph for the complete graph 퐾푛 as the base graph and investigated the following question:

Problem 6.1 ([CFGLS92]). What is the highest number 푞 for which any demand graph on

푛 vertices and maximum degree 푞 is realizable in 퐾푛?

One can easily verify that the parameter 푞 cannot exceed 푛 . Indeed, take a demand graph 2 퐷 obtained by replacing every edge in a one-factor on 푛 vertices by 푞 parallel edges. In order to create edge-disjoint paths, most paths need to use at least two edges in 퐾푛, thus inequality (5.1) implies the indicated upper bound. The authors of [CFGLS92] conjectured that if 푛 ≡ 2 (mod 4), then 푞 = 푛 . However, Girão 2 and Mészáros showed, that asymptotically, 푞/푛 is less than 1 . 2 Proposition 6.2 (Girão and Mészáros [GiMé17]). If every 푛-vertex demand graph 퐷 with Δ(퐷) ≤ 푞 is realizable in 퐾 , then 푞 ≤ 13 푛 + 푂(1). 푛 27 Csaba, Faudree, Gyárfás, Lehel, and Shelp showed the following lower bound.

Theorem 6.3 (Csaba, Faudree, Gyárfás, Lehel, and Schelp [CFGLS92]). Any demand graph 푛 퐷 on 푛-vertices with Δ(퐷) ≤ is realizable in 퐾푛. 4+2√3 We improve their result by proving the following theorem:

Theorem 6.4 (Győri, Mezei, and Mészáros [GMM16]). Any demand graph 퐷 on 푛-vertices with Δ(퐷) ≤ 2⌊ 푛 ⌋ − 4 is realizable in 퐾 . 6 푛 74 Complete base graphs

Kubicka, Kubicki, and Lehel [KKL99] investigated terminal-pairability properties of the Cartesian product of complete graphs. In their paper, the following “Clique-Lemma” was proved and frequently used:

Lemma 6.5 (Kubicka, Kubicki, and Lehel [KKL99]). Let 퐷 be an 푛-vertex demand graph, where 푛 ≥ 5. If Δ(퐷) ≤ 푛 − 1 and 푒(퐷) = 푛, then 퐷 is realizable in 퐾푛.

In the same paper, the following related problem was raised about the possible strengthening of Lemma 6.5:

Problem 6.6 ([KKL99]). Let 퐷 be an 푛-vertex demand graph such that Δ(퐷) ≤ 푛−1. What is the largest value of 훼 such that 푒(퐷) ≤ 훼 ⋅ 푛 implies that 퐷 is realizable in 퐾푛?

Obviously, 1 ≤ 훼 due to Lemma 6.5. It is also easy to see that 훼 < 2. Let 퐷 be a demand graph on 푛 ≥ 4 vertices, in which two pairs of vertices, 푢, 푣 and 푥, 푦 are both joined by (푛−2) parallel edges (푑퐷(푤) = 0 for 푤 ∉ {푥, 푦, 푢, 푣}). Observe that to realize the demand graph, any disjoint path system must contain a path from 푥 to 푦 passing through 푢 or 푣. However, there are also 푛 − 2 disjoint paths connecting 푢 and 푣, meaning that 푢 or 푣 is incident to at least 2 + (푛 − 2) = 푛 disjoint edges, which is clearly a contradiction. This implies that the number of edges in 퐷 cannot exceed 2푛 − 5. We show that this bound is sharp by proving the following theorem:

Theorem 6.7 (Győri, Mezei, and Mészáros [GMM16]). Let 퐷 be a demand graph on 푛 vertices with at most 2푛 − 5 edges, such that no vertex is incident to more than 푛 − 1 edges.

Then 퐷 has a realization in 퐾푛.

Before the proofs, we fix further notation and terminology. For convenience, we call a pair of edges joining the same two vertices a 퐶2. For 푘 > 2, 퐶푘 denotes the cycle on 푘 vertices. For a subset 푆 ⊂ 푉 (퐺) of vertices let 푒(푆, 푉 (퐺) − 푆) denote the number of edges with exactly one endpoint in 푆. Let 퐺[푆] denote the subgraph induced in 퐺 by the subset of vertices 푆. We call a pair of vertices joined by 푘 parallel edges a 푘-bundle. For a vertex 푣 we denote the set of neighbors by 푁(푣) and use 훾(푣) = |푁(푣)|. We define the multiplicity 푚(푣) of a vertex 푣 as follows: 푚(푣) = 푑(푣) − 훾(푣). Observe that 푚(푣) is the minimal number of edges incident to 푣 that need to be replaced by longer paths in a realization to guarantee an edge-disjoint path-system for the terminals of 푣. We define an operation that is repeatedly used in our proofs: given an edge 푢푣 ∈ 퐸, we say that we lift 푢푣 to a vertex 푤 when the edge 푢푣 is substituted by 푢푤 and 푤푣 (forming a path of length 2). Note that this operation increases the degree of 푤 by 2, but does not affect the 6.1 Proof of Theorem 6.4 75

푧 푤 푧 푤

푢 푣 푢 푣

(a) Before (b) After

Fig. 6.1 Lifting 2 edges of 푢푣 to 푧 and 푤

푣 푣

푁(푣) 푁(푣)

(a) Before (b) After

Fig. 6.2 Resolving the multiplicities at 푣 degree of any other vertex (including 푢 and 푣). Also, as a by-product of the operation, if 푤 is already joined by an edge to 푢 or 푣, the multiplicity of the appropriate pairs increase by one (see Fig. 6.1). Finally, note that if a graph 퐺 has 푛 vertices and 푑(푣) ≤ 푛 − 1, all multiplicities of 푣 can be easily resolved by subsequent liftings. Indeed, 푣 has 푛 − 1 − 훾(푣) non-neighbors and 푚(푣) = 푑(푣) − 훾(푣) ≤ 푛 − 1 − 훾(푣) multiplicities, thus we can assign every edge of 푣 causing a multiplicity to a non-neighbor to which that particular edge can be lifted without creating new multiplicities at 푣. As a result, 푑(푣) does not change but 훾(푣) becomes equal to 푑(푣). We call this the resolution of the multiplicities of 푣 (see Fig. 6.2).

6.1 Proof of Theorem 6.4

We show that if 퐷 = (푉 , 퐸) is a demand multigraph on 푛 vertices and Δ(퐺) ≤ 2⌊ 푛 ⌋ − 4, 6 then 퐷 can be transformed into a simple graph by replacing parallel edges by paths of 퐷. We prove the statement by induction on 푛. Observe first that the statement is obvious for 푛 < 18. For 18 ≤ 푛 < 24, note that the demand graph 퐷 is the disjoint union of 2-bundles, 76 Complete base graphs circles, paths, and isolated vertices (i.e., a 2-matching). It is easy to realize 2-matchings in

퐾푛; the verification of the statement is left to the reader. From now on assume 푛 ≥ 24. We may assume without loss of generality that 퐷 is an 2⌊ 푛 ⌋ − 4 -regular multigraph; if necessary, additional parallel edges may be added to 퐷. ( 6 ) Should a single vertex 푣 fail to meet the degree requirement, we bump up its degree by further lifting operations as follows: as the deficit 2⌊ 푛 ⌋ − 4 − 푑(푣) must be even, we can lift an ( 6 ) arbitrary edge 푒 ∈ 퐸([푉 (퐷) − 푣]) to 푣. We remind the reader that lifting 푒 to 푣 increases 푑(푣) by two while it does not affect the degree of the rest of the vertices. We will use the well-known 2-Factor-Theorem of Petersen [Pet91]. Be aware that a 2-factor of a multigraph may contain several 퐶2’s (however, this is the only way parallel edges may appear in it).

Theorem 6.8 (Petersen [Pet91]). Let 퐺 be a 2푘-regular multigraph. Then 퐸(퐺) can be decomposed into the union of 푘 edge-disjoint 2-factors.

Some operations, which are performed later in the proof, are featured in the following defi- nition, claim, and lemma.

Definition 6.9 (Lifting coloring). Let 퐹 be a multigraph, and 푐 ∶ 퐸(퐹 ) ∪ 푉 (퐹 ) → {1, 2, 3} be a coloring of the edges and vertices of 퐹 . We call 푐 a lifting coloring of 퐹 if and only if

1. for any edge 푒 = 푢푣 ∈ 퐸(퐹 ), 푐(푢) ≠ 푐(푒) and 푐(푣) ≠ 푐(푒), and

2. for any two edges 푒1, 푒2 ∈ 퐸(퐹 ) incident to a common vertex we have 푐(푒1) ≠ 푐(푒2).

Moreover, if the number of vertices in different color classes differ by either 0, 1, or 2, then we call 푐 a balanced lifting coloring of 퐹 .

Claim 6.10. Let 퐹 be a multigraph such that ∀푣 ∈ 푉 (퐹 ) we have 푑퐹 (푣) ≤ 2. If

푤1, 푤2, 푤3 ∈ 푉 (퐹 ) are three pairwise non-adjacent different vertices, then 퐹 has a bal- anced lifting coloring where 푤푖 gets color 푖.

Proof. The proof is easy but its complete presentation requires a rather lengthy (but straight- forward) casework. We leave the verification of the statement to the reader. Fig. 6.3 shows an example output of this lemma.

Lemma 6.11. Let 퐷 be a demand graph on 푛 vertices, such that Δ(퐷) ≤ ⌊ 푛 ⌋ − 4. Further- 3 more, let 푋 = {푥1, 푥2, 푥3} be a subset of 푉 (퐷) of cardinality 3, such that |퐸(퐷[푋])| = 0. Let 퐵 be an at most 3-element subset of 푉 (퐷) ⧵ 푋. Let 퐹 be a 2-matching of 퐷, i.e., there 6.1 Proof of Theorem 6.4 77

푥1 푥2 푥3

Fig. 6.3 A balanced lifting coloring, where 푥1, 푥2, 푥3 get pairwise different colors.

are at most 2 edges of 퐹 incident to any vertex of 퐷. Moreover, either 푑퐹 (푥푖) = 2 or 푑 (푥 ) ≤ ⌊ 푛 ⌋ − 5 for 푖 = 1, 2, 3. Then there exists a demand graph 퐻 which satisfies 퐷 푖 3

• 푉 (퐻) = 푉 (퐷) ⧵ 푋,

• 퐸(퐻) ⊃ 퐸(퐷[푉 (퐻)]) ⧵ 퐹 ,

• {푒 ∈ 퐸(퐻) ∶ 푒 is incident to at least one of 퐵} ⊂ 퐸(퐷), and

• for any 푣 ∈ 푉 (퐻) we have 푑퐻 (푣) ≤ 푑퐷(푣) − 푑퐹 (푣) + ퟙ(푣 ∉ 퐵).

Moreover, if 퐻 has a realization in 퐾푛−3, then 퐷 is realizable in 퐾푛.

Proof. We will perform a series of liftings in 퐷 in two phases, obtaining 퐷′ and 퐷″. At the end of the second phase, we will achieve that there are no incident parallel edges to 푋 in 퐷″. Therefore, setting 퐻 = 퐷″ − 푋 will satisfy the second claim of the lemma. First, we determine the series of liftings to be executed in the first phase. Notice that

Claim 6.10 implies the existence of a balanced lifting coloring 푐 of 퐹 such that 푐(푥푖) ≡ 푖 + 1

(mod 3). Lift each edge 푓 ∈ 퐹 to 푥푐(푓), except if 푓 is incident to 푥푐(푓), then leave 푓 where it is. Let 퐹 ′ be the set of lifted edges, that is

퐹 ′ = the two edges joining 푥 to the two vertices of 푓 , ⨄ { 푐(푓) } 푓∈퐹 , 푥푐(푓)∉푓 where ⨄ denotes the disjoint union. Let the multigraph 퐷′ be defined on the same vertex set as 퐷, and let its edge set be

퐸(퐷′) = {푒 ∈ 퐸(퐷) ∶ 푒 ∉ 퐹 or 푥 ∈ 푒} 퐹 ′. 푐(푒) ⨄ 78 Complete base graphs

In other words, 퐷′ is the demand graph into which 퐷 is transformed by lifting the elements of 퐹 . Let 푌 = 푉 (퐷) ⧵ 푋. Observe that 푑퐷′ (푦) = 푑퐷(푦) for 푦 ∈ 푌 . Let

푌푖 = {푦 ∈ 푌 ⧵ 퐵 | 푐(푦) = 푖} be the color 푖 vertices in 푌 ⧵ 퐵. The balancedness of 푐 guarantees that

푛 |푌 | = |푐−1(푖) ⧵ 푋 ⧵ 퐵| ≥ |푐−1(푖)| − 1 − |퐵| ≥ − 5. 푖 ⌊3⌋

′ In the second phase, our task is to resolve all multiplicities of 푥푖 in 퐷 . Observe that as edges of 퐹 of the same color formed a matching, out of every two parallel edges that are ′ ′ ′ incident to 푥푖 in 퐷 , at least one is an initial edge in 퐸(퐷 ) ⧵ 퐹 . The vertex 푥푖 is incident ′ ′ to 푑퐷′ (푥푖) − 푑퐹 ′ (푥푖) edges of 퐸(퐷 ) ⧵ 퐹 ; we plan to lift these edges to elements of 푌푖 by using every vertex in 푌푖 for lifting at most once. If 푑퐹 (푥푖) = 2, then one of the two edges of ′ 퐹 incident to 푥 has color 푖 − 1, and this edge is lifted to 푥푖−1 in 퐷 . Thus

푑퐷(푥푖) − 1, if 푑퐹 (푥푖) = 2; 푑 ′ (푥 ) − 푑 ′ (푥 ) ≤ ≤ |푌 |. 퐷 푖 퐹 푖 { 푛 − 5, if 푑 (푥 ) < 2; } 푖 ⌊ 3 ⌋ 퐹 푖

−1 As elements of 푐 (푖) are not incident to edges of color 푖, the set 푌푖 ⧵ 퐵 offers enough space to carry out the liftings. That being said, note that neighbors of 푥푖 in 푌푖 cannot be used for lifting as they would create additional multiplicities. On the other hand, if 푣 ∈ 푌푖 and

푒 = 푣푥푖 ∈ 퐸(퐷), then 푒 is an initial edge of 푥푖 that either generates no multiplicity at all or is part of a bundle of parallel edges, one of which we do not lift. In other words, for every vertex of 푌푖 that is excluded from the lifting we mark an initial edge of 푥푖 that we do not need to lift. Because of this, resolution of the remaining multiplicities at 푥푖 can be performed in ″ 푌푖 − 푁(푥푖). Let 퐷 denote the demand graph obtained after resolving every multiplicity of

푥1, 푥2, and 푥3. At most 1 element of 퐸(퐷′) ⧵ 퐸(퐹 ′) has been lifted to each 푦 ∈ 푌 , therefore there are no multiple edges between the sets 푋 and 푌 in the demand graph 퐷″. Moreover, 퐷″[푋] = 퐷′[푋] is a subgraph of a triangle, which emerges as we lift the at most one edge of color

푖 + 2 of 푥푖 to 푥푖+1 (take the indices cyclically), for 푖 = 1, 2, 3. Any vertex 푦 ∈ 푌 of color 푖 has at most two incident edges in 퐹 ′, joining 푦 to a subset of

{푥푖+1, 푥푖+2}. 6.1 Proof of Theorem 6.4 79

• If an edge has been lifted to 푦 ∈ 푌 of color 푖, then 푦 is adjacent to 푥푖 and 푑퐷″ (푦) = ″ 푑퐷′ (푦) + 2. Thus, 푦 is joined to at least 푑퐹 ′ (푦) + 1 elements of 푋 in 퐷 . As no edge

of color 푖 can be incident to 푦, we have 푑퐹 ′ (푦) = 푑퐹 (푦). Therefore

푑퐷″[푌 ](푦) ≤ 푑퐷″ (푦) − 푑퐹 ′ (푦) − 1 = 푑퐷′ (푦) − 푑퐹 (푦) + 1 = 푑퐷(푦) − 푑퐹 (푦) + 1.

• If no edges have been lifted to 푦 ∈ 푌 , then 푑퐷″ (푦) = 푑퐷′ (푦) and 푦 is adjacent to at ″ least 푑퐹 (푦) elements of 푋 in 퐷 . Therefore

푑퐷″[푌 ](푦) = 푑퐷″ (푦) − 푑퐹 (푦) ≤ 푑퐷′ (푦) − 푑퐹 (푦) = 푑퐷(푦) − 푑퐹 (푦).

As elements of 퐵 are excluded from 푌푖, 0 edges are lifted to them, and so we proved the statement of the lemma.

Let 푋1 = {푥1, 푥2, 푥3} be a subset of 3 elements of 푉 (퐷), such that 퐷[푋1] has 0 edges. Such a set trivially exists, as any two non-adjacent vertices have (푛 − 2) − 2Δ(퐷) ≥ 푛 + 2 common 3 non-neighbors. Since the degree in 퐷 is at least 2 ⋅ (24/6) − 4 = 4, Theorem 6.8 implies the existence of two disjoint 2-factors, 퐴1 and 퐴2 of 퐷. Notice that 퐴2 − 푋1 has 3 path components (as a special case, an isolated vertex is a path on one vertex). Extend 퐴2 − 푋1 to a maximal 2-matching 퐹2 of 퐷 − 푋1 − 퐴1. It is easy to see that there exists a 3-element subset 퐵1 of 푉 (퐷) ⧵ 푋1 such that

• 퐵1 induces 0 edges in 퐷 − 퐴1,

• {푣 ∈ 푉 (퐷) ⧵ 푋 ∶ 푑 (푣) = 0} ⊂ 퐵 , and 1 퐹2 1 • 퐵 = {푣 ∈ 푉 (퐷) ⧵ 푋 ∶ 푑 (푣) = 1} ⧵ 퐵 has cardinality at most 3. 2 1 퐹2 1

We are ready to use Lemma 6.11. First, apply it to 퐷, where we lift 퐹 = 퐴1 to elements of

푋 = 푋1, while not creating new edges incident to 퐵 = 퐵1. Let the obtained graph be 퐻1. We have Δ(퐻1) ≤ Δ(퐷) − 훿(퐴1) + 1 = Δ(퐷) − 1. Furthermore, 퐸(퐻1[퐵1]) ⊆ 퐸(퐷[퐵1]) = ∅, and for all 푣 ∈ 퐵 we have 푑 (푣) ≤ Δ(퐷) − 훿(퐴 ) ≤ Δ(퐷) − 2. 1 퐻1 1

We apply Lemma 6.11 once again. Now 퐻1 is our base demand graph, 퐹2 is the 2-matching to be lifted to elements of 퐵1, and we avoid lifting to elements of 퐵2. Let the resulting 80 Complete base graphs

demand graph be 퐻2, whose vertex set is 푉 (퐷) ⧵ 푋1 ⧵ 퐵1 of cardinality 푛 − 6. We have

푑 (푣) − 푑 (푣) + 1 if 푣 ∉ 퐵 , 푑 (푣) ≤ 퐻1 퐹2 2 ≤ 퐻2 { 푑 (푣) − 푑 (푣) if 푣 ∈ 퐵 . } 퐻1 퐹2 2

(Δ(퐷) − 1) − 2 + 1 if 푣 ∉ 퐵2, 푛 − 6 ≤ ≤ Δ(퐷) − 2 = 2 ⌊ ⌋ − 4. { (Δ(퐷) − 1) − 1 if 푣 ∈ 퐵2. } 6

By induction on 푛, we know that 퐻2 is realizable in 퐾푛−6, implying that 퐻1 is realizable in

퐾푛−3, which in turn implies that 퐷 has a realization in 퐾푛.

6.2 Proof of Theorem 6.7

We prove our statement by induction on 푛. For 푛 ≤ 4 the statement is straightforward, the cases 푛 = 5, 6 require a somewhat cumbersome casework. Note that if 푛 ≥ 4, we may assume that 퐷 has exactly 2푛 − 5 edges, otherwise we join two non-neighbors whose degree is smaller than 푛 − 1. For the inductive step, we choose a vertex 푥, resolve each of its multiplicities, and delete it from the demand graph. There are two additional conditions to assert as the number of vertices decreases from 푛 to 푛 − 1:

i) The number of edges of 퐷 must decrease by at least two.

ii) Every vertex of degree 푛−1 must lose at least one edge. Decreasing the degree 푑(푣) of a vertex 푣 can be achieved by lifting an edge incident to 푣 to 푥. Note that this operation might create additional multiplicities that need to be resolved before the deletion of 푥.

In addition, observe that we can lift at least one edge to a vertex 푣 without its degree exceed- ing the degree bound for 푛′ = 푛 − 1 if and only if 푑(푣) < 푛 − 2. Let

퐵 = {푧1, … , 푧|퐵|} = {푣 ∈ 푉 (퐷) ∶ 푑(푣) ≥ 푛 − 2}.

As ∑ 푑(푣) = 4푛 − 10, it follows that |퐵| ≤ 3. We perform a casework on |퐵|. 푣∈푉 (퐷)

|퐵| = 0 ∶ If 퐵 is empty, then the only condition we need to guarantee is the deletion of at least two edges in 퐷. We have two cases. 6.2 Proof of Theorem 6.7 81

• If ∀푥 ∈ 푉 (퐷) we have 훾(푥) ≤ 1, then 퐷 is the disjoint union of bundles and isolated vertices. Let {푥, 푦} be the edge with the highest multiplicity. If 푑(푥) = 푑(푦) ≤ 푛 − 2, and every other degree is at most 푛 − 4, then lift copies of {푥, 푦} to the other 푛 − 2 vertices and delete both 푥 and 푦; we can use induction on the remaining graph. If 퐷 is composed of an 푛 − 2 and an 푛 − 3 bundle, it is easy to

find a realization of 퐷 in 퐾푛 directly. • If there is an 푥 ∈ 푉 (퐷) with 훾(푥) ≥ 2: we have 푛 − 1 − 훾(푥) vertices as a lifting target to resolve the 푑(푥) − 훾(푥) multiplicities of 푥. Obviously, 푑(푥) − 훾(푥) ≤ 푛 − 3 − 훾(푥), thus we have enough space to resolve all multiplicities of 푥. After the deletion of 푥, the graph has 훾(푥) ≥ 2 fewer edges, and the maximum degree is still two less than the number of vertices.

|퐵| = 1 ∶ We perform the same operation as in the previous case with the choice 푥 = 푧1.

Observe that our inequality becomes 푑(푧1) − 훾(푧1) ≤ 푛 − 1 − 훾(푧1), thus we have enough vertices in the multigraph to perform all the necessary liftings.

|퐵| = 2 ∶ Observe first that 푧1 and 푧2 are joined by an edge 푒 or else

2푛 − 5 ≥ 푒(퐵, 푉 (퐷) − 퐵) = 푑(푧1) + 푑(푧2) ≥ 2푛 − 4,

a contradiction. Let us first assume that 푧1 or 푧2 (say, 푧1) has more than one neighbor (i.e., 푒(퐵, 푉 (퐷) − 퐵) > 0). Observe that in this case

푚(푧1) = 푑(푧1) − 훾(푧1) ≤ (푛 − 1) − 훾(푧1),

thus, each multiplicity of 푧1 can be resolved by lifting the appropriate edges to 푉 (퐷)−

{푧1} − 푁(푧1).

In the remaining case 푧1 and 푧2 form a bundle of at most 푛−1 edges. We can lift 푛−2 of these edges to 푉 (퐷) − 퐵 without difficulties, delete one of the vertices in 퐵, and proceed by induction.

|퐵| = 3: Observe that any two vertices of {푧1, 푧2, 푧3} must be joined by an edge, else the same reasoning as above leads to a contradiction. Note also, that a simple average degree calculation guarantees the existence of an isolated vertex 푥. We distinguish two cases: 82 Complete base graphs

(a) Demand graph (b) A solution

Fig. 6.4 A demand graph and a possible realization in 퐾6

i) If 푒(퐵, 푉 (퐷)−퐵) = 0, we may assume that 푉 (퐷)−퐵 induces an edge, otherwise 3(푛−3) ≥ 4푛−10 ⇒ 푛 ≤ 7 and all edges are contained in 퐵. For 푛 = 5, 6, 7, that leads to 4 possible demand graphs whose realization can easily be completed; a case for 푛 = 6 is shown in Fig. 6.4. Let 푓 denote an arbitrary edge in 푉 (퐷) − 퐵. We lift two non-parallel edges of 퐵 as well as 푓 to 푥; observe that the degrees of all vertices in 퐵 dropped by at least 1. As 푛 ≥ 7, the multiple edge created at vertex 푥 can be lifted to a vertex of 푉 (퐷) − 퐵 that was not incident to 푓. ii) If 푒(퐵, 푉 (퐷) − 퐵) > 0, let 푓 be an edge between 퐵 and 푉 (퐷) − 퐵. Without loss

of generality, we may assume 푓 is incident to 푧3. We lift 푓 as well as an edge 푒

between 푧1 and 푧2 to 푥; as 푒 and 푓 are disjoint, no new multiplicity is created, thus we can delete 푥 and proceed by induction. Chapter 7

Complete grid base graphs

7.1 Introduction

A long-standing open question concerning path-pairability of graphs is the minimal possible value of the maximum degree Δ(퐺) of a path-pairable graph 퐺. Faudree, Gyárfás, and Lehel [FGL99] proved that the maximum degree must grow together with the number of vertices in path-pairable graphs. They in fact showed that a path-pairable simple graph with maximum degree Δ has at most 2ΔΔ vertices. The result yields that for a path-pairable simple graph 퐺 on 푛 vertices we have log 푛 푐 ⋅ ≤ Δ(퐺). log log 푛 This bound is conjectured to be asymptotically sharp, although to date only constructions of much higher order of magnitude have been found. Until recently, the best-known construc- tion was due to Kubicka, Kubicki, and Lehel [KKL99] who showed that two dimensional complete grids on an even number of vertices (of at least 6) are path-pairable. □ A two-dimensional complete grid is the Cartesian product 퐾푠 퐾푡 of two complete graphs

퐾푠 and 퐾푡 and it can be constructed by taking the Cartesian product of the sets {1, 2, … 푠} and {1, 2, … 푡} and joining two distinct vertices if they share a coordinate. Higher dimen- sional complete grids can be defined similarly: let 푑, 푡1, … , 푡푑 be positive integers and let 푉 denote the set of 푑-dimensional vectors of positive integer coordinates not exceeding 푡푖 in the 푖th coordinate, that is,

푉 = {(푎 , … , 푎 ) ∶ 1 ≤ 푎 ≤ 푡 , 푖 = 1, 2, … , 푑}. (푡1,…,푡푑) 1 푑 푖 푖 84 Complete grid base graphs

The 푑-dimensional grid graph 퐾 is constructed by taking 푉 as its vertex set, (푡1,…,푡푑) (푡1,…,푡푑) and two vertices are joined by an edge if the corresponding vectors differ at exactly one coordinate. Note that this graph is isomorphic to the Cartesian product 퐾 □퐾 □ … □퐾 . 푡1 푡2 푡푑 For 푡1 = 푡2 = ⋯ = 푡푑 = 푡 we use the notation

푑 푑 ⏞⏞⏞⏞⏞⏞⏞⏞⏞□ □ 퐾푡 = 퐾푡 … 퐾푡 .

For a more detailed introduction to the Cartesian product of graphs the reader is referred to [IK00]. With 푠 = 푡 the construction of Kubicka, Kubicki, and Lehel gives examples of path-pairable graphs on 푛 = 푠⋅푡 vertices with maximum degree 2⋅√푛. This bound was recently improved □ □ to √푛 by Mészáros [Més16]. It was also conjectured in [KKL99] that 퐾푡 퐾푡 퐾푡 is path- pairable for sufficiently large even values of 푡. In this chapter, we significantly improve the upper bound on the minimal value of the max- imum degree of path-pairable graphs: we prove that high dimensional complete grids are path-pairable. We eventually study the more general terminal-pairability variant of the above path-pairability problem and prove the following theorem: 푑 Theorem 7.1 (Győri, Mezei, and Mészáros [GMM17]). Let 퐺 = 퐾푡 and let 퐷 = (푉 (퐷), 퐸(퐷)) be a demand graph with 푉 (퐷) = 푉 (퐾푑) and Δ(퐷) ≤ 2⌊ 푡 ⌋ − 2. Then 푡 12 퐷 can be realized in 퐺. Theorem 7.1 immediately implies the following corollary: 푑 Corollary 7.2. If 푡 ≥ 24, 퐾푡 is path-pairable. The above construction provides examples of path-pairable graphs on 푛 = 푡푑 vertices with maximum degree 푡 − 1 Δ(퐾푑) = (푡 − 1) ⋅ 푑 = log 푛 ⋅ . 푡 log 푡 Observe that 푡 can be chosen to be a constant (푡 = 24) thus we have obtained path-pairable graphs on 푛 vertices with Δ ≈ 7.24 log 푛.

7.2 Proof of Theorem 7.1

푑 For 푖 = 1, … , 푡, let 퐿푖 be the subgraph of 퐾푡 induced by

{(푎1, … , 푎푑−1, 푖) ∶ 1 ≤ 푎푗 ≤ 푡푗, 푗 = 1, 2, … , 푑 − 1} . 7.2 Proof of Theorem 7.1 85

푑 We call 퐿1, … , 퐿푡 the layers of 퐾푡 . Similarly, by fixing the first 푑 − 1 coordinates we get 푑−1 푡 copies of 퐾푡; we denote these complete subgraphs by 푙1, … , 푙푡푑−1 and refer to them as columns.

푑 Given an edge 푢푣 of the demand graph with 푢, 푣 ∈ 퐾푡 we replace 푢푣 by a path of three ′ ′ ′ ′ ′ ′ ′ ′ edges 푢푢 , 푢 푣 , and 푣 푣, where 푢 , 푣 ∈ 퐿푖 for some 푖 ∈ {1, 2, … , 푡} and 푢, 푢 and 푣, 푣 lie in the same columns. Having done that, we consider the new demand edges defined within the 푡 layers and 푡푑−1 columns and break the initial problem into 푡푑−1 + 푡 subproblems that we solve inductively. The upcoming paragraphs discuss the details of the drafted solution. For the discussion of the base case 푑 = 1 as well as for the inductive step we use Theorem 6.4. We mention that instead of using this theorem we could use a weaker version of it with Δ(퐷) ≤ 푡 proved by Csaba, Faudree, Gyárfás, Lehel, and Schelp [CFGLS92]. With 4+2√3 every further step of our proof unchanged, a result corresponding to the weaker theorem can be proved with a smaller bound on Δ(퐷). Let 푞 be an even number with 2 ≤ 푞 ≤ ⌊ 푡 ⌋ − 1 and let 퐷 = (푉 (퐷), 퐸(퐷)) be a de- 6 푑 ′ mand multigraph with 푉 (퐷) = 퐾푡 and Δ(퐷) ≤ 푞. Let 퐸 (퐷) denote the set of demand edges whose vertices lie in different 푙푖, 푙푗 columns. We construct an auxiliary graph 퐻 with 푑−1 ′ 푉 (퐻) = 푉 (퐾푡 ) and project every edge of 퐸 (퐷) into 퐻 by deleting the last coordinates of the vertices. It is easy to see that Δ(퐻) ≤ 푡 ⋅ 푞. We may assume without loss of generality that 퐷 is (푡 ⋅ 푞)-regular by joining additional pairs of vertices or replacing edges by paths of length two if necessary. Again, we use the 2-factor decomposition theorem of Petersen (Theorem 6.8) to distribute the original demand edges among the layers 퐿1, … , 퐿푡 and define new subproblems on them. Obviously, the graph 퐻 satisfies the conditions of Theorem 6.8, thus 퐸(퐻) can be partitioned into 푞 ⋅ 푡 edge-disjoint 2-factors. By arbitrarily grouping the above 2-factors into 푞 -tuples, 2 2 we can partition 퐸(퐻) into 푡 edge-disjoint subgraphs 퐻1, … , 퐻푡 with Δ(퐻푖) ≤ 푞. Assume now that the vertices 푢 = (푎, 푖) and 푣 = (푏, 푗) (푎, 푏 ∈ [푡]푑−1) are joined by a demand ′ edge belonging to 퐸 (퐷) (thus 푎 ≠ 푏) and the corresponding edge in 퐻 is contained by 퐻푘. We then replace the demand edge 푢푣 by the following triple of newly established demand edges: {(푎, 푖), (푎, 푘)} , {(푎, 푘), (푏, 푘)} , {(푏, 푘), (푏, 푗)} . We claim the following:

(i) For every layer 퐿푗 the condition Δ(퐿푗) ≤ 푞 holds. 86 Complete grid base graphs

(ii) For every column 푙푗 the condition Δ(푙푗) ≤ 2푞 holds.

The first statement obviously follows from the partition of 퐸′(퐷). For the second one, ob- serve that a vertex 푣 in 푙푗 is initially incident to 푞 demand edges and at most 푞 additional demand edges are joined to it (otherwise (i) is violated). Notice now that every layer 퐿푗 contains a (푑 − 1)-dimensional subproblem that can be solved (within the layer) by the in- ductive hypothesis. Also, every column 푙푗 contains a subproblem (note that the original demand edges in 퐸(퐷)\퐸′(퐷) are incorporated into these subproblems) that can be solved by Theorem 6.4. This completes our proof.

7.3 Remarks

푑 By using Theorem 6.4 and the described inductive approach we proved that 퐾푡 is path- pairable for 푡 ≥ 24, 푑 ∈ ℤ+. Even if the bound in Theorem 6.4 is improved to the point of being sharp, it only improves the constant 5.2 in Theorem 7.1 and decreases the lower bound on 푡 in Corollary 7.2, however, it does not affect the Ω(log 푛) order of magnitude of the maximum degree. Let us measure the sharpness of our theorem. Assume 푑 ≥ 2 and that 푡 is even. Take the 푑 following matching 푀 of the vertices of 푉 (퐾푡 ): pair vertex (푥1, … , 푥푑) with (푡 + 1 − 푥1, 푡 + 푑 1−푥2, … , 푡+1−푥푑). Let 퐷 = (푉 (퐾푡 ), 푞⋅푀), i.e., every edge in 푀 is taken with multiplicity 푞. Since the vertices of each edge are different in each coordinate, inequality (5.1) becomes

1 1 ⋅ 푡푑 ⋅ 푞 ⋅ 푑 ≤ ⋅ 푑 ⋅ (푡 − 1) ⋅ 푡푑, 2 2 implying that 푞 ≤ (푡 − 1). This means that there is at most a factor of (6 + 휀푡) between the extremal bound and the result of Theorem 7.1. We mention that one particularly interesting and promising path-pairable candidate (with the same order of magnitude of vertices but with a better constant for Δ) is the 푑-dimensional 푑 hypercube 푄푑 on 2 vertices (Δ(푄푑) = 푑). Observe that hypercubes are special members 푑 of the above studied complete grid family as 푄푑 = 퐾2 . Although it is known that 푄푑 is not path-pairable for even values of 푑 (see [Fau92]), the question is open for odd dimensional hypercubes for 푑 ≥ 5 (푄1 and 푄3 are both path-pairable).

Conjecture 7.3 ([CFGLS92]). The (2푘 + 1)-dimensional hypercube 푄2푘+1 is path-pairable for all 푘 ∈ ℕ. Chapter 8

Related subjects, algorithms and complexity

8.1 Immersions

Recently, the study of graph immersions has become increasingly popular. As the following definition shows, it is very closely related to the concepts of terminal-pairability. Definition 8.1. Let 퐻 and 퐺 be (multi)graphs. There is an immersion of 퐻 in 퐺 (or 퐻 is immersed in 퐺, or 퐺 contains an immersion of 퐻) iff there is map 휙 ∶ 푉 (퐻) ∪ 퐸(퐻) → 푉 (퐺) ∪ 퐸(퐺) such that • 휙 maps vertices of 퐻 into distinct vertices of 퐺,

• a loop on a vertex 푢 is mapped to a cycle of 퐺 which traverses 휙(푢),

• an edge 푢푣 of 퐻 is mapped to a path connecting 휙(푢) to 휙(푣) in 퐺, and

• for two distinct edges 푒1 and 푒2 in 퐻, their images 휙(푒1) and 휙(푒2) are edge-disjoint.

This relation is denoted as 퐻 ≤i 퐺. If in addition, for any vertex 푣 ∈ 푉 (퐻) and edge 푒 ∈ 퐸(퐻) we have 푣 ∉ 푒 ⟹ 휙(푣) ∉ 푉 (휙(푒)), then 퐻 has a strong immersion in 퐺, denoted 퐻 ≤si 퐺. Remark 8.2. In the study of graph immersions, the lifting operation is defined as the inverse of our lifting operation. In the terminal-pairability problem, the function mapping vertices of 퐻 to vertices of 퐺 is fixed. However, if 퐺 = 퐾푛 and 퐻 is loopless, the notion of realizable and immersible coincide. 88 Related subjects, algorithms and complexity

The transitive property of the immersion relations means that both ≤i and ≤si define partial orders on the set of finite graphs. The following fundamental result about graph immersions was conjectured by Nash-Williams.

∞ Theorem 8.3 (Robertson and Seymour [RS10]). In any infinite sequence of graphs (퐺푖)푖=1, there exists a pair 푖 < 푗 such that 퐺푖 ≤i 퐺푗.

This property of the finite graphs with the order ≤i is called well-partial-ordered. An imme- diate consequence of the theorem is that any subset of graphs that is upward-closed w.r.t. ≤i has finitely many minimal elements. Similarly, any property which is downward-closed on immersion order can be described by finitely many graphs. This is a useful property, since for every fixed graph 퐻 there is a polynomial time algorithm to check whether there exists an immersion of 퐻 in the input graph 퐺, see [FL92]. Abu-Khzam and Langston have explored connections between the immersion order and graph colorings, and made the following conjecture.

Conjecture 8.4 (Abu-Khzam and Langston [AL03]). If 휒(퐺) ≥ 푛, then 퐾푛 ≤i 퐺. This is the immersion analogue of Hajós’s refuted conjecture (where immersion order is replaced with topological minor order), and Hadwiger’s unsolved conjecture (where immer- sion order is replaced with minor order). Observe, that

ℱ푛 = {퐺 finite graph ∶ 휒(퐺) < 푛 and ∀퐻 ≤i 퐺 satisfies 휒(퐻) < 푛} is a downward-closed set w.r.t. ≤i. Thus, its complement is upward-closed, and therefore has finitely many minimal elements; these graphs are called 푛-immersion-critical. It is easy to see that 퐾푛 is 푛-immersion-critical (any graph properly immersed in 퐾푛 has two vertices that are not joined by an edge). If true, Conjecture 8.4 would imply that 퐾푛 is immersed in any graph that is not in ℱ푛, i.e., 퐾푛 is the only 푛-immersion-critical graph. They also proved that

Theorem 8.5 (Abu-Khzam and Langston [AL03]). If 퐺 is 푛-immersion-critical and 퐺 ≇ 퐾푛, then 퐺 is 푛-edge-connected.

A trivial consequence of 푛-edge-connectivity is that 훿(퐺) ≥ 푛. The above ideas motivate the following problem, which is the dual of the terminal-pairability problem in complete graphs (Problem 6.1).

Problem 8.6 (DeVos, Kawarabayashi, Mohar, and Okamura [DKMO10]). Determine the minimum value of 푓(푛) such that any simple graph with minimum degree 푓(푛) contains an immersion of 퐾푛. 8.2 Algorithms and complexity 89

Maximum Edge-Disjoint Paths problem (MaxEDP)

Input Two loopless multigraphs, 퐷 and 퐺, on the same vertex set

Feasible solution A subgraph 퐷∗ ⊆ 퐷 and its realization in 퐺

Objective Maximize 푒(퐷∗)

Decision version Given (퐷, 퐺, 푘), decide whether max 푒(퐷∗) ≥ 푘.

Table 8.1 Definition of the Maximum Edge-Disjoint Paths problem (MaxEDP)

Clearly, 푓(푛) ≥ 푛 − 1. For small values of 푛 ≤ 7, it has been verified in [DKMO10] that 푓(푛) = 푛 − 1. However, a class of counterexamples to this equality have been constructed for 푛 ≥ 8 in [CH14]. The first bound proved on 푓(푛) is the following theorem. Theorem 8.7 (Devos, Dvořák, Fox, McDonald, Mohar, and Scheide [DDFMMS14]). If 퐻 is a simple graph with 훿(퐻) ≥ 200푛, then 퐾푛 ≤si 퐻. Dvořák and Yepremyan [DY15] claim to have improved the lower bound on the minimum degree to 11푛 + 7. Theorem 6.4 has the following alternative statement in the language of immersions. Corollary 8.8. If 퐻 is a loopless multigraph on at most 푛 vertices with Δ(퐻) ≤ 2⌊ 푛 ⌋ − 4, 6 then 퐻 ≤i 퐾푛.

Combining our result with that of Dvořák and Yepremyan [DY15], we get a sufficient condi- tion (with fairly strong asymptotic consequences) on when a loopless multigraph immerses in a simple graph. Theorem 8.9. Let 퐻 be a loopless multigraph, and let 퐺 be a simple graph. If

max {33Δ(퐻) + 172, 11|푉 (퐻)| + 7} ≤ 훿(퐺), then 퐻 ≤i 퐺.

8.2 Algorithms and complexity

The maximum edge-disjoint paths problem (see Table 8.1) is among the early problems shown to be NP-complete by Richard Karp [Kar75], although he referred to it as the “dis- 90 Related subjects, algorithms and complexity joint paths problem”. For a fixed number of paths the problem is solvable in polynomial time (see [RS10]). However, if the number of required paths is part of the input, then the (decision version of the) problem is NP-complete even for series-parallel [NVZ01] and com- plete graphs [EV06]. This has been one of the reasons that forced us to consider an extremal approach to the terminal-pairability problem. Surprisingly, and inadvertently, Theorem 6.4 gives the to date tightest approximation to the maximum edge-disjoint paths problem in complete graphs (see Theorem 8.14). Although these results are by-products of our study, we believe that this efficiency is not a coincidence, even though our approach has been an extremal one from the beginning. We store graphs concurrently as edge lists and adjacency lists; an edge contains pointers to its copies in both lists. For a note on models of computation and graph representations, the reader is advised to consult Appendix A.

8.2.1 Algorithmic versions of Theorem 6.4 and 7.1

We will use the following results to find 2-factors.

Theorem 8.10 (Cole, Ost, and Schirra [COS01, Thm. 2]). Given a regular bipartite multi- graph on 푚 edges, there is a deterministic algorithm that finds a complete matching in 푂(푚).

Theorem 8.11 (Cole, Ost, and Schirra [COS01, Thm. 1]). Given a regular bipartite multi- graph on 푚 edges with maximum degree Δ, there is a deterministic 푂(푚 log Δ) time algorithm that finds a proper edge coloring using Δ colors.

Using randomization, there are even more efficient algorithms to find perfect matchings (see Goel, Kapralov, and Khanna [GKK13]), however, using them would not improve the order of magnitude of the running time of the following theorem.

Theorem 8.12. Given a loopless multigraph 퐷 on 푛 vertices with Δ(퐷) ≤ 2⌊ 푛 ⌋ − 4, there 6 2 is a deterministic 푂(Δ(퐷) 푛) time algorithm which finds a realization of 퐷 in 퐾푛.

Proof. Preprocessing. We label each edge of 퐷 with a unique label. Whenever we lift a labeled edge, the two new edges inherit their ancestors label. Via these labels, we can recover the edge-disjoint paths in the solution.

Let the vertex set of the demand graph be 푉 (퐷) = {푣1, … , 푣푛}. By lifting existing edges or joining non-maximal degree vertices (via an edge with a yet unused label), we can make the input graph 2⌈ Δ(퐷) ⌉-regular in 푂(Δ(퐷)푛) time. 2 8.2 Algorithms and complexity 91

Iterative step (see Theorem 6.4). If 퐷 is 2-regular after preprocessing, a realization can be found in 푂(푛) time. We can find an Eulerian orientation 퐷⃖⃖⃗ in 푂(Δ(퐷)푛) time. Construct a bipartite graph 퐺 by ′ ′ ″ ″ ′ ″ taking two copies, {푣1, … , 푣푛} and {푣1 , … , 푣푛 }, of the vertex set of 퐷, and join 푣푖 to 푣푗 ⃖⃖⃗ iff there is an edge from 푣푖 to 푣푗 in 퐷. Observe, that perfect matchings of 퐺 correspond to 2-factors of 퐷. Via Theorem 8.10, two perfect matchings of 퐺 can be found in 푂(Δ(퐷)푛) time, which cor- respond to two edge-disjoint 2-factors, 퐴1 and 퐴2, of 퐷. A lifting coloring of a 2-matching can be constructed in 푂(푛) time. A run of Lemma 6.11 can be computed in 푂(푛) time, as a lifting operation can be performed in 푂(1). A set 푋1 can be chosen in 푂(푛), and 퐴2 − 푋1 can be extended to a maximal (not maximum!) 2-matching in 푂(푛), as well. Similarly, 퐵1 and 퐵2 can be determined in 푂(푛) time. The edges incident to the 6 vertices removed by two iterations of Lemma 6.11 are saved to a separate solution graph.

By lifting or adding a constant number of edges, we can make the remaining graph 퐻2 regular. Recurse on 퐻2. Running time. The degree of the demand graph decreases by two in every iteration, whose running time is dominated by finding 2-factors. Theoretically, it could be profitable to com- pute a 2-factor decomposition of 퐷 during preprocessing (for example, via Theorem 8.11) and maintain this structure for subsequent iterations. However, it is unclear how an Eulerian orientation could be maintained in 표(Δ(퐷)푛) time, let alone a 2-factor decomposition.

In the following we show using an argument which is similar to Kosowski’s [see Kos08,

Thm. 6], that there is a polynomial time (3 + 휀푛)-approximation scheme for the MaxEDP problem in 퐾푛. We will need the following theorem.

Theorem 8.13 (Gabow [Gab83, Thm. 4.1]). Let 퐻 be a multigraph on the vertex set

{푣1, 푣2, … , 푣푛} with 푚 edges. Let 푢푖 ∈ ℕ. The spanning subgraph of 퐻 with the maxi- mum number of edges in which 푑퐻 (푣푖) ≤ 푢푖 (for all 푖 = 1, … , 푛) can be found in 푂(푚푛 log 푛) time and 푂(푚) space.

We are ready to prove our approximation result of MaxEDP in complete graphs.

3 Theorem 8.14. Let 퐷 be a demand graph on the vertex set of 퐾푛. There is an 푂(푚푛 log 푛+푛 ) time algorithm which gives a (3 + 푂(1/푛))-approximation solution to the MaxEDP problem in 퐾푛. 92 Related subjects, algorithms and complexity

Proof. Let 퐷opt be a subgraph of 퐷 which is realizable in 퐾푛, such that it has the maximum possible number of edges. Obviously, Δ(퐷opt) ≤ 푛 − 1. Run the algorithm of Theorem 8.13 on 퐷 with 푢 = 2⌊ 푛 ⌋ − 4 (for 푖 = 1, … , 푛) to obtain 퐷∗. 푖 6 According to Theorem 6.8, we can partition 퐸(퐷 ) into ⌈ 푛−1 ⌉ edge-disjoint 2-matchings. opt 2 Order the 2-matchings in decreasing order of their cardinality, and choose the first ⌊ 푛 ⌋ − 2. 6 ′ Let the spanning subgraph of 퐷opt formed by the union of the chosen 2-matchings be 퐷 . Since Δ(퐷′) ≤ 2⌊ 푛 ⌋ − 4, we have 푒(퐷′) ≤ 푒(퐷∗). Furthermore, because we take the largest 6 2-matchings,

푛 1 ⌊ ⌋ − 2 1 5 + 푒(퐷∗) ≥ 푒(퐷′) ≥ 6 ⋅ 푒(퐷opt) ≥ − 3 ⋅ 푒(퐷opt). ⌊ 푛 ⌋ (3 푛 − 1 ) 2

∗ 3 By Theorem 8.12, we can compute a realization of 퐷 in 퐾푛 in 푂(푛 ) time.

Theorem 8.12 and Theorem 7.1 have the following consequence.

푑 푑 Corollary 8.15. Let 퐷 be a loopless multigraph as a demand graph in 퐾푡 (which has 푛 = 푡 vertices). If Δ(퐷) ≤ 2⌊ 푡 ⌋ − 2, then there is a deterministic 푂(푑 ⋅ 푛 ⋅ Δ(퐷)2) time algorithm 12 푑 which finds a realization of 퐷 in 퐾푡 .

Proof. Without loss generality, we may make 퐷 regular with an even degree. We can use Theorem 8.11 to find a 2-factor decomposition of 퐷 in 푂(푡푑 ⋅Δ(퐷)⋅log Δ(퐷)). Furthermore, this decomposition can be inherited by the layers 퐿푖, so it does not have to be recomputed Δ(퐷) when the algorithms invokes recursion on the layers. Let 푇푡 (푑) be a bound on the running time of the rest of the algorithm. We have

Δ(퐷) 2 푇푡 (1) = 푂(Δ(퐷) 푡) Δ(퐷) 푑 푑−1 2Δ(퐷) Δ(퐷) 푇푡 (푑) = 푂(Δ(퐷) ⋅ 푡 ) + 푡 ⋅ 푇푡 (1) + 푡 ⋅ 푇푡 (푑 − 1)

Solving the recursion, we get

Δ(퐷) 푑 2 2 푇푡 (푑) = 푂 (푑 ⋅ 푡 ⋅ Δ(퐷) ) = 푂(푑 ⋅ 푛 ⋅ Δ(퐷) ), which clearly dominates the time spent preprocessing the graph. 8.3 Further base graphs 93

8.2.2 Comparing our results to the state of the art

According to a result of Carmi, Erlebach, and Okamoto [CEO03], the solution produced by a shortest-path-first or a bounded-length greedy algorithm is not better than a 3-approximation result for every input graph. Theorem 8.14 almost achieves this bound by producing a (3 +

휀푛)-approximation for any instance. The champion before Theorem 8.14 was the 3.75-approximation algorithm of Kosowski [Kos08]. On demand graphs where 푑(퐷) = 표(Δ(퐷)), our algorithm is up to a factor of 푛 slower than that of Kosowski. However, if Δ(퐷) ≤ (1 + 표(1)) ⋅ 푛, we may replace Theo- rem 8.13 with a 2-matching decomposition to gain a log 푛 on the running time. The solution produced by this modified algorithm is a 3Δ(퐷) + 표(1) -approximation of the optimum. ( 푛 )

8.3 Further base graphs

I am hopeful that our new results demonstrated in this part will increase interest in the terminal-pairability problem. Continuing this line of research, complete bipartite base graphs have been studied by Colucci, Erdős, Győri, and Mezei in two settings: the case when the demand graph is bipartite with respect to the classes of the base graph has been studied in [CEGM17a], and when no structural restrictions (other than maximum degree) are made on the demand graph is explored in [CEGM17b]. A risky and undertaking research direction is to study the terminal-pairability problem very generally, and to try to discover sufficient conditions for a demand graph to be realizable in a base graph, without a priori specifying too much information about any of them. The degree conditions in our theorems are special cut conditions. Can we prove stronger theorems if we consider more than only single vertex cuts? In other words, does interpreting the problem as an integer multi-commodity flow task help?

Problem 8.16. Suppose 퐷 and 퐺 are loopless multigraphs on the vertex set 푉 = {1, … , 푛}. What is the minimum value of 푓(푛) so that

푒 (퐴, 푉 − 푋) 푓(푛) ≤ min 퐺 ⟹ 퐷 is realizable in 퐺? ∅≠퐴⊂푉 푒퐷(퐴, 푉 − 푋)

By choosing 퐺 as a regular expander graph, one can prove that 푓(푛) ≥ Ω(log 푛). If 퐺 is required to be simple, a similar construction implies 푓(푛) ≥ Ω(log 푛/ log log 푛).

References

[Agg84] A. Aggarwal, The art gallery theorem: its variations, applications, and algorithmic aspects, PhD thesis, Johns Hopkins University, 1984. [AL03] Faisal N. Abu-Khzam and Michael A. Langston, and the immersion order, Computing and combinatorics, vol. 2697, Lecture Notes in Comput. Sci. Springer, Berlin, 2003, pp. 394–403, doi: 10.1007/3-540- 45071-8_40, MR2063516. [AZ14] Martin Aigner and Günter M. Ziegler, Proofs from The Book, Fifth Edition, Including illustrations by Karl H. Hofmann, Springer-Verlag, Berlin, 2014, pp. viii+308, isbn: 978-3-662-44205-0, doi: 10.1007/978-3-662-44205-0, MR3288091. [BCLMMV16] Therese C. Biedl, Timothy M. Chan, Stephanie Lee, Saeed Mehrabi, Fab- rizio Montecchiani, and Hamideh Vosoughpour, On Guarding Orthogo- nal Polygons with Sliding Cameras, arXiv preprint (2016), arXiv: 1604. 07099v1. [CEGM17a] Lucas Colucci, Péter L Erdős, Ervin Győri, and Tamás Róbert Mezei, Terminal-Pairability in Complete Bipartite Graphs, submitted to Discrete Appl. Math. (2017), arXiv: 1702.04313. [CEGM17b] Lucas Colucci, Péter L Erdős, Ervin Győri, and Tamás Róbert Mezei, Terminal-Pairability in Complete Bipartite Graphs with Non-Bipartite De- mands, submitted to Theoret. Comput. Sci. (2017), arXiv: 1705.02124. [CEO03] Paz Carmi, Thomas Erlebach, and Yoshio Okamoto, Greedy edge-disjoint paths in complete graphs, Graph-theoretic concepts in computer science, vol. 2880, Lecture Notes in Comput. Sci. Springer, Berlin, 2003, pp. 143– 155, doi: 10.1007/978-3-540-39890-5_13, MR2080076. [CFGLS92] László Csaba, Ralph J. Faudree, András Gyárfás, Jenő Lehel, and Richard H. Schelp, Networks communicating for each pairing of terminals, Net- works 22.7 (1992), pp. 615–626, issn: 0028-3045, doi: 10 . 1002 / net . 3230220702, MR1189290. [CH14] Karen L. Collins and Megan E. Heenehan, Constructing graphs with no immersion of large complete graphs, J. Graph Theory 77.1 (2014), pp. 1– 18, issn: 0364-9024, doi: 10.1002/jgt.21770, MR3231086. [Cha91] , Triangulating a simple polygon in linear time, Discrete Comput. Geom. 6.5 (1991), pp. 485–524, issn: 0179-5376, doi: 10.1007/ BF02574703, MR1115104. 96 References

[Chv75] Vašek Chvátal, A combinatorial theorem in plane geometry, J. Combina- torial Theory Ser. B 18 (1975), pp. 39–41, MR0372750. [COS01] Richard Cole, Kirstin Ost, and Stefan Schirra, Edge-coloring bipartite multigraphs in 푂(퐸 log 퐷) time, Combinatorica 21.1 (2001), pp. 5–12, issn: 0209-9683, doi: 10.1007/s004930170002, MR1805711. [DDFMMS14] Matt Devos, Zdeněk Dvořák, Jacob Fox, Jessica McDonald, Bojan Mo- har, and Diego Scheide, A minimum degree condition forcing complete graph immersion, Combinatorica 34.3 (2014), pp. 279–298, issn: 0209- 9683, doi: 10.1007/s00493-014-2806-z, MR3223965. [Die10] Reinhard Diestel, Graph theory, Fourth Edition, vol. 173, Graduate Texts in Mathematics, Springer, Heidelberg, 2010, pp. xviii+437, isbn: 978-3- 642-14278-9, doi: 10.1007/978-3-642-14279-6, MR2744811. [DKMO10] Matt DeVos, Ken-ichi Kawarabayashi, Bojan Mohar, and Haruko Oka- mura, Immersing small complete graphs, Ars Math. Contemp. 3.2 (2010), pp. 139–146, issn: 1855-3966, MR2729363. [DM13] Stephane Durocher and Saeed Mehrabi, Guarding orthogonal art galleries using sliding cameras: algorithmic and hardness results, Mathematical foundations of computer science 2013, vol. 8087, Lecture Notes in Com- put. Sci. Springer, Heidelberg, 2013, pp. 314–324, doi: 10.1007/978-3- 642-40313-2_29, MR3126217. [DMK90] Peter Damaschke, Haiko Müller, and Dieter Kratsch, Domination in con- vex and chordal bipartite graphs, Inform. Process. Lett. 36.5 (1990), pp. 231–236, issn: 0020-0190, doi: 10 . 1016 / 0020 - 0190(90 ) 90147 - P, MR1081460. [DY15] Zdeněk Dvořák and Liana Yepremyan, Complete graph immersions and minimum degree, arXiv preprint (2015), arXiv: 1512.00513v1. [EV06] Thomas Erlebach and Danica Vukadinović, Path problems in generalized stars, complete graphs, and brick wall graphs, Discrete Appl. Math. 154.4 (2006), pp. 673–683, issn: 0166-218X, doi: 10.1016/j.dam.2005.05.017, MR2202473. [Fau92] Ralph J. Faudree, Properties in pairable graphs, New Zealand J. Math. 21 (1992), New Zealand Mathematics Colloquium (Dunedin, 1991), pp. 91– 106, issn: 1171-6096, MR1167462. [FGL92] Ralph J. Faudree, András Gyárfás, and Jenő Lehel, Minimal path pairable graphs, Proceedings of the Twenty-third Southeastern International Con- ference on Combinatorics, Graph Theory, and Computing (Boca Raton, FL, 1992), vol. 88, 1992, pp. 111–128, MR1208923. [FGL99] Ralph J. Faudree, András Gyárfás, and Jenő Lehel, Path-pairable graphs, J. Combin. Math. Combin. Comput. 29 (1999), pp. 145–157, issn: 0835- 3026, MR1677781. [Fis78] Steve Fisk, A short proof of Chvátal’s watchman theorem, J. Combin. The- ory Ser. B 24.3 (1978), p. 374, issn: 0095-8956, doi: 10 . 1016 / 0095 - 8956(78)90059-X, MR496460. References 97

[FL92] Michael R. Fellows and Michael A. Langston, On well-partial-order the- ory and its application to combinatorial problems of VLSI design, SIAM J. Discrete Math. 5.1 (1992), pp. 117–126, issn: 0895-4801, doi: 10.1137/ 0405010, MR1146902. [FM84] Alain Fournier and Delfin Y Montuno, Triangulating simple polygons and equivalent problems, ACM Transactions on Graphics (TOG) 3.2 (1984), pp. 153–174. [Fra13] András Frank, Diszkrét Optimalizálás jegyzet, 2013, eprint: http://www. cs.elte.hu/~frank/jegyzet/disopt/dopt13.pdf. [Gab83] Harold N Gabow, An efficient reduction technique for degree-constrained subgraph and bidirected network flow problems, Proceedings of the fif- teenth annual ACM symposium on Theory of computing, ACM, 1983, pp. 448–456. [GG78] Martin Charles Golumbic and Clinton F. Goss, Perfect elimination and chordal bipartite graphs, J. Graph Theory 2.2 (1978), pp. 155–163, issn: 0364-9024, doi: 10.1002/jgt.3190020209, MR493395. [GHKS96] Ervin Győri, Frank Hoffmann, Klaus Kriegel, and Thomas Shermer, Generalized guarding and partitioning for rectilinear polygons, Comput. Geom. 6.1 (1996), pp. 21–44, issn: 0925-7721, doi: 10 . 1016 / 0925 - 7721(96)00014-4, MR1387672. [GiMé17] António Girão and Gábor Mészáros, An improved upper bound on the maximum degree of terminal-pairable complete graphs, arXiv preprint (Aug. 24, 2017), arXiv: 1708.06837. [GKK13] Ashish Goel, Michael Kapralov, and Sanjeev Khanna, Perfect matchings in 푂(푛 log 푛) time in regular bipartite graphs, SIAM J. Comput. 42.3 (2013), pp. 1392–1404, issn: 0097-5397, doi: 10.1137/100812513, MR3504633. [GM16] Ervin Győri and Tamás Róbert Mezei, Partitioning orthogonal polygons into ≤ 8-vertex pieces, with application to an art gallery theorem, Comput. Geom. 59 (2016), pp. 13–25, issn: 0925-7721, doi: 10.1016/j.comgeo. 2016.07.003, MR3545993. [GM17] Ervin Győri and Tamás Róbert Mezei, Mobile vs. point guards, submitted to Discrete Comput. Geom. (2017), arXiv: 1706.02619. [GMM16] Ervin Győri, Tamás Róbert Mezei, and Gábor Mészáros, Terminal- Pairability in Complete Graphs, J. Combin. Math. Combin. Comput. (2016), accepted for publication (October 2016), arXiv: 1605.05857. [GMM17] Ervin Győri, Tamás Róbert Mezei, and Gábor Mészáros, Note on terminal- pairability in complete grid graphs, Discrete Math. 340.5 (2017), pp. 988– 990, issn: 0012-365X, doi: 10.1016/j.disc.2017.01.014, MR3612429. [GT85] Harold N. Gabow and Robert Endre Tarjan, A linear-time algorithm for a special case of disjoint set union, J. Comput. System Sci. 30.2 (1985), pp. 209–221, issn: 0022-0000, doi: 10 . 1016 / 0022 - 0000(85 ) 90014 - 5, MR801823. 98 References

[Győ86] Ervin Győri, A short proof of the rectilinear art gallery theorem, SIAM J. Algebraic Discrete Methods 7.3 (1986), pp. 452–454, issn: 0196-5212, doi: 10.1137/0607051, MR844048. [HK91] Frank Hoffmann and Michael Kaufmann, On the rectilinear art gallery problem—algorithmic aspects, Graph-theoretic concepts in computer sci- ence (Berlin, 1990), vol. 484, Lecture Notes in Comput. Sci. Springer, Berlin, 1991, pp. 239–250, doi: 10.1007/3-540-53832-1_46, MR1114588. [Hof90] Frank Hoffmann, On the rectilinear art gallery problem, Automata, Lan- guages and Programming: 17th International Colloquium Warwick Uni- versity, England, July 16–20, 1990 Proceedings, ed. by Michael S. Pater- son, Berlin, Heidelberg: Springer Berlin Heidelberg, 1990, pp. 717–728, isbn: 978-3-540-47159-2, doi: 10.1007/BFb0032069. [Hon76] Ross Honsberger, Mathematical gems. II, Dolciani Mathematical Expo- sitions, No. 2, The Mathematical Association of America, Washington, D.C., 1976, pp. ix+182, MR0472273. [IK00] W. Imrich and S. Klavžar, Product Graphs: Structure and Recognition, J. Wiley& Sons, New York, 2000. [Kar75] R. Karp, On the computational complexity of combinatorial problems, Networks 5 (1975), pp. 45–68. [KKK83] J. Kahn, M. Klawe, and D. Kleitman, Traditional galleries require fewer watchmen, SIAM J. Algebraic Discrete Methods 4.2 (1983), pp. 194–206, issn: 0196-5212, doi: 10.1137/0604020, MR699771. [KKL99] Ewa Kubicka, Grzegorz Kubicki, and Jenő Lehel, Path-pairable property for complete grids, Combinatorics, graph theory, and algorithms, Vol. I, II (Kalamazoo, MI, 1996), New Issues Press, Kalamazoo, MI, 1999, pp. 577– 586, MR1985088. [KKT92] David G. Kirkpatrick, Maria M. Klawe, and Robert E. Tarjan, in 푂(푛 log log 푛) time with simple data structures, Discrete Comput. Geom. 7.4 (1992), pp. 329–346, issn: 0179-5376, doi: 10.1007/ BF02187846, MR1148949. [KM11] Matthew J. Katz and Gila Morgenstern, Guarding orthogonal art gal- leries with sliding cameras, Internat. J. Comput. Geom. Appl. 21.2 (2011), pp. 241–250, issn: 0218-1959, doi: 10 . 1142 / S0218195911003639, MR2786379. [Kos08] Adrian Kosowski, The maximum edge-disjoint paths problem in complete graphs, Theoret. Comput. Sci. 399.1-2 (2008), pp. 128–140, issn: 0304- 3975, doi: 10.1016/j.tcs.2008.02.017, MR2416955. [LM96] Mario A. Lopez and Dinesh P. Mehta, Efficient Decomposition of Polygons into L-shapes with Application to VLSI Layouts, ACM Trans. Des. Autom. Electron. Syst. 1.3 (July 1996), pp. 371–395, issn: 1084-4309, doi: 10 . 1145/234860.234865. Appendix 99

[LTL89] W. T. Liou, J. J. Tan, and R. C. Lee, Minimum Partitioning Simple Rectilin- ear Polygons in O(N Log Log N) - Time, Proceedings of the Fifth Annual Symposium on Computational Geometry, SCG ’89, Saarbruchen, West Germany: ACM, 1989, pp. 344–353, isbn: 0-89791-318-3, doi: 10.1145/ 73833.73871. [Lub85] Anna Lubiw, Decomposing Polygonal Regions into Convex Quadrilater- als, Proceedings of the First Annual Symposium on Computational Ge- ometry, SCG ’85, Baltimore, Maryland, USA: ACM, 1985, pp. 97–106, isbn: 0-89791-163-6, doi: 10.1145/323233.323247. [LWŻ12] Andrzej Lingas, Agnieszka Wasylewicz, and Paweł Żyliński, Linear-time 3-approximation algorithm for the 푟-star covering problem, Internat. J. Comput. Geom. Appl. 22.2 (2012), pp. 103–141, issn: 0218-1959, doi: 10.1142/S021819591250001X, MR2981125. [MB87] Haiko Müller and Andreas Brandstädt, The NP-completeness of STEINER TREE and DOMINATING SET for chordal bipartite graphs, Theoret. Comput. Sci. 53.2-3 (1987), pp. 257–265, issn: 0304-3975, doi: 10.1016/ 0304-3975(87)90067-3, MR918093. [Més16] Gábor Mészáros, On path-pairability in the Cartesian product of graphs, Discuss. Math. Graph Theory 36.3 (2016), pp. 743–758, issn: 1234-3099, doi: 10.7151/dmgt.1888, MR3518137. [NVZ01] Takao Nishizeki, Jens Vygen, and Xiao Zhou, The edge-disjoint paths problem is NP-complete for series-parallel graphs, Discrete Appl. Math. 115.1-3 (2001), 1st Japanese-Hungarian Symposium for Discrete Mathe- matics and its Applications (Kyoto, 1999), pp. 177–186, issn: 0166-218X, doi: 10.1016/S0166-218X(01)00223-2, MR1869356. [ORo87] Joseph O’Rourke, Art gallery theorems and algorithms, International Se- ries of Monographs on Computer Science, The Clarendon Press, Oxford University Press, New York, 1987, pp. xvi+282, isbn: 0-19-503965-3, MR921437. [Pet91] Julius Petersen, Die Theorie der regulären graphs, Acta Math. 15.1 (1891), pp. 193–220, issn: 0001-5962, doi: 10.1007/BF02392606, MR1554815. [RS10] Neil Robertson and Paul Seymour, Graph minors XXIII. Nash-Williams’ immersion conjecture, J. Combin. Theory Ser. B 100.2 (2010), pp. 181– 205, issn: 0095-8956, doi: 10.1016/j.jctb.2009.07.003, MR2595703. [Sch88] Arnold Schönhage, A nonlinear lower bound for random-access machines under logarithmic cost, J. Assoc. Comput. Mach. 35.3 (1988), pp. 748– 754, issn: 0004-5411, doi: 10.1145/44483.44492, MR963171. [SH95] Dietmar Schuchardt and Hans-Dietrich Hecker, Two NP-hard art-gallery problems for ortho-polygons, Math. Logic Quart. 41.2 (1995), pp. 261– 267, issn: 0942-5616, doi: 10.1002/malq.19950410212, MR1330860. [WK07] Chris Worman and J. Mark Keil, Polygon decomposition and the or- thogonal art gallery problem, Internat. J. Comput. Geom. Appl. 17.2 (2007), pp. 105–138, issn: 0218-1959, doi: 10.1142/S0218195907002264, MR2309901.

Appendix A

A note on models of computation and representations of graphs

When multigraphs are part of the input, one should exercise great care when determining running times. The problem has its roots in the details of the graph representation used when describing the input and output graphs. Let us choose the very common edge list representation. Consider the following problem: given an input multigraph with 푚 ≤ 푛 edges on the vertex set {1, … , 푛}, output any simple (2 ) graph with 푚 edges on the vertex set of the input graph. Clearly, the output needs Ω(푚 log 푛) space. However, if the edges of the multigraph are incident to only a subset of the vertex set, say, {1, 2, 3, 4}, then the input may need only 푂(푚 + log 푛) bits of space. Thus, an algorithm solving this problem cannot have a running time which is at most a linear function of the size of the input. The running time of breadth first and depth first search algorithms is usually regarded as 푂(푚 + 푛), but a factor of log 푛 is clearly missing. However, these algorithms are correctly regarded as having a linear running time as a function of the size of the input. It is easy to see that describing a simple graph with Ω(푛) edges requires Ω(푛 log 푛) space, and thus the extra log 푛 factor is usually not a problem. One could argue that the previous problem is only a question of whether one chooses the unit cost or the logarithmic cost RAM machine model. However, we may exacerbate the problem (of describing the running time of an algorithm in terms of the size of its input) further by describing a multiedge by the vertices it joins and its multiplicity. Then the size of the input may be as low as 푂(log 푚 + log 푛). 102 A note on models of computation and representations of graphs

However, the logarithmic cost RAM machine has surprising limitations. Schönhage [Sch88] showed, that storing 푛 arbitrary bits takes Ω(푛 log∗ 푛) time in this model. For these reasons, our choice for the model of computation is the unit cost RAM machine for both Chapter 4 and Chapter 8. Alternatively, one may multiply the running time of our algorithms in Chapter 8 by a factor of 푂(log 푛) (where 푛 is the number of vertices of the output graph) to get the logarithmic cost running times of our algorithms. However, the 푂(푛) algorithms outlined in Chapter 4 remain linear even in the logarithmic cost model. Appendix B

Algorithms on orthogonal polygons

Algorithm B.1 Finding the horizontal cuts of an orthogonal polygon, part I Require: 푃 orthogonal polygon Ensure: pair[푣] will contain the vertical side of 푃 which the other end of the horizontal cut starting at the reflex vertex 푣 intersects

1: function Find horizontal cuts(푃 ) 2: 푛 ← number of vertices of 푃 3: 푇 ← Triangulate(푃 ) ▷ List of triangles 4: Initialize 퐿[푣] = ∅, doubly linked lists for each vertex 푣 of 푃 5: for all 푡 ∈ 푇 do 6: for 푖 = 1, 2, 3 do 7: 퐿[푡.푣푖] ← append a link to 푡 8: 푡.푙푖 ← a link to 푡’s location in 퐿[푡.푣푖] 9: end for 10: end for

11: for all side or diagonal 푠 of 푃 do 12: Initialize 푆[푠] to empty doubly linked list 13: if 푠 is a vertical side of 푃 then 14: 푆[푠] ← insert 푠 15: end if 16: end for 104 Algorithms on orthogonal polygons

Algorithm B.2 Finding the horizontal cuts of an orthogonal polygon, part II 17: 푄 ← a queue of vertices with |퐿[푣]| = 1 18: while 푄 ≠ ∅ do 19: 푢 ← pop the first element of 푄 20: 푡 ← 퐿[푢] 21: 푣, 푤 ← other two vertices of 푡 so that 푤.푦 ≤ 푣.푦 22: 푠푢, 푠푣, 푠푤 ← sides of 푡 opposite the vertex in the index 23: Delete 푡 from 푇 and the 3 links to it in 퐿, update 푄 24: if 푤.푦 ≤ 푢.푦 ≤ 푣.푦 then 25: 푆[푠푢] ← 푆[푠푤] append 푆[푠푣] 26: else if 푠푢 is horizontal then 27: Process 푆[푠푣] and 푆[푠푤] in 푦-order and update pair[] for the vertices in them 28: else if 푣.푦 < 푢.푦 then 29: 푆[푠푢] ← segment of 푆[푠푣] visible along the 푥-axis from 푠푢 30: 푅 ← segment of 푆[푠푣] not visible along the 푥-axis from 푠푢 31: Process 푅 and 푆[푠푤] in 푦-order and update pair[] for the vertices in them 32: else if 푤.푦 > 푢.푦 then 33: 푆[푠푢] ← segment of 푆[푠푤] visible along the 푥-axis from 푠푢 34: 푅 ← segment of 푆[푠푤] not visible along the 푥-axis from 푠푢 35: Process 푅 and 푆[푠푣] in 푦-order and update pair[] for the vertices in them 36: end if

37: if 푠푢 is a vertical side of 푃 then 38: for all reflex vertex 푧 in 푆[푠푢] do 39: if the horizontal cut of 푧 starts towards 푠푢 then 40: pair[푧] ← 푠푢 41: end if 42: end for 43: if 푣 is a reflex vertex then 44: pair[푣] ← the first or last element of 푆[푠푢] that contains a point with the same 푦-coordinate as 푣 45: end if 46: if 푤 is a reflex vertex then 47: pair[푤] ← the first or last element of 푆[푠푢] that contains a point with the same 푦-coordinate as 푤 48: end if 49: end if 50: end while 51: return the list pair[] 52: end function Appendix B 105

Algorithm B.3 Constructing the horizontal 푅-tree of an orthogonal polygon 1: function horizontal 푅-tree(푃 ) 2: opposite_side[] ← Find horizontal cuts(푃 ) ▷ see Algorithm B.1 3: for all reflex vertex 푣 of 푃 do 4: 푤 ← new vertex at the height of 푣.푦 in opposite_side[푣] 5: if not present, insert 푤 into 푃 6: cut_pair[푣] ← 푤 7: cut_pair[푤] ← 푣 8: end for

9: 퐺 ← ({푃 }, ∅) ▷ 퐺 is a graph with a single node 푃 10: Initialize cut_to_edge[] empty 11: CurrentNode ← 푃 12: for all vertex 푣 of 푃 in clockwise order do 13: if 푣 is a reflex or a new vertex then 14: if cut_to_edge[푣] = ∅ then 15: Split CurrentNode along {푣, cut_pair[푣]} in 퐺 16: 푒 ← {푁1, 푁2} the two new pieces whose union is CurrentNode 17: 퐺 ← 퐺 + 푒 18: cut_to_edge[푣] ← 푒 19: cut_to_edge[cut_pair[푣]] ← 푒 20: CurrentNode ← the piece containing clockwise_next푃 (푣) 21: else 22: CurrentNode ← pair of CurrentNode in cut_to_edge[푣] 23: end if 24: end if 25: end for 26: return 퐺 27: end function 106 Algorithms on orthogonal polygons

Algorithm B.4 Finding a minimum cardinality horizontal 푟-guard system 1: function Solve MHSC(P) 2: 푇퐻 ← horizontal 푅-tree(푃 ) ▷ Algorithm B.3 3: 푇푉 ← vertical 푅-tree(푃 ) 4: for all vertical slice 푡 ∈ 푇푉 do 5: 푎, 푏 ← vertical sides of 푃 bounding 푡 6: ℎ푎 ← horizontal slice in 푉 (푇퐻 ) containing 푎 7: ℎ푏 ← horizontal slice in 푉 (푇퐻 ) containing 푏 8: N[푡] ← {ℎ푎, ℎ푏} 9: end for

10: 푟 ← arbitrary node of 푇퐻 to serve as root 11: dist[] ← Breadth First Search(푇퐻 , 푟) ▷ distance from 푟

12: LCA[] ← Lowest Common Ancestors(푇퐻 , 푟, N[]) ▷ Algorithm of [GT85] 13: ▷ LCA[푡] contains the lowest common ancestors of the elements of N[푡]

14: 푆 ← ∅ 15: Set every node of 푇퐻 unmarked 16: for all 푡 ∈ 푉 (푇푉 ) so that dist[LCA[푡]] is not increasing do ▷ reverse BFS-order 17: if both elements of N[푡] are unmarked then 18: 푆 ← 푆 ∪ {LCA[푡]} 19: Set Mark(LCA[t]) 20: end if 21: end for 22: return 푆 23: end function

24: function Set Mark(푢) 25: for all neighbor 푤 of 푢 in 푇퐻 do 26: if dist[푤] > dist[푢] and 푤 is unmarked then 27: Set Mark(w) 28: end if 29: end for 30: end function