Geometric Multicut

We study the following separation problem: Given a collection of colored objects in the plane, compute a shortest"fence"$F$, i.e., a union of curves of minimum total length, that separates every two objects of different colors. Two objects are separated if $F$ contains a simple closed curve that has one object in the interior and the other in the exterior. We refer to the problem as GEOMETRIC $k$-CUT, where $k$ is the number of different colors, as it can be seen as a geometric analogue to the well-studied multicut problem on graphs. We first give an $O(n^4\log^3 n)$-time algorithm that computes an optimal fence for the case where the input consists of polygons of two colors and $n$ corners in total. We then show that the problem is NP-hard for the case of three colors. Finally, we give a $(2-4/3k)$-approximation algorithm.


Introduction
Problem Statement We are given k pairwise interior-disjoint sets B 1 , B 2 , . . . , B k in the plane, not necessarily connected. We want to find a covering of the plane R 2 =B 1 ∪B 2 ∪ · · · ∪B k such that the setsB i are closed and interior-disjoint, B i ⊆B i , and the total length of the boundary F = k i=1 ∂B i between the different setsB i is minimized.
We think of the k sets B i as having k different colours and each set B i as a union of simple geometric objects like circular disks or simple polygons. We callB i the territory of colour i. Examples are shown in Figs. 1 and 2. The "fence" F consists of the boundaries that separate the territories, or alternatively, F is the set of points belonging to more than one territory. As we can see, the fence does not have to be connected, and a territory can have more than one connected component.
An alternative view of the problem concentrates on the fence: A fence is defined as a union of curves F such that each connected component of R 2 \ F intersects at most one set B i . An interior-disjoint covering as defined above gives, by definition, such a fence. Likewise, a fence F induces such a covering, by assigning each connected Fig. 1 An instance with k = 2 sets, red and green, with two disks each; the big green disk is only partially shown. The optimal covering has a hippodrome-shaped red territory, with the small green disk as a hole, and an additional unbounded part of the green territory. The fence F has two components: the boundary of the hippodrome and the boundary of the small green disk Fig. 2 An instance of geometric 3-cut and a fence in black. The fence contains a cycle that does not touch any object. The grey fence shows how such a cycle can be shrunk without changing the total length of the fence (Lemma 2.2). We believe this to be the optimal fence. In any case, we can ensure that this fence is optimal by filling the territories more densely with objects of the appropriate colour component of R 2 \ F to an appropriate territoryB i . The total length of a fence F is also called the cost of F and is denoted as |F|.
In this paper, we will focus on the case where the input consists of simple polygons with disjoint interiors. We refer to this problem as geometric k-cut. Each input polygon is called an object. The results can be extended to more general shapes of objects as long as they are reasonably well behaved, but we refrain from trying to achieve greater generality. We use n to denote the total number of corners of the input polygons, counted with multiplicity.
Even in this simple setting, the problem poses both geometric and combinatorial difficulties. A set B i can consist of several objects, and the combinatorial challenge is to choose which of the objects should be grouped into the same component ofB i . The geometric task is to construct a network of curves that surrounds the given groups of objects and thus separates the groups from each other. For k = 2 colours, optimal fences consist of geodesic curves around obstacles, which are well understood. As soon as the number k of colours exceeds 2, the geometry becomes more complicated, and the problem acquires traits of the geometric Steiner tree problem, as shown in the example in Fig. 2.
Our Results In Sect. 3, we show how to solve the case with k = 2 colours in time O(n 4 log 3 n). (The running time is actually a tiny bit smaller, see Theorem 3.2.) The crucial observation is that the optimal fence must consist of line segments between corners of input polygons (Lemma 3.1). The algorithm is then straightforward. We consider the arrangement A formed by all these line segments. The shortest fence corresponds to a minimum cut in the dual graph of this arrangement. This is a planar graph, and for solving the multiple-source multiple-sink maximum flow problem in this graph, we can apply results from the literature.
The case with k = 3 colours is already NP-hard, as we show in Sect. 4 by a reduction from planar positive 1-in-3-sat (Theorem 4.7). The main feature of the gadgets in our reduction is that they have different optimal solutions (in a local sense) of equal length, thus allowing logical values to be represented and propagated. The analysis of our clause gadget, which captures the logical core of the reduction, is unfortunately quite involved and requires a large case distinction over several pages.
It is not known whether the decision version of geometric k-cut is in NP or not. Indeed, this seems to depend on the complexity of other problems such as the sum of square roots problem [17] and the Euclidean Steiner tree problem [11], both of which are not known to be in NP. See the remarks after Theorem 3.2.
In Sect. 5, we discuss an approximation algorithm. We first compare the optimal fence F A consisting of line segments between corners of input polygons to the unrestricted optimal fence F * , and in Theorem 5.1 we show that |F A | ≤ 4|F * |/3. The proof requires topological arguments (Lemma 5.2) as well as combinatorial arguments (Lemma 5.4). As in Sect. 3, restricting the solution to the arrangement A allows us to view the problem as a graph-theoretic problem. By applying a 1.2965-approximation algorithm for the k-terminal multiway cut problem [21], we obtain a polynomial-time 4/3 · 1.2965-approximation algorithm for geometric k-cut (Theorem 5.6).
Related Work Despite the fact that the problem is natural and fundamental, there is little previous work. The problem of enclosing a set of objects by a shortest system of fences has recently been considered with a single set B 1 by Abrahamsen et al. [1].
The task is to "enclose" the components of B 1 by a shortest system of fences. This can be formulated as a special case of our problem with k = 2 colours: We add an additional set B 2 , far away from B 1 and large enough so that it is never optimal to surround B 2 . Thus, we have to enclose all components of B 1 and separate them from the unbounded region. In this setting, there will be no nested fences. Abrahamsen et al. gave an algorithm with running time O(n polylog n) for the case where the input consists of n unit disks.
Some variations with additional constraints on the fence become NP-hard already for point objects with two colours. For example, if we require the fence to be a single closed curve, it has been observed by Eades and Rappaport [10] already in 1993 that one can model the Euclidean Travelling Salesman Problem of computing the shortest tour through a given set of sites by placing two tiny objects of opposite colour next to each site. If we require the fence to be connected, the same construction will lead to the Euclidean Steiner Tree Problem, which was shown to be NP-hard by Garey, Graham, and Johnson in 1977 [11].
Applications Besides being a natural problem in its own right, the geometric multicut problem may well find applications in image processing and computer vision. As we describe in Sect. 3, a problem closely related to the case k = 2 has been studied from the perspective of image segmentation. Simplified slightly, we are given a picture with some pixels known to be black or white, and we have to choose colours for the remaining pixels so as to minimize the boundary between black and white regions. The problem for k > 2 is equally well motivated in this context, although we have not found any explicit references to it (perhaps because of the NP-hardness which we will prove in this case).

Structure of Optimal Fences
Lemma 2.1 An optimal fence F * is a union of (not necessarily disjoint) closed curves, disjoint from the interior of the objects. Furthermore, if the objects are polygons, F * is the union of straight line segments of positive length. If two non-collinear line segments in F * have a common endpoint p that is not a corner of an object, then exactly three line segments meet at p, forming angles of 2π/3 with each other.
Proof We first prove that the curves in F * are disjoint from the interior of each object. To this end, consider any fence F in which some open curve π ⊂ F is contained in the interior of an object O ⊂ B i . Then the connected components of R 2 \ F on both sides of π must be part of the territoryB i . Hence, π can be removed from F while the fence remains feasible. That operation reduces the length, so F is not optimal.
We next show that F * is the union of a set of closed curves. Suppose not. Let F ⊂ F * be the union of all closed curves contained in F * and let π be a connected component in F * \ F . Then π is the (not necessarily disjoint) union of a set of open curves, which do not contribute to the separation of any objects. Hence, F * \ π is a fence of smaller length than F * , so F * is not optimal.
In a similar way, one can consider the union L of all line segments of positive length contained in F * , and if F * \ L is non-empty, a curve π in F * \ L can be replaced by a shortest path homotopic to it, which consists of a sequence of line segments. (See the proof of Lemma 5.2.) The last claimed property is shared with the Euclidean Steiner minimal tree on a set of points in the plane, and it can be proved in the same way, see for example Gilbert and Pollak [13]: suppose that the fence F contains two non-collinear line segments 1 and 2 sharing an endpoint p that is not a corner of an object. If the angle between 1 and 2 at p is less than 2π/3, then parts of 1 and 2 can be replaced by three shorter segments. Hence, the angle between segments meeting at p is at least 2π/3, and there can be at most three such line segments. If there are only two, one can make a shortcut. Therefore, there are exactly three segments, and they form angles of 2π/3.
As can be seen in Fig. 2, optimal fences may contain cycles that do not touch any object. By the following lemma, such cycles can be eliminated without increasing the length. This will be useful for the design of our approximation algorithm (Sect. 5).

Lemma 2.2
Let N be the set of corners of the objects in an instance of geometric k-cut. There exists an optimal fence F * with the property that F * \ N contains no cycles.
Proof Let us look at a connected component T of F * \ N . Since F * is a union of closed curves by Lemma 2.1, it follows that the leaves of F * \ N are in N . All other vertices have degree 3, and the incident edges meet at angles of 2π/3. If T contains a cycle C, we can push the edges of C in a parallel fashion (forming an offset curve), as shown in Fig. 2. This operation does not change the total length of T . This can be seen by looking at each degree-3 vertex v individually: We enclose v in a small equilateral triangle whose sides cut the edges at right angles, see Fig. 3. It is a well-known geometric fact that the sum of the distances from a point v inside an equilateral triangle to the three sides is constant. (This can be seen by observing that each distance is proportional to one of the barycentric coordinates of v, and that the three proportionality factors are the same in case of an equilateral triangle.) This implies that the length of the fence inside the triangle is unchanged by the offset operation. The portions of C outside the triangles are just translated and do not change their lengths either.
As we offset the cycle C, an edge of C must eventually hit a corner of an object. Another conceivable possibility is that an edge of C between two degree-3 vertices is reduced to a point, but this would lead to an optimal fence with two non-collinear segments sharing an endpoint and forming an angle of π/3, violating Lemma 2.1. In this way, the cycles of T can be eliminated one by one. We mention that the restriction of objects to polygonal shapes is not crucial for Lemmas 2.1 and 2.2. If objects have curved boundaries, the fence consists of straight segments that are disjoint from the interior of the objects, plus portions of object boundaries.

The Bicoloured Case
In this section we consider the case of k = 2 colours. Let N be the set of all corners of the objects. A line segment is said to be free if it is disjoint from the interior of every object. A vertex v of an optimal fence cannot have degree 3 or more unless v ∈ N , as otherwise two of the regions meeting at v would be part of the same territory and could be merged, thus reducing the length of the fence. We therefore get the following consequence of Lemma 2.1.

Lemma 3.1 An optimal fence consists of free line segments with endpoints in N .
Let S be the set of all free segments with endpoints in N . S includes all edges of the objects. Let A be the arrangement induced by S, see Fig. 4. Consider an optimal fence F * and the associated territoriesB 1 andB 2 . Lemma 3.1 implies that F * is contained in the edges and vertices of A. Thus, each cell of A belongs entirely either toB 1 or B 2 . The objects are cells of A whose classification (i.e., membership ofB 1 versusB 2 ) is fixed. In order to find F * , we need to select the territory that each of the other cells belongs to. Since |S| = O(n 2 ), A has size O(|S| 2 ) = O(n 4 ) and can be computed in O(|A|) = O(n 4 ) time [7]. For simplicity, we stick with the worst-case bounds. In practice, set S can be pruned by observing that the edges of an optimal fence must be bitangents that touch the objects in a certain way, because the curves of the fence are locally shortest.
Finding an optimal fence amounts to minimising the boundary betweenB 1 and B 2 . This can be formulated as a minimum-cut problem in the dual graph G(V , E) of the arrangement A. There is a node in V for each cell and a weighted edge in E for each pair of adjacent cells: the weight of the edge is the length of the cells' Fig. 4 Left: the arrangement A induced by an instance of geometric 2-cut with two green and two red objects. The dual graph G is blue. Right: the optimal solution common boundary. Let S 1 , S 2 ⊂ V be the sets of cells that contain the objects of B 1 , B 2 , respectively. We need to find the minimum cut that separates S 1 from S 2 . This can be obtained by finding the maximum flow in G from the sources S 1 to the sinks S 2 , where the capacities are the weights. Such a maximum flow can be computed in strongly polynomial time. As G is a planar graph, we can use the algorithm by Borradaile et al. [4] with running time O(|V | log 3 |V |). The running time has since then been improved to O(|V | log 3 |V |/log 2 log |V |) by Gawrychowski and Karczmarz [12]. As |V | = O(|S| 2 ) = O(n 4 ), we obtain the following theorem. A Note on the Machine Model Theorem 3.2 assumes that edge weights can be added and subtracted in constant time. As the edge weights are Euclidean distances, whose computation involves square roots, this is only warranted if we work in the real-ram model of computation, which is appropriate for geometric algorithms [19].
In the Turing machine model, the exact comparison of sums of square roots is difficult [17], and geometric 2-cut is not known to be even in NP, a property that it shares with many other geometric optimisation problems such as the Euclidean Travelling Salesman Problem or the Euclidean Minimum Spanning Tree Problem [11].
Related Algorithms A similar algorithm has been described before in a slightly different context: image segmentation [14], see also [4]. Here, we have a rectangular grid of pixels, each having a given gray-scale value. Some pixels are known to be either black or white. The remaining pixels have to be assigned either the black or the white colour. Each pixel has edges to its (at most four) neighbours. The weights of these edges can be chosen in such a way that the minimum cut problem corresponds to minimising a cost function consisting of two parts: One part, the data component, has a term for each pixel, and it measures the discrepancy between the gray-value of the pixel and the assigned value. The other part, the smoothing component, penalises neighbouring pixels with similar gray-values that are assigned different colours.
Alternative Approaches The running time of roughly n 4 in Theorem 3.2 is rather high. In many instances, the arrangement A might be much smaller than the worst case, and then the algorithm will of course benefit. The O(n 4 ) complexity is due to the inclusion of all intersections between the O(n 2 ) potential line segments. We are rewarded because this turns the problem into a problem on a planar graph, and therefore the effort for obtaining a maximum flow adds only a polylogarithmic factor. On the other hand, finding the minimum cut in the arrangement A is some sort of overkill, since it optimises also weird types of fences that zigzag through the arrangement, while we know that optimal fences can only bend at object corners.
It would be nice to work only with the O(n 2 ) line segments without their crossings. We have considered an incremental approach that turns red objects into green objects one by one and determines the green territories that should be merged, by computing the boundary cycle of the resulting larger territory. However, a preliminary estimate indicated that this approach would not be competitive with the algorithm of Theorem 3.2, unless it is combined with new ideas.

Hardness of the Tricoloured Case
We show how to construct an instance I of geometric 3-cut from an instance of planar positive 1-in-3-sat. For ease of presentation, we first describe the reduction geometrically, allowing irrational coordinates. We prove that if is satisfiable, then I has a fence of a certain cost M * , whereas if is not satisfiable, then the cost is at least M * + 1/50. This gap of 1/50 allows us to slightly move the corners into a new instance I with rational coordinates, while still being able to distinguish whether is satisfiable or not, based on the cost of an optimal fence.
In order to make the geometric part of the proof as simple as possible, we introduce a new specialised problem, coloured trigrid positive 1-in-3-sat, by endowing the instances with additional geometric and combinatorial structure (in the form of a double edge colouring). • G( ) is a subgraph of the infinite regular triangular grid in the plane, which is composed of equilateral triangles of side length 1. • For each variable x, there is a simple cycle v x .

Auxiliary NP-Complete Problems
• For each clause C = {x, y, z}, there is a path P C and three vertical paths C x , C y , C z with one endpoint at a vertex of P C and one at a vertex of each of v x , v y , v z . • Except for the described incidences, no edges share a vertex. • All vertices have degree 2 or 3.
• Any two adjacent edges form an angle of π or 2π/3. • The number of vertices is bounded by a quadratic function of the size of .
Mulzer and Rote [20] showed that another problem, planar positive 1-in-3-sat, is NP-complete, which is similar but uses a slightly different plane embedding with axis-parallel segments: The variables are represented by disjoint line segments on a horizontal line ; and each three-legged clause looks like a rotated E-shape and lies above or below . Figure 5 shows how such an instance can be easily converted to follow the conventions of Definition 4.1. It follows that trigrid positive 1-in-3-sat is also NP-complete.
The idea of our reduction to geometric 3-cut is to thicken the edges of G( ) into channels of width 1/2, as illustrated in Fig. 6. A channel contains small inner objects and is bounded by larger outer objects of another colour. There will be two

Fig. 5
Left: an instance of planar positive 1-in-3-sat for the formula which are represented as rotated E-shapes. Right: a corresponding instance of trigrid positive 1-in-3-sat. The paths representing the three clauses are highlighted. Clause vertices are drawn as dots and branch vertices as boxes 1 2 Fig. 6 Illustration of a section of a channel with red outer objects and six green inner objects, centred around an edge of the graph G( ) (the dashed line), and two ways of separating the different colours. The solution on the left will be called the inner solution because the empty part inside the channel is assigned to the same territory as the inner objects. The solution on the right is called the outer solution equally good ways to separate the inner and outer objects, namely long fences along the boundaries of the channel and individual fences around the inner objects. Any other way of separating the inner from the outer objects will turn out to require more fence. These two optimal ways of separating the colours are used to represent the truth values.
We will now be more specific. Consider an instance ( , G( )) of trigrid positive 1-in-3-sat. There are some vertices of degree three on the cycles v x corresponding to each variable x in , and these are denoted as branch vertices. There is also one vertex of degree three on the path P C corresponding to each clause C in , which we denote as a clause vertex. These are the only vertices of degree 3.
We consider G( ) as a subset of the plane and remove all clause vertices. This splits G( ) into one connected component E x for each variable x of . We build one channel around each set E x , including the bends and branch vertices, and we will ensure that there are two equally good ways to separate the inner and outer objects throughout the whole channel. These two choices, along the boundaries or around each inner object individually, play the roles of x being false and true, respectively.
At the clause vertices where three regions E x , E y , E z meet, we make a clause gadget that connects the three channels of x, y, z. The objects in the clause gadget can be separated using the least amount of fence if and only if one of the channels is in the state corresponding to true and the other two are in the false state. Therefore, this corresponds to the clause being satisfied in the sense that exactly one variable is true.
In order to make this idea work, we first assign two colours to every edge of G( ): an inner and an outer colour from the set {red, green, blue}. These will be used as the colours of the inner and outer objects of the channel. The colouring must have the following properties: 1. The inner and outer colours of every edge are distinct. 2. Any two adjacent collinear edges have the same inner or the same outer colour (or both). 3. Any two adjacent edges that meet at an angle of 2π/3 at a non-clause vertex have the same inner and the same outer colour. 4. The inner colours of the three edges meeting at a clause vertex are red, green, blue in clockwise order, while the outer colours of the same edges are blue, red, green, respectively.
We now introduce the problem coloured trigrid positive 1-in-3-sat, which we will reduce to geometric 3-cut, see Fig. 7.

Definition 4.2
In coloured trigrid positive 1-in-3-sat, we are given an instance ( , G( )) of trigrid positive 1-in-3-sat together with a colouring of the edges of G( ) satisfying the above four requirements. We want to decide whether has a satisfying assignment in the sense of positive 1-in-3-sat (Definition 4.1).

Lemma 4.3 The problem coloured trigrid positive 1-in-3-sat is NP-complete.
Proof Membership in NP is obvious. For NP-hardness, we reduce from trigrid positive 1-in-3-sat. Let ( , G( )) be an instance of the latter. We assume that all vertical paths C x have length at least 4. This can be achieved by stretching them vertically, as shown in Fig. 7, or simply by scaling the whole graph by a factor of 4.
We colour each triple of edges meeting at a clause vertex according to requirement 4. Then, in each clause path P C , we simply continue the colouring from the edges incident to the clause vertices in both directions, and also to the first edge of the vertical paths C x incident to the endpoints. For all branch vertices and all cycles v x we choose red as the outer colour and blue as the inner colour, and this colouring is also used for the first edge on each incident vertical path C x . It remains to colour the "interior" edges of the vertical paths C x . Since each vertical path has at least four edges and only the colours of the first and last edges have been fixed, it is possible to change inner or outer colour three times. It is easy to check that this is sufficient to interpolate between any combination of colours at the boundary edges. There are six possible combinations of inner and outer colours: G), and (G, B), denoting the three colours by R, B, G. These combinations can be arranged in a cycle of length six, so that it is possible to get from one combination to an adjacent one by changing the inner or the outer colour: inner: outer: Each colour change is denoted by a vertical bar. It follows that one can get from any combination to any other in at most three steps. The maximum number of changes is needed when the inner and outer colours have to be swapped.
Therefore, it is possible to adjust the colours so that the entire path gets coloured. We have hence constructed an instance of coloured trigrid positive 1-in-3-sat.

Building a geometric 3-sat Instance from Tiles
Consider an instance ( , G( )) of coloured trigrid positive 1-in-3-sat that we want to reduce to geometric 3-cut. We use hexagonal tiles of six different types, namely straight, inner colour change, outer colour change, bend, branch, and clause tiles. Each tile is a regular hexagon with side length 1/ √ 3 and hence has distance 1 between opposite sides.
Every tile is placed with its centre at a vertex p of G( ), and rotated so that it has two horizontal edges. Thus, each edge of G( ), which has length 1, connects the centres of two adjacent tiles. Let G p be the part of the graph G( ) within distance 1/2 from p. Figure 8 shows the tiles and how they are placed according to the shape and colours of G p .
In order to define the objects of a tile, we take the offsets of the edges of G p at distance 1/4 on both sides, as shown in Fig. 8. Such an offset is obtained by translating each edge of G p parallel to itself. The moving edges are shortened or extended to meet adjacent moving edges in common endpoints. The region between the offset curves contains all points at distance at most 1/4 from the edges of G p . In the bend tile, this region contains also some points of larger distance because an offset of a reflex angle is formed. The largest distance occurs for the vertex q: it has distance 1/ √ 12 from p. The offset polygons partition the tile into an inner and an outer region. The outer objects cover the outer region completely. Every point in the outer region is coloured with the outer colour of the closest edge in G p . The inner region is mostly empty, except for the inner objects described in each case below.
We place the origin at the centre p = (0, 0). We describe each tile in one selected orientation, as shown in Fig. 8; the tiles can be rotated by multiples of π/3. In each case, we assume that G p contains the vertical segment from p upwards to (0, 1/2).
The Straight Tile: This is used when two collinear edges meet at p with the same inner and outer colour. There are four axis-parallel squares of the inner colour of G p with side length 1/8 centred at (±(1/4 − 1/16), ±1/4). This size is chosen so that Rotations by ±2π/3 around p give the remaining points in the tile. The point c and its images c 1 , c 2 form an equilateral triangle with side length 2x ≈ 0.2034 their total perimeter is 2 and equals the length of the boundary between the inner and outer regions.
The Inner Colour Change Tile: This is used when two consecutive collinear edges have different inner colours. In addition to the four squares of the previous case, there are four smaller axis-parallel squares with side length 1/28 centred at (±(1/4 − 1/56), ±1/56). Each square is coloured in the inner colour of the closest point in G p . The size of the small squares is chosen so that they can be individually enclosed using fences of total length 2 × 7 × 1/28 = 1/2, which is the width of the inner region.
The Outer Colour Change Tile: This is used when two consecutive collinear edges have different outer colours. There are four axis-parallel squares of the inner colour of G p with side length 3/32. Their centres are (±(1/4 − 3/64), ±1/4). The size of these squares is chosen so that their total perimeter is 2 − 1/2 = 3/2.
The Bend Tile: If two non-collinear edges meet at p, we use a bend tile. We place an axis-parallel square with side length x = (6 + √ 3)/72 and centre (−(1/4−x/2), 1/4) and another with side length y = (6 − √ 3)/48 and centre (1/4 − y/2, 3/8). We place symmetric squares across the symmetry line b. One of the outer objects has a concave corner q with exterior angle 2π/3. We place a parallelogram at this corner, of side length x, with two edges running along the edges of the outer object. The boundary between the inner and the outer region has a total length of (1 − √ 3/6) + (1 + √ 3/6) = 2. The inner objects are chosen so that the total perimeter of the two small squares, 8y = 1 − √ 3/6, as well as the total perimeter of the three larger objects, 12x = 1 + √ 3/6, equals the length of the respective boundary on which these objects abut.
The Branch Tile: This is used when p is a branch vertex. We place axis-parallel squares of side length y = (6 − √ 3)/48 centred at (±(1/4 − y/2), 3/8) and their rotations around p by angles 2π/3 and 4π/3. The boundary between the inner and the outer regions has total length of (6 − √ 3)/2, and the total perimeter of the inner objects is also 24y = (6 − √ 3)/2. The Clause Tile: It is used for a clause vertex, and it is described in the caption of Fig. 8.

Solving the Tiles Locally
Let an instance I of geometric 3-sat be given together with a fence F. We will consider the restriction of I to a polygon P, which is a tile or a part of a tile. In this way, we only have to look at problems of constant size. The part of the fence F ∩ P inside P can be expressed as a union of (not necessarily disjoint) closed curves and open curves with endpoints on the boundary ∂ P. An open curve must be contained in a larger closed curve of F that continues outside P.
Note that F ∩ P has the property that if a path π ⊂ P connects two objects in P of different colour, then π intersects F ∩ P. We call a union of closed and open curves in P with this property a solution to I ∩ P. Clearly, this is a necessary condition for a set of curves to be extensible to a fence F for the full instance. In the following, we analyse the solutions to the tiles defined in Sect. 4.2, and we characterise the solutions of minimum cost. We say that two closed curves (disjoint from the interiors of the objects) are homotopic if one can be continuously deformed into the other without entering the interiors of the objects. Two open curves with endpoints on the boundary of the tile are homotopic if they can be extended outside the tile to two homotopic closed curves.
The following lemma characterises the optimal solutions to each type of tile. The statement is that if a solution is not too much more expensive than the solutions shown in Fig. 9, then it will contain curves homotopic to each curve in one of the solutions in the figure.
Lemma 4.4 Figure 9 shows optimal solutions to each kind of tile. The cost in each case is: • Straight tile: 2.
• Inner colour change tile: 5/2. Moreover, if the cost of a solution F to a tile T exceeds the optimum by less than 1/50, then F is homotopic to one of the optimal solutions F * of T in the following sense: For each curve π * in F * , there is a curve π in F homotopic to π * . If π * is a closed curve, the distance from any point on π to the closest point on π * is less than (1/8 + 1/100) 2 − (1/8) 2 < 0.06. If π * is an open curve and π * has an endpoint f * , there is a corresponding endpoint f of π with f * f < 1/10.

Proof
We assume again that the origin is at the centre p = (0, 0) of the tile T , and we assume that the orientation and colours are as in Fig. 8.
For each tile T , G p consists of the two or three half-edges of G( ) meeting at p, and it separates T into two or three pieces. The pieces are two pentagons for the straight, inner colour change, and outer colour change tiles; a pentagon and a nonconvex heptagon for the bend tile; and three pentagons for the branch and the clause tiles.
For each tile type except the clause tile, we consider each such piece T separately and check the minimum cost of a solution to T . Since these pieces contain few objects, it is easy to compute the optimal solutions. For example, consider the simplest instance: the left half-tile T of the straight tile. The fence runs inside a 1/4 × 1 1 8 < 0.04 Fig. 10 Left: a square of side length 1/8. The red curve encloses all curves of length at most 1/2 + 1/50 that enclose the square. One such curve with maximum deviation from the boundary of the square is drawn in black. The red curve consists of eight elliptic arcs. Middle and right: a solution to the straight tile in the outer resp. inner state with a cost that exceeds the optimum by 1/50 rectangle containing two small blue squares. There are two possibilities: The two blue squares can be in the same connected component of the blue territory or in two different components. These components may be disjoint from the boundary or touch the boundary of T . In the first case, the fence must contain a closed curve surrounding the blue object(s) in it. In the second case, the fence is a curve between two boundary points. In each case, it is easy to calculate (or even to see) what the optimal solution is and, by comparing all possibilities, one finds that there are the two optimal solutions shown in the first two pictures of Fig. 9. The solution in the right half must be symmetric to the left half in order to produce a solution to the whole tile T . In a similar way, one can treat the other tiles. We omit the details, but we will give the full proof for the most complicated case: the clause tile. Here, it is not true that a solution to the complete tile can be obtained by combining optimal solutions of the three smaller pieces. As this proof requires an extensive case analysis, it is deferred to Lemma 4.5.
It turns out that for each piece T of the first five tile types, there are two solutions, and they are as shown in Fig. 9. One solution corresponds to the outer state and the other to the inner state. In order to be combined to a solution for all of T , each of the two or three pieces T needs to be in the same state. Thus, the solutions shown in Fig. 9 are all the optimal solutions.
By analysing the cases more carefully, one obtains a stronger claim that any solution F that is not homotopic to an optimal solution has a cost that exceeds the optimal cost by more than 1/50. (Again, we give the detailed analysis only for the clause tile in Lemma 4.5 below.) Consider therefore a solution F whose cost exceeds the cost of a homotopic optimal solution F * by less than 1/50. In order to decide how much F can deviate from F * , consider the straight tile as an example, see Fig. 10. In the outer state, each curve enclosing an inner object has length at least 1/2. Since the total cost is less than 2 + 1/50, each curve has length less than 1/2 + 1/50. An elementary analysis gives that a closed curve of length at most 1/2 + 1/50 which encloses a square of side length 1/8 is within distance (1/16 + 1/100) 2 − (1/16) 2 < 0.04 from the boundary of the square. For the inner state, consider the curve π ⊂ F in the right side of the tile that has the inner objects to the left. The length of π has to be less than 1 + 1/50 in order for the total cost to be less than 2 + 1/50. Note that π has to pass through the upper right corner (1/4, 5/16) of the upper right square. Therefore, π has to meet the top edge of T at a point within distance (3/16 + 1/50) 2 − (3/16) 2 < 0.09 from the corresponding endpoint (1/4, 1/2) of π * . The other non-clause tiles are analysed in a similar way.
The largest possible deviation between a closed curve in F and F * appears for the clause tile, since it contains an inner object with the longest edge of all tiles, namely a triangle with an edge of length 1/4. This leads to a deviation of less than (1/8 + 1/100) 2 − (1/8) 2 < 0.06. Likewise, the largest possible deviation between open curves is 1/10, as realised in the clause tile and described in Lemma 4.5.
It remains to analyse the optimal solutions of the clause tile. We name objects in the clause tile as shown in Fig. 11. Indices are taken modulo 3. The optimal solutions are covered by Case 2.3 in the proof.  Fig. 13, Case 2.3 for an illustration of the case i = 0):

Moreover, if the cost is less than
• a curve from f i ∈ a i a i to b i , where f i a i < 1/10, • a curve from f i ∈ a i a i to b i , where f i a i < 1/10, • a curve from f i+1 ∈ a i+1 a i+1 to b i+1 , where f i+1 a i+1 < 1/10, • a curve from f i+1 ∈ a i+1 a i+1 to b i+1 , where f i+1 a i+1 < 1/10, • a curve from c i+1 to c i+2 , • a curve from c i to b i+2 , • a curve from c i+2 to b i+2 .
Proof Clearly, F must contain segments d i c i , e i b i , and e i b i+2 on the shared boundary of two objects of different colour, for i = 0, 1, 2. In total, this amounts to 3 d 0 c 0 + 6 e 0 b 0 . In the following, we argue about the fence needed in addition to that, i.e., the part of F contained in the closed 15 We characterise how the solution looks when the additional cost in T is at most the critical threshold with the quantity x that was defined in Fig. 8. When we say that the solution must contain a curve or a tree with certain properties (such as connecting two specific points), we mean such a curve or tree inside T . We define a domain as a connected component of a territory inside a tile. Two different domains might conceivably be connected outside the tile, but we are interested only in the local situation. For this definition, we also do not consider the common point e i+1 of objects O i and I i+1 as providing a connection between them. We only consider connections in T . Since a territory is a closed set by definition, the interior of a domain might be disconnected.
We define the cases by specifying which objects are in the same domain. After making enough assumptions in one branch of the case analysis, we will conclude that the solution must connect certain groups of points. In most cases, this allows us to derive a lower bound on the cheapest solution, which is above 1.684. In the case that contains the optimal solution, all objects of different colours will be separated, and then we state what the solutions satisfying the specific assumptions are.
The shortest connection network for a specified set of terminal points is a geodesic variation of the geometric Steiner tree problem, where the network is constrained to lie in the region T . It is usually easy to restrict the structure of the shortest connection network to a few possibilities, using geometric criteria such as that an angle less than 2π/3 between incident edges is forbidden unless it is blocked by an object. We will often refer to the Fermat point F of three given points A, B, C: the point minimising the sum of distances to the tree points. If all angles in the triangle ABC are less than 2π/3, F lies in the interior of this triangle. The three segments to F A, F B, FC make equal angles 2π/3 at F and they form the minimal Steiner tree of A, B, C.
Once the combinatorial structure of a potential solution was specified, we have used the Geogebra software [15] to construct the solution from the geometric constraints and to estimate its costs numerically, and also for producing the illustrations. We will report the costs rounded to three digits; this precision is sufficient for the comparisons.
Note first that for i = 0, 1, 2, in order to separate O i from I i , the solution must contain a curve (in T ) starting at b i that has a length of at least 0.24, and similarly one from b i in order to separate O i from I i . The prefixes of length 0.24 of these six curves are disjoint. We can therefore charge 0.24 to each b i and b i , unless this point is already connected otherwise. The shortest possible cost of 0.24 arises when b i is connected to a i and b i to a i . All possibilities of a different structure (for example, connecting b i , b i with each other or to c i and c i+1 , respectively) cost at least 0.25.
In the discussion of the cases it will often happen that an object I i or I i is in a different domain than all other objects of the same colour. In this case, we say that I i or I i is isolated.

Proposition 4.6 • If the object I i is isolated, the solution must contain a curve from b i to c i inside the tile. • If the object I i is isolated, the solution must contain a curve from b i to c i+1 inside the tile.
Proof If I i is isolated, it is separated from all other objects in the tile, of whatever colour. Thus there must be curve between b i and c i within the tile, or two curves that go from b i and c i to the boundary and continue outside. The second case is excluded by the following calculation: The shortest connection from c i to the boundary has length ≈ 0.441. To this, we have to add 6 × 0.24 = 1.44 for and this is far more than 1.684 in total. The statement about I i is analogous.
We now start the case distinction. There is also a symmetric version of these trees. The optimal cost is ≈ 0.874. Adding the 4 × 0.24 = 0. 96 charged to b 1 , b 1 , b 2 , b 2 , we get significantly more than 1.684.  2 charged to b 0 , b 1 , b 1 , b 2 , b 2 O 1 is not in a domain with I 2 (and with I 2 ). There is a curve from b 1 to b 1 , bounding the domain of O 1 ∪ O 1 , and this curve can be continued from b 1 to c 2 , and from c 2 to b 2 (because of the isolated object I 2 ). Thus, as in the previous Case 2.1.3.1, but for a different reason, we must have a curve connecting b 1 and b 2 , and therefore the solution cannot be better than that solution.
The shortest solution that has all necessary connections consists of segments from b 0 , b 1 , c 2 to their Fermat point and the segments b 0 c 1 , b 1 c 2 , b 2 c 2 , b 2    In order to separate I 0 ∪ I 0 from O 0 and O 0 , the solution either contains a curve from b 0 to b 0 or curves from b 0 and b 0 to the boundary segment a 0 a 0 . We consider the latter option, which is 0.02 cheaper. It will follow from the analysis that even this is too expensive to get below M + 0.02. The alternative choices of connecting b 0 and b 0 also do not interfere with the optimal connections between the remaining points.
The individual cases are shown in Fig. 13.
area that the tiles cover (i.e., A is a union of the hexagons). We will cover any holes in A with completely red tiles, and place red tiles all the way along the exterior boundary of A. Let R be the set of these added red tiles and let I be the resulting instance of geometric 3-cut. It is now trivial how to place the fences in I everywhere except in the interior of A. Consider a fence F to the obtained instance with cost M. Let M * be the sum of the cost of an optimal solution to each tile in T plus the cost of the fence that must be placed along the boundaries of the added red tiles in R. We claim that if is satisfiable, then a solution realising the minimum M * exists. Furthermore, if M < M * + 1/50, then is satisfiable.
Suppose that is satisfiable and fix a satisfying assignment. Consider a clause tile where E x , E y , and E z meet. Now, we choose the v-outer state, where v ∈ {x, y, z} is the variable that is true. For each non-clause tile that covers a part of E w for a variable w of , we choose the outer state if w is true and the inner otherwise. It is now easy to see that the curves form a fence of the desired cost.
On the other hand, suppose that M < M * + 1/50. It follows that in each tile in T , the cost exceeds the optimum by at most 1/50. Hence, the solution in each tile is homotopic to one of the optimal states as described in Lemma 4.4. We now claim that the states of all tiles representing one variable must agree on either the inner or outer state. Consider two adjacent tiles where one is in the inner state. There are open curves with endpoints on the shared edge of the two tiles with a distance of more than 1/2 − 2 · 1/10 = 3/10. The other tile cannot be in the outer state, because then there would have to be an extra open curve of length at least 3/10 to connect those endpoints. It follows that the other tile must also be in the inner state. Thus, both tiles are either in the inner or in the outer state, as desired.
We now describe how to obtain a satisfying assignment of . Consider a clause tile where E x , E y , and E z meet and suppose the tile is in the x-outer state. It follows from the above that each tile covering E x is in the outer state or, in the case of the clause tile, in the x-outer state. Similarly, each non-clause tile covering only E y (resp. E z ) is in the inner state and each clause tile covering a part of E y (resp. E z ) is not in the y-outer (resp. z-outer) state. We now set x to true and y and z to false and do similarly with the other clause tiles, and it follows that we get a solution to .
So far, we have described the construction geometrically. Since regular hexagons are involved, this requires irrational coordinates. We will now approximate each object O from inside by an object O with rational coordinates. For this purpose, we replace every corner v by a substitute v ∈ O with vv < 1/(200n). See Fig. 14 for an example. If v is a concave corner, like v 3 in the example, we require that the closest point to v on the boundary should be the point v. This restricts v to an angular region between two normals to the edges incident to v.
Since the objects in our instance have no sharp angles (the smallest angle b 0 c 0 e 0 ≈ 24 • occurs in the clause tile) and there is only one concave angle of size 2π/3, namely in the bend tile, there is plenty of room for choosing the points v , and it is easy to find points with small rational coordinates. In fact, we can choose all coordinates be multiples of 1/(2000n), so that they require only logarithmically many bits.
This results in an instance I where all objects are subsets of corresponding objects in I . Let C and C be the cost of the optimal solutions to I and I , respectively, and note that C ≤ C, as any solution to I is also a solution to I . We claim that C < C +1/100. To prove this, consider a solution F to I . If F contains parts in the interior of an object O of I , we move these parts to the boundary of O as follows. Let We now describe the modification we make on F in order to avoid O. If F intersects some edge region E i , we project each point in F ∩ E i to the closest point on v i v i+1 . This does not increase the length of the curve. However, this may disconnect the fence when it winds around a corner between v i and v i . For this purpose, we add a cap p i v i ∪ v i q i around each convex vertex v i . Parts of the fence F close to the corners which are inside O but not in one of the edge regions E i are simply discarded. The caps ensure that no connectivity is lost. We perform these operations for every object.
The modifications of F made to avoid the objects of I do not increase the length, except for the added caps, which have total length less than n × 1/(100n) = 1/100. Hence, C < C + 1/100.
Let M := 100 M * /100, so that M is rational and M * ≤ M < M * + 1/100. We conclude by observing that if C ≤ M , then C < C + 1/100 < M + 1/100 < M * + 1/50, and thus is satisfiable. On the other hand, if is satisfiable, then C ≤ C = M * ≤ M . We can thus tell whether is satisfiable or not by evaluating whether C ≤ M .

Approximation Algorithm
The approach for k = 2 from Sect. 3 does not extend to k ≥ 3 because Lemma 3.1 does not apply: The arrangement A (formed by the free segments between the corners N of the input objects) is no longer guaranteed to contain an optimal fence, see Fig. 2.
However, we can follow the approach of Sect. 3 and still hope to get an approximate solution in A: We show that the optimal fence F A contained in A has a cost which is at most 4/3 times higher than the true optimal fence F * (Sect. 5.1). We construct a corresponding lower-bound example with |F A | > 1.15 · |F * |. (This factor is the conjectured Steiner ratio, see Sect. 5.2.) This reduces the problem to a graph-theoretic problem: the coloured multiterminal cut problem in the weighted dual graph G = (V , E) of A. We have terminals of k ≥ 3 different colours and want to make a cut that separates every pair of terminals of different colours. This problem is NP-hard, but we can use approximation algorithms, see Sect. 5.3.
Proof By Lemmas 2.1 and 2.2, we know that after cutting an optimal fence F * at all points of N , the remaining components are Steiner minimal trees with leaves in N and internal Steiner vertices of degree 3, where three segments make angles of 2π/3. Consider such a Steiner tree T (Fig. 15 a). Since T is embedded in the plane, the leaves can be enumerated in cyclic order as v 1 , . . . , v m . We will replace T by a connected systemT of fences that connects the same set of leaves v 1 , . . . , v m , but contains only segments from the arrangement A. Furthermore, we prove that the total length ofT is bounded as |T | ≤ 4|T |/3. Thus, carrying out this replacement for every Steiner tree leads to the fence F A of the desired cost. If T consists of a single segment, we definē T to be the same segment, in which case trivially |T | ≤ 4|T |/3. Assume therefore that T has at least one Steiner vertex.
Let T i j be the path in T from v i to v j . For each pair {i, j}, we define the pathT i j as the shortest path with the properties that (a)T i j has endpoints v i and v j , and (b)T i j is homotopic to T i j : this means that T i j can be continuously deformed intoT i j while keeping the endpoints fixed at v i and v j , without entering the interiors of the objects.
It is clear that (c)T i j is contained in the arrangement A, and (d)T i j is at most as long as T i j .
We will constructT as the union of pathsT i j that are specified by a certain set S of leaf pairs {i, j}, and we will show that its total length is bounded, |T | ≤ 4|T |/3. The fact that F A is a valid fence is ensured by our choice of the set S, which we will now discuss.
If we overlay all paths T i j for {i, j} ∈ S, we get a multigraph T , which has the same vertices as T and uses the edges of T , some of them multiple times. We require these three properties: 1. Every edge of T is used once or twice in T . Fig. 15 a Steiner tree T with five terminals v 1 , . . . , v 5 , which is part of a larger fence system F * . Steiner vertices are white, leaves are black. b The transformed graphT , formed as the union of three shortest homotopic pathsT 15 ,T 24 , andT 35 2. Every Steiner vertex of T has even degree (4 or 6) in T . (By contrast, the degree in T is always 3.) 3. Any two paths T i j and T i j with {i, j}, {i , j } ∈ S that have a point of T in common must cross in the following sense: If we assume, by relabelling if necessary, If the multigraph T is indeed constructed as the overlay of paths T i j , property 2. is a consequence of 1. We will in fact construct the set S of pairs indirectly, through the multigraph T . We will show that, once properties 1. and 2 . are fulfilled by T , we can represent T as a union of a family of paths T i j for which 3. holds. Let us discuss property 3. Two paths that share a common endpoint cross always. Thus, 3. poses a constraint only when the two paths have four distinct endpoints altogether. Property 3. is important to ensure thatT is indeed connected, and that replacing T byT results in a valid fence. Although this is intuitively obvious, we could not come up with a short and elegant argument. We use the following lemma and its corollary, whose proofs are given later on. For a path P and points x, y ∈ P, we denote by P[x, y] the subpath of P from x to y. To make this notation unambiguous even if P is not simple, we will assume that the points x, y are associated to particular parameter values along the parameterisation of P.

Lemma 5.2 Suppose that the paths T i j and T i j cross in the sense of 3. Then there exists a pointx ∈T i j ∩T i j such that the path
is homotopic to the path T ji .

Corollary 5.3
For any two leaves v i and v j , where the pair {i, j} is not necessarily in S, the setT contains a path from v i to v j that is homotopic to the path T i j .
As a consequence, after replacing T byT in F * , we get a system of fences F that encloses and separates the same objects as F * , and thus we have indeed produced a valid fence.

Proof of Corollary 5.3
Let the vertices of T i j be x 0 , x 1 , . . . , x p+1 in order such that x 0 := v i and x p+1 := v j . For each m = 0, 1, . . . , p, we select, by property 1., a path T k m l m with {k m , l m } ∈ S that goes through the directed edge x m x m+1 on the way from v k m to v l m . This leads to a sequence of paths T k 0 l 0 , T k 1 l 1 , . . . , T k p l p , where k 0 = i, l p = j, and any two successive paths T k m−1 l m−1 and T k m l m have the point x m in common, and hence cross, by property 3. Lemma 5.2 implies that also the corresponding paths T k m−1 l m−1 andT k m l m have a common pointx m such that is homotopic to U m := T l m−1 k m . Now, define the paths The path W is homotopic to T i j , as it has the same endpoints and is obtained by joining paths in the simple tree T . Also, W andW are homotopic, as the corresponding subpaths are homotopic. The pathW is thus homotopic to T i j , andW is contained in T , so we are done.
Proof of Lemma 5. 2 We first describe how T i j can be continuously deformed intoT i j while remaining a polygonal path, moving one vertex at a time. We denote byT i j the current path during this deformation procedure.
Consider the case thatT i j has a vertex b which is not in the set of corners N . Let a and c be the neighbouring vertices. We then move b towards c, thus shortening the edge bc while the edge ab sweeps over a region in the plane. If ab hits the corner of an object,T i j gets a new vertex a at this point. The segment aa will then remain static, and we continue the movement of b with a taking the role of a. When b eventually reaches c, the number of vertices ofT i j that are not in N has decreased by 1. We repeat this process of contracting edges as long as there is a vertex not in N . Note that it is possible that the path crosses itself during the deformation, or it may have a vertex where it turns 180 • back on itself. Such a vertex is known as a spur, and it can be easily eliminated by moving it to the closest adjacent vertex.
(For establishing Theorem 5.1, we could already stop the deformation procedure as soon as all vertices ofT i j are in N andT i j is free of spurs, becauseT i j is contained in A and is at most as long as T i j , thus satisfying properties (c) and (d).) IfT i j is not yet the shortest homotopic path, it must contain three consecutive vertices abc such that the angle at b contains no object. In this case we can start the same deformation move from b towards c as above. Temporarily, the vertex b is an additional vertex not in N , but after the move,T i j is again a path connecting vertices of N . Since the number of such paths that are not longer than the initial path T i j is finite, the procedure must eventually terminate with the shortest homotopic pathT i j .
We successively apply this procedure to the pairs i j and i j . We still have to prove the existence of a pointx ∈T i j ∩T i j with the property stated in the lemma. We assume that the four corners v i , v j , v i , v j are distinct because otherwise the statement follows easily if we choose a shared endpoint asx.
The proof uses that fact that the number of crossings between the pathsT i j and T i j can only change by an even number during a deformation. The definition of a crossing requires some care, as the paths may share segments. Assume thatT i j is the path that is currently being deformed, whileT i j is either the initial path T i j or the final deformed pathT i j .
Orient the pathsT i j andT i j arbitrarily. Consider a maximal subpath Q that is shared betweenT i j andT i j , possibly in opposite directions. IfT i j enters and leaves Q on the same side ofT i j , we say thatT i j touchesT i j at Q. Otherwise,T i j and T i j form a crossing at Q. Here it is important thatT i j has no spurs, since at a spur, the side on whichT i j enters or leavesT i j is ill-defined. If Q contains an endpoint q of one of the paths, we extend this path into the interior of the object in order to determine the side ofT i j on whichT i j enters or leaves Q at q.
A crossing Q ofT i j andT i j is a homotopic crossing if it has the desired property for the lemma, namely thatT Clearly, this does not depend on the choice ofx ∈ Q, because Q is represented by a connected interval of parameters, both onT i j andT i j .
WhenT i j is deformed by moving one vertex at a time, as described above, it is easy to see that crossings can only appear or disappear in pairs: It is not possible for a crossing Q to appear or disappear byT i j sliding over an endpoint q ofT i j , since that would requireT i j to enter the interior of the object with q on the boundary.
Furthermore, a pair of crossings Q 1 , Q 2 that appear or disappear will either both be homotopic crossings or non-homotopic crossings: At the moment when the pair appears or disappears, the loop formed by the subpaths ofT i j andT i j between Q 1 and Q 2 is empty and thus contains no objects. Therefore, ifx 1 ∈ Q 1 andx 2 ∈ Q 2 , the pathsT i j [v j , During the deformation ofT i j , each crossing Q can move back and forth onT i j , expand and shrink. However, it is clear that its character (homotopic versus nonhomotopic) does not change during the deformation.
The initial number of crossings is 1, and the single crossing Q is a homotopic crossing, since T ji can be realized as a pathT Hence the number of homotopic crossings ofT i j andT i j is odd, and in particular positive, which establishes the claim.
To bound the length ofT , we bound each pathT i j , {i, j} ∈ S, by the corresponding path T i j in T . This upper estimate is simply the total length of T plus the length of the duplicated edges of T .
As mentioned above, we start by constructing the multigraph T . By property 1., this boils down to selecting which edges of T to duplicate. In order to fulfil property 2., we require that the degree of every inner vertex of T becomes even. We now analyse this task from a purely combinatorial viewpoint. We show in the end that this is sufficient to ensure that the edges of T can be partitioned into paths T i j such that 3. holds.

Lemma 5.4
The edges that should be duplicated can be chosen so that their total length is at most |T |/3. Proof For a particular tree, the optimum can be computed easily by dynamic programming, as follows. We root T at some arbitrary leaf. Consider a subtree U rooted at some vertex u of T such that u has one child v in U , see Fig. 16. We define U 1 and U 2 as the cost of the optimal set of duplicated edges in U , under the constraint that the multiplicity of the edge uv in T is 1 and 2, respectively. By induction, we will establish that This gives min {U 1 , U 2 } ≤ |U |/3 and proves the lemma, since this also holds for U = T . In the base case, U has only one edge. Then U 1 = 0 and U 2 = uv = |U |, and (1) holds.
If U is larger, v has degree 3, and two subtrees L and R are attached there. If uv is not duplicated, then exactly one of the other edges incident to v has to be duplicated in order for v to get even degree in T . On the other hand, if uv is duplicated, then either both or none of the other edges should be duplicated. Hence, we can compute U 1 and U 2 by the following recursion: We therefore get from (2) and from (3). Adding inequalities (4) and (5) and using the inductive hypothesis (1) for L and R gives Fig. 17 The core (left) and repeated (right) construction for the proof of Lemma 5.5 2U 1 + U 2 ≤ 2L 1 + L 2 + 2R 1 + R 2 + uv ≤ |L| + |R| + uv = |U |.
The bound |T |/3 in Lemma 5.4 cannot be improved, as shown by the graph K 1,3 with 3 edges of unit length. This graph can appear as a Steiner tree in an optimal fence, see Fig. 17. (But this does not mean that the factor 4/3 in Theorem 5.1 cannot be improved.) We now have a multigraph T where every internal vertex has even degree. It follows that the edges of T can be partitioned into leaf-to-leaf paths, much like when creating an Eulerian tour in a graph where all vertices have even degree. The endpoint pairs of these paths constitute the set S of leaf pairs.
We still need to satisfy property 3. Whenever two paths P 1 and P 2 violate this property, we repair this by swapping parts of the paths, without changing the number of remaining violating pairs, as follows: The paths P 1 and P 2 have a common vertex, and thus also a common edge uv, because the maximum degree in T is 3. Orient P 1 and P 2 so that they use this edge in the direction uv, and cut them at v into P 1 = Q 1 · R 1 and P 2 = Q 2 · R 2 . We now make a cross-over at v, forming the new paths Q 1 · R 2 and Q 2 · R 1 . These new paths satisfy 3. To check that we did not create any new violations, we observe that, by property 1., no other path can use the edge uv, because the capacity of 2 is already used up by P 1 and P 2 . Thus, all other paths can either interact with Q 1 and Q 2 , or with R 1 and R 2 . Swapping the parts of P 1 and P 2 in the other half of the tree T does not affect property 3. We have thus established Theorem 5.1.

Lemma 5.5
For every ε > 0, there is an instance of geometric 3-cut for which Proof The core idea is shown in Fig. 17: Three very thin rectangles in different colours form an equilateral triangle with side length √ 3. The optimal fence uses the centre of the triangle as a Steiner vertex, whereas the fence F A is restricted to follow the triangle edges. Considered in isolation, this example gives only a ratio |F A |/|F * | ≈ 4 √ 3/(3 + 2 √ 3) ≈ 1.07, because the outer boundary edges, which are common to both fences, "dilute" the ratio. So we set k = 1/ε, and repeat the construction k × k times. We get |F * | = 2k 2 · 3 + 2k · √ 3, versus |F A | = 2k 2 · 2 √ 3 + 2k · √ 3.

Finding a Good Fence in A
As in Sect. 3, the restriction to A reduces the optimal fence problem to a graphtheoretic problem of finding a best multicut in a planar graph. We apply results from the literature. The problem of finding a small cut in a planar graph G = (V , E) that separates k different classes T 1 , . . . , T k ⊂ V of terminals was mentioned as a suggestion for future work by Dahlhaus et al. [9], but we have not found any subsequent work on that except for the case k = 2 [4]. We can, however, reduce the problem to the multiway cut problem in general graphs (also known as the multiterminal cut problem): For each class T i , we add an "apex vertex" t i which is connected to all vertices in T i by edges of infinite weight. We then ask for the cut of minimum total weight that separates each pair t i , t j . Dahlhaus et al. showed the problem to be APX-hard for k ≥ 3 and gave a simple (2 − 2/k)-approximation algorithm. The approximation ratio was later improved to 3/2 − 1/k (expected) by Cȃlinescu et al. [6]. Their algorithm is based on a geometric LP relaxation of the problem and an appropriate randomised rounding scheme. Successive refinements of the rounding scheme have brought down the ratio further: the currently best one is 1.2965, due to Sharma and Vondrák [21], and it has been verified only by computer. A slightly worse hand-verified ratio of 297/229 ≈ 1.29694 was given by Buchbinder et al. [5]. For specific values of k the best known ratios are due to Karger et al. [16]. Finally, it is worth noting that, under the Unique Games Conjecture, the integrality gap of the LP of Cȃlinescu et al. has been shown to be a lower bound for the approximation ratio for the multiway cut problem by Manokaran et al. [18]; the best known value for the integrality gap is 1.20016 − ε, for any ε > 0, due to Bérczi, Chandrasekaran et al. [3].
Together with Theorem 5.1, we obtain the following result.

Concluding Remarks
We have initiated the study of the geometric multicut problem. As our NP-hardness reduction does not imply APX-hardness, an interesting open question is whether there exists a (1 + ε)-approximation algorithm for any ε > 0.
There are other versions of the problem which could also be interesting to study. For example, apart from considering shortest paths in the plane, much attention has also been paid to minimum-link paths, i.e., paths connecting two points and consisting of a minimum number of line segments. The analogous problem in our setup is likewise interesting: Compute a simplest possible fence, i.e., one that is the union of as few line segments as possible. The fence can be required to be disjoint from the object interiors, or it can be allowed to pass through the objects, leading to two different problems.