Walks on Borders of Polygons

4 downloads 0 Views 124KB Size Report
Department of Mathematics and. TUCS - Turku Centre for Computer Science. University of Turku, FIN-20014 Turku, Finland. vehalava@utu.fi, harju@utu.fi.
Vesa Halava | Tero Harju

Walks on Borders of Polygons

TUCS Technical Report No 698, June 2005

Walks on Borders of Polygons Vesa Halava Tero Harju Department of Mathematics and TUCS - Turku Centre for Computer Science University of Turku, FIN-20014 Turku, Finland. [email protected], [email protected]

TUCS Technical Report No 698, June 2005

Abstract We give a graph theoretical proof for the existence of a walk connecting left and right sides of a rectangle when it is partitioned into (finitely many) rectangles colored in a specific way, and the walk is aloud to use only borders between rectangles of different color. The problem was originally introduced by J.R. Isbell in the proof of his Zig-Zag Theorem. We prove the existence of such a walk also when the problem is generalized other partitions of the rectangle, such as partitions to arbitrary polygons.

Keywords: Zig-Zag; Isbell; coloring; polygon; rectangle; handshaking

TUCS Laboratory Discrete Mathematics for Information Technology Laboratory

1

Introduction

In 1966 J.R. Isbell proved his algebraic Zig-Zag Theorem [3] using a simple property of paths in a geometrical problem on rectangle partitions. We shall introduce here a bit more general form of the problem, the first version of which is stated as follows: let R be a rectangle in the plane which is partitioned into a finitely many rectangles R1 , R2 , . . . , Rn , called small rectangles, which can be of different sizes, and which may overlap only on their sides. Every point of the rectangle R must be contained in one small rectangle. We say that the partitioning of R satisfies the color condition, if (1) the rectangles along the top border of R are colored white, (2) the rectangles along the bottom border of R are colored gray, and (3) all other small rectangles are colored either white or gray. In Figure 1(a) there is an example of a partition of a rectangle satisfying the color condition.

(a)

(b)

Figure 1: In (a) a partition of R satisfying the color condition is shown and in (b) the bold line presents a good path.

We wish to show that there always exists a good path, a path from the left hand border of R to the right hand border such that the path goes along the borders of differently colored rectangles: at each point (excepting the vertices of the small rectangles) on one side there is a white rectangle and on the other side there is a gray rectangle; see Figure 1(b) for an example of a good path. Note that a good path need not be a unique solution for an instance of our problem.

2

Origin of the problem

Instead of colors Isbell [3] used signs + and − for the small rectangles. More important difference to our approach is that the small rectangles in [3] were 1

assumed to be of one unit height so that they appeared leveled on horizontal lines. In the following we have no such restriction on the form of the rectangles. In his paper Isbell gave only an outline of proof of the existence of a good path, and he referred to his proof as ‘hand waving’, which is interesting because our proof will use handshaking! The first formal proof of the problem was given by J. M. Philip [4] in 1974. That proof employed some surplus ‘inside information’ of the rectangles inherited from the algebraic problem setting in Isbell’s paper. A rather simple topological proof was given in 1997 by the present authors together with L. Ilie in [2], where also an algorithm for finding a good path was given. The algorithm works also in the present more general framework of the problem, and therefore we shall shortly discuss the idea in it; for the proof, we refer to [2]. The idea is to dissolve borders of small rectangles as in the following: 1. merge the white rectangles along the top border of R to form a polygon, 2. merge iteratively to the so obtained polygon each white rectangle having a border that intersects with the border of the polygon, 3. if there is gray polygon completely inside the unified polygon it is also added to the polygon, 4. once there are no more small rectangles to be added to the polygon, the lowest border line of the obtained polygon defines a desired path. In Figure 2 we have shown the final polygon produced by the above algorithm for the partition in Figure 1(a).

Figure 2: The final polygon obtained by the algorithm is indicated using cross hatching. The problem is fairly simple to state, and the existence of a good path is almost immediate to the eye when one uses colors like white and gray for the rectangles, but for a mathematician it is always nice, if not necessary, to find out how something fits to already established theory. In the next section we give a simple graph theoretical reasoning for the problem using a handshaking property of degrees in graphs. 2

3

A proof by handshaking

We need only the first principles of graph theory. For more advanced topics, an interested reader is referred to the book by Chartrand and Lesniak [1]. In general, a graph G = (V, E) consists of a finite set of elements, called vertices, and a set E of edges of the form e = {x, y}, where x and y are different vertices. The degree deg(x) of a vertex x in G is the number of edges incident with x, i.e., deg(x) is the number of pairs e = {x, y} in E. A vertex x is said to be even, if deg(x) is even, and otherwise it is called odd. The following result is often referred to as the first theorem in graph theory. Its proof is imminent, since each edge provides one to the degree of each of its vertices. Lemma 1 (Handshaking lemma). If G = (V, E) is a graph with m edges, then X 2m = deg(x) . x∈V

In particular, every graph has an even number of odd vertices. Let us return to our problem on rectangles. Let R be a rectangle together with a partitioning to white and gray small rectangles as in the above. We define a graph GR = (V, E) where the set V of vertices consists of the vertices (corner points) of the small rectangles, and the set E of edges consists of pairs {x, y} such that (x, y) is a line segment common to two small rectangles such that the other side of the line is white while the other side is gray; for an illustration, see the graph for our previous example in Figure 3.

Figure 3: The graph GR of the rectangle of Figure 1. Only the vertices of degree at least one are drawn.

Since the angles in the figures are 90o , we have that 0 ≤ deg(x) ≤ 1 in GR for the vertices on the borders of R. Indeed, the only odd vertices are on the border: Lemma 2. Let x be an interior vertex of R, that is, it is not on a border of the rectangle R. Then deg(x) is is either 0, 2 or 4. 3

Proof. Since the rectangles have only right angles, either 3 or 4 small rectangles meet at each interior vertex; see Figure 4. The case of three rectangles meeting at x is illustrated in Figure 4(a). If there R2 and R3 are colored differently, then deg(x) = 2, because the line segment between either R1 and R2 or R1 and R3 also produces an edge in the graph GR . On the other hand, if R2 and R3 have the same color, then either deg(x) = 0 (if R1 shares the common color) or deg(x) = 2 (if R1 has a different color). In the case of four small rectangles, see Figure 4(b), we can suppose that adjacent rectangles have different colors, because otherwise we can merge two similarly colored small rectangles and in this way we reduce this case to the case illustrated in Figure 4(a). Now, we have deg(x) = 4.

R1

R2

R1

R3

R3

R2

R4

x (b)

(a)

Figure 4: In (a) x meets three rectangles and in (b) four rectangles. A walk in a graph G is any sequence W = e1 e2 . . . en of edges ei = {xi , xi+1 } that are compatible in the sense that ei+1 starts where ei ended. ∗ → xn+1 . A walk We say that W is from x1 to xn+1 , and denote this by x1 − is a path if no vertex is repeated, i.e., xi 6= xj for i < j. Note that paths in the graphs GR correspond to non-self-intersecting walks along the borders of differently colored small rectangles. If W is a walk as in the above, then we ∗ obtain a path from x1 to xn+1 by removing all cycles z − → z from W . For a graph G = (V, E) and a subset A ⊆ V of its vertices, let ∗

cl(A) = {y ∈ V | there is a walk x − → y for some x ∈ A} be the closure of the set A. We are now ready to prove that good paths always exist. Theorem 1. Let R be a rectangle with a partitioning to white and gray small rectangles satisfying the color condition. Then there exists a path from the left border to the right border using only lines between different colors. Proof. We show that there is an odd number vertices on the left border of R. Indeed, the vertices x on the left border are as in Figure 4(a), where now R1 denotes the surrounding plane. The color changes at x, i.e., R2 and R3 are colored differently, if and only if deg(x) = 1. (Notice that if R2 and R3 have the same color, then deg(x) = 0.) The top small rectangles are white and 4

the bottom rectangles are gray, and therefore the color has to change an odd number of times when we descent down the left border. This shows that the number of odd vertices on the left border must be odd. Let then A be the set of vertices on the left border of R, and consider its closure cl(A) as part of the graph GR , i.e., remove all vertices of GR that are not in cl(A). The degrees of the interior vertices of cl(A) are the same as in GR , and thus they are all even. By Lemma 1 every graph has an even number of odd vertices, and therefore cl(A) must contain an odd vertex from ∗ the right border of R. Consequently there exists at least one path x − →y from the left border of R in GR that ends in an odd vertex on the right border of R. This proves our claim.

4

General polygonal partitions

As in [2] also the present method can be generalized. We begin with partitions to polygons, and then argue that the case holds also for more general geometrical partitions to colored figures. Assume first that a rectangle R is partitioned to triangles instead of rectangles. Suppose that the coloring satisfies the color conditions as stated for rectangular partitions. Here a border triangle is one that has a side on the border, not only one vertex. In the color condition we require that the top border triangles have white color and the bottom border triangles have gray color. The graph GR for triangle partitions is defined in the same way as for rectangles. The problem for triangle partitions differs from the previous framework basically on the following points, see Figure 5: (1) The vertices of GR on the borders of R may have degree greater that one, and the degree of the interior vertices can be larger than four. (2) There can be vertices in GR on the top and bottom border of R. This is because a triangle may have a vertex on the border without sharing any side with the border. Lemma 3. In the graph GR of triangular partition of R, there is an odd number of odd vertices on both left and right borders of R. All other vertices are even. Proof. Consider a left border vertex x as in Figure 6(a), where x is a common vertex to k ≥ 2 triangles. Then again the color changes at x, i.e., R1 and Rk have different colors, if and only if deg(x) is odd. This holds equally well if x is a corner vertex of the big rectangle R. As in the case of rectangular partitions, when descending down the left border, the color changes an odd 5

(a)

(b)

Figure 5: In (a) there is a triangle partition, and in (b) the graph GR is illustrated.

R1 R2 .. .

x

R1 R2

Rk ...

R1 R2

Rk ...

Rk (a)

(b)

(c)

Figure 6: In (a) the vertex x is on the left border of R; in (b) the vertex is on the top border, and in (c) the vertex is interior.

number of times, and hence there is an odd number of odd vertices on the left border. The proof for the right border is symmetric to the above argument. Similarly, if x is on the top border as in Figure 6(b), then R1 and Rk have the same color, and hence deg(x) is even. This also holds if x is a vertex of the big rectangle, and symmetric argument shows that deg(x) is even for all vertices on the bottom border of R. Finally, if x is an interior vertex as in Figure 6(c), then, when we travel around x, the color of the triangles changes an even number of times since the original color of R1 is invariant. Hence also in this case deg(x) is even. Now the same handshaking argument applies to GR as for the case of rectangles, and hence we have proved Theorem 2. For each triangular partition of a rectangle satisfying the color conditions, there is a path from the left border of the rectangle to the right border of the rectangle using only borders of triangles of different color. Since all polygons can be divided into triangles (which will have the same color as the original polygon) by adding diagonals, we obtain the following corollary. 6

Corollary 1. For each polygon partition of a rectangle satisfying the color conditions, there is a path from the left border of the rectangle to the right border of the rectangle using only borders of polygons of different color. Clearly, the borders of the figures taking part in the partitioning need not be straight lines. In topological terms, we can require that the small figures are homotopically equivalent to triangles and the big figure to a rectangle, that is, we require that there is a continuous transformation of the plane that maps each small figure to a triangle and the big figure to a rectangle. Indeed, an arbitrary partition of topologically connected parts can be simply defined with a continuous self-intersecting curve entering from the left border of the big picture and leaving from the right border of the picture, where, of course, the left and right borders have to be well defined.

References [1] G. Chartland and L. Lesniak, Graphs & Digraphs, Chapman & Hall/CRC, Boca Raton, 2005 (4th edition). [2] V. Halava, T. Harju, and L. Ilie, On a Geometric Problem of Zig-Zags, Inform. Proc. Letters, 62 (1997), 1 - 4. [3] J. R. Isbell, Epimorphisms and dominoes, Proceedings of the Conference on Categorial Algebra, La Jolla, 1965, Springer, 232 - 246 (1966). [4] J. M. Philip, A proof of Isbell’s Zig-Zag Theorem, J. Algebra, 32 (1974), 328 - 331.

7

Lemmink¨aisenkatu 14 A, 20520 Turku, Finland | www.tucs.fi

University of Turku • Department of Information Technology • Department of Mathematics

˚ Abo Akademi University • Department of Computer Science • Institute for Advanced Management Systems Research

Turku School of Economics and Business Administration • Institute of Information Systems Sciences

ISBN 952-12-1580-1 ISSN 1239-1891