Cell-paths in mono-and bichromatic line arrangements in the plane ∗

We prove that the dual graph of any arrangement of n lines in general position always contains a path of length at least n 2 / 4 . Further, we show that in every arrangement of n red and blue lines—in general position and not all of the same color—there is a simple path through at least n cells where red and blue lines are crossed alternatingly.


Introduction
Given an arrangement of n red and blue lines in the Euclidean plane, we consider sequences of cells of the arrangement such that consecutive cells share an edge and no cell appears more than once in the sequence.We refer to such sequences as cell-paths, or simply paths.A path is called alternating if the common edges of consecutive cells alternate in color.The length of a path is defined to be one less than the number of cells involved.Cell-paths can also be seen as paths in the dual graph of the arrangement, in which there is a vertex for every cell in the arrangement, and an edge connects two vertices when the corresponding cells are adjacent.
In this paper we study the existence of long paths in both monochromatic and bichromatic arrangements.First we consider the following question: What is the largest number f (n) such that every arrangement of n lines in general position (no three lines share a point and no two lines are parallel) has a cell-path of length at least f (n)?It is not hard to argue that f (n) ∈ Ω(n), and a quadratic upper bound trivially follows from the number of cells in an arrangement.In Section 2, we prove that n 2 /4 ≤ f (n) ≤ n 2 /3 + O(n).We also show that there always exists a path of length at least the number of cells of size four or more.
Originally, our research on cell-paths was motivated by the following bichromatic variant of the question: What is the largest number p(n) such that every arrangement of n blue and red lines in general position and not all of the same color has an alternating path of length at least p(n)?Naturally, this problem is more constrained and it is non-trivial to prove even the existence of, say, a linear-size cellpath.In Section 3, we answer this question in the affirmative, proving that p(n) ≥ n.We also give a simple example showing p(n) ≤ 2n − O(1).Hence, there is indeed a significant difference between the monochromatic and the bichromatic setting.
Previous work.Arrangements of lines have been thoroughly studied for decades [7,10,13,14,15,23].For example, properties of monotone paths in the arrangement have been considered (see, e.g., [9]).Substantial emphasis has been put into studying degenerate arrangements in which, e.g., the number of vertices decreases dramatically.Further, the kind of cells one may obtain as well as their extremal number were investigated (for example how many triangles appear in any simple arrangement).In another direction, one can study the graph having as vertices the intersection points of lines, which are adjacent if they are consecutive in one of the lines [6], and investigate its basic properties as a graph, such as edgecolorings or whether it can be decomposed into Hamiltonian cycles (in projective space) [11].For later use, recall that the cells in any arrangement can be 2-colored chessboard-like, i.e., no two cells with the same color are adjacent [24] (see also [18]).
Not many problems on colored arrangements of lines were considered in the early times, in contrast to the rich (and still growing) literature on combinatorial problems on red and blue points [7,21].The first publications considered bichromatic sets of lines and studied the number and distribution of the intersection points of lines with the same color [16,17,27].There is a recent line of research on problems in which lines have to be colored to achieve some property, or are already colored and one looks at the kind of cells that appear, regarding the color of their sides [3,4,5].Our problem on alternating paths adds to this trend.
The present work on bichromatic line arrangements was inspired by a well known (still open) problem on points: Consider a set R of n red points and a set B of n blue points in convex position.Then it is easy to see that a crossing-free alternating Hamiltonian path on R ∪ B does not always exist.What is the longest crossing-free alternating path spanned by these points?Akiyama and Urrutia [2] gave an O(n 2 ) algorithm to find an alternating Hamiltonian path, if it exists.Erdős (see [22]) popularized the problem of studying the value (n) such that a plane alternating path of length at least (n) always exists for any such pair R and B. Abellanas et al. [1], and independently Kynčl et al. [22], proved that (n Hajnal and Mészáros [20] proved that (n) ≥ n + Ω( √ n).The gap is still to be closed.Other variations and related problems appear in Mészáros' PhD thesis [25].
Our results are also related to a long-standing open problem about paths in planar graphs.In 1963, Moon and Moser [26] showed that there exist three-connected planar graphs with n vertices in which the longest simple path has length at most cn log 2/ log 3 , where c is some constant.It is conjectured (see [19]) that this is a lower bound as well, hence that every three-connected planar graph contains a path of this length.Our result on f (n) shows that considering dual graphs of arrangements instead, we always get a path of length Ω(n 2 ).
Finally note that during the preparation of the final version of the manuscript, we heard about a recent unpublished work on this topic due to Hoffmann, Kleist, and Miltzow, showing that f (n) = n 2 /3−O(n), closing the gap above.They also provide additional results on the bichromatic version.

Long paths in arrangements
We begin by considering the following problem: given a set S of n ≥ 2 lines in general position, our aim is to find bounds on the length of the longest simple path in the dual graph of the arrangement.Let A(S) be the arrangement associated with S, and let G be the dual graph of A(S).Recall that the number of vertices of G is N = n+1 2 + 1.We define f (S) as the length of the longest simple path in G, and let f (n) = min |S|=n f (S).In this section we show: The upper bound on f follows from the fact that the number of vertices of G is quadratic.In Proposition 2.13 below we improve this trivial upper bound with a better constant.
Similarly, we provide two distinct lower bounds for f (Theorem 2.10 and Theorem 2.11).The first one uses Tutte's theorem to show that a graph very similar to G is Hamiltonian, whereas the proof of the second one is elementary and directly gives a simple algorithm to find the path.The difference between them is that the bound on the first one is proportional to the number of large cells (having four or more edges), while the second one depends only on n.Thus, clearly the first one is more useful for the particular cases in which the number of such cells is big.

A lower bound using Tutte's Theorem
The first lower bound construction uses Tutte's theorem stating that every four-connected planar graph is Hamiltonian.Thus, our aim is to perform local transformations to G to make it four-connected while preserving planarity and removing as few vertices of G as possible.
Recall that, since every vertex of A(S) has degree 4, G is a bipartite quasi-quadrangulation (i.e., every face of G has size four, except for the unbounded one).It is easy to check that G is two-connected and planar.We consider the natural embedding of G given by S, in which every vertex of G is located in the corresponding face of A(S), every edge of G intersects exactly one edge of A(S), and the face corresponding to the unbounded cells of A(S) is the outer face.Recall that a vertex cutset of a graph is a set of vertices whose removal disconnects the graph.
Let C be a simple cycle of G.By Jordan's theorem, the removal of C from G decomposes the remaining vertices into two subsets, which we call outer and inner, where the outer one is the component that contains the unbounded cells of the arrangement.Given a vertex v ∈ C, we define its inner degree as the number of neighbors of v that belong to the inner component.
Let P be a simple path of G whose first and last vertex are incident to the outer face, while all other vertices are interior vertices of G. Then the removal of P splits the remaining vertices of G into two subsets as well.We refer to P as a separating path and to the induced subsets as separated vertex sets.The proof of the following lemma is similar to the one of Lemma 2.2.
Lemma 2.3 For any separating path P of G with k vertices, one of the separated vertex sets of G has cardinality at most Lemma 2.4 Let C be a simple cycle of G, and let I(C) be the set of vertices in its interior.
If I(C) = ∅, there exists a simple cycle C with the same set I(C) in its interior such that no two consecutive vertices of C have inner degree zero.
For any separating path P that splits the remaining vertices of G into V 1 and V 2 , there exists a separating path P such that (1) for each side of P , at least one out of any two consecutive vertices of P has an emanating edge to that side, (2) P splits the remaining vertices of the first and the last vertex of P have emanating edges to both sides of P .
Proof: Suppose I(C) = ∅.As all faces of G in the interior of C have size four, at most two consecutive vertices of C can have inner degree zero.Moreover, the only possibility of having two consecutive such vertices is that C uses three consecutive edges of a face in its interior.Iteratively replacing these edges by the fourth edge of this face wherever such a situation occurs, we obtain a simple cycle C .C has exactly I(C) in its interior as well, and no two consecutive vertices of C have inner degree zero.
Similarly, in a separating path P , two consecutive vertices without emanating edges on one side can occur only if P uses three consecutive edges of a face on that side.Replacing all such occurrences on both sides gives the claimed properties. 2 Lemma 2.5 All vertex cutsets of size two of G consist of the two neighbors of a degree-two vertex.
Proof: Consider a vertex cutset C = {c 1 , c 2 } of size two and the at least two resulting sets V 1 , V 2 of the remaining vertices of G. First let one of the sets, w.l.o.g.V 1 , contain only inner vertices of G.It follows that V 1 is the interior of a cycle of G and the vertices of this cycle are not contained in V 1 .By Lemma 2.4, there exists a cycle, also with V 1 in its interior such that no two consecutive vertices of that cycle have inner degree zero.Further, for V 1 not to be empty, this cycle has to have a length of at least 6 by Lemma 2.2.Hence, at least three vertices of this cycle have inner degree larger than zero and C is not a cutset.If both V 1 and V 2 contain vertices of the outer face, then there exists a separating path in G.By Lemma 2.4 (3), c 1 and c 2 have to be the end points (first and last vertex) of this separating path.Therefore, by Lemma 2.4 (1), this separating path contains at most three vertices.Thus, by Lemma 2. Lemma 2.6 If C is a vertex cutset of size three of G where one of the separated sets does not contain any vertex of the outer face, then C consists of the three neighbors of a degree-three vertex.
Proof: Consider a minimal cutset C of size three and let V 1 be a connected component that contains only interior vertices of G. Recall the first part of the previous proof.By Lemma 2.4, there exists a separating cycle with V 1 in its interior such that no two consecutive vertices of that cycle have inner degree zero.If V 1 contains only one vertex, then this separating cycle has to have a length of at least 6 by Lemma 2.2.Hence, at least three vertices of this cycle have inner degree larger than zero.Thus, C can be a cutset, if V 1 contains only one degree-three vertex.However, if V 1 contains more than one vertex, then the separating cycle has to have a length of at least 8 by Lemma 2.2.Therefore, at least four vertices of this cycle have inner degree larger than zero and C is not a cutset. 2 In order to construct a long path in G, we will use the following well-known result.
Given a degree-three vertex x in a graph, adjacent to u, v, w, the corresponding Y-∆ transformation consists of removing vertex x, adding edges uv, uw, and vw, and removing any parallel edges.This is illustrated in Figure 1.We define a new graph G by applying the following two transformations to G, in the given order (see Figure 2): 1. Add an extra vertex v ∞ , and make it adjacent to all vertices of G dual to the unbounded cells of A(S).
2. For all vertices of degree three, perform a Y-∆ transformation.Observe that after adding v ∞ , no two vertices of degree three are adjacent.Hence, the transformation is well-defined.
Lemma 2.8 G is a four-connected planar graph, hence it is Hamiltonian.
Proof: We need to show that G does not have any cutset of size three or less.We first verify the following claim To verify this, we need to show that the vertices of degree three that are eliminated by the Y-∆ transformations do not reconnect the separated vertex sets in G.Each such Y-∆ transformation involves three vertices u, v, w that are pairwise adjacent in G .Hence, the degree-three vertex of G that was eliminated can be assigned to the same side of the partition in G as the vertices {u, v, w} \ C. Next, we rule out the existence of a cutset C of size two in G , thereby showing that G is at least three-connected.From our observation, C \ {v ∞ } would be a cutset of G.If v ∞ belongs to C then C \ {v ∞ } has size one, which is impossible since G is known to be two-connected.Otherwise, we have a cutset of size two in G, which from Lemma 2.5 must consist of the two neighbors of a degree-two vertex in G.This vertex, however, after adding v ∞ became of degree three, thus it must have been eliminated by a Y-∆ transformation, hence again C cannot be a cutset in G .Now suppose that C is a cutset of size exactly three in G , and suppose first that C does not contain v ∞ .From our observation, C is also a cutset of G.By Lemma 2.6, the separated sets either all contain vertices of the outer face or only one separated set, containing exactly one vertex of degree three, is cut off by its neighbors.Degree-three vertices of G are eliminated by the Y-∆ transformations and all vertices of the outer face in G are connected by v ∞ in G .Thus, C cannot be a cutset in G and we have a contradiction.Hence, we can assume that v ∞ ∈ C, and that C \ {v ∞ } is a cutset of size two of G.But this case was already ruled out above, hence G cannot have a cutset of size at most three, and therefore is four-connected.2 Note that using Chiba and Nishizeki's algorithm [8], a Hamiltonian cycle in G can be found in linear time.In order to complete the bound, we must provide a lower bound on the number of vertices of G .Let N >3 be the number of vertices of G that have degree larger than 3. Observe that the transformations we have done to G have only affected the vertices of degree two or three.That is, any vertex that has degree 4 or more in G will also be present in G .In particular, we have that G has at least N >3 vertices.Lemma 2.9 N >3 ≥ n 2 /6 − 5n/6 + 1 .
Proof: Recall that G has exactly N = n+1 2 + 1 vertices.G has no interior vertices of degree two.Furthermore, it is known that the maximum number of degree-three interior vertices in G, that is, the number of bounded triangular cells in the arrangement A(S), is at most n(n − 2)/3 [12].Also, the number of exterior vertices of degree two or three in G is at most 2n.Hence, Proof: Consider a Hamiltonian cycle in G .This cycle can be transformed into a simple path of length at least N >3 in G, by eliminating v ∞ and replacing every portion of the cycle using one or two edges of a triangle obtained from a Y-∆ transformation by two edges incident to the degree-three vertex (see Figure 3). 2

An improved Ω(n 2 ) lower bound
In this section we present an alternative lower bound that performs better than the previous one when N >3 is small.
Proof: Consider the arrangement A(S) to have a fixed direction, with distinguished topmost and bottommost infinite cells.In order to describe the lower bound construction, we will use the simplified wiring diagram W of A(S) with respect to this direction, as depicted in Fig. 4. We refer the reader to the book by Stefan Felsner for precise definitions and discussions of wiring diagrams [10].
Recall that the horizontal lines in W represent the levels of A(S) (in the given fixed direction).We number the levels from top to bottom with L 1 , . . ., L n .Let R 0 and R n be the two (one-cell) outer rows above L 1 and below L n , respectively.Let R i , 1 ≤ i ≤ n − 1, be an inner row of cells between two levels L i and L i+1 .
Note that the union over the cells in all inner rows does not include the topmost cell (in R 0 ) and the bottommost cell (in R n ).Further, note that vertical segments in W represent line intersections in A(S), hence two cells are adjacent in the arrangement exactly if they share a horizontal segment in W . Observation 2.12 Each interior cell in any inner row R i , 1 ≤ i ≤ n − 1, has at least one neighbor in R i−1 , at least one neighbor in R i+1 , and altogether at least three neighbors in R i−1 ∪ R i+1 Proof: If an interior cell had only two neighbors, then it would be bounded by two lines intersecting at least twice, see Fig. 5. 2 The subgraph H i of the dual graph induced by U i is a caterpillar (a star if i = 0 or i = n − 1).Let P i be the longest path in H i connecting the left infinite cells with the arrangement simplified wiring diagram wiring diagram  right infinite cells.See Fig. 6 for an example.It is easy to see that all vertices dual to infinite cells of U i are in P i .We show that the union of the paths P i contains the dual vertices of all cells of W . Consider an interior cell C in R i .The vertex dual to C lies on P i if and only if C has at least two neighbors in R i+1 .Similarly, the vertex dual to C lies on P i−1 if and only if C has at least two neighbors in R i−1 .It follows by Observation 2.12 that the vertex dual to C is in P i or in P i−1 (or in both of them).
Our aim is first to show that we can combine (parts of) the paths P i into four different longer paths, each of them connecting the topmost cell to the bottommost cell.Then we will prove that at least one of these four paths fulfills the bound claimed in the theorem.
Fig. 7: The (sub)paths P L i and P R i of the paths Pi (i = {1, 2}) of example in Fig. 6.The non-contained parts of P1 and P2 are shown in gray, dashed and dotted, respectively.The infinite cells C L i and C R i are shaded. For . See Fig. 7 for an example.Note that each of P L i and P R i traverses all interior cells of P i plus at least two of its infinite cells.Consider the four infinite cells Observe that one of the two paths P L i , P R i contains both C L i and C L i+1 (in some order), while the other path contains exactly one of the two cells.An analogous statement holds for C R i , C R i+1 .Hence, out of the four infinite cells of U i (1 ≤ i ≤ n − 2), two are contained exactly once and two are contained exactly twice in P L i and P R i together.Thus, summing the number of infinite cells contained in P L i and P R i and averaging over the four infinite cells of U i , we count each such infinite cell at least 3/2 times.
For i ∈ {0, n − 1}, Trivially, every infinite cell of U 0 and U n−1 is visited twice by P L 0 together with P R 0 , and P L n−1 together with P R n−1 , respectively.We partition the paths P L i , P R i into four different sets Q k , k ∈ {0, 1, 2, 3}, defined by: See Fig. 8 for an example.Observe that in each Q k the paths are disjoint.Moreover, they can easily be connected to form one long path by adding certain edges connecting neighboring infinite cells.See the shaded cells in Fig. 8 for examples.We define these sets E k of connecting edges for each Q k : Combining the edges in E k with the edges in the paths in Q k , we get a path Q k , for each k ∈ {0, 1, 2, 3}.What remains to show is that at least one of the four paths Q k has the desired length.
Recall that P L i and P R i contain all interior cells of P i .By Observation 2.12, each interior cell lying in some row R i has at least two neighbors above or below and therefore lies on both paths P L i and P R i , or on both paths P L i−1 and P R i−1 (or even on all four paths).Thus, each interior cell lies on at least two of the four paths Q k .Further, all infinite cells (except for the topmost and bottommost one) in U i , 0 ≤ i ≤ n−1, are counted at least 3/2 times (on average) in P L i and P R i together.For the topmost and bottommost cell, observe that both are contained in each of the four paths Q k .
Fig. 8: The four sets Q k , k 0, 1, 2, 3, of paths, for the example in Fig. 4. For each set Q k , the infinite cells that need to be connected to obtain one long path are shown shaded.
Altogether, it follows that the sum of the number of the cells that are traversed by each Q k for k ∈ {0, 1, 2, 3} is at least Thus, by the pigeonhole principle, at least one out of the four paths Q k visits at least n 2 +3n+4 4 cells.2 There exists a family of arrangements with a fixed direction, see Fig. 9 (left), such that the technique described in the proof of Theorem 2.11 results in a path visiting only n 2 4 + n + 2 cells (if n is a multiple of 4).On the other hand, for the same arrangement with a different direction, see Fig. 9 (right), this technique results in a path visiting n 2 2 − n 2 + 4 cells.An interesting open question is whether we can always find a direction such that we get a better bound.
The proof of Theorem 2.11 clearly also holds for cell-paths in pseudoline arrangements.Since the lower bound of n(n − 2)/3 of bounded triangular faces as well holds for pseudoline arrangements [12], it can be observed that also Theorem 2.10 remains true for pseudoline arrangements.

Upper bound
We show that the previous lower bound on the length of the longest simple path in G is within a factor 4/3 of the optimum.
Q 3 visits 26 of 37 cells Q 3 visits 32 of 37 cells Proof: It is well-known that the cells of any line arrangement can be properly two-colored, hence that G is a bipartite graph.We will refer to the colors as black and white.Füredi and Palásti [13] give an example of an arrangement of n lines in which there are n 2 /3 + O(1) black cells and n 2 /6 + O(n) white cells.Hence, there are roughly twice as many black cells as white cells, which is known to be asymptotically tight [18].Now observe that any simple path or cycle in G will alternatingly traverse white and black cells, hence cannot have length greater than n 2 /3 + O(n). 2

Long alternating paths in bichromatic arrangements
In this section we prove the existence of long alternating paths in bichromatic arrangements.First observe that general position is important to allow a positive answer: Assume that n ≥ 4 and that at least two lines are red and two lines are blue.Take all the n lines in the arrangement to go through a common point, so that all of the red lines have slope between 0 and 1, and all of the blue lines have positive slope larger than 1.Then every alternating path has length at most two.This holds since each cell on an alternating path, except for the first and the last one, has to be bichromatic, i.e., has to have a red and a blue edge on its boundary.But the constructed arrangement has only four bichromatic cells and no two of them share an edge.Further, consider an arrangement of n lines, all blue except for exactly one of them red, in general position.Then the length of the longest alternating path is 2n − O(1): In the arrangement (as edge set) there are n red edges which can be used at most once in a path, so in an alternating path at most 2n + 1 edges can be used; hence the upper bound.For the lower bound we go through the 2n cells along the red line, crossing the red line in every other step, and a blue edge for entering a red-line-incident cell not yet visited in the steps in between; this results in a path of length 2n − 1.
The following lemma directly implies our main result for the stated problem on bichromatic arrangements.infinity (otherwise such path can be extended).Consequently, the union of edges in X separates the plane into two parts, one part of which contains the seed cell z.Suppose the edges in X are all blue (recall that they all have the same color).Then it is not possible that both sides contain a point on a red line, as otherwise, since we can travel on red lines between these two points, a red line would have to cross the union of edges in X, which we know is not possible, since all of them are blue.Thus, the side that does not contain z must be completely monochromatic, i.e., all cells there are bounded by edges of the same color.
Since every point p in the complement of reach(z) must have such a cycle or path X separating p from reach(z), it follows that bichromatic vertices cannot be interior to the complement of reach(z), as claimed.As argued before, this implies Lemma 3.1.

Discussion
• The linear bound on the length of the alternating path is probably not tight if an equal number of red and blue lines is required.However, as already stated at the beginning of Section 3, when abandoning the general position assumption, it is easy to construct an example with the same number of red and blue lines where the maximum alternating path has only length two.Obviously, the same bound still holds if no three lines intersect in a common point, but all lines are allowed to be parallel -just place all blue lines vertically followed by all red lines vertically.On the other hand, these arrangements have only one vertex in the first construction and no vertex at all in the second case.Another degenerate example arrangement but with a quadratic number of vertices (and cells) whose longest alternating path has length only O(n) is depicted in Fig. 11.This example has an equal number of red and blue lines, half of the lines are vertical parallel and half of them are horizontal parallel.
• A closer inspection of the given proof shows that we have actually established the following.
Theorem 3.4 Let C be a set of red and blue simple closed or biinfinite curves, each of which separates the plane into two parts.If the union of red curves is connected, the union of blue curves is connected, and no point is contained in more than two of the curves, then any pair of bichromatic cells in the arrangement is connected by an alternating path.
• Further, Lemma 3.1 can be generalized to higher dimensions: Consider two antipodal bichromatic cells in a (d + 1)-dimensional arrangement.Intersect these two cells (and the arrangement) with a hyperplane H.The intersection of the arrangement with H gives a d-dimensional bichromatic arrangement, in which the antipodal cells are connected by induction.

Lemma 2 . 2
In any cycle C of G of length 2k, the inner degree of any vertex of C is at most k − 2 and the number of vertices in the inner part is at most (k − 1)(k − 2)/2.Proof: Consider the set S(C) ⊆ S of lines associated with edges of C. Since C is a cycle, every line in S(C) is intersected by C an even number of times, and at least twice.Hence, there are |S(C)| ≤ k such lines.As any vertex v of C is incident to two edges on C, there are exactly |S(C)| − 2 lines left that could correspond to edges incident to v and in the inner part of C. Further, the number of vertices in the inner part of C is at most the number of bounded cells of the arrangement formed by S(C) and thus at most

Fig. 3 :
Fig. 3: Obtaining a long path in G from a Hamiltonian cycle in G (left), using the operations shown on the right.

Fig. 4 :
Fig. 4: An of an arrangement and its presentations as a wiring diagram and as a simplified wiring diagram.The dual graph is shown in the arrangement and the simplified wiring diagram.

Fig. 5 :
Fig. 5: An interior cell C cannot have two neighbors only.

Fig. 9 :
Fig. 9: An example where the above proof gives a path of length ∼ n 2 /4, instantiated for n = 8. (left) With the given direction of the arrangement our technique yields a path (Q0 and Q3) visiting 26 cells.(right) The same arrangement rotated by 90 • : the constructed path (Q1 and Q3) visits 32 cells.

Fig. 10 :
Fig. 10: Orientation of the dual graph G of a bichromatic line arrangement.Cells of b-out-colored vertices are drawn as shaded, while cells of r-out-colored vertice are drawn white.Every bichromatic vertex of the arrangement yields a four-cycle in the oriented graph.

Fig. 11 :
Fig.11: An arrangement not in general position, but with a quadratic number of vertices, in which the length of the longest alternating path is in O(n) (an example of a long path is shown).