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

Let G 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 NPcomplete 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.


Introduction
Let G 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 d uv 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 generalgraphs.

ISRN Discrete Mathematics
In this paper a special case of CCP on trapezoid graphs is considered.For the case, we take d uv 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 trapezoid i 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 n 2 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.algorithm for the same.They also propose an O n 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 O n time.

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.

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 R > 1 and uniform vertex costs.An O n 2 time algorithm is designed to solve the problem.

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 O n 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.

Preliminaries
This section presents the preliminaries on which the desired algorithm depends.
A trapezoid i is left 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 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 Figure 1, T 1 2, T 3 6, B 1 1, B 2 3, and so forth.
The symbol x ∼ 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.For i < 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 case i < 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.
Proof.As u < 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.For i < 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.Let tr 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 all T 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 all u ∈ V , T u can be computed in O n time.
Proof.Recall that T 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 t 1 b 1 2n, t 2 be the tl k and let b 2 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 t 2 and t 1 and on the bottom channel between b 2 and b 1 .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, t 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.

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 T * G from a given trapezoid diagram is constructed as follows.
First, compute two arrays T 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 dist 1 u .We define the length of the vertex 1 as 0. The vertex on the spine at length l is denoted by u * l .The set of leaves of the caterpillar at length l is denoted by X l .Next, compute the leaves of the caterpillar as follows: Finally, connect u and u * i by an edge, for all u ∈ X i .The resulting graph is the caterpillar T * G .The caterpillar T * G for the graph of Figure 1 is shown in Figure 2.
If u ∈ X i then we define dist 1 u i, i 0, 1, . . ., l.The elements of the set X i are the leaves of u * i , i 0, 1, . . ., l.Let v i be any leave at length i and and Y i be the collection of elements of the caterpillar at length i, That is, v i ∈ X i and Y i X i ∪ {u * i }.Proof.The existence of the caterpillar T * 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.

Properties of the Caterpillar
The vertices of P G satisfy the following results.By the construction of the caterpillar it is easy to see that, if u, v ∈ P G such that Proof.Let u and v be two arbitrary vertices of P G such that dist 1 u − dist 1 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.
Proof.Without loss of generality, let u u * l and v ∈ X l i where i > 2. Then v, u * l i ∈ E. There exists a path in Hence v is not adjacent to u * l and the lemma follows.
The following lemma can be proved by arguments similar to those used in the above lemma.
Proof.There are four cases that may arise.The following lemma follows from the properties of the caterpillar.Lemma 3.6.If u, v, and w be three vertices of the caterpillar of length l 1 , l 2 , and l 3 , respectively such that Observe that, if {u, v} ∈ E such that u ∈ X i and v ∈ X i 3 then there does not exist w ∈ X i−j , j > 2 with {w, u} ∈ E. Also, there does not exist t ∈ X i j , j > 2 with {v, t} ∈ E. Lemma 3.7.For any two vertices u, v ∈ P G , the distance between u and v is minimum along P G .
Proof.Let u 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 u * i and v u * i m .For m 1, the possible paths from u to v are 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 That is, the lemma is true for m 2 also.Let the lemma be true for m k.Then a shortest path from The following definitions are crucial in designing our algorithm.

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.

Proof of Correctness
By the process of computation of D, 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 set D 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 dist 1 t > dist 1 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.

Concluding Remarks
To date no algorithms have been proposed for CCP on trapezoid graphs.In this paper, we proposed an O n 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 O n 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.

Figure 1 :
Figure 1: A trapezoid graph and one of its trapezoid representation.

Figure 2 :
Figure 2: The caterpillar of the graph of Figure 1.

Lemma 3 . 1 .
The caterpillar T * G of a connected trapezoid graph G exists and is unique for a given trapezoid diagram.
has highest top right and bottom right point intersecting u * l in the trapezoid diagram.But u * l 1 has highest top right or bottom right point intersecting u * l , a contradiction.

Theorem 4 . 1 .
Algorithm 1 finds a minimum cardinality conditional covering set on trapezoidgraphs in O n 2 time.Proof.Step 1 can be computed using O n time.Step 2 requires O n 2 time.Step 3 can be done in constant time.So the caterpillar is constructed in O n 2 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 n 2 .
Horne and Smith 12 considered weighted cost CCP on tree graphs and presented an O n 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 O n 1 , b 1 , t 2 , and b 2 until all points are scanned.Let t 1 be t 2 − 1, b 1 b 2 − 1, t be the previous top right point before t, t 2 min{t 2 , tl k } and b 2 min{b 2 , bl k } where k corresponds to the trapezoid whose top right point is t.
Clearly, algorithm TOP takes O n time to compute all T i , i 1, 2, . . ., n.Similarly, all B i , i 1, 2, . . ., n can be computed in O n time.
by the construction of the caterpillar, it follows that {u, v} / ∈ E.
Case 3. u ∈ P G and v / ∈ P G .Since dist 1 u > dist 1 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.

:
Definition 3.8.Two vertices u, 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. Three vertices u, 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. Compute the sets T u , B u and N u for each vertex u ∈ V .Step 2: Construct the caterpillar.Compute the vertices of the spine and the sets X i for i 0, 1, 2, . . ., l; where l is the highest length of the caterpillar.If d u, v j ≤ R, j > p 2 and for all u ∈ Y If d u, v j ≤ R, j > p 2 and for all u ∈ Y i and j − 1 R > l then i then D D ∪ {v j } such that j is maximum, replace i by j − 1, p i R, goto Step 7; elseif X p ∅ or u ∈ N u * p−1 ∪ N u * p−2 forall u ∈ X p then D D ∪ {u * p }, replace i by p, p i R, goto Step 7; else D D ∪ {u * p−1 }, replace i by p − 1, p i R, goto Step