Abstract

Let 𝐺=(𝑉,𝐸) be a simple connected undirected graph. Each vertex 𝑣𝑉 has a cost 𝑐(𝑣) and provides a positive coverage radius 𝑅(𝑣). A distance 𝑑uv is associated with each edge {𝑢,𝑣}𝐸, and 𝑑(𝑢,𝑣) is the shortest distance between every pair of vertices 𝑢,𝑣𝑉. A vertex 𝑣 can cover all vertices that lie within the distance 𝑅(𝑣), except the vertex itself. The conditional covering problem is to minimize the sum of the costs required to cover all the vertices in 𝐺. This problem is NP-complete for general graphs, even it remains NP-complete for chordal graphs. In this paper, an 𝑂(𝑛2) time algorithm to solve a special case of the problem in a trapezoid graph is proposed, where 𝑛 is the number of vertices of the graph. In this special case, 𝑑uv=1 for every edge {𝑢,𝑣}𝐸, 𝑐(𝑣)=𝑐 for every 𝑣𝑉(𝐺), and 𝑅(𝑣)=𝑅, an integer >1, for every 𝑣𝑉(𝐺). A new data structure on trapezoid graphs is used to solve the problem.

1. Introduction

Let 𝐺=(𝑉,𝐸) be a finite, connected, undirected, and simple graph where 𝑉={1,2,,𝑛} is the set of vertices and 𝐸 is the set of edges with |𝐸|=𝑚. A distance 𝑑𝑢𝑣 is associated with each edge {𝑢,𝑣}𝐸, and 𝑑(𝑢,𝑣) is the shortest distance between every pair of vertices 𝑢,𝑣𝑉. Each vertex 𝑣𝑉 has a cost 𝑐(𝑣) and provides a positive coverage radius 𝑅(𝑣). The vertex 𝑢𝑉 is covered by a vertex 𝑣𝑉 if and only if 𝑣𝑢 and 𝑑(𝑣,𝑢)𝑅(𝑣). The conditional covering problem (CCP, for short) is to minimize the sum of the costs of the vertices required to cover all the vertices in 𝑉. One closely related problem to the CCP is the total dominating set problem, which is a special case of the CCP in which all distances and coverage radii are equal to 1. The total dominating set problem is NP-complete even on bipartite graphs [1]. Since the total dominating set is a special case of CCP, the CCP is also NP-complete for general graphs.

In this paper a special case of CCP on trapezoid graphs is considered. For the case, we take 𝑑𝑢𝑣=1 for all {𝑢,𝑣}𝐸, 𝑐(𝑣)=𝑐 for all 𝑣𝑉, and the coverage radius 𝑅(𝑣)=𝑅, a fixed positive integer >1 for all 𝑣𝑉. That is, all edge weights are unity, coverage radii are uniform, and vertex costs are constant.

Trapezoid graphs were first investigated in [2, 3]. Trapezoid graphs are the intersection graphs of finite collections of trapezoids between two parallel lines [3]. Both the interval graphs and the permutation graphs form subclasses of the trapezoid graphs [3] and trapezoid graphs are subclasses of cocomparability graphs [4].

A trapezoid diagram consists of two horizontal lines (top channel and bottom channel) and a set of trapezoids. A trapezoid 𝑖 between these lines has four corner points tl(𝑖), tr(𝑖), bl(𝑖), and br(𝑖) which represent the top left, top right, bottom left, and bottom right corner points of the trapezoid 𝑖, respectively. Let 𝑇=1,2,,𝑛 denote the set of trapezoids in the trapezoid diagram for a trapezoid graph 𝐺=(𝑉,𝐸) with |𝑉|=𝑛. For trapezoid 𝑖, tl(𝑖)<tr(𝑖) and bl(𝑖)<br(𝑖) holds. A graph, 𝐺=(𝑉,𝐸), is a trapezoid graph when a trapezoid diagram exists with trapezoid set 𝑇, such that each vertex 𝑖𝑉 corresponds to a trapezoid 𝑖𝑇 and an edge {𝑖,𝑗}𝐸 if and only if trapezoids 𝑖 and 𝑗 intersect within the trapezoid diagram. There is an 𝑂(𝑛2) time recognition algorithm for trapezoid graphs [5]. Moreover, this algorithm also computes a trapezoid diagram, if the given graph 𝐺 is a trapezoid graph. Any trapezoid diagram can be transformed into another trapezoid diagram with all corner points distinct, when the two representations still correspond to the same trapezoid graph. Without loss of generality, it is assumed that no two trapezoids share a common endpoint. The points on each horizontal line of the trapezoid diagram are labeled with distinct integers between 1 and 2𝑛 from left to right. The terms vertex and trapezoid are used interchangeably whenever the context is unambiguous. In this paper, it is assumed that a trapezoid diagram is given and the trapezoids are labeled in increasing order of their top right corner point, that is, 𝑖<𝑗 if and only if tr(𝑖)<tr(𝑗).

As mentioned earlier, the CCP on arbitrary graphs is NP-complete. Several important graph problems that are NP-hard in general case have polynomial time algorithms for trapezoid graphs. Solving these problems on special graphs is of great importance because solutions to a problem on special classes of graphs might shed new light on solutions for the problem on general graphs. Also, solutions to problems on special graphs can be used to approximate solutions to the problems on general graphs. Many real world problems can be modeled as special graphs, and hence simpler solutions are needed compared to the ones for general graphs.

1.1. Review of Previous Work

Moon and Chaudhry [6] were the first to address CCP as constrained facility location model. They present an integer programming model for this problem. Efficient heuristic algorithms for the CCP have been extensively studied in [710]. Moon and Papayanopoulos [11] consider one variation of CCP on trees. Complexity issues regarding the placement of facilities in CCP were considered in [1, 12, 13]. For the CCP on a path graph with uniform coverage radii, Lunday et al. [13] presented a linear time algorithm to solve the unweighted cost CCP and an 𝑂(𝑛2) dynamic programming algorithm to solve the weighted cost CCP. Horne and Smith [1] studied the weighted cost CCP on path and extended star graphs with nonuniform coverage radius and developed an 𝑂(𝑛2) dynamic programming algorithm. In an another article, Horne and Smith [12] considered weighted cost CCP on tree graphs and presented an 𝑂(𝑛4) dynamic programming algorithm. Recently, Sivan et al. [14] have shown that algorithm for CCP on paths, presented by Horne and Smith, is erroneous and further present a correct 𝑂(𝑛3) algorithm for the same. They also propose an 𝑂(𝑛2) algorithm for the CCP on paths when all vertices are assigned unit costs and further extend this algorithm to interval graphs without an increase in time complexity. In our previous work [15], we solved the CCP on unweighted interval graphs with uniform coverage radius which runs in 𝑂(𝑛) time.

1.2. Application

Trapezoid graphs are applied in various fields, including modeling channel routing problems in VLSI design [3] and identifying the optimal chain of nonoverlapping fragments in bioinformatics [16]. See also [17] for other practical applications of trapezoid graphs. The application area of the CCP includes locating facilities in distribution systems, emergency systems, communication systems, energy supply systems, and so forth.

1.3. Main Result

To the best of our knowledge, no algorithm is available to solve the CCP on trapezoid graphs. In this paper, a special case of the CCP on trapezoid graphs is considered with unit edge weights, uniform coverage radius 𝑅>1 and uniform vertex costs. An 𝑂(𝑛2) time algorithm is designed to solve the problem.

1.4. Organization of the Paper

The rest of this paper is organized as follows. Section 2 establishes basic notations and some properties of trapezoid graphs. In Section 3, a new data structure, called caterpillar, is constructed and important properties of caterpillar are proved. In Section 4, an 𝑂(𝑛2) time algorithm is designed for solving conditional covering problem on a trapezoid graph. The time complexity is also calculated in this section. Finally, Section 5 contains some conclusions.

2. Preliminaries

This section presents the preliminaries on which the desired algorithm depends.

A trapezoid 𝑖 is left to the trapezoid 𝑗 if 𝑖<𝑗 and 𝑖 does not intersect 𝑗 in the trapezoid diagram. Similarly, a trapezoid 𝑖 is right to the trapezoid 𝑗 if 𝑖>𝑗 and 𝑖 does not intersect 𝑗 in the trapezoid diagram.

For a vertex 𝑣𝑉 of a graph 𝐺=(𝑉,𝐸), the open neighborhood of 𝑣 are defined as 𝑁(𝑣)={𝑢{𝑢,𝑣}𝐸}. For each 𝑣𝑉, 𝑁(𝑣) can be computed in 𝑂(𝑛2) time.

𝑇(𝑖) is the highest trapezoid intersecting the trapezoid 𝑖 such that tr(𝑇(𝑖))>tr(𝑖) or 𝑇(𝑖)=𝑖 if such trapezoid does not exist.

𝐵(𝑖) is the trapezoid with highest bottom right point intersecting the trapezoid 𝑖 such that br(𝐵(𝑖))>br(𝑖) or 𝐵(𝑖)=𝑖 if such trapezoid does not exist.

For example, as occurred in Figure 1, 𝑇(1)=2, 𝑇(3)=6, 𝐵(1)=1, 𝐵(2)=3, and so forth.

The symbol 𝑥𝑦 is used to indicate the adjacency between the vertices 𝑥 and 𝑦, that is, there is an edge between 𝑥 and 𝑦. It should be noted that 𝑥𝑦 implies 𝑦𝑥.

The following properties of trapezoid graphs are useful for our proofs.

Lemma 2.1. For 𝑖<𝑗 two vertices 𝑖 and 𝑗 are adjacent in 𝐺 if and only if either tl(𝑗)<tr(𝑖) or bl(𝑗)<br(𝑖).

Proof. Let us consider the case 𝑖<𝑗 and tl(𝑗)<tr(𝑖). By the ordering of trapezoids, tr(𝑖)<tr(𝑗) as 𝑖<𝑗. Then tl(𝑗)<tr(𝑖)<tr(𝑗). Therefore, in the corresponding trapezoid representation, the trapezoid 𝑖 intersects the trapezoid 𝑗, so 𝑖 is adjacent to 𝑗 in 𝐺. Now consider the case when 𝑖<𝑗 and bl(𝑗)<br(𝑖). In this case, bl(𝑗)<br(𝑖) and 𝑡𝑟(𝑖)<tr(𝑗). Therefore in trapezoid representation, the chord joining the corner points bl(𝑗) and tr(𝑗) of 𝑗 always intersects 𝑖, that is, the trapezoids 𝑖 and 𝑗 have a nonempty intersection in the trapezoid representation and hence 𝑖 is adjacent to 𝑗 in 𝐺. Conversely, let 𝑖 is adjacent to 𝑗 in 𝐺 and 𝑖<𝑗. Therefore in the trapezoid representation 𝑖 and 𝑗 have a nonempty intersection and tr(𝑖)<tr(𝑗). This is possible only when either tl(𝑗)<tr(𝑖) or bl(𝑗)<br(𝑖) or both. Hence the lemma holds.

Lemma 2.2. For any three vertices 𝑢,𝑣,𝑤𝑉, if 𝑢<𝑣<𝑤 and {𝑢,𝑤}𝐸 then either, {𝑢,𝑣}𝐸 or {𝑣,𝑤}𝐸.

Proof. As 𝑢<𝑣<𝑤, so by the ordering of trapezoids we have tr(𝑢)<tr(𝑣)<tr(𝑤). The condition {𝑢,𝑤}𝐸 implies that either tl(𝑤)<tr(𝑢) or bl(𝑤)<br(𝑢). Therefore any trapezoid 𝑣, satisfying the inequality tr(𝑢)<tr(𝑣)<tr(𝑤), either intersects 𝑢 or 𝑤 or both, that is, either {𝑢,𝑣}𝐸 or {𝑣,𝑤}𝐸.

The following result is used to test whether two trapezoids are adjacent or not.

Lemma 2.3. For 𝑖<𝑗 two vertices 𝑖 and 𝑗 of the trapezoid graph G are not adjacent if and only if tr(𝑖)<tl(𝑗) and br(𝑖)<bl(𝑗).

Proof. Let tr(𝑖)<tl(𝑗) and br(𝑖)<bl(𝑗). Since always tl(𝑖)<tr(𝑖),bl(𝑖)<br(𝑖),tl(𝑗)<tr(𝑗), and bl(𝑗)<br(𝑗) holds. It follows that tl(𝑖)<tr(𝑖)<tl(𝑗)<tr(𝑗) and bl(𝑖)<br(𝑖)<bl(𝑗)<br(𝑗). This means that in the trapezoid representation, the trapezoid 𝑖 lie on the left of the trapezoid 𝑗, implying that in the graph the vertices 𝑖 and 𝑗 are not adjacent. Conversely, in the trapezoid graph the vertices 𝑖 and 𝑗 are nonadjacent only when in the trapezoid representation the trapezoids 𝑖 and 𝑗 have no common region, that is, only when 𝑖 is completely on the left of 𝑗, that is, tr(𝑖)<tl(𝑗) and br(𝑖)<bl(𝑗). Hence the lemma follows.

To compute all 𝑇(𝑖), the trapezoids on the top and bottom channels of the matching diagram are scanned. The following lemma computes all 𝑇(𝑖).

Lemma 2.4. For all 𝑢𝑉, 𝑇(𝑢) can be computed in 𝑂(𝑛) time.

Proof. Recall that 𝑇(𝑢) is the trapezoid having highest top right point among all trapezoids intersecting the trapezoid 𝑢. Let 𝑡 be the last top right point in the trapezoid representation. Then 𝑡=2𝑛. Let 𝑡1=𝑏1=2𝑛, 𝑡2 be the tl(𝑘) and let 𝑏2 be the bl(𝑘) where 𝑘 is the trapezoid whose top right point is 𝑡. Initially, we scan the points on the top channel between 𝑡2 and 𝑡1 and on the bottom channel between 𝑏2 and 𝑏1. For each such point 𝑝, let 𝑖 be its corresponding trapezoid. If 𝑇(𝑖) is not found yet, then 𝑇(𝑖) is 𝑞, where 𝑞 corresponds to the trapezoid whose top right point is 𝑡. Continue the same process with the following adjustment on 𝑡, 𝑡1, 𝑏1, 𝑡2, and 𝑏2 until all points are scanned. Let 𝑡1 be 𝑡21, 𝑏1=𝑏21, 𝑡 be the previous top right point before 𝑡, 𝑡2=min{𝑡2,tl(𝑘)} and 𝑏2=min{𝑏2,bl(𝑘)} where 𝑘 corresponds to the trapezoid whose top right point is 𝑡.
Clearly, algorithm TOP takes 𝑂(𝑛) time to compute all 𝑇(𝑖), 𝑖=1,2,,𝑛.
Similarly, all 𝐵(𝑖), 𝑖=1,2,,𝑛 can be computed in 𝑂(𝑛) time.

The difficulty of the problem comes from the fact that the neighbor of a vertex of trapezoid graphs can be spread everywhere in the two channels of the trapezoid diagram. To overcome this difficulty a caterpillar is constructed from the given trapezoid diagram.

3. Scheme to Construct a Caterpillar

A caterpillar is a tree in which a single path is incident to every edge. The single path is called the spine of the caterpillar. The vertices not on the spine of a caterpillar are leaves of the caterpillar.

The caterpillar 𝑇(𝐺) from a given trapezoid diagram is constructed as follows.

First, compute two arrays 𝑇(𝑖) and 𝐵(𝑖) for all 𝑖𝑉. Then construct a path such that in the path the distance between any two vertices in the trapezoid graph is shortest. Initialize 𝑖=1. If 𝑇(𝑖)=𝑛 or 𝐵(𝑇(𝑖)))𝐵(𝑖) or 𝐵𝑇𝐵𝑇(𝑖)𝐵𝑇𝐵(𝑖) (𝐵𝑇𝐵𝑇(𝑖) is the composition of 𝐵 and 𝑇, that is, 𝐵𝑇𝐵𝑇(𝑖)=𝐵(𝑇(𝐵(𝑇(𝑖))))) then 𝑖 is adjacent to 𝑇(𝑖), otherwise 𝑖 is adjacent to 𝐵(𝑖). Let 𝑖 be adjacent to the vertex 𝑡 (either 𝑇(𝑖) or 𝐵(𝑖)). Replace 𝑖 by 𝑡 and repeat the process until 𝑡 is adjacent to 𝑛. This path is the spine of the caterpillar. Let 𝑃(𝐺) be the spine of the caterpillar. The length of a vertex 𝑢 in the spine is the number of edges in the path from the vertex 1 to 𝑢 and is denoted by dist1(𝑢). We define the length of the vertex 1 as 0. The vertex on the spine at length 𝑙 is denoted by 𝑢𝑙. The set of leaves of the caterpillar at length 𝑙 is denoted by 𝑋𝑙. Next, compute the leaves of the caterpillar as follows: 𝑋𝑙𝑢=𝑁𝑙𝑢𝑙1,𝑋𝑙1𝑢=𝑁𝑙1𝑢𝑙2,𝑢𝑙𝑋𝑙,𝑋𝑙𝑖𝑢=𝑁𝑙𝑖𝑢𝑙(𝑖+1),𝑢𝑙(𝑖1)𝑋𝑙(𝑖1)𝑋𝑙(𝑖2)𝑋,for𝑖=2,3,,𝑙1,0𝑢=𝑁(1)1𝑋1𝑋2.(3.1)

Finally, connect 𝑢 and 𝑢𝑖 by an edge, for all 𝑢𝑋𝑖. The resulting graph is the caterpillar 𝑇(𝐺). The caterpillar 𝑇(𝐺) for the graph of Figure 1 is shown in Figure 2.

If 𝑢𝑋𝑖 then we define dist1(𝑢)=𝑖, 𝑖=0,1,,𝑙. The elements of the set 𝑋𝑖 are the leaves of 𝑢𝑖, 𝑖=0,1,,𝑙. Let 𝑣𝑖 be any leave at length 𝑖 and and 𝑌𝑖 be the collection of elements of the caterpillar at length 𝑖, That is, 𝑣𝑖𝑋𝑖 and 𝑌𝑖=𝑋𝑖{𝑢𝑖}.

Lemma 3.1. The caterpillar 𝑇(𝐺) of a connected trapezoid graph 𝐺 exists and is unique for a given trapezoid diagram.

Proof. The existence of the caterpillar 𝑇(𝐺) follows from the construction of caterpillar. Since for a given trapezoid diagram the order of a vertex 𝑖𝑉 is unique, 𝐵(𝑖) and 𝑇(𝑖) are also unique. Thus the caterpillar is unique for any trapezoid graph 𝐺.

3.1. Properties of the Caterpillar

The vertices of 𝑃(𝐺) satisfy the following results.

By the construction of the caterpillar it is easy to see that, if 𝑢,𝑣𝑃(𝐺) such that |dist1(𝑢)dist1(𝑣)|>1 then {𝑢,𝑣}𝐸.

Lemma 3.2. If 𝑢,𝑣𝑃(𝐺) such that dist1(𝑢)dist1(𝑣)>1 then 𝑢>𝑣.

Proof. Let 𝑢 and 𝑣 be two arbitrary vertices of 𝑃(𝐺) such that dist1(𝑢)dist1(𝑣)>1. Observe that there exists a vertex 𝑤𝑃(𝐺) in between 𝑢 and 𝑣 such that 𝑣𝑤. Then there are two cases that may arise.
Case 1. {𝑤,𝑢}𝐸. In this case tr(𝑢)>tr(𝑣), since else tr(𝑢)<tr(𝑣) implies that {𝑣,𝑢}𝐸 which contradicts Lemma 3.1. Hence 𝑢>𝑣.
Case 2. {𝑤,𝑢}𝐸. It is clear that dist1(𝑣)<dist1(𝑤)<dist1(𝑢). Then, since {𝑢,𝑣}𝐸 (Lemma 3.1) and {𝑣,𝑤}𝐸, in the trapezoid diagram 𝑢 lie on the right of 𝑣. Therefore 𝑢>𝑣.

Lemma 3.3. If 𝑢𝑃(𝐺) and 𝑣𝑋𝑖 such that dist1(𝑣)dist1(𝑢)>2 then {𝑢,𝑣}𝐸.

Proof. Without loss of generality, let 𝑢=𝑢𝑙 and 𝑣𝑋𝑙+𝑖 where 𝑖>2. Then (𝑣,𝑢𝑙+𝑖)𝐸. There exists a path in 𝑇(𝐺) such that 𝑢𝑙𝑢𝑙+1𝑢𝑙+𝑖𝑣.
Since 𝑣 is adjacent to 𝑢𝑙+𝑖, if 𝑣 is adjacent to 𝑢𝑙 then 𝑣 has highest top right and bottom right point intersecting 𝑢𝑙 in the trapezoid diagram. But 𝑢𝑙+1 has highest top right or bottom right point intersecting 𝑢𝑙, a contradiction.
Hence 𝑣 is not adjacent to 𝑢𝑙 and the lemma follows.

The following lemma can be proved by arguments similar to those used in the above lemma.

Lemma 3.4. If 𝑢𝑋𝑙 and 𝑣𝑋𝑙+3 such that {𝑢,𝑣}𝐸 then {𝑣,𝑢𝑙+1}𝐸.

Lemma 3.5. If 𝑢,𝑣𝑇(𝐺) such that dist1(𝑢)dist1(𝑣)>3 then {𝑢,𝑣}𝐸.

Proof. There are four cases that may arise.
Case 1. 𝑢,𝑣𝑃(𝐺). Since dist1(𝑢)dist1(𝑣)>3 and 𝑢,𝑣𝑃(𝐺), by the construction of the caterpillar, it follows that {𝑢,𝑣}𝐸.
Case 2. 𝑢,𝑣𝑃(𝐺). If {𝑢,𝑣}𝐸, then 𝑢 or 𝑣 must be a member of 𝑃(𝐺) which is a contradiction.
Case 3. 𝑢𝑃(𝐺) and 𝑣𝑃(𝐺). Since dist1(𝑢)>dist1(𝑣), 𝑢𝑃(𝐺) and 𝑣𝑃(𝐺), therefore {𝑢,𝑣}𝐸.
Case 4. 𝑢𝑃(𝐺) and 𝑣𝑃(𝐺). If {𝑢,𝑣}𝐸, then 𝑣 must be a member of 𝑃(𝐺) which is a contradiction. Hence the lemma follows.

The following lemma follows from the properties of the caterpillar.

Lemma 3.6. If 𝑢, 𝑣, and 𝑤 be three vertices of the caterpillar of length 𝑙1, 𝑙2, and 𝑙3, respectively such that 𝑙1<𝑙2<𝑙3. If 𝑑(𝑢,𝑤)𝑅 then, 𝑑(𝑣,𝑤)𝑅.

Observe that, if {𝑢,𝑣}𝐸 such that 𝑢𝑋𝑖 and 𝑣𝑋𝑖+3 then there does not exist 𝑤𝑋𝑖𝑗, 𝑗>2 with {𝑤,𝑢}𝐸. Also, there does not exist 𝑡𝑋𝑖+𝑗, 𝑗>2 with {𝑣,𝑡}𝐸.

Lemma 3.7. For any two vertices 𝑢,𝑣𝑃(𝐺), the distance between 𝑢 and 𝑣 is minimum along 𝑃(𝐺).

Proof. Let 𝑢 and 𝑣 be two arbitrary vertex of 𝑃(𝐺) such that 𝑑(𝑢,𝑣)=𝑚. We will show that there does not exist any path from 𝑢 to 𝑣 with 𝑑(𝑢,𝑣)<𝑚. Without loss of generality let 𝑢=𝑢𝑖 and 𝑣=𝑢𝑖+𝑚. For 𝑚=1, the possible paths from 𝑢 to 𝑣 are 𝑢𝑖𝑢𝑖+1 and 𝑢𝑖𝑣𝑖𝑣𝑖+1𝑢𝑖+1. Therefore, the distance between 𝑢 and 𝑣 is minimum along 𝑃(𝐺), that is, the lemma is true for 𝑚=1. For 𝑚=2, the possible paths from 𝑢 to 𝑣 are 𝑢𝑖𝑢𝑖+1𝑢𝑖+2,𝑢𝑖𝑣𝑖𝑣𝑖+1𝑢𝑖+1𝑢𝑖+2, 𝑢𝑖𝑣𝑖𝑣𝑖+1𝑣𝑖+2𝑢𝑖+2, and 𝑢𝑖𝑣𝑖𝑣𝑖+2𝑢𝑖+2. That is, the lemma is true for 𝑚=2 also.
Let the lemma be true for 𝑚=𝑘. Then a shortest path from 𝑢 to 𝑣 is 𝑢𝑖𝑢𝑖+1𝑢𝑖+𝑘. Since 𝑣𝑖+𝑘+1 may adjacent to the leaves 𝑣𝑖+𝑘,𝑣𝑖+𝑘1 and 𝑣𝑖+𝑘2, the possible shortest paths from 𝑢 to 𝑣 are 𝑢𝑖𝑢𝑖+1𝑢𝑖+𝑘𝑢𝑖+𝑘+1 and 𝑢𝑖𝑢𝑖+1𝑢𝑖+𝑘2𝑣𝑖+𝑘2𝑣𝑖+𝑘+1𝑢𝑖+𝑘+1. Hence 𝑢𝑖𝑢𝑖+1𝑢𝑖+𝑘𝑢𝑖+𝑘+1 is a shortest path.

The following definitions are crucial in designing our algorithm.

Definition 3.8. Two vertices 𝑢, 𝑣  (𝑢<𝑣) in a set form a dominating pair if and only if 𝑑(𝑢,𝑣)𝑅 and there is no other vertex 𝑤 in the set with 𝑑(𝑣,𝑤)𝑅.

Definition 3.9. Three vertices 𝑢, 𝑣, and 𝑤  (𝑢<𝑣<𝑤) in a set form a dominating triple if and only if 𝑑(𝑢,𝑣)𝑅, 𝑑(𝑣,𝑤)𝑅 and and there is no other vertex 𝑤 in the set with 𝑑(𝑣,𝑤)𝑅.

4. Minimum Cardinality Conditional Covering

The algorithm proceeds by covering the vertices of the caterpillar from left to right. The algorithm selects the members of conditional covering set in such a way that each member belongs to a dominating pair or a dominating triple.

A formal algorithm is presented in Algorithm 1.

Input: A trapezoid graph with a trapezoid diagram and coverage radius 𝑅 .
Output: A conditional covering set 𝐷 in 𝑉 .
 Initially 𝐷 = 𝜙 and 𝑖 = 0 .
Step 𝟏 : Compute the sets 𝑇 ( 𝑢 ) , 𝐵 ( 𝑢 ) and 𝑁 ( 𝑢 ) for each vertex 𝑢 𝑉 .
Step 𝟐 : Construct the caterpillar. Compute the vertices of the spine and the sets 𝑋 𝑖 for
    𝑖 = 0 , 1 , 2 , , 𝑙 ; where 𝑙 is the highest length of the caterpillar.
Step 𝟑 : Compute 𝑝 = 𝑖 + 𝑅 .
   If 𝑑 ( 𝑢 , 𝑣 𝑗 ) 𝑅 , 𝑗 > 𝑝 + 2 and for all 𝑢 𝑌 𝑖 then
      𝐷 = 𝐷 { 𝑣 𝑗 } such that 𝑗 is maximum, replace 𝑖 by 𝑗 1 , 𝑝 = 𝑖 + 𝑅 , goto Step 4;
   elseif 𝑋 𝑝 = or 𝑢 𝑁 ( 𝑢 𝑝 1 ) 𝑁 ( 𝑢 𝑝 2 ) for all 𝑢 𝑋 𝑝 then
      𝐷 = 𝐷 { 𝑢 𝑝 } , replace 𝑖 by 𝑝 , 𝑝 = 𝑖 + 𝑅 , goto Step 5;
   else 𝐷 = 𝐷 { 𝑢 𝑝 1 } , replace 𝑖 by 𝑝 1 , 𝑝 = 𝑖 + 𝑅 , goto Step 5;
   endif
Step 𝟒 : If 𝑝 > 𝑙 then
     𝐷 = 𝐷 { 𝑣 } such that 𝑑 ( 𝑣 , 𝑣 𝑗 ) 𝑅 and finish;
   elseif 𝑝 = 𝑙 then
     𝐷 = 𝐷 { 𝑢 𝑝 } and finish;
   else go to step 6;
   endif;
Step 𝟓 : If 𝑝 > 𝑙 then
     𝐷 = 𝐷 { 𝑣 } such that 𝑑 ( 𝑣 , 𝑢 ) 𝑅 and finish;// 𝑢 is the latest selected member
                             of 𝐷 //
   elseif 𝑝 = 𝑙 then 𝐷 = 𝐷 { 𝑢 𝑝 } and finish;
   else go to step 6;
   endif;
Step 𝟔 : If 𝑑 ( 𝑢 , 𝑣 𝑗 ) 𝑅 , 𝑗 > 𝑝 + 2 and for all 𝑢 𝑌 𝑖 then
      𝐷 = 𝐷 { 𝑣 𝑗 } such that 𝑗 is maximum, replace 𝑖 by 𝑗 1 , 𝑝 = 𝑖 + 𝑅 , goto Step 7;
   elseif 𝑋 𝑝 = or 𝑢 𝑁 ( 𝑢 𝑝 1 ) 𝑁 ( 𝑢 𝑝 2 ) for all 𝑢 𝑋 𝑝 then
      𝐷 = 𝐷 { 𝑢 𝑝 } , replace 𝑖 by 𝑝 , 𝑝 = 𝑖 + 𝑅 , goto Step 7;
   else 𝐷 = 𝐷 { 𝑢 𝑝 1 } , replace 𝑖 by 𝑝 1 , 𝑝 = 𝑖 + 𝑅 , goto Step 7;
   endif;
Step 𝟕 : If 𝑝 > 𝑙 then
     𝐷 is the required solution;
   elseif 𝑝 = 𝑙 then
     If 𝑋 𝑝 = or 𝑢 𝑁 ( 𝑢 𝑝 1 ) 𝑁 ( 𝑢 𝑝 2 ) for all 𝑢 𝑋 𝑝 then
        𝐷 is the required solution;
     else 𝐷 = 𝐷 { 𝑢 𝑝 } and finish;
     endif;
   else go to Step 8;
   endif;
Step 𝟖 : If 𝑑 ( 𝑢 , 𝑣 𝑗 ) 𝑅 , 𝑗 > 𝑝 + 2 and for all 𝑢 𝑌 𝑖 and 𝑗 1 + 𝑅 > 𝑙 then
      𝐷 = 𝐷 { 𝑣 𝑗 } and finish;
   elseif 𝑝 + 𝑅 > 𝑙 then
      𝐷 = 𝐷 { 𝑢 𝑝 } and stop;
   elseif 𝑝 + 𝑅 = 𝑙 and 𝑋 𝑝 + 𝑅 = or 𝑢 𝑁 ( 𝑢 𝑝 + 𝑅 1 ) 𝑁 ( 𝑢 𝑝 + 𝑅 2 ) for all 𝑢 𝑋 𝑝 + 𝑅 then
      𝐷 = 𝐷 { 𝑢 𝑝 } and stop;
   else goto next Step;
   endif;
Step 𝟗 : If 𝑢 𝑁 ( 𝑢 𝑝 1 ) 𝑁 ( 𝑢 𝑝 2 ) , for all 𝑢 𝑋 𝑝 then
    replace 𝑖 by 𝑝 + 1 and goto Step 3;
   else replace 𝑖 by 𝑝 and goto Step 3;
   endif;

4.1. Proof of Correctness

By the process of computation of 𝐷, it is easy to see that every vertex of the caterpillar is covered by a vertex in 𝐷. Also, any member of 𝐷 is included in a dominating pair or triple. Therefore each vertex of the induced subgraph of 𝐷 in 𝐺 is covered by at least one other vertex in 𝐷.

Observe that the set 𝐷 consists entirely of dominating pairs and triples of vertices. If not, then there exists a minimum cardinality conditional covering set 𝐷 that does not contain entirely is covering pairs and triples. So, there must exists a set of four vertices 𝑥,𝑦,𝑧,𝑤 such that 𝑑(𝑥,𝑦)𝑅, 𝑑(𝑦,𝑧)𝑅 and d(𝑧,𝑤)𝑅. Now, if a vertex 𝑡 be chosen as a member of 𝐷 instead of 𝑧 such that dist1(𝑡)>dist1(𝑤) and 𝑑(𝑡,𝑤)𝑅 then also each vertex of the induced subgraph of 𝐷 in 𝐺 is covered by at least one other vertex in 𝐷. Again, the set of vertices covered by 𝑥,𝑦,𝑧,𝑤 is a proper subset of the set of vertices covered by 𝑥,𝑦,𝑤,𝑡. Since the aim is to minimize |𝐷|, later selection is better. Again, at each stage, the algorithm selects the member of 𝐷 of maximum length of the caterpillar, such that the newly selected member covers the vertices of maximum length on the right and covers all uncovered vertices on the left. Therefore the solution set 𝐷 is of minimum cardinality.

Theorem 4.1. Algorithm 1 finds a minimum cardinality conditional covering set on trapezoidgraphs in 𝑂(𝑛2) time.

Proof. Step 1 can be computed using 𝑂(𝑛) time. Step 2 requires 𝑂(𝑛2) time. Step 3 can be done in constant time. So the caterpillar is constructed in 𝑂(𝑛2) time. In worst case Step 4 is to be repeated for 𝑂(𝑛) time. Therefore, the total running time of the algorithm CCP is 𝑂(𝑛2).

5. Concluding Remarks

To date no algorithms have been proposed for CCP on trapezoid graphs. In this paper, we proposed an 𝑂(𝑛2) time algorithm for solving CCP on trapezoid graphs. The proposed algorithm was designed based on the strategy: first, construct the caterpillar and then solve the problem on the constructed caterpillar. Since the class of permutation graphs is a subclass of trapezoid graphs, this problem on permutation graphs can also be solved in 𝑂(𝑛2) time by our algorithm. It would be interesting to develop more efficient algorithms of low complexity for these problems. A future study could also continue to examine one of several practical variations of the CCP.