# An Efficient Algorithm to Solve the Conditional Covering Problem on Trapezoid Graphs

Authors: Akul Rana; Anita Pal; Madhumangal Pal
Journal: ISRN Discrete Mathematics
 (2011)

---

## Abstract

LetG=(V,E) be a simple connected undirected graph. Each vertex v∈V has a cost c(v) and provides a positive coverage radius R(v). A distance duv is associated with each edge {u,v}∈E, and d(u,v) is the shortest distance between every pair of vertices u,v∈V. A vertex v can cover all vertices that lie within the distance R(v), except the vertex itself. The conditional covering problem is to minimize the sum of the costs required to cover all the vertices in G. This problem is NP-complete for general graphs, even it remains NP-complete for chordal graphs. In this paper, an O(n2) time algorithm to solve a special case of the problem in a trapezoid graph is proposed, where n is the number of vertices of the graph. In this special
case, duv=1 for every edge {u,v}∈E, c(v)=c for every v∈V(G), and R(v)=R, an integer >1, for every  v∈V(G). A new data structure on trapezoid graphs is used to solve the problem.


---

## Body

## 1. Introduction

LetG=(V,E) be a finite, connected, undirected, and simple graph where V={1,2,…,n} is the set of vertices and E is the set of edges with |E|=m. A distance duv is associated with each edge {u,v}∈E, and d(u,v) is the shortest distance between every pair of vertices u,v∈V. Each vertex v∈V has a cost c(v) and provides a positive coverage radius R(v). The vertex u∈V is covered by a vertex v∈V if and only if v≠u and d(v,u)≤R(v). 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 V. 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 takeduv=1 for all {u,v}∈E, c(v)=c for all v∈V, and the coverage radius R(v)=R, a fixed positive integer >1 for all v∈V. 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 trapezoidi between these lines has four corner points tl(i), tr(i), bl(i), and br(i) which represent the top left, top right, bottom left, and bottom right corner points of the trapezoid i, respectively. Let T=1,2,…,n denote the set of trapezoids in the trapezoid diagram for a trapezoid graph G=(V,E) with |V|=n. For trapezoid i, tl(i)<tr(i) and bl(i)<br(i) holds. A graph, G=(V,E), is a trapezoid graph when a trapezoid diagram exists with trapezoid set T, such that each vertex i∈V corresponds to a trapezoid i∈T and an edge {i,j}∈E if and only if trapezoids i and j intersect within the trapezoid diagram. There is an O(n2) time recognition algorithm for trapezoid graphs [5]. Moreover, this algorithm also computes a trapezoid diagram, if the given graph G 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 2n 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, i<j if and only if tr(i)<tr(j).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 [7–10]. 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 O(n2) 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 O(n2) dynamic programming algorithm. In an another article, Horne and Smith [12] considered weighted cost CCP on tree graphs and presented an O(n4) 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 O(n3) algorithm for the same. They also propose an O(n2) 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 O(n) 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 radiusR>1 and uniform vertex costs. An O(n2) time algorithm is designed to solve the problem.


### 1.4. Organization of the Paper

The rest of this paper is organized as follows. Section2 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 O(n2) 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.


## 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 [7–10]. 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 O(n2) 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 O(n2) dynamic programming algorithm. In an another article, Horne and Smith [12] considered weighted cost CCP on tree graphs and presented an O(n4) 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 O(n3) algorithm for the same. They also propose an O(n2) 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 O(n) 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 radiusR>1 and uniform vertex costs. An O(n2) time algorithm is designed to solve the problem.


## 1.4. Organization of the Paper

The rest of this paper is organized as follows. Section2 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 O(n2) 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 trapezoidi isleft to the trapezoid j if i<j and i does not intersect j in the trapezoid diagram. Similarly, a trapezoid i is right to the trapezoid j if i>j and i does not intersect j in the trapezoid diagram.For a vertexv∈V of a graph G=(V,E), the open neighborhood of v are defined as N(v)={u:{u,v}∈E}. For each v∈V, N(v) can be computed in O(n2) time.T(i) is the highest trapezoid intersecting the trapezoid i such that tr(T(i))>tr(i) or T(i)=i if such trapezoid does not exist.B(i) is the trapezoid with highest bottom right point intersecting the trapezoid i such that br(B(i))>br(i) or B(i)=i if such trapezoid does not exist.For example, as occurred in Figure1, T(1)=2, T(3)=6, B(1)=1, B(2)=3, and so forth.Figure 1
A trapezoid graph and one of its trapezoid representation.The symbolx~y is used to indicate the adjacency between the vertices x and y, that is, there is an edge between x and y. It should be noted that x~y implies y~x.The following properties of trapezoid graphs are useful for our proofs.Lemma 2.1.
Fori<j two vertices i and j are adjacent in G if and only if either tl(j)<tr(i) or bl(j)<br(i).Proof.
Let us consider the casei<j and tl(j)<tr(i). By the ordering of trapezoids, tr(i)<tr(j) as i<j. Then tl(j)<tr(i)<tr(j). Therefore, in the corresponding trapezoid representation, the trapezoid i intersects the trapezoid j, so i is adjacent to j in G. Now consider the case when i<j and bl(j)<br(i). In this case, bl(j)<br(i) and tr(i)<tr(j). Therefore in trapezoid representation, the chord joining the corner points bl(j) and tr(j) of j always intersects i, that is, the trapezoids i and j have a nonempty intersection in the trapezoid representation and hence i is adjacent to j in G. Conversely, let i is adjacent to j in G and i<j. Therefore in the trapezoid representation i and j have a nonempty intersection and tr(i)<tr(j). This is possible only when either tl(j)<tr(i) or bl(j)<br(i) or both. Hence the lemma holds.Lemma 2.2.
For any three verticesu,v,w∈V, if u<v<w and {u,w}∈E then either, {u,v}∈E or {v,w}∈E.Proof.
Asu<v<w, so by the ordering of trapezoids we have tr(u)<tr(v)<tr(w). The condition {u,w}∈E implies that either tl(w)<tr(u) or bl(w)<br(u). Therefore any trapezoid v, satisfying the inequality tr(u)<tr(v)<tr(w), either intersects u or w or both, that is, either {u,v}∈E or {v,w}∈E.The following result is used to test whether two trapezoids are adjacent or not.Lemma 2.3.
Fori<j two vertices i and j of the trapezoid graph G are not adjacent if and only if tr(i)<tl(j) and br(i)<bl(j).Proof.
Lettr(i)<tl(j) and br(i)<bl(j). Since always tl(i)<tr(i),bl(i)<br(i),tl(j)<tr(j), and bl(j)<br(j) holds. It follows that tl(i)<tr(i)<tl(j)<tr(j) and bl(i)<br(i)<bl(j)<br(j). This means that in the trapezoid representation, the trapezoid i lie on the left of the trapezoid j, implying that in the graph the vertices i and j are not adjacent. Conversely, in the trapezoid graph the vertices i and j are nonadjacent only when in the trapezoid representation the trapezoids i and j have no common region, that is, only when i is completely on the left of j, that is, tr(i)<tl(j) and br(i)<bl(j). Hence the lemma follows.To compute allT(i), the trapezoids on the top and bottom channels of the matching diagram are scanned. The following lemma computes all T(i).Lemma 2.4.
For allu∈V, T(u) can be computed in O(n) time.Proof.
Recall thatT(u) is the trapezoid having highest top right point among all trapezoids intersecting the trapezoid u. Let t be the last top right point in the trapezoid representation. Then t=2n. Let t1=b1=2n, t2 be the tl(k) and let b2 be the bl(k) where k is the trapezoid whose top right point is t. Initially, we scan the points on the top channel between t2 and t1 and on the bottom channel between b2 and b1. For each such point p, let i be its corresponding trapezoid. If T(i) is not found yet, then T(i) is q, where q corresponds to the trapezoid whose top right point is t. Continue the same process with the following adjustment on t, t1, b1, t2, and b2 until all points are scanned. Let t1 be t2-1, b1=b2-1, t be the previous top right point before t, t2=min{t2,tl(k)} and b2=min{b2,bl(k)} where k corresponds to the trapezoid whose top right point is t.
Clearly, algorithm TOP takesO(n) time to compute all T(i), i=1,2,…,n.
Similarly, allB(i), i=1,2,…,n can be computed in O(n) 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

Acaterpillar 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 caterpillarT*(G) from a given trapezoid diagram is constructed as follows.First, compute two arraysT(i) and B(i) for all i∈V. Then construct a path such that in the path the distance between any two vertices in the trapezoid graph is shortest. Initialize i=1. If T(i)=n or B(T(i)))≠B(i) or BTBT(i)≠BTB(i) (BTBT(i) is the composition of B and T, that is, BTBT(i)=B(T(B(T(i))))) then i is adjacent to T(i), otherwise i is adjacent to B(i). Let i be adjacent to the vertex t (either T(i) or B(i)). Replace i by t and repeat the process until t is adjacent to n. This path is the spine of the caterpillar. Let P(G) be the spine of the caterpillar. The length of a vertex u in the spine is the number of edges in the path from the vertex 1 to u and is denoted by dist1(u). We define the length of the vertex 1 as 0. The vertex on the spine at length l is denoted by ul*. The set of leaves of the caterpillar at length l is denoted by Xl. Next, compute the leaves of the caterpillar as follows: (3.1)Xl=N(ul*)-{ul-1*},Xl-1=N(ul-1*)-{ul-2*,ul*}∪Xl,Xl-i=N(ul-i*)-{ul-(i+1)*,ul-(i-1)*}∪Xl-(i-1)∪Xl-(i-2),fori=2,3,…,l-1,X0=N(1)-{u1*}∪X1∪X2.Finally, connectu and ui* by an edge, for all u∈Xi. The resulting graph is the caterpillar T*(G). The caterpillar T*(G) for the graph of Figure 1 is shown in Figure 2.Figure 2
The caterpillar of the graph of Figure1.Ifu∈Xi then we define dist1(u)=i, i=0,1,…,l. The elements of the set Xi are the leaves of ui*, i=0,1,…,l. Let vi be any leave at length i and and Yi be the collection of elements of the caterpillar at length i, That is, vi∈Xi and Yi=Xi∪{ui*}.Lemma 3.1.
The caterpillarT*(G) of a connected trapezoid graph G exists and is unique for a given trapezoid diagram.Proof.
The existence of the caterpillarT*(G) follows from the construction of caterpillar. Since for a given trapezoid diagram the order of a vertex i∈V is unique, B(i) and T(i) are also unique. Thus the caterpillar is unique for any trapezoid graph G.


### 3.1. Properties of the Caterpillar

The vertices ofP(G) satisfy the following results.By the construction of the caterpillar it is easy to see that, ifu,v∈P(G) such that |dist1(u)-dist1(v)|>1 then {u,v}∉E.Lemma 3.2.
Ifu,v∈P(G) such that dist1(u)-dist1(v)>1 then u>v.Proof.
Letu and v be two arbitrary vertices of P(G) such that dist1(u)-dist1(v)>1. Observe that there exists a vertex w∈P(G) in between u and v such that v~w. Then there are two cases that may arise.
Case 1.
{w,u}∈E. In this case tr(u)>tr(v), since else tr(u)<tr(v) implies that {v,u}∈E which contradicts Lemma 3.1. Hence u>v.
Case 2.
{w,u}∉E. It is clear that dist1(v)<dist1(w)<dist1(u). Then, since {u,v}∉E (Lemma 3.1) and {v,w}∈E, in the trapezoid diagram u lie on the right of v. Therefore u>v.Lemma 3.3.
Ifu∈P(G) and v∈Xi such that dist1(v)-dist1(u)>2 then {u,v}∉E.Proof.
Without loss of generality, letu=ul* and v∈Xl+i where i>2. Then (v,ul+i*)∈E. There exists a path in T*(G) such that ul*~ul+1*~⋯~ul+i*~v.
Sincev is adjacent to ul+i*, if v is adjacent to ul* then v has highest top right and bottom right point intersecting ul* in the trapezoid diagram. But ul+1* has highest top right or bottom right point intersecting ul*, a contradiction.
Hencev is not adjacent to ul* and the lemma follows.The following lemma can be proved by arguments similar to those used in the above lemma.Lemma 3.4.
Ifu∈Xl and v∈Xl+3 such that {u,v}∈E then {v,ul+1*}∈E.Lemma 3.5.
Ifu,v∈T*(G) such that dist1(u)-dist1(v)>3 then {u,v}∉E.Proof.
There are four cases that may arise.
Case 1.
u,v∈P(G). Since dist1(u)-dist1(v)>3 and u,v∈P(G), by the construction of the caterpillar, it follows that {u,v}∉E.
Case 2.
u,v∉P(G). If {u,v}∉E, then u or v must be a member of P(G) which is a contradiction.
Case 3.
u∈P(G) and v∉P(G). Since dist1(u)>dist1(v), u∈P(G) and v∉P(G), therefore {u,v}∉E.
Case 4.
u∈P(G) and v∉P(G). If {u,v}∉E, then v must be a member of P(G) which is a contradiction. Hence the lemma follows.The following lemma follows from the properties of the caterpillar.Lemma 3.6.
Ifu, v, and w be three vertices of the caterpillar of length l1, l2, and l3, respectively such that l1<l2<l3. If d(u,w)≤R then, d(v,w)≤R.Observe that, if{u,v}∈E such that u∈Xi and v∈Xi+3 then there does not exist w∈Xi-j, j>2 with {w,u}∈E. Also, there does not exist t∈Xi+j, j>2 with {v,t}∈E.Lemma 3.7.
For any two verticesu,v∈P(G), the distance between u and v is minimum along P(G).Proof.
Letu and v be two arbitrary vertex of P(G) such that d(u,v)=m. We will show that there does not exist any path from u to v with d(u,v)<m. Without loss of generality let u=ui* and v=ui+m*. For m=1, the possible paths from u to v are ui*~ui+1* and ui*~vi~vi+1~ui+1*. Therefore, the distance between u and v is minimum along P(G), that is, the lemma is true for m=1. For m=2, the possible paths from u to v are ui*~ui+1*~ui+2*,ui*~vi~vi+1~ui+1*~ui+2*, ui*~vi~vi+1~vi+2~ui+2*, and ui*~vi~vi+2~ui+2*. That is, the lemma is true for m=2 also.
Let the lemma be true form=k. Then a shortest path from u to v is ui*~ui+1*~⋯~ui+k*. Since vi+k+1 may adjacent to the leaves vi+k,vi+k-1 and vi+k-2, the possible shortest paths from u to v are ui*~ui+1*~⋯~ui+k*~ui+k+1* and ui*~ui+1*~⋯~ui+k-2*~vi+k-2~vi+k+1~ui+k+1*. Hence ui*~ui+1*~⋯~ui+k*~ui+k+1* is a shortest path.The following definitions are crucial in designing our algorithm.Definition 3.8.
Two verticesu, v  (u<v) in a set form a dominating pair if and only if d(u,v)≤R and there is no other vertex w in the set with d(v,w)≤R.Definition 3.9.
Three verticesu, v, and w  (u<v<w) in a set form a dominating triple if and only if d(u,v)≤R, d(v,w)≤R and and there is no other vertex w in the set with d(v,w)≤R.


## 3.1. Properties of the Caterpillar

The vertices ofP(G) satisfy the following results.By the construction of the caterpillar it is easy to see that, ifu,v∈P(G) such that |dist1(u)-dist1(v)|>1 then {u,v}∉E.Lemma 3.2.
Ifu,v∈P(G) such that dist1(u)-dist1(v)>1 then u>v.Proof.
Letu and v be two arbitrary vertices of P(G) such that dist1(u)-dist1(v)>1. Observe that there exists a vertex w∈P(G) in between u and v such that v~w. Then there are two cases that may arise.
Case 1.
{w,u}∈E. In this case tr(u)>tr(v), since else tr(u)<tr(v) implies that {v,u}∈E which contradicts Lemma 3.1. Hence u>v.
Case 2.
{w,u}∉E. It is clear that dist1(v)<dist1(w)<dist1(u). Then, since {u,v}∉E (Lemma 3.1) and {v,w}∈E, in the trapezoid diagram u lie on the right of v. Therefore u>v.Lemma 3.3.
Ifu∈P(G) and v∈Xi such that dist1(v)-dist1(u)>2 then {u,v}∉E.Proof.
Without loss of generality, letu=ul* and v∈Xl+i where i>2. Then (v,ul+i*)∈E. There exists a path in T*(G) such that ul*~ul+1*~⋯~ul+i*~v.
Sincev is adjacent to ul+i*, if v is adjacent to ul* then v has highest top right and bottom right point intersecting ul* in the trapezoid diagram. But ul+1* has highest top right or bottom right point intersecting ul*, a contradiction.
Hencev is not adjacent to ul* and the lemma follows.The following lemma can be proved by arguments similar to those used in the above lemma.Lemma 3.4.
Ifu∈Xl and v∈Xl+3 such that {u,v}∈E then {v,ul+1*}∈E.Lemma 3.5.
Ifu,v∈T*(G) such that dist1(u)-dist1(v)>3 then {u,v}∉E.Proof.
There are four cases that may arise.
Case 1.
u,v∈P(G). Since dist1(u)-dist1(v)>3 and u,v∈P(G), by the construction of the caterpillar, it follows that {u,v}∉E.
Case 2.
u,v∉P(G). If {u,v}∉E, then u or v must be a member of P(G) which is a contradiction.
Case 3.
u∈P(G) and v∉P(G). Since dist1(u)>dist1(v), u∈P(G) and v∉P(G), therefore {u,v}∉E.
Case 4.
u∈P(G) and v∉P(G). If {u,v}∉E, then v must be a member of P(G) which is a contradiction. Hence the lemma follows.The following lemma follows from the properties of the caterpillar.Lemma 3.6.
Ifu, v, and w be three vertices of the caterpillar of length l1, l2, and l3, respectively such that l1<l2<l3. If d(u,w)≤R then, d(v,w)≤R.Observe that, if{u,v}∈E such that u∈Xi and v∈Xi+3 then there does not exist w∈Xi-j, j>2 with {w,u}∈E. Also, there does not exist t∈Xi+j, j>2 with {v,t}∈E.Lemma 3.7.
For any two verticesu,v∈P(G), the distance between u and v is minimum along P(G).Proof.
Letu and v be two arbitrary vertex of P(G) such that d(u,v)=m. We will show that there does not exist any path from u to v with d(u,v)<m. Without loss of generality let u=ui* and v=ui+m*. For m=1, the possible paths from u to v are ui*~ui+1* and ui*~vi~vi+1~ui+1*. Therefore, the distance between u and v is minimum along P(G), that is, the lemma is true for m=1. For m=2, the possible paths from u to v are ui*~ui+1*~ui+2*,ui*~vi~vi+1~ui+1*~ui+2*, ui*~vi~vi+1~vi+2~ui+2*, and ui*~vi~vi+2~ui+2*. That is, the lemma is true for m=2 also.
Let the lemma be true form=k. Then a shortest path from u to v is ui*~ui+1*~⋯~ui+k*. Since vi+k+1 may adjacent to the leaves vi+k,vi+k-1 and vi+k-2, the possible shortest paths from u to v are ui*~ui+1*~⋯~ui+k*~ui+k+1* and ui*~ui+1*~⋯~ui+k-2*~vi+k-2~vi+k+1~ui+k+1*. Hence ui*~ui+1*~⋯~ui+k*~ui+k+1* is a shortest path.The following definitions are crucial in designing our algorithm.Definition 3.8.
Two verticesu, v  (u<v) in a set form a dominating pair if and only if d(u,v)≤R and there is no other vertex w in the set with d(v,w)≤R.Definition 3.9.
Three verticesu, v, and w  (u<v<w) in a set form a dominating triple if and only if d(u,v)≤R, d(v,w)≤R and and there is no other vertex w in the set with d(v,w)≤R.


## 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 Algorithm1.Algorithm 1:Algorithm CCP.
Input: A trapezoid graph with a trapezoid diagram and coverage radius R.Output: A conditional covering set D in V.InitiallyD=ϕ and i=0.Step1: Compute the sets T(u), B(u) and N(u) for each vertex u∈V.Step2: Construct the caterpillar. Compute the vertices of the spine and the sets Xi fori=0,1,2,…,l; where l is the highest length of the caterpillar.Step3: Compute p=i+R.Ifd(u,vj)≤R, j>p+2 and for all u∈Yi thenD=D∪{vj} such that j is maximum, replace i by j-1, p=i+R, goto Step 4;elseifXp=∅ or u∈N(up-1*)∪N(up-2*) for all u∈Xp thenD=D∪{up*}, replace i by p, p=i+R, goto Step 5;elseD=D∪{up-1*}, replace i by p-1, p=i+R, goto Step 5;endifStep4: If p>l thenD=D∪{v} such that d(v,vj)≤R and finish;elseifp=l thenD=D∪{up*} and finish;else go to step 6;endif;Step5: If p>l thenD=D∪{v} such that d(v,u)≤R and finish;// u is the latest selected memberof D//elseifp=l then D=D∪{up*} and finish;else go to step 6;endif;Step6: If d(u,vj)≤R, j>p+2 and for all u∈Yi thenD=D∪{vj} such that j is maximum, replace i by j-1, p=i+R, goto Step 7;elseifXp=∅ or u∈N(up-1*)∪N(up-2*) for all u∈Xp thenD=D∪{up*}, replace i by p, p=i+R, goto Step 7;elseD=D∪{up-1*}, replace i by p-1, p=i+R, goto Step 7;endif;Step7: If p>l thenD is the required solution;elseifp=l thenIfXp=∅ or u∈N(up-1*)∪N(up-2*) for all u∈Xp thenD is the required solution;elseD=D∪{up*} and finish;endif;else go to Step 8;endif;Step8: If d(u,vj)≤R, j>p+2 and for all u∈Yi and j-1+R>l thenD=D∪{vj} and finish;elseifp+R>l thenD=D∪{up*} and stop;elseifp+R=l and Xp+R=∅ or u∈N(up+R-1*)∪N(up+R-2*) for all u∈Xp+R thenD=D∪{up*} and stop;else goto next Step;endif;Step9: If u∈N(up-1*)∪N(up-2*), for all u∈Xp thenreplace i by p+1 and goto Step 3;else replacei by p and goto Step 3;endif;


### 4.1. Proof of Correctness

By the process of computation ofD, it is easy to see that every vertex of the caterpillar is covered by a vertex in D. Also, any member of D is included in a dominating pair or triple. Therefore each vertex of the induced subgraph of D in G is covered by at least one other vertex in D.Observe that the setD consists entirely of dominating pairs and triples of vertices. If not, then there exists a minimum cardinality conditional covering set D that does not contain entirely is covering pairs and triples. So, there must exists a set of four vertices x,y,z,w such that d(x,y)≤R, d(y,z)≤R and d(z,w)≤R. Now, if a vertex t be chosen as a member of D instead of z such that dist1(t)>dist1(w) and d(t,w)≤R then also each vertex of the induced subgraph of D in G is covered by at least one other vertex in D. Again, the set of vertices covered by x,y,z,w is a proper subset of the set of vertices covered by x,y,w,t. Since the aim is to minimize |D|, later selection is better. Again, at each stage, the algorithm selects the member of D 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 D is of minimum cardinality.Theorem 4.1.
Algorithm1 finds a minimum cardinality conditional covering set on trapezoidgraphs in O(n2) time.Proof.
Step 1 can be computed usingO(n) time. Step 2 requires O(n2) time. Step 3 can be done in constant time. So the caterpillar is constructed in O(n2) time. In worst case Step 4 is to be repeated for O(n) time. Therefore, the total running time of the algorithm CCP is O(n2).


## 4.1. Proof of Correctness

By the process of computation ofD, it is easy to see that every vertex of the caterpillar is covered by a vertex in D. Also, any member of D is included in a dominating pair or triple. Therefore each vertex of the induced subgraph of D in G is covered by at least one other vertex in D.Observe that the setD consists entirely of dominating pairs and triples of vertices. If not, then there exists a minimum cardinality conditional covering set D that does not contain entirely is covering pairs and triples. So, there must exists a set of four vertices x,y,z,w such that d(x,y)≤R, d(y,z)≤R and d(z,w)≤R. Now, if a vertex t be chosen as a member of D instead of z such that dist1(t)>dist1(w) and d(t,w)≤R then also each vertex of the induced subgraph of D in G is covered by at least one other vertex in D. Again, the set of vertices covered by x,y,z,w is a proper subset of the set of vertices covered by x,y,w,t. Since the aim is to minimize |D|, later selection is better. Again, at each stage, the algorithm selects the member of D 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 D is of minimum cardinality.Theorem 4.1.
Algorithm1 finds a minimum cardinality conditional covering set on trapezoidgraphs in O(n2) time.Proof.
Step 1 can be computed usingO(n) time. Step 2 requires O(n2) time. Step 3 can be done in constant time. So the caterpillar is constructed in O(n2) time. In worst case Step 4 is to be repeated for O(n) time. Therefore, the total running time of the algorithm CCP is O(n2).


## 5. Concluding Remarks

To date no algorithms have been proposed for CCP on trapezoid graphs. In this paper, we proposed anO(n2) 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 O(n2) 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.



---

*Source: 213084-2011-11-17.xml*