26
arXiv:0907.1280v1 [cs.CG] 7 Jul 2009 The Complexity of Guarding Terrains James King Erik Krohn McGill University University of Iowa [email protected] [email protected] July 7, 2009 Abstract A set G of points on a 1.5-dimensional terrain, also known as an x-monotone polygonal chain, is said to guard the terrain if any point on the terrain is seen by a point in G. Two points on the terrain see each other if and only if the line segment between them is never strictly below the terrain. The minimum terrain guarding problem asks for a minimum guarding set for the given input terrain. We prove that the decision version of this problem is NP-hard. This solves a significant open problem and complements recent positive approximability results for the optimization problem. Our proof uses a reduction from PLANAR 3-SAT. We build gadgets capable of mirroring a consistent variable assignment back and forth across a main valley. The structural simplicity of 1.5-dimensional terrains makes it difficult to build general clause gadgets that do not destroy this assignment when they are evaluated. However, we exploit the structure in instances of PLANAR 3-SAT to find very specific operations involving only adjacent variables. For these restricted operations we can construct gadgets that allow a full reduction to work.

James King Erik Krohn [email protected] erik …€¦ · completeness proof was proposed but never ... The first constant factor approximation for the terrain ... The interested

Embed Size (px)

Citation preview

Page 1: James King Erik Krohn jking@cs.mcgill.ca erik …€¦ · completeness proof was proposed but never ... The first constant factor approximation for the terrain ... The interested

arX

iv:0

907.

1280

v1 [

cs.C

G]

7 Ju

l 200

9

The Complexity of Guarding Terrains

James King Erik KrohnMcGill University University of [email protected] [email protected]

July 7, 2009

Abstract

A set G of points on a 1.5-dimensional terrain, also known as anx-monotone polygonal chain, issaid to guard the terrain if any point on the terrain is seen bya point inG. Two points on the terrain seeeach other if and only if the line segment between them is never strictly below the terrain. The minimumterrain guarding problem asks for a minimum guarding set forthe given input terrain. We prove that thedecision version of this problem is NP-hard. This solves a significant open problem and complementsrecent positive approximability results for the optimization problem.

Our proof uses a reduction from PLANAR 3-SAT. We build gadgets capable of mirroring a consistentvariable assignment back and forth across a main valley. Thestructural simplicity of 1.5-dimensionalterrains makes it difficult to build general clause gadgets that do not destroy this assignment when theyare evaluated. However, we exploit the structure in instances of PLANAR 3-SAT to find very specificoperations involving only adjacent variables. For these restricted operations we can construct gadgetsthat allow a full reduction to work.

Page 2: James King Erik Krohn jking@cs.mcgill.ca erik …€¦ · completeness proof was proposed but never ... The first constant factor approximation for the terrain ... The interested

1 Introduction

An instance of theterrain guarding problemcontains a terrainT that is anx-monotone polygonal chain.An x-monotone chain inℜ2 is a chain that intersects any vertical line at most once. Theterrain is given byits set of verticesP = {v1, v2, ..., vn}, wherevi = (xi, yi). The vertices are ordered such thatxi < xi+1.There is an edge connecting each(vi, vi+1) pair wherei = 1, 2, ..., n − 1. We say a pointp on the terrainseesanother pointq on the terrain if the line segmentpq is never strictly below the terrainT .

A set G of points on the terrain is called aguarding setif every point on the terrain is seen by somepoint in G. The optimization version of the terrain guarding problem is the problem of finding a minimumguarding set for a given terrain. There are two standard versions of the terrain guarding problem: a discreteversion and a continuous version. The discrete version allows us to place guards only at the vertices of theterrain. The continuous version, which we have defined above, allows guards to be placed anywhere on theterrain. In other versions a subset of points on the terrain to guard is given with the input.

Motivation for guarding terrains comes from scenarios thatinclude covering a road with street lights orsecurity cameras. Other applications include finding a configuration for line-of-sight transmission networksfor radio broadcasting, cellular telephony and other communication technologies [1].

The complexity of terrain guarding has been an open problem of interest since 1995, when an NP-completeness proof was proposed but never completed by Chenet al. [2]. With the problem’s hard-ness strongly suspected but not known, a series of approximation algorithms have been developed overthe last decade. The first constant factor approximation forthe terrain guarding problem was shown byBen-Mosheet al. in [1]. Clarkson and Varadarajan also give a constant factorapproximation in [3]. A4-approximation was proposed by King in [10] but further analysis increased the approximation factor to 5.A 4-approximation was given by Elbassioniet al. in [7]. Recently a PTAS was given by Gibsonet al. in[9]. With the knowledge that the problem is not APX-complete, it is of even greater interest whether or notit is NP-complete, and this has been reiterated with each approximation algorithm developed.

The terrain guarding problem is closely related to theart gallery problemthat involves guarding theinterior of a polygon. The basic version of the art gallery problem is that ofvertex guardinga simplepolygon, where we are given a simple polygon and we wish to findthe smallest subset of the vertices thatsee the entire polygon. Thepoint guardingversion allows guards to be placed anywhere inside the polygon.

The art gallery problem was shown to be NP-complete by Lee andLin in [11]. Along with being NP-complete, the art gallery problem was shown to be APX-hard in[6]. This means that there exists a constantǫ > 0 such that no polynomial time algorithm can guarantee an approximation ratio of1+ǫ unlessP = NP .Ghosh provides aO(log n)-approximation for the problem of vertex guarding ann-vertex simple polygon[8]. The point guarding problem seems to be much harder than the vertex guarding problem and preciouslittle is known about it [5]. A restricted version of the point guarding problem where the polygon isx-monotone has been shown to have anO(1)-approximation by Nilsson in [13]. Based on his result Nilssonalso provides aO(OPT 2) approximation for rectilinear polygons.

Straightforward attempts to show NP-hardness for the terrain guarding problem run up against the largeamount of restriction in the complexity of terrains. By far the most significant restriction is given by thefollowing claim first noted by Ben-Mosheet al. [1]:

Claim 1 (Order Claim). Leta, b, c, d be four points on the terrain in increasing order ofx-coordinates. Ifaseesc andb seesd, thena seesd.

The order claim is crucially exploited by all approximationalgorithms for the problem. In this paper wedevelop a construction that overcomes the order claim obstacle and shows that the terrain guarding problem

1

Page 3: James King Erik Krohn jking@cs.mcgill.ca erik …€¦ · completeness proof was proposed but never ... The first constant factor approximation for the terrain ... The interested

is NP-hard. Therefore, an exact polynomial time algorithm is not possible unlessP = NP. The NP-hardnessresult is shown for the standard discrete and continuous variants of the problem.

According to Demaine and O’Rourke [4], the complexity of theterrain guarding problem was posed byBen-Moshe. We quote from [4]:

What is the complexity of computing the guard set of minimum size for a given x-monotonechain in the plane? According to the poser, “most tenured professors think the problem is NP-hard.” This problem in fact goes back to 1995, when Chenet al. [2] claimed an NP-hardnessresult, but “the proof, whose details were omitted, was never completed successfully” [10].

The remainder of the paper is organized as follows. Our reduction is from planar 3SAT and is overviewedin Section 2. Section 3 describes the gadgets used in the reduction and Section 4 provides a conclusion andfuture work. The interested reader can see an example of a full reduction in Appendix C.

2 Reduction: Overview

The initial reduction will be for the discrete terrain guarding problem where both the set of guards and theset of points to be guarded are a finite subset of the terrain. We give a reduction from the planar 3SATproblem. This problem was shown to be NP-complete in [12]. Planar 3SAT is defined as follows: LetΦ = (X,C) be an instance of 3SAT, with variable setX = {x1, . . . , xn} and clausesC = {c1, . . . , cm}such that each clause consists of exactly three distinct literals. Define aformula graphGΦ = (V,E)with vertex setV = X

⋃C and edgesE = E1

⋃E2 whereE1 = {(xi, xi+1)|1 ≤ i ≤ n}, andE2 =

{(xi, cj) | cj containsxi or xi}. A 3SAT formulaΦ is calledplanar if the corresponding formula graphGΦ

is planar. The edge setE1 defines a cycle on the verticesX, and thus divides the plane into exactly 2 faces.Each nodecj ∈ C lies in exactly one of those two faces. We have to determine whether there exists anassignment of truth values to the variables inX that satisfies all the clauses in theC.

It is easy to see that the clauses inside the variable cycle can be generated by performing a sequenceβ ofsteps starting withσ = 〈x1, . . . , xn〉 where at each step we do one of the following untilσ becomes empty:

1. Delete a variable from sequenceσ and call the resulting variable sequenceσ.

2. Generate a clause using three consecutive variables inσ and delete the middle variable fromσ. Callthe resulting variable sequenceσ.

Similarly there is a different sequenceα of steps starting fromσ = 〈x1, . . . , xn〉 that generates allclauses outside the variable cycle. The interested reader can see Appendix C for an illustration of thissequence.

The terrainT constructed by our reduction is shaped like a valley. A coarse view of the terrain can beseen in Figure 1. We identify disjoint pieces of the terrain calledchunks. Even indexed chunks,C0, C2, C4,

..., C−2, C−4, ..., are on the left side of the terrain and odd indexed chunks,C1, C3, ..., C−1, C−3, ..., are onthe right side of the terrain. ChunksC0, C1, C2, ..., Ck are used to “implement” the sequenceβ. ChunksC0, C−1, C−2, ..., C−k′ are used to “implement” the sequenceα.

Recall that we are considering the discrete terrain guarding problem; we have a finite set of guards.Chunks containdistinguished pointswhich are the points to be guarded in our reduction. Chunks alsocontain a set of potential guard locations. Distinguished points and the set of potential guard locations willbe defined in Section 3.

2

Page 4: James King Erik Krohn jking@cs.mcgill.ca erik …€¦ · completeness proof was proposed but never ... The first constant factor approximation for the terrain ... The interested

C0

C−2

C2

C1

C−1

Figure 1: A coarse view of a terrainT constructed by our reduction showing chunksC−2, C−1, C0, C1 andC2.

Corresponding to each even chunk,Ci is a subsequenceλi of the sequence of variables〈x1, x2, ..., xn〉.There will be2|λi| guard locations, one for each of the2|λi| literals corresponding to the variables inλi

1.We will refer to these guard locations by the corresponding literal names. Locationx andx correspondingto a variablex are consecutive on the chunk but either may be to the left or right of the other. The left toright ordering of literals in a chunkCi corresponding to different variables is according toλi if i is even. Ifi is odd, the right to left ordering of the literals corresponding to different variables is according toλi.

Associated with each chunkCi will be a numberni. In the reduction,ni guards will be needed withinchunkCi to see distinguished points inCi. If less thanni guards are placed in chunkCi, no matter howmany guards are placed elsewhere, certain distinguished points in chunkCi will go unseen.For C0, λ0 =〈x1, x2, ..., xn〉, the literal locations arex1, x1, x2, x2, ..., xn, xn andn0 = n. To guardC0 usingn0 guards,we will have to place exactlyn guards at exactlyn of the literal locations, with one guard for each variableor its complement. Note that such a placement of guards specifies an assignment to the variables.

C0, C1, ..., Ck are used to implement the sequenceβ, as we now describe. Suppose that we have addedchunksC1, ..., Ci to implement stepsβ1, ..., βj of β. Let σ(j) refer to the sequenceσ after stepβj . Byconstruction, chunkCi will have λi = σ(j). Supposeβj+1 is a step in which we delete variablex fromσ(j). ChunkCi+1 will have λi+1 = σ(j) \ x. We will haveni = |λi|, andni+1 = |λi+1|. The relationshipbetweenCi andCi+1 will be what we call adeletion, which has the following property: to guardCi andCi+1 usingni + ni+1 guards, it is necessary that we have:

1. exactlyni+1 = |λi+1| guards at the literals withinCi+1, one for each variable so that this correspondsto an assignment to the variables inλi+1;

2. exactlyni = |λi| guards at the literals withinCi, one for each variable so that this corresponds to anassignment to the variables inλi;

3. The location of the guards must be consistent for all variables exceptx: There is a guard at literalyin Ci if and only if there is a guard at literaly in Ci+1.

Suppose thatβj+1 is a clause step involving the variablesx, y andz. This requires up to two applicationsof an inversion gadgetfollowed by aclause gadget. An inversion involving a variablex uses three chunks

1Certain chunks are an exception, some chunks may have2|λi| + 2 literals. Most chunks have 2 literals corresponding to 1variable; certain chunks may have 4 literals correspondingto 1 variable.

3

Page 5: James King Erik Krohn jking@cs.mcgill.ca erik …€¦ · completeness proof was proposed but never ... The first constant factor approximation for the terrain ... The interested

y

z

x

y

x

z

ww

Figure 2: Partial chunk showing the ordering of the variables w, x, y, andz.

Ci, Ci+1, andCi+2. Its purpose is to change the left to right ordering of literals x andx in Ci+2 to beopposite of that inCi. If the relationship betweenCi, Ci+1, andCi+2 is an inversion corresponding tox,thenλi+2 = σ(j) is the same asλi. We haveni = |λi|, ni+1 = |λi| + 1, andni+2 = |λi+2|. To guardCi, Ci+1, andCi+2 usingni + ni+1 + ni+2 guards, it is necessary that we have:

1. ni+2 = |λi+2| guards forCi+2, one for each variable, as above;

2. ni+1 guards forCi+1;

3. ni = |λi| guards forCi, one for each variable;

4. The location of the guards must be consistent for all variables: There is a guard at literaly in Ci if andonly if there is a guard at literaly in Ci+2.

Suppose thatβj+1 is a clause step involvingx∨y∨z. The variablesx, y andz must occur consecutivelyin either left to right or right to left order inCi; it must also be the case that the literalx, the two literalscorresponding toy and the literalz occur consecutively in either left to right or right to left order in Ci,see Figure 2. Recall thatβj+1 also deletes the middle variabley. By construction, chunkCi will haveλi = σ(j). ChunkCi+1 will have λi+1 = σ(j) \ y. We haveni = |λi| andni+1 = |λi+1|. The relationshipbetweenCi andCi+1 will be what we call aclause gadget, which has the following property: to guardCi

andCi+1 usingni + ni+1 guards, it is necessary that we have:

1. ni+1 = |λi+1| guards forCi+1, one for each variable;

2. ni = |λi| guards forCi, one for each variable;

3. The location of the guards must must be consistent for all variables excepty: There is a guard at literala in Ci if and only if there is a guard at literala in Ci+1;

4. There is a guard inCi at one ofx, y, or z.

Similar actions are done to build the chunksC−1, C−2, ..., C−k′ for theα sequence. Our discussion im-plies that chunksC−k′ , ..., C0, ..., Ck can be guarded with

∑k−k′ ni guards if and only if we have a satisfying

assignment to the planar 3SAT formulaΦ. The location of the guards in chunkC0 will tell us the truth valuefor each variable. Our construction will be such that ifΦ is satisfiable, then

∑k−k′ ni guards aresufficient

for seeing all distinguished points. This will establish NP-hardness.

4

Page 6: James King Erik Krohn jking@cs.mcgill.ca erik …€¦ · completeness proof was proposed but never ... The first constant factor approximation for the terrain ... The interested

3 Reduction: Gadgets

The following subsections describe the gadgets introducedin Section 2. In Section 3.1, we begin by de-scribing the shape of a chunk and the location of the literalscorresponding to a variable. In Section 3.2,we describe the basic gadget relating two chunks called themirror gadget. Subsequently, we modify themirror gadget to obtain the deletion gadget, the inversion gadget, and the clause gadget. We will referto the construction of chunksC1, C2, . . . , Ck as “going down” fromC0, and the construction of chunksC−1, C−2, . . . , C−k′ as “going up” fromC0. Take an arbitrary variablex in an even chunkCi. Guard loca-tions inCi to the right ofx will be considered “below”x and guard locations inCi placed to the left ofxwill be considered “above”x. With odd chunks, guard locations to the left are consideredbelow and guardlocations to the right are considered above. For example, inFigure 2,w is abovex; y is belowx.

3.1 Variable Gadget

The first gadget we will describe is thevariable gadget. An example of a variable gadget fora in chunkCi

is shown in Figure 3. The variable gadget has avariable distinguished point, d, that can be seen from onlytwo vertices: the literalsa anda vertices. The following is what we will refer to as theUniqueness Claim:

Uniqueness Claim.No guard can see more than 1 variable distinguished point.

Because of theUniqueness Claim, the total number of variable distinguished points provides a lowerbound on the number of guards that are necessary to guard all of the distinguished points.

To see how multiple variables are placed, assume a chunkCi hasλi = 〈w, x, y, z〉. Figure 2 shows howvariable gadgets corresponding to each variable are placedwithin the chunk. ChunkC0 hasn such variablegadgets, 1 for each variable. In Figure 2,4 guards are required to guard the4 variable distinguished pointsbecause of theUniqueness Claim.

a

d

a

Figure 3: Variable Gadget.

Local Summary of Variable Gadgets: To guard the variable distinguished pointd for a variablea inchunkCi, at least1 guard must be placed at the literala or a location inCi.

3.2 Mirroring

Going down, chunksCi andCi+1 can form what we call a mirror gadget. Here, we will haveni = |λi|,λi+1 = λi, andni+1 = |λi+1|. The relationship betweenCi andCi+1 will be what we call amirroring,which has the following property: to guardCi andCi+1 usingni+ni+1 guards, it is necessary that we have:

5

Page 7: James King Erik Krohn jking@cs.mcgill.ca erik …€¦ · completeness proof was proposed but never ... The first constant factor approximation for the terrain ... The interested

1. exactly|λi+1| guards at the literals withinCi+1, one for each variable so that this corresponds to anassignment to the variables inλi+1;

2. exactly|λi| guards at the literals withinCi, one for each variable so that this corresponds to an assign-ment to the variables inλi;

3. The location of the guards must be consistent for all variables: There is a guard at literaly in Ci if andonly if there is a guard at literaly in Ci+1.

bibi

bi+1

x

bi+1

Ci Ci+1

x′

Figure 4: Mirroring one variable. Visibilities are as follows: bi seesx, bi+1. bi seesx′, bi+1, bi+1. bi+1 seesx, bi+1, bi, bi. bi+1 seesx′, bi+1, bi.

To describe the mirroring for1 variable, let us first focus on a variable gadget corresponding to a variableb in chunksCi andCi+1, see Figure 4. We introduce the notion ofmirrored distinguished pointscorrespond-ing to b in Ci+1. In Figure 4, mirrored distinguished points arex andx′. bi is the literalb in chunkCi. bi+1

andbi both see our mirrored distinguished pointx′ but neither seex. bi+1 andbi both seex but neither seex′. This leads us to the following lemma:

Lemma 2. For two guards to see the variable distinguished points inCi and Ci+1 corresponding to avariable b and the mirrored distinguished points corresponding to variable b in Ci+1, it is necessary andsufficient to place guards at the literalb locations in both chunks or guards at the literalb locations in bothchunks.

Proof. Since we have two variable gadgets forb, theUniqueness Claimstates that two guards are necessaryto guard the variable distinguished points forb in Ci andCi+1. We claim two guards are sufficient to guardthe mirrored and variable distinguished points inCi+1 and variable distinguished points inCi. We mustchoose one guard from{bi, bi} and one guard from{bi+1, bi+1}. If we place a guard atbi, x is not seen.Sincebi+1 does not seex, we must place a guard atbi+1. Similar arguments can be made if we choosebi

first.

Mirroring up uses a similar proof. If a guard is placed atbi+1, a guard must be placed atbi so thatx′ isseen. Similarly withbi+1 andbi.

We see in Figure 5 how variable gadgets are constructed to ensure a guard placed in one variable gadgetdoes not see the distinguished points of a different variable gadget. Let us say thatai andbi belong to chunkCi. ai+1 andbi+1 belong to chunkCi+1. To ensure that guards placed at a literal for one variable does notaffect the mirroring of another variable, in other wordsq should be seen by onlyai+1 andai and by no otherguards inCi andCi+1, similarly q′ should be seen by onlyai+1 andai and by no other guards inCi andCi+1, the following are also true. The line defined byq andm hits the terrain at pointai. Since we knowai does not seeq, a guard placed atai or ai in chunkCi will not see any ofb’s distinguished points inCi

6

Page 8: James King Erik Krohn jking@cs.mcgill.ca erik …€¦ · completeness proof was proposed but never ... The first constant factor approximation for the terrain ... The interested

or Ci+1. In other words,m blocksai from seeing below variable gadgeta in Ci andCi+1. In general, aguard placed at either literal fora ∈ Ci will not see any of the mirrored or variable distinguished points ofdifferent variables below (to the right of) the variable gadget fora ∈ Ci and also below (to the left of) thevariable gadget fora ∈ Ci+1.

Neitherbi nor bi can seeq or q′ ensuringb in Ci does not affect any ofa’s distinguished points inCi+1.The line defined byq′ andai+1 passes just aboveai and hits the terrain just belowai. Because of this noguard placed below this line can seeq′. The line defined byq andm hits the terrain at pointai. In Figure 5,the terrain coming out ofq to the left ofq is drawn on this line. Therefore no guard below this line can seeq.In general, no guard below (to the right of) the variable gadget fora ∈ Ci can seeq or q′ nor can any guardbelow (to the left of) the variable gadget fora ∈ Ci+1 seeq or q′. Note that the visibilities do not disruptthe order claim.

q

ai

ai

m

p′

q′

ai+1

p

bi

Ci

Ci+1

bi

ai+1

Figure 5: Variable gadgets do not interfere with each other.Important visibilities are as follows:ai seesq′, ai+1. ai seesq, ai+1, ai+1. bi seesp′, ai+1, ai+1. bi seesp, ai+1, ai+1. Note that the visibilities do notdisrupt the order claim.

Local Summary of Mirroring Gadget Ci–Ci+1 going down: To guard the variable distinguished pointsand mirrored distinguished points ofCi+1 and the variable distinguished points ofCi with ni +ni+1 guards,it is necessary and sufficient to placeni guards at literals inCi andni+1 guards at literals inCi+1 in aconsistent way.

For mirroring up, the picture is exactly the same as above, but we proceed in the opposite direction.Note that Lemma 2 says that if we have a guard atai+1, the second guard is forced to be atai. Similarly forai+1 andai.

Local Summary of Mirroring Gadget Ci+1–Ci going up: To guard the variable distinguished points andmirrored distinguished points ofCi+1 and the variable distinguished points ofCi with ni +ni+1 guards, it isnecessary and sufficient to placeni guards at literals inCi andni+1 guards at literals inCi+1 in a consistentway.

3.3 Deletion Gadget

A deletion of a variablex going down from chunkCi to chunkCi+1 involves flattening out the terrain inchunkCi+1 where the variable gadget forx would have been placed. The interested reader can read a fulldescription of deletion in Appendix A.

7

Page 9: James King Erik Krohn jking@cs.mcgill.ca erik …€¦ · completeness proof was proposed but never ... The first constant factor approximation for the terrain ... The interested

a

w

maa

v

b

c

c

a

a’s mirrored d.p.

Ci b

c

c

Ci+1

Figure 6: Clause going down.

Local Summary of Deletion GadgetCi–Ci+1 going down: To guard the variable distinguished pointsand mirrored distinguished points ofCi+1 and the variable distinguished points ofCi with ni +ni+1 guards,it is necessary and sufficient to placeni guards at literals inCi andni+1 guards at literals inCi+1 in aconsistent way.

Local Summary of Deletion GadgetCi+1–Ci–Ci−1 going up: To guard the variable distinguished pointsand mirrored distinguished points ofCi+1 andCi, and the variable distinguished points ofCi−1 with ni+1 +ni + ni−1 guards, it is necessary and sufficient to placeni+1 guards at literals inCi+1 andni guards atliterals inCi, andni−1 guards at literals inCi−1 in a consistent way.

3.4 Downward Clause Gadget

Let us say the clause we are constructing isCli = (a ∨ b ∨ c), see Figure 6. We will haveλi+1 = λi \ b,ni = |λi|, ni+1 = |λi+1|. The total number of guards needed withinCi andCi+1 will be ni +ni+1. We willreplace the middle variable gadgetb in Ci+1 with our clause gadget. In chunkCi, the left to right orderingof literals if i is even (right to left ifi is odd) must be exactlya, b, b, c. We will assume the ordering is correctwhen placing a clause gadget. Section 3.6 will show how to make a change if the ordering is incorrect. InFigure 6,w is ourclause distinguished point. We can manipulate theb variable gadget inCi so thatb or b isblocked from seeingw. In this case,b is moved further down so it does not seew.

The original use of them point was to block a potential guard placed at thea ∈ Ci guard locationfrom seeing mirrored distinguished points below (to the left of) thea variable gadget inCi+1. In this casehowever, we wanta ∈ Ci to seev. We move ourm point towards the mirrored distinguished point ofa ∈ Ci

so that the guard location fora ∈ Ci seesv. It should be noted that our mirroring ofa is not disrupted withthis modification. This modification now allowsa ∈ Ci to seev, which then allowsa to seew. Note that thevisibilities do not disrupt the order claim. We also note that a ∈ Ci does not seew. We then adjust thevw

line segment by movingw slightly upwards so thatw seesc ∈ Ci. A ray shot fromw throughv will hit theterrain in chunkCi at pointc so thatc in Ci does not seew. It should be noted that the mirroring down ofa

andc are still intact; we are still able to mirror the values ofa andc down the terrain. If neithera ∈ Ci norb ∈ Ci nor c ∈ Ci is chosen as a guard location, we require an extra guard to seew. However if one of theseliterals is chosen to be a guard, our clause distinguished point w is guarded and no extra guard is needed.

We also note thatb will no longer be used in any future clauses going downward. The reduction fromplanar 3SAT allows us to order the clauses in a certain way to ensure that the middle variable will no longer

8

Page 10: James King Erik Krohn jking@cs.mcgill.ca erik …€¦ · completeness proof was proposed but never ... The first constant factor approximation for the terrain ... The interested

be used in future clauses going down the terrain. For detailed information on how the clauses are ordered,the interested reader can see Appendix C. Because of this ordering, we can safely replace theb variablegadget inCi+1 with a clause gadget.

Local Summary of Clause GadgetCi–Ci+1 going down: To guard the variable distinguished points,clause distinguished point and mirrored distinguished points ofCi+1 and the variable distinguished pointsof Ci with ni +ni+1 guards, it is necessary and sufficient to placeni guards at literals inCi andni+1 guardsat literals inCi+1 in a consistent way. Note that if a guard is placed ata or b or c in chunkCi, our clausedistinguished point is seen and no additional guard is required.

3.5 Upward Clause Gadget

The upward clause gadget uses similar arguments as the downward clause gadget. The interested reader canread a full description of the upward clause gadget in Appendix B.

Local Summary of Clause GadgetCi–Ci−1–Ci−2 going up: To guard the variable distinguished points,clause distinguished point and mirrored distinguished points of Ci−1, the variable distinguished points ofCi−2 and the variable and mirrored distinguished points ofCi with ni + ni−1 + ni−2 guards, it is necessaryand sufficient to placeni guards at literals inCi andni−1 guards at literals inCi−1 andni−2 guards atliterals inCi−2 in a consistent way. Note that if a guard is placed ata in Ci−2 or b in Ci−1 or c in Ci−2, ourclause distinguished point is seen and no additional guard is required.

3.6 Inversion Gadget

The left to right (right to left) ordering of literals becomes important when placing a clause gadget and itis possible that the literals are “out of order.” In a regularmirroring of variablea, the left to right order ofa anda will be the same in all even chunks, similarly with all odd chunks. To switch the order, we makeuse of an inversion gadget. Let us consider chunksCi, Ci−1, Ci−2 when an inversion gadget is being placedto invert a variable, see Figure 7. We will haveλi−1 = λi, λi−2 = λi, ni = |λi|, ni−1 = |λi−1| + 1 andni−2 = |λi−2|. The total number of guards needed will beni + ni−1 + ni−2. Thea literal in Ci−2 is to theright of a in Ci−2. Using the inversion gadget inCi−1, we can swap the left to right ordering of thea anda

literal so thata in Ci is to the left ofa in Ci.

3.6.1 Inverting Down

In Figure 7, the variable gadget fora in chunkCi−1 is replaced with an inversion gadget. The inversiongadget adds two literal locations for variablea in Ci−1, namelya′ and a′. The variable and mirroreddistinguished points ofa ∈ Ci−1 are being replaced with five inversion distinguished points. These fiveinversion distinguished pointsare: (x, z1, y1, y2, z2). y1 andy2 should be thought of as “mirrored distin-guished points” since they are seen by guards inside chunkCi−1 and by thea anda literal guard locations inchunkCi−2. z1 andz2 are the replacement “variable distinguished points.” Theyare replacement variabledistinguished points in the sense that no guard outside of the inversion gadget fora in Ci−1 can see them.More importantly,z1 andz2 are considered replacement “variable distinguished points” because they obeythe Uniqueness Claim. z1 is only seen bya ∈ Ci−1 anda′ ∈ Ci−1. z2 is only seen bya ∈ Ci−1 anda′ ∈ Ci−1. Thex point is the special inversion distinguished point that allows the inversion to take place.

9

Page 11: James King Erik Krohn jking@cs.mcgill.ca erik …€¦ · completeness proof was proposed but never ... The first constant factor approximation for the terrain ... The interested

aa

a′a′

a

z1

z2

a

av

x

y2

y1

Ci

Ci−1

Ci−2

v′

a

Figure 7: Inverting one variable.

The important visibilities are given here:a ∈ Ci−1 seesz1 andv; a′ ∈ Ci−1 seesz1, y1 andx; a′ ∈ Ci−1

seesx, y2 andz2; a ∈ Ci−1 seesz2 andv′; a ∈ Ci−2 seesy1; anda ∈ Ci−2 seesy2. Although not entirelyobvious from the Figure, it’s important to note a ray shot from a ∈ Ci−1 througha ∈ Ci−1 hits the terrainto the left ofv ∈ Ci. These visibilities do not disrupt the order claim.

Because of theUniqueness Claim, it is necessary that we place4 guards to see the variable distinguishedpoints ofCi, Ci−1 andCi−2. If we place the4 guards in a consistent manner, the mirrored distinguishedpoints ofCi and the inversion distinguished points ofCi−1 will also be seen. We will only concern ourselveswith the inversion ofa and ignore the other variables being mirrored. The other variables are being mirroredwithout consequence. We will assume we already have a guard at a ∈ Ci−2 or a ∈ Ci−2. Because ofthe Uniqueness Claim, it is necessary that we place3 guards to see the remaining “variable distinguishedpoints” of z1 andz2 and also the variable distinguished point ofa ∈ Ci. If we place the remaining3 guardsin a consistent manner, the remaining distinguished pointsof y1, y2, x, v andv′ will also be seen.

We note that we need to place one guard ata ∈ Ci or a ∈ Ci to see the variable distinguished point fora ∈ Ci. This leaves two guards to be placed to see the remaining “variable distinguished points” ofz1 andz2.

Using the example in Figure 7, let us saya ∈ Ci−2 was chosen to be a guard. We know at least1 guardmust be placed ata ∈ Ci or a ∈ Ci to see the variable distinguished point ofa in Ci leaving2 guards to seethe unguarded inversion distinguished points:y2, x, z1 andz2. Let us first consider who can guardy2. Theonly 2 guards that seey2 area′ ∈ Ci−1 anda ∈ Ci−2. If we place a guard ata ∈ Ci−2, one of the “variabledistinguished points” ofz1 or z2 will go unseen. Therefore we must choose to place our guard ata′ ∈ Ci−1.

We have one guard left to place in the inversion gadget that must seez1. In order to see bothv andv′,we must place our guard ata ∈ Ci−1. The only other choice isa′ ∈ Ci−1 but this guard does not seev orv′. Placing a guard ata ∈ Ci−1 leavesv′ and the variable distinguished point ofa ∈ Ci unguarded.a ∈ Ci

is chosen to be a guard and the inversion is complete. Similararguments are made showing that ifa ∈ Ci−2

is chosen, thena′ ∈ Ci−1, a ∈ Ci−1 anda ∈ Ci−1 must be chosen.

10

Page 12: James King Erik Krohn jking@cs.mcgill.ca erik …€¦ · completeness proof was proposed but never ... The first constant factor approximation for the terrain ... The interested

Local Summary of Inversion GadgetCi−2–Ci−1–Ci going down: To guard the variable distinguishedpoints and mirrored distinguished points ofCi, the variable, mirrored and inversion distinguished pointsof Ci−1 and the variable distinguished points ofCi−2 with ni + ni−1 + ni−2 guards, it is necessary andsufficient to placeni guards at literals inCi, ni−1 guards inCi−1, andni−2 guards at literals inCi−2 in aconsistent way. If variablea is being inverted, the left to right ordering of the literalsa anda in Ci−2 areopposite of that inCi.

3.6.2 Inverting Up

Similar arguments are used to show the inversion going up. Wewill have λi−1 = λi−2, λi = λi−2,ni = |λi|, ni−1 = |λi−1|+1 andni−2 = |λi−2|. The total number of guards needed will beni+ni−1+ni−2.

Local Summary of Inversion GadgetCi–Ci−1–Ci−2 going down: To guard the variable distinguishedpoints and mirrored distinguished points ofCi, the variable, mirrored and inversion distinguished pointsof Ci−1 and the variable distinguished points ofCi−2 with ni + ni−1 + ni−2 guards, it is necessary andsufficient to placeni guards at literals inCi, ni−1 guards inCi−1, andni−2 guards at literals inCi−2 in aconsistent way. If variablea is being inverted, the left to right ordering of the literalsa anda in Ci−2 areopposite of that inCi.

3.7 Local vs Global View of Gadgets

Having completed the construction, we see that for every chunk Ci we needni points placed within thechunk just to guard the variable distinguished points within the chunk. This is given by theUniquenessClaim. We now observe that the local summary of any gadget holds good in a global sense, that is, it isindependent of how guards are placed in chunks outside this gadget. We illustrate this by summarizing amirror gadget using chunksCi andCi+1 going down. The reader may find it useful to compare with thelocal summary in Section 3.2.

Global Summary of Mirroring Gadget Ci–Ci+1 going down: To guard the variable distinguished pointsand mirrored distinguished points ofCi+1 and the variable distinguished points ofCi with ni guards inCi

andni+1 guards inCi+1, it is necessary to placeni guards at literals inCi andni+1 guards at literals inCi+1 in a consistent way. This necessity holds good forany placement of guards in locations outsideCi

andCi+1. The local sufficiency condition obviously holds good for any placement of guards outsideCi andCi+1.

What this stronger condition means, in the context of Figure5, is thatai+1 andai are the only guardlocations that seeq amongall possibleguard locations on the terrain. Similarly for pointsq′, p andp′.The argument for why this holds is the same as the one made for guard locations withinCi and Ci+1.Having completed the entire construction, we are only now ina position to state this global property. The“necessary” parts of each of the gadgets are similarly modified to hold in a global sense.

3.8 Putting it all Together

Each chunkCi in our construction needsni guards within it. Because of theUniqueness Claim, the terrainwe construct needs at least

∑k−k′ ni guards just to see all of the variable distinguished points.Our construc-

tion ensures that if the distinguished points can be seen by∑k

−k′ ni guards, then the input formula mustbe satisfiable. In particular, the assignment for the variables chosen by then0 points in chunkC0 must be

11

Page 13: James King Erik Krohn jking@cs.mcgill.ca erik …€¦ · completeness proof was proposed but never ... The first constant factor approximation for the terrain ... The interested

consistently mirrored to all chunks and the clause distinguished points must be seen. If the input formula issatisfiable, picking a satisfying assignment and propagating it through our gadgets in the natural way resultsin a set of

∑k−k′ ni guards that see all of the distinguished points. Thus the proof of NP-hardness is thus

completed.

Theorem 3. Discrete terrain guarding is NP-hard.

3.9 Continuous Version

Using the same construction, it can be shown that the continuous version of the terrain guarding problemis also NP-hard. We argue that the entire terrain can be seen by

∑k−k′ ni guards if and only if the input

formula is satisfiable. TheUniqueness Claimholds true despite guards being able to be placed anywhere onthe terrain; since there areni variable distinguished points in chunki, it follows that

∑k−k′ ni are necessary

for seeing the entire terrain. We now argue that if∑k

−k′ ni see the entire terrain, they can be assumed to bein guard locations from the earlier reduction. From this, itfollows that the formula is satisfiable.

Referring to Figure 3, the only potential guards that seed are points on a line segmentad and points on aline segmentda. Let’s say we pick a guardg on the line segmentad. a will see every point thatg does. If wechooseg as our guard, we can simply move our guard toa without any loss of visibility. Similar argumentscan be said abouta and the line segmentda. Therefore, we assume that any guard placed in the sub-terrainada is either ata or a. In particular, the only potential guards ford area anda. Simiarly arguments aremade for the “variable distinguished points” in the inversion gadget. Therefore theUniqueness Claimholdstrue in the continuous version; in other words the lower bound on the number of guards necessary to guardthe variable distinguished points is the same in the continuous version as in the discrete version.

If the formula is satisfiable,∑k

−k′ ni guards will see the entire terrain if the guards are placed insat-isfying locations. Clearly the distinguished points are all seen. It can be shown that the terrain within thechunks is seen. The “empty space” outside of the chunks is also seen. For any 2 chunksCi andCi−2 wherei = k, k − 1, k − 2, ..., 0,−1, ...,−k′ + 3,−k′ + 2, any guard in chunkCi−1 will see the “empty space”betweenCi andCi−2 because of the order claim. The “empty space” above chunkC−k′+1 is seen by theguard placed at the literal for the last deleted variable in chunk Ck′ . The “top” of the terrain is drawn insuch a way that a guard placed for the last variable being deleted while “going up” will see the highest partof the terrain in chunkCk′ . As for the “bottom” of the terrain, the terrain can be slightly modified betweenchunkCk−1 to Ck so that the terrain connecting those two chunks is seen by theonly two remaining literalsin chunkCk−1. The entire terrain is thus seen.

4 Conclusion and Future Work

We have shown that terrain guarding is NP-hard. With the PTASfor terrain guarding given by Gibson et al.[9], this essentially resolves the approximability of the problem. The biggest remaining question regardingthe complexity of terrain guarding is whether or not it is fixed-parameter tractable.

Acknowledgments

We would like to thank Kasturi Varadarajan and Bengt Nilssonfor their valuable comments, discussions andsuggestions.

12

Page 14: James King Erik Krohn jking@cs.mcgill.ca erik …€¦ · completeness proof was proposed but never ... The first constant factor approximation for the terrain ... The interested

References

[1] B. Ben-Moshe, M. Katz, and J. Mitchell.A Constant-Factor Approximation Algorithm for Optimal1.5D Terrain Guarding. SIAM Journal on Computing, 36(6): 1631–1647, 2007.

[2] D. Z. Chen, V. Estivill-Castro, and J. Urrutia.Optimal guarding of polygons and monotone chains.Canadian Conference on Computational Geometry, 1995.

[3] K.L. Clarkson, K. Varadarajan.Improved Approximation Algorithms for Geometric Set Cover. Proc.21st ACM Symposium on Computational Geometry, 2005.

[4] E. D. Demaine and J. ORourke.Open problems: Open problems from CCCG 2005. Proceedings of the18th Canadian Conference on Computational Geometry, pages75-80, 2006.

[5] A. Deshpande, T. Kim, E. D. Demaine, and S. E. Sarma.A Pseudopolynomial TimeO(log n)-Approximation Algorithm for Art Gallery Problems. WADS, 2007.

[6] S. Eidenbenz.Inapproximability Results for Guarding Polygons without Holes. Lecture Notes in Com-puter Science, vol. 1533 (ISAAC’98), 427-436, 1998.

[7] K. Elbassioni, E. Krohn, D. Matijevic, J. Mestre, D. Severdija Improved Approximations for Guarding1.5-Dimensional Terrains. Symposium on Theoretical Aspects of Computer Science, 2009.

[8] S. Ghosh.Approximation algorithms for art gallery problems. Proc. Canadian Information ProcessingSociety Congress, 1987.

[9] M. Gibson, G. Kanade, E. Krohn, K. VaradarajanAn Approximation Scheme for Terrain Guarding.APPROX, 2009.

[10] J. King.A 4-Approximation Algorithm for Guarding 1.5-DimensionalTerrains. Lecture Notes in Com-puter Science (3887), 629-640, 2006.

[11] D. Lee and A. Lin.Computational complexity of art gallery problems. IEEE Trans. Inform. Theory,vol. 32, 276-282, 1986.

[12] D. Lichtenstein.Planar Formulae and their uses, SIAM Journal on Computing, 11(2): 329-343, 1981.

[13] B. Nilsson.Approximate guarding of monotone and rectilinear polygons. Proceedings of ICALP 2005,1362-1373, 2005.

13

Page 15: James King Erik Krohn jking@cs.mcgill.ca erik …€¦ · completeness proof was proposed but never ... The first constant factor approximation for the terrain ... The interested

Appendix A: Deletion Gadget

w

x

y

w

y

Ci

Ci+1

Figure 8: Deleting a variable when mirroring down.

Let us consider chunksCi andCi+1 going down when a deletion gadget is being placed to delete variablex. The total number of guards needed will beni + ni+1 whereni = |λi| andni+1 = |λi+1|. The list ofvariables inCi+1, λi+1 = λi \ x. We replace the variable gadget forx in Ci+1 with a flat surface as seen inFigure 8.

Going up, we need three chunksCi+1, Ci, andCi−1 to construct a deletion gadget for deleting variablex. We will haveλi = λi+1, λi−1 = λi+1 \x, ni+1 = |λi+1|, ni = |λi| andni−1 = |λi−1|. The total numberof guards needed will beni+1 + ni + ni−1. We flatten out the mirrored distinguished points of variablegadgetx in Ci as seen in Figure 9. The mirrored distinguished points were there to help us mirrorx up theterrain. However,x is no longer needed so the mirrored distinguished points cango away as shown.

Ci+1

Ci−1

Ci

FlattenedRegion

wx

y

w

xy

w

y

Figure 9: Deleting a variable when mirroring up.

14

Page 16: James King Erik Krohn jking@cs.mcgill.ca erik …€¦ · completeness proof was proposed but never ... The first constant factor approximation for the terrain ... The interested

a

c

a

wa

cc

cc b

b

a

c

a

a

b

b

h

Ci

Ci−2

Ci−1

Figure 10: Clause going up.

Appendix B: Upward Clause Gadget

The clause gadget going up is done similarly to mirroring variables upward with a few small changes. Wewill haveλi−1 = λi, λi−2 = λi \b, ni = |λi|, ni−1 = |λi−1| andni−2 = |λi−2|. The total number of guardsneeded will beni +ni−1 +ni−2. We replace the highest (in this case leftmost) mirroring distinguished pointof b ∈ Ci−1 with a clause distinguished pointw. We flatten out the other mirroring distinguished point forb ∈ Ci−1 similar to the deletion gadget.

The original purpose of ourh point was to ensure thata ∈ Ci−2 did not affect variables below (to theright of) a ∈ Ci−1. However, we wanta ∈ Ci−2 to seew soh is adjusted accordingly for this. It should benoted thata ∈ Ci−2 does not seew. We also allowc ∈ Ci−2 to seew. The original reason to not allow thiswas soc would not affect the mirroring ofb. This is no longer the case so we allowc ∈ Ci−2 to seew. w

is adjusted accordingly so that a ray shot fromw throughb ∈ Ci−1 seesc ∈ Ci−2. We now have only threevariables that can seew: b ∈ Ci−1, a ∈ Ci−2, andc ∈ Ci−2. We note thatb can safely disappear as it willnot be needed in any other clauses going upwards because of the ordering of the clauses. See AppendixC

for a detailed explanation of whyb can be removed.

15

Page 17: James King Erik Krohn jking@cs.mcgill.ca erik …€¦ · completeness proof was proposed but never ... The first constant factor approximation for the terrain ... The interested

b

Cl3

Cl4

d

a

Cl6

Cl2Cl1

Cl5 c

e

Figure 11: Planar 3SAT Example.

Appendix C: Reduction Example

The reduction from planar 3SAT is done in the following way. The reduction given in this section combinesseveral steps when visibility is not affected in an effort tominimize the number of figures needed. Forexample, several variables might be deleted in one chunk where the specification calls for only one deletionper chunk.

In Figure 11 we have an instance of planar 3SAT. There are clauses outside the variable cycle and clausesinside the variable cycle. A clauseCli is connected to 3 distinct variables. For example,Cl2 = (c ∨ d ∨ e).We arbitrarily pick a variable to be the lowest indexed variable and work clockwise around the variable cyclein increasing order. In the example in Figure 11 we choosea to be the lowest index variable. Our orderingof variables isa < b < c < d < e. This indexing of variables also gives us the ordering of variable gadgetsin chunks. In even chunks,a will be the leftmost variable gadget,b will be the next leftmost, followed bycand so on. In odd chunks,a will be the rightmost variable gadget,b will be the next rightmost, followed byc and so on. ChunkC0 is shown in Figure 14. Theinterval of a clauseCli is denotedI(Cli). The intervalof a clause is defined as the span from the lowest index variable in Cli to the highest indexed variable inCli. From the example,I(Cl3) = (b, d).

We will focus on clauses outside of the variable cycle. We assume that each clause has3 distinctvariables. Because of this and because our graph is planar, every clause outside the variable cycle hasa unique interval. Take two clauses outside the cycleCli andClj. We know the intervals are distinct.

16

Page 18: James King Erik Krohn jking@cs.mcgill.ca erik …€¦ · completeness proof was proposed but never ... The first constant factor approximation for the terrain ... The interested

b

Cl3

Cl2

Cl4

cCl1

de

a

Figure 12: Planar 3SAT Example.

Because of planarity, either the intervalsI(Cli) andI(Clj) have disjoint interiors or one of the intervals isproperly contained in the other. IfI(Cli) is properly contained withinI(Clj), we say that clauseCli < Clj.We therefore have a partial ordering of the clauses. With this partial ordering we construct a valid totalordering of all of the clauses both inside the variable cycleand outside the variable cycle. The orderingof clauses outside the cycle are used when placing clauses going up the terrain. Similarly, intervalsI(Cli)andI(Clj) for clauses inside the variable ring either have disjoint interiors orI(Cli) is properly containedwithin I(Clj).

Let us consider the ordering of clauses outside of the cycle,call this orderingΓ. It is because of thisordering that we can delete the “middle” variable from the terrain when we place our clause gadget. Themiddle variable is defined as the variable that is not an endpoint of the interval. For example, ifCli =(c∨h∨r) andI(Cli) = (c, r), our middle variable ish. Let us take the first clause inΓ, call this clauseCli.We know that for every other clauseClj ∈ Γ, Clj ≮ Cli. Since we are placing the smallestI(Cli) first,based on our partial ordering, we know there are no clauses less thanCli. Since intervals do not overlapbecause of planarity, no other clauseClj ∈ Γ will use the middle variable ofCli. Before we can place aclause gadget forCli, there may be unused variables in the span ofI(Cli). We must first delete these unusedvariables before generating a clause gadget forCli.

As an example, consider Figure 11. We have three clauses on the outside of the cycle and three clauseson the inside of the cycle.Cl1 = (a∨ c∨ e), Cl2 = (c∨ d∨ e), Cl3 = (b∨ c∨ d), Cl4 = (a∨ b∨ d), Cl5 =(a ∨ b ∨ c), Cl6 = (a ∨ d ∨ e). The intervals of each of the clauses areI(Cl1) = (a, e), I(Cl2) =(c, e), I(Cl3) = (b, d), I(Cl4) = (a, d), I(Cl5) = (a, c), I(Cl6) = (a, e). A partial ordering of the clausesoutside the cycle isCl3 < Cl4 andCl4 < Cl6 andCl3 < Cl6. A possible total ordering for clauses outsidethe ring is then〈Cl3, Cl4, Cl6〉. A partial ordering of clauses inside the cycle isCl2 < Cl1 andCl5 < Cl1.A possible total ordering for clauses inside the ring is〈Cl2, Cl5, Cl1〉 or 〈Cl5, Cl2, Cl1〉.

The remainder of the example will use the planar 3SAT exampleshown in Figure 12. The clauses for

17

Page 19: James King Erik Krohn jking@cs.mcgill.ca erik …€¦ · completeness proof was proposed but never ... The first constant factor approximation for the terrain ... The interested

Figure 13: The entire terrain.

the example are defined asCl1 = (a ∨ c ∨ d), Cl2 = (a ∨ d ∨ e), Cl3 = (b ∨ c ∨ d), Cl4 = (a ∨ b ∨ d).An overview of the entire terrain is shown in Figure 13. In each subsequent figure, we will show

the specific part of the terrain we are describing along with asmaller version of the entire terrain to givereference to where we are on the terrain.

Figure 14 shows the details of chunkC0. Starting at chunkC0 we will work our way downward. Thefigures place small rectangles for literals chosen as guard locations. In our example, we have chosen to placeguards at the literal locationsa, b, c, d, ande. We choose clauseCl1 as the first clause placed on the terraingoing downward from our total ordering obtained before.

Before we can place a gadget for clauseCl1 on the terrain, we must delete theb variable sinceI(Cl1) =(a, d) and we only use thea, c andd variables. This deletion is done in chunkC1 as shown in Figure 15. Inthis figure, the location where theb variable gadget would be inC1 is replaced by a flat surface.

We are now ready to place a clause gadget and this is shown in Figure 16. In this figure, thec variablegadget, as seen in the left in Figure 16, is replaced with a clause gadget for clauseCl1, as seen in the rightin Figure 16. If we were only doing a mirroring, a ray shot fromthec mirrored distinguished point in chunkC2 throughn would hit thec literal location in chunkC1. However, since we are replacing thec variablegadget with a clause gadget, we want two other literals to seeinto c’s variable region, which now containstheCl1 distinguished point. Those literal locations beingd in C1 anda in C1. TheCl1 distinguished pointis adjusted upward accordingly so that a ray shot fromCl1’s distinguished point throughn would hit theguard location ford ∈ C1. Referring back to Figure 15, we move them towardsp so thata ∈ C1 seesCl1’s

18

Page 20: James King Erik Krohn jking@cs.mcgill.ca erik …€¦ · completeness proof was proposed but never ... The first constant factor approximation for the terrain ... The interested

a

d

e

b

c

Figure 14: ChunkC0 which contains variable gadgets for all variables on the variable cycle.

a

e

d

c Flattened Surface

m

p

Figure 15: ChunkC1 which places a deletion gadget for variableb.

19

Page 21: James King Erik Krohn jking@cs.mcgill.ca erik …€¦ · completeness proof was proposed but never ... The first constant factor approximation for the terrain ... The interested

a

d

e

a

d

e

c mirrored d.p.

n n

Cl1 distinguished point

Figure 16: ChunkC2 which places a clause gadget for clauseCl1.

a

e

d

d

Figure 17: ChunkC3 which places an inversion gadget for variabled.

20

Page 22: James King Erik Krohn jking@cs.mcgill.ca erik …€¦ · completeness proof was proposed but never ... The first constant factor approximation for the terrain ... The interested

a

e

d

m

Figure 18: ChunkC4.

distinguished point in chunkC2. Recall thatm was originally there to keepa from seeing into variablegadgets to the right ofa in chunkC2. We also movec ∈ C1 down so that it does not seeCl1’s distinguishedpoint. There are now 3 literal locations that can seeCl1’s distinguished point, namelya ∈ C1, c ∈ C1, andd ∈ C1. If any of these literals have a guard at their location,Cl1’s distinguished point is seen, in otherwords,Cl1 is satisfied. It is also important to note that none of these modifications affect the mirroring ofvariablesa andd or any other variable.

The next clause that is placed isCl2 = (a ∨ d ∨ e). Literalsa ande are in the correct location in chunkC2 but d is not. Therefore, thed variable must be inverted before we can place the next clausegadget. Weinvert d in chunkC3 as shown in Figure 17. After the inversion gadget is placed inchunkC3, the orderingof thed andd literals in chunkC4 is correct. This is shown in Figure 18.

Once the literals are in the correct order, we can place our clause gadget forCl2. This is done in chunkC5 as shown in Figure 19. In this figure, thed variable gadget is replaced with a clause gadget for clauseCl2. The purpose of then point in Figure 19 was to ensure variable gadgets belowd in chunkC4 did not seeinto d’s variable gadget. In this case, we want 1 other literal to see intod’s variable region, which is now ourCl2 distinguished point, that point beinge ∈ C4. TheCl2 distinguished point is adjusted up accordingly.The literald ∈ C4 is also adjusted down accordingly. Referring back to Figure18, we adjust them point sothata ∈ C4 seesCl2’s distinguished point. Recall thatm was originally there to keepa from seeing intodifferent variable gadgets in chunkC5. There are now 3 literal locations that can seeCl2’s distinguishedpoint, namelya ∈ C4, d ∈ C4, ande ∈ C4. If any of these literals have a guard at their location,Cl2’sdistinguished point is seen and the clause is satisfied.

As said in the beginning of this section, we are combining several deletions in chunkC5 to save space.We show the deletion of thea ande variable in Figure 19. The variable gadgets are simply replaced withflat surfaces.

This ends our reduction going downward and we count how many guards are necessary going downward.We see that each variable gadget requires a guard to be placedat one of the literal points for that particularvariable gadget. No other point on the terrain sees these variable distinguished points so a guard is required

21

Page 23: James King Erik Krohn jking@cs.mcgill.ca erik …€¦ · completeness proof was proposed but never ... The first constant factor approximation for the terrain ... The interested

Cl2 distinguished point

n

Figure 19: ChunkC5 which places a clause gadget for clauseCl2 and a deletion gadget for variablea ande.

to be placed at a literal location for each variable gadget. We also add 1 extra guard for each inversion gadgetthat was placed. Recall that an inversion requires 1 extra guard because the inversion gadget has 2 “variabledistinguished points”. We count the number of variable gadgets in each chunkC0, C1, C2, C3, C4, andC5

and end up with5 + 4 + 3 + (3 + 1) + 3 + 0 = 19.We now consider placing gadgets going “up” the terrain. We wish to place a gadget for clauseCl3 on

our terrain but we must invert variabled first. Figure 20 shows chunkC−1 and the inversion ofd.We can now place a clause gadget forCl3 = (b ∨ c ∨ d). We place this gadget in chunkC−2 as shown

in Figure 21. The mirrored distinguished point forc is replaced withCl3’s distinguished point. Since weare deletingc in this chunk, we flatten out the other mirrored distinguished point for c. We moveCl3’sdistinguished point accordingly so that it sees thed guard location in chunkC−3.

The changes for the clause gadget are continued in chunkC−3 as shown in Figure 22. The change wemust make is adjusting them point as seen before. The original purpose ofm was to ensureb ∈ C−3 didnot see other variables mirrored distinguished points to the right ofb ∈ C−2. However, this changes becausewe wantb ∈ C−3 to seeCl3’s distinguished point. The only guard locations that seeCl3’s distinguishedpoint arec ∈ C−2, b ∈ C−3 andd ∈ C−3. We also delete thee variable in chunkC−3 to save space. Todeletee, the mirrored distinguished points fore ∈ C−3 are flattened out.

ChunkC−4 is shown in Figure 23. In this chunk we place the clause gadgetfor Cl4. We replace variablegadgetb ∈ C−4 with a clause gadget forCl4. Cl4’s distinguished point is adjusted accordingly so that itsees thed literal guard location in chunkC−5. Since this is the last clause to be placed and to save space,thea andd variables are deleted in chunkC−5 as shown in Figure 24. Adjustments to the terrain in chunkC−5 are made similarly as before so thata seesCl4’s distinguished point. The only guard locations that seeCl4’s distinguished point areb ∈ C−4, a ∈ C−5 andd ∈ C−5.

This ends our reduction going upward and we count how many guards are necessary going upward. Wenote that each variable gadget requires a guard to be placed at one of the literal points for that particularvariable gadget because of theUniqueness Claim. No other point on the terrain sees these variable distin-guished points so a guard is required to be placed at a literallocation for each variable gadget. We also

22

Page 24: James King Erik Krohn jking@cs.mcgill.ca erik …€¦ · completeness proof was proposed but never ... The first constant factor approximation for the terrain ... The interested

a

e

d

d

b

c

Figure 20: ChunkC−1 which places an inversion gadget for variabled.

a

e

b

d

c

Cl3 distinguished point

Flattened region to deletec

Figure 21: ChunkC−2 which places a clause gadget for clauseCl3 and also deletes variablec.

23

Page 25: James King Erik Krohn jking@cs.mcgill.ca erik …€¦ · completeness proof was proposed but never ... The first constant factor approximation for the terrain ... The interested

a

e

b

d

m

Figure 22: ChunkC−3 which places a deletion gadget for variablee.

a

b

d

Cl4 distinguished point

Figure 23: ChunkC−4 which places a clause gadget for clauseCl4 and also deletes variableb.

24

Page 26: James King Erik Krohn jking@cs.mcgill.ca erik …€¦ · completeness proof was proposed but never ... The first constant factor approximation for the terrain ... The interested

a

d

Figure 24: ChunkC−5 which places a deletion gadget for variablesa andd.

add 1 extra guard for each inversion gadget that was placed. Recall that an inversion requires 1 extra guard.We count the number of variable gadgets in each chunkC−1, C−2, C−3, C−4, andC−5 and end up with(5 + 1) + 5 + 4 + 3 + 2 = 20.

The entire terrain needs at least39 guards. However39 guards are sufficient if the planar 3SAT instanceis satisfiable. Assuming correct choices were made in mirroring, no extra guards are required to see themirrored distinguished points. If the planar 3SAT instanceis satisfiable, the entire terrain can be guardedwith 39 guards because the clause distinguished points will also beseen. If more than39 guards are requiredto see the entire terrain, the planar 3SAT instance is not satisfiable.

25