• Aucun résultat trouvé

It will be as fleeting as a cool breeze upon the back of one’s neck.

— Joseph I. Guillotine

Guillotine cut is a technique of adaptive partition that has found interesting appli-cations in many geometric problems. Roughly speaking, a guillotine cut is a subdi-vision by a straight line that partitions a given area into at least two subareas. By a sequence of guillotine cut operations, we can partition the input area into smaller areas, solve the subproblems in these smaller areas, and combine these solutions to obtain a feasible solution to the original input.

In some applications of guillotine cut, there may be an exponential number of ways to form a feasible solution from the solutions of the subproblems. A few meth-ods have been developed to reduce the number of ways of combining the solutions of the subproblems and yet still preserve good approximation. In this chapter, we study the technique of guillotine cut and the related methods for combining the so-lutions of subproblems.

5.1 Rectangular Partition

We start with a geometric problem MIN-RP, which has a number of applications in engineering design, such as process control, layout for integrated circuits, and architectural design.

D.-Z. Du et al., Design and Analysis of Approximation Algorithms,

Springer Optimization and Its Applications 62, DOI 10.1007/978-1-4614-1701-9_5,

© Springer Science+Business Media, LLC 2012

165

Figure 5.1: A rectilinear polygon with holes.

MINIMUM EDGE-LENGTH RECTANGULAR PARTITION (MIN-RP):

Given a rectilinear polygon, possibly with some rectilinear holes, par-tition it into rectangles with the minimum total edge length.

In the above definition, by a hole in the input polygon, we mean a rectilinear polygon that may be completely or partially degenerated into a line segment or a point (seeFigure 5.1). The existence of holes in an input polygon makes a difference in the polynomial-time solvability of the problem: While the problem MIN-RP, in the general case, isNP-hard, the problem MIN-RP for hole-free inputs can be solved in timeO(n4), wheren is the number of vertices in the input rectilinear polygon. The polynomial-time algorithm for the hole-free MIN-RP is an application of dynamic programming, based on the following fact.

Lemma 5.1 Suppose that the inputRtoMIN-RPis hole-free. Then there exists an optimal rectangular partitionPforRin which each maximal line segment contains a vertex of the boundary.1

Proof.Consider a rectangular partitionPofRwith the minimum total length. Sup-poseP has a maximal line segment AB that does not contain any vertex of the boundary. Without loss of generality, let us assume it is a vertical line segment.

Then the two endpointsAandB of this line segment must lie on the interior of two horizontal line segments that are inP or in the boundary. Suppose there arer horizontal line segments touching the interior ofABfrom the right, andhorizontal line segments touching the interior ofAB from the left. We claim thatrmust be equal to. Indeed, ifr > (orr < ), then we can move the line segment AB to the right (or to the left, respectively) to reduce the total length of the rectangular partition (seeFigure 5.2(a)). This contradicts the optimality ofP.

Since r = , movingABto either the right or left does not increase the total length ofP. Let us keep movingAB to the left until it is not movable. Then the

1A maximal line segment in a partition is one that cannot be extended farther in either direction.

5.1 Rectangular Partition 167

(a)

B D

A C

F E

B A

(b)

Figure 5.2: (a) MovingABtowardCDwould reduce the total length ofP. (b) MovingABto the left and merging it withEF would reduce the total length ofP.

line segmentAB, in its final position, must meet either a vertex of the boundary or another vertical line segment inP. The latter case is, however, not possible: IfAB meets another line segmentEF inP, then they merge into one, and the total length of the rectangular partition is reduced, contradicting the optimality ofP again (see Figure 5.2(b)).

This proves that the line segment AB can be moved to meet a vertex of the boundary. We perform such movements for all line segments inPthat do not contain a boundary vertex, and the resulting partition has the required property and has the

same length asP.

From the above lemma, we can see that there are onlyO(n2)candidates for a line segment in an optimal rectangular partitionPsatisfying the property of Lemma 5.1: Let us define agrid pointto be the intersection point of any two lines that pass through a boundary vertex. Then one of the endpoints of a maximal line segment in P must be a boundary vertex, and the other one must be either a boundary vertex or a grid point (see Figure 5.3). Therefore, there are O(n2) such line segments.

This observation allows us to design a dynamic programming algorithm to solve the problem MIN-RP without holes in polynomial time (see Exercise 5.1).

When the input rectilinear polygon has holes, the problem MIN-RP becomes NP-hard. In the following, we apply the technique of guillotine cut to approximate this problem.

Aguillotine cutis a straight line that cuts through a connected region and breaks it into at least two subregions. A rectangular partition is called aguillotine rectan-gular partitionif it can be constructed by a sequence of guillotine cuts, each cutting through a connected subregion. It is not hard to see that the minimum-length guil-lotine rectangular partition of a given rectilinear polygon (possibly with holes) can be found in polynomial time. First, it can be proved by the argument similar to that of Lemma 5.1 that there exists a minimum-length guillotine rectangular partition in which every maximal line segment contains a vertex of the boundary. Moreover, the restriction of using only guillotine cuts in each step allows us to apply dynamic

Figure 5.3: The vertices of the boundary (dark circles) and the grid points (white circles) of a rectilinear polygon.

programming to this problem. That is, we can partition a rectilinear polygonRby first using a guillotine cut to break it into two or more smaller rectilinear polygons, and then recursively partition these new rectilinear polygons. In this recursive al-gorithm, there are, in each iteration,O(n)possible choices for the next guillotine cut. In addition, there are altogetherO(n4)possible subproblems, because each sub-problem’s boundary is composed of pieces of the input boundary plus at most four guillotine cut edges. Therefore, the minimum-length guillotine rectangular partition can be computed by dynamic programming in timeO(n5).

Since the minimum-length guillotine rectangular partition can be computed in polynomial time, it is natural to try to use it to approximate the problem MIN -RP. What is the performance ratio of this method? Unfortunately, no good bounds of the performance ratio have been found for the general case of MIN-RP. In the following, we present a special case for which this method has a nice performance ratio.

MIN-RP1: Given a rectangleRwith a finite number of points inside the rectangle, find a minimum-length rectangular partition of R, treating the given points as degenerate holes.

It has been proven that the restricted version MIN-RP1is stillNP-hard.

Theorem 5.2 The minimum-length guillotine rectangular partition is a2 -approxi-mation toMIN-RP1.

Proof.We follow the general approach of the analysis of approximation algorithms designed by the restriction method; that is, we will convert an optimal rectangular partition to a guillotine rectangular partition. To be more precise, letRbe an input rectangle to MIN-RP1, andPa minimum-length rectangular partition ofR. We are going to construct a guillotine rectangular partitionPG fromP such that the

5.1 Rectangular Partition 169 total edge length ofPGis at most twice the total edge length ofP. Therefore, the total length of an optimal guillotine rectangular partition cannot exceed twice the total edge length ofP.

In the construction, we will use guillotine cuts to divideRinto smaller rectangles and recursively partition these rectangles. We will call each intermediate rectangle created by guillotine cuts awindow(so that it will not be confused with the final rectangles created by partitionPG). For a windowW, we writeint(W)to denote the interior area ofW.

The guillotine cuts will add new edges toPG\P. In order to estimate the cost of these new edges, we will use acharging methodto charge the cost of each new edge inPG\Pto the edges in the original partitionP. The charging policy will be explained using the notion ofdark pointsin a windowW. We say a pointzin W is avertical (or,horizontal)1-dark pointwith respect to the partitionPand windowW if each vertical (or, respectively, horizontal) half-line starting fromz, but not including pointz, going in either direction meets at least one horizontal (or, respectively, vertical) line segment inP∩int(W). (In particular, a pointzon the boundary ofW is not1-dark.) In the construction, a new horizontal edgetis added toPG\Ponly if all of its points are vertical1-dark points, and so its cost can be charged to edges inPthat lie parallel tot.

To be more precise, the guillotine rectangular partitionPG can be constructed fromPby applying the following rules on each windowW, starting with the initial windowW =R:

(1) Ifint(W)does not contain any edge inP, then do nothing.

(2) If there exists a horizontal line segmentsinPthat cuts through the whole windowW, then we apply a guillotine cut toW along the line segments. (3) If there exists a vertical line segment sinP whose length inW ≥ h/2,

wherehis the height of the windowW, then we apply a guillotine cut toW alongs. The cut extendssto a line segment at most twice as long ass. (4) IfW contains at least one edge inPand yet neither case (2) nor case (3)

holds, then we apply toW a horizontal guillotine cuttthat partitionsW into two equal parts.

We note that in case (2), we did not introduce any new edge inPG\P, and so there is no extra cost. In case (3), the new edge added toPG\Phas total length

≤length(s). We charge the cost of this new edge to the line segments.

For case (4), we first claim that every point in the line segment tis a vertical 1-dark point. To see this, we assume, by way of contradiction, that there is a point z int that is not vertical 1-dark. Then the rectangle defined by the partitionP that containszmust have height at leasth/2. The boundary of this rectangle must contain either a horizontal segment inPthat cuts through the whole windowW or a vertical segment inP of length≥h/2, both cases contradicting the assumption of case (4). This proves the claim. Since each point intis vertical1-dark, we can charge the cost of each new edget1int∩(PG \P)as follows: We charge 1/2

Case (3) Case (4)

Figure 5.4: Constructing a guillotine partition from a given partition. (The arrows indicate how to charge its cost.)

of the cost oft1 to the horizontal line segments inPthat lie immediately above the line segmentt1, and the other1/2to the horizontal line segments inPthat lie immediately below the line segmentt1(seeFigure 5.4).

In the above charging policy, each vertical line segment inPis charged at most once with cost less than or equal to its own length. In addition, each horizontal line segment inPis charged at most twice, each time with cost less than or equal to1/2 of its length. To see this, we note that if a horizontal line segmentshas been charged once by a new line segmentt1inPGbelow it, thent1becomes the boundary of the new windows, and all points betweent1andsare non-1-dark in the new window containings. Thus, the line segmentscannot be charged again by any cut below it.

The above analysis shows that the total charge and, hence, the total length of added line segments inPG\Pcannot exceed the total length ofP.

Finally, we observe that each time we perform a guillotine cut, each new subwin-dow must contain fewer line segments inPthan the current window. Thus, after a finite number of guillotine cuts,int(W)no longer contains any line segment of P. This means that P ⊆ PG. In particular,PG covers every given point inR.

Thus,PGis a guillotine rectangular partition ofR. This completes the proof of the

theorem.

Since the optimal guillotine rectangular partitionQ can be computed in time O(n5), and since its total length does not exceed that ofPG, we get the following conclusion:

Corollary 5.3 The problemMIN-RP1has a polynomial-time2-approximation.