8
INFORMATION SCIENCES IN~P,NAlaO~,~L JOViaL ELSEVIER Journal of Information Sciences 108 (1998) 5-12 Geodesic visibility in graphs Angela Y. Wu a, Azriel Rosenfeld b,. " Department of Computer Science and Information Systems, American University, Washington, DC 20016-8116, USA b Computer Vision Laboratory, Center for Automation Research, University of Maryland, College Park, MD 20742-3275, USA Received 1 April 1997; accepted 20 June 1997 Communicated by Azriel Rosenfeld Abstract Two nodes in a pebbled graph are said to be mutually visible if there exists a shortest path (a "geodesic") between them which is unpebbled. In an earlier paper we studied this concept for node-pebbled graphs, and characterized various types of pebbled graphs that are geodesically "convex", i.e., any two of their unpebbled nodes are mutu- ally visible. In this paper we consider arc pebblings as well as node pebblings. We show that the visibility relations defined by arc and node pebblings are incomparable, and we give general characterizations of the visibility relations that can be defined by the two types of pebblings. We also show that in any arc-pebbled (node-pebbled) graph having n nodes, there exists a set of at most n/2 (n/3 + 1) nodes from which every (unpebbled) node is visible. © 1998 Elsevier Science Inc. All rights reserved. Keywords: Visibility; Graphs; Geodesics; Guarding sets 1. Visibility in discrete spaces It is easy to define visibility in Euclidean space; P and Q are mutually visible iff the line segment PQ is unobstructed. In [1] we suggested that a natural gen- eralization of "visibility" to other types of metric spaces could be defined in terms of geodesics: P and Q are mutually visible iff there exists an unobstructed *Corresponding author. Tel.: +I 301 405 4526; fax: +1 30l 314 9115; e-maih [email protected]. 0020-0255/98/$19.00 © 1998 Elsevier Science Inc. All rights reserved. PII: S0020-0255(98) 1 0063-9

Geodesic visibility in graphs

Embed Size (px)

Citation preview

Page 1: Geodesic visibility in graphs

I N F O R M A T I O N SCIENCES

IN~P, NAlaO~,~L JOViaL

ELSEVIER Journal of Information Sciences 108 (1998) 5-12

Geodesic visibility in graphs Angela Y. Wu a, Azriel Rosenfeld b,.

" Department of Computer Science and Information Systems, American University, Washington, DC 20016-8116, USA

b Computer Vision Laboratory, Center for Automation Research, University of Maryland, College Park, MD 20742-3275, USA

Received 1 April 1997; accepted 20 June 1997

Communicated by Azriel Rosenfeld

Abstract

Two nodes in a pebbled graph are said to be mutually visible if there exists a shortest path (a "geodesic") between them which is unpebbled. In an earlier paper we studied this concept for node-pebbled graphs, and characterized various types of pebbled graphs that are geodesically "convex", i.e., any two of their unpebbled nodes are mutu- ally visible. In this paper we consider arc pebblings as well as node pebblings. We show that the visibility relations defined by arc and node pebblings are incomparable, and we give general characterizations of the visibility relations that can be defined by the two types of pebblings. We also show that in any arc-pebbled (node-pebbled) graph having n nodes, there exists a set of at most n/2 (n/3 + 1) nodes from which every (unpebbled) node is visible. © 1998 Elsevier Science Inc. All rights reserved.

Keywords: Visibility; Graphs; Geodesics; Guarding sets

1. Visibility in discrete spaces

It is easy to define visibility in Euclidean space; P and Q are mutual ly visible iff the line segment PQ is unobstructed. In [1] we suggested that a natural gen- eralization o f "visibility" to other types o f metric spaces could be defined in terms o f geodesics: P and Q are mutual ly visible iff there exists an unobstructed

*Corresponding author. Tel.: +I 301 405 4526; fax: +1 30l 314 9115; e-maih [email protected].

0020-0255/98/$19.00 © 1998 Elsevier Science Inc. All rights reserved. PII: S 0 0 2 0 - 0 2 5 5 ( 9 8 ) 1 0 0 6 3 - 9

Page 2: Geodesic visibility in graphs

A.Y. Wu, A. Rosenfeld l Journal of lnformation Sciences 108 (1998) 5-12

geodesic (i.e., shortest path) between P and Q. Note that there may be many such paths.

This paper continues the study of visibility in discrete spaces, i.e in graphs. In [1] we assumed that the obstructions are "pebbles" placed on the nodes of the graph; two unpebbled nodes P,Q of a pebbled graph G are mutually visible iff there exists a shortest path p in G between P and (2 such that no node o f p is pebbled. In [1] we characterized various types of node-pebbled graphs G that are geodesically "convex" - i.e., any two unpebbled nodes of G are mutually visible.

An alternative way to limit visibility in a graph G is to pebble the arcs of G rather than the nodes. Evidently, if we do this, G cannot be convex unless it is connected and completely unpebbled. (Indeed, if P,Q are neighboring nodes of G, there is a unique shortest path, of length 1, between P and (2, so that if the arc (P,Q) is pebbled, P and Q cannot be mutually visible.) In general, as we shall see in Section 2, the visibility relations that can be defined on G by peb- bling some of its arcs are incomparable to the visibility relations that can be defined on G by embedding it into a larger graph G* and pebbling the nodes of G*-G. We also characterize these two types of "geodesic visibility" relations on a graph in terms of "geodesic transitivity" properties.

Let N be a set of nodes of G. Given a visibility relation on G, a set of nodes M is called a guarding set [2] for N if every node of N is visible from some node of M. In Section 3 we establish bounds on the sizes of guarding sets (i.e., on the size of M as a function of the size of N) for various visibility relations.

2. Geodesic visibility relations

There are many ways to define visibility relations on (the nodes of) a graph G. Evidently, any such relation V should be reflexive and symmetric, but this still allows many possibilities. For example, we might call V a myopic visibility relation if two nodes are mutually visible iff the distance between them is at most d (for some d ~> 0). Evidently, any such V is in fact reflexive and sym- metric. In particular, d = 0 yields the trivial visibility relation in which each node can see only itself.

Node pebbling and arc pebbling allow us to define two types of geodesic vis- ibility relations. Let G' be the subgraph on a subset of the nodes of G, and V a relation on G' such that, for all A,B, in G', we have V(A,B) iff there exists a shortest path p in G between A and B such that the nodes o f p all lie in G '. (Note that any such V is reflexive and symmetric.) Evidently, the class of such Vs is just the class of visibility relations on G defined by node pebblings of G, where the nodes of G ~ are just the unpebbled nodes of G. Similarly, let G' be the subgraph defined by a subset E ' of the arcs of G, and V a relation on G' such that V(A,B) if there exists a shortest path p in G between A and B such

Page 3: Geodesic visibility in graphs

A.Y. Wu, A. Rosenfeld / Journal of lnformation Sciences 108 (1998) 5-12 7

that the arcs between successive pairs of nodes o f p all lie in E ~. (Note that any such V is reflexive and symmetric.) Evidently, the class of such Vs is just the class of visibility relations on G defined by arc pebblings of G, where E ' is the set of unpebbled arcs of G.

Both of these types of geodesic visibility relations have the following geode- sic transitivity properties.

(a) If V(A,B), then there exists a shortest path p from A to B such that V(A,Z) and V(Z,B) for all Z on p.

(b) If there exists a shortest path p from A to B, and a node Z on p such that V(A,Z) and V(Z,B), then V(A,B).

Indeed, if the relation is defined by node pebbling, then V(A,B) iff there is a shortest path p from A to B such that all the nodes of p are unpebbled. For any Z on p, the segments o f p from A to Z and Z to B are shortest paths from A to Z and from Z to B, and their nodes are all unpebbled, proving (a). Con- versely, if Z is on some shortest path from A to B, and V(A,Z) and V(Z,B), then there exist shortest paths ql, q2 from A to Z and Z to B whose nodes are unpebbled; since p is shortest path from A to B, the segments o f p from A to Z and Z to B must be shortest paths, so must have the same lengths as q~ and q2, so that the concatenation of ql and q2 is an unpebbled shortest path from A to B, proving (b). The argument for arc pebbling is the same, with "arcs" replacing "nodes".

Proposition 1. Any reflexive symmetric relation V on G that satisfies (a)-(b) must be a geodesic visibility relation defined by arc pebbling.

Proof. Let E ' be the set of arcs (P,Q) of G such that V(P,Q). If there exists a shortest path p between A and B such that (P,Q) is in E ' for all successive P,Q on p, then by repeatedly using (b) we can easily show that V(A,B). Conversely, if V(A,B), let p be the path whose existence is implied by (a); by repeatedly using (a) we can show that V(C,D) for all C,D on p, and in particular that V(P,Q) for all successive P,Q on p, so that (P,Q) is in E' . []

It is not hard to see that neither of (a) and (b) implies the other. Let V be the myopic visibility relation for d = 1 (a node can see itself and its neighbors, but nothing further away). Then if A,B are at distance 2, (b) does not hold; but (a) holds (trivially). Conversely, let V be the "hypermetropic" visibility relation for which V(A,B) iff A = B or d(A,B) ~> 2. Then if A,B are at distance 2, (a) does not hold, but (b) holds (trivially).

A geodesic visibility relation defined by node pebbling is actually a relation on a subgraph G' of G. As we saw above, any such relation must satisfy (a) (b). In addition, it satisfies

(c) If P,Q are neighbors in G, then V(P,Q) iff P,Q are nodes of G' since (P,Q) is a shortest path in G from P to Q and consists entirely of nodes of G'.

Page 4: Geodesic visibility in graphs

A. K Wu, A. Rosenfeld / Journal of Information Sciences 108 (1998) 5-12

Proposition 2. Any reflexive, symmetric relation V on a subset G' of the nodes of G that satisfies (a)-(c) must be a geodesic visibility relation defined by node pebbling.

ProoL If there exists a shortest path p between A and B such that all the nodes o f p are nodes of G', then we have V(P,Q) for any two successive nodes of p, and by repeatedly using (b) we can show that V(A,B). Conversely, if V(A,B), let p be the path whose existence is implied by (a): by repeatedly using (a) we can show (as in the arc-pebbling case) that V(P,Q) for all successive P,Q on p, and since P,Q are neighbors in G, they must therefore be in G'. []

The two types of geodesic visibility relations are not comparable; the node- pebbling type is more restricted than the arc-pebbling type because it satisfies an additional condition ((c) in addition to (a)-(b)), but it is less restricted be- cause it is a relation on a subgraph G' of G. To illustrate the incomparability of the types, we give two simple examples. 1. If we pebble one arc (P,Q) of the graph G, the nodes P and Q become mu-

tually invisible. On the other hand, let G* be a node-pebbled graph and let G be the subgraph of G* defined by the unpebbled nodes; then no matter what G* is, any pair of neighboring nodes of G are always mutually visible. Thus the pebbling of one arc of any graph G yields a visibility relation on G that cannot be obtained by embedding G in a larger graph G* and pebbling the nodes of G*-G.

2. Let G be a string. Any arc pebbling of G disconnects it into substrings, and two nodes are mutually visible iff they belong to the same substring. On the other hand, let G have four nodes A,B,C,D, and define G* by adding a single pebbled node Z to G and joining it by arcs to A and D. Then in G*, every pair of nodes of G except (A,D) are mutually visible. Evidently, this visibility relation on G cannot be obtained by any arc pebbling of G.

3. Guarding sets

Let V be a visibility relation on G, and let N be a set of nodes of G. A set M of nodes of G is called a guarding set for N if every node of N is visible from some node of M. Our goal in this section is to establish tight upper bounds on the size of M, as a function of the size of N, for various visibility relations.

Evidently, for the trivial visibility relation, any guarding set for N must con- tain N, so that the smallest guarding set for N is N itself. The following prop- osition generalizes this result to an arbitrary myopic visibility relation Vd in which two nodes are mutually visible iff the distance between them is at most d.

Page 5: Geodesic visibility in graphs

A.Y. Wu, A. Rosenfeld / Journal of Information Sciences 108 (1998) 5 12 9

Proposition 3. For the v&ibility relation Vd, the node set N of a connected graph G has a guarding set o f size at most FlNl/(d + 1) 1 .

Proof. Let R be any node of G, and let T be a spanning tree of G rooted at R. Let To, T1 , . . . , Td be the sets o f nodes at levels 0, d + 1, 2d + 2 . . . . ; 1, d + 2, 2d + 3, •..; 2, d + 3, 2d + 4 . . . . ; . . . ; d, 2d + 1 . . . . . o f T. Evidently the T~s are a par t i t ion of the nodes of T i n t o d + 1 disjoint subsets. For any k >~ d, any node P at level k has a parent , a g randparen t . . . . , a (d - 2)- t imes-great g randparen t in T; P and these ancestors of P all belong to different Tis, and P is at distance ~< d f rom each o f them. Thus every Ti is a guarding set for the set o f nodes of G that are at levels k ~> d of T. T o ensure that this remains true for the nodes at levels 0 , . . . , d - 1, we adjoin R to each o f Tl . . . . . Td, defining ~* = Ti U {R}, 1 ~< i ~< d - 1. A node at level k ~< d - 1 is at distance ~< d - 1 f rom R; and since R is now a node of every ~ , as well as o f To, it follows that To and every ~ is a guarding set for the entire node set N of G. Since the d + 1 Tis are a par t i t ion of N, at least one of them, say Tj, has size at mos t [INI/(d + 1)J. I f j = 0, To is a guarding set o f size at mos t UN]I(d + 1)j ~< IlN[l(d + 1) 1. I f j ~ O; the guarding set ~ has size at mos t HNI/(d + 1)J + 1. I f N is not a mult iple of d + 1, this is equal to I[N[/(d + 1) 1, and we are done. I f [N[ = ( d + 1)n, and the sizes of the Tis are all equal, To is a guarding set o f size n = [Nll(d + 1). Otherwise, one o f the Tis must have size less than n; even if this is Tj for s o m e j ¢ O, this still gives us a guarding set ~ o f size at mos t n = ]N[/(d + 1). []

Propos i t ion 3 is an easy consequence of T h e o r e m 5 of [3]. The "k-cover ing n u m b e r " of a tree is the size of a smallest guarding set for Vk; and the result in [3] can be extended to any connected graph by simply construct ing a spanning tree. However , we have given a p r o o f of Propos i t ion 3 in order to make this pape r self-contained.

Fo r d = 1 or 2, the bound of Propos i t ion 3 can be slightly improved. In the p r o o f o f Propos i t ion 3, we need not adjoin R to Tl, since if G has more than one node, level 1 is n o n e m p t y and R is at distance 1 f rom any node at level 1. Hence if d = 1, To and TI are bo th guarding sets, so that there is a guarding set o f size at mos t LINI/2A. (A guarding set for V 1 is called a dominating set [4].) I f d = 2, and every node on level 1 has a child, then every node on level 0 or 1 is at distance 2 or 1 f rom a node on level 2, so that To, T1, and T2 are all guarding sets, and there is a guarding set o f size at mos t ~[N[/3 j . I f some node P on level 1 has no child, we can delete P f rom Tl and adjoin it to T2; then every node on level 0 or 1 is at distance at mos t 2 f rom a node of To, Tl, or 7"2, and since they are still a part i t ion, in this case too there is a guarding set o f size at most LINI/ 3j. Thus we have proved.

Proposition 4. For the visibility relations V1 and V2, the node set N o f a connected graph has a guarding set of size at most LINI/2J or LINI/3A, respectively.

Page 6: Geodesic visibility in graphs

10 A. Y. Wu, A. RosenfeM I Journal of lnformation Sciences 108 (1998) 5-12

(1,])

(I,2)

(1,3)

(1.4)

(2,1) (3,1) (4,1) (n-I,I) (n,I)

Fig. 1. A simple example of a graph with n(d + l) nodes which requires n guards under Vd. The bottom node in each column is visible only from the nodes of its column; hence a guarding set must contain at least one node in each column.

The bound o f Propos i t ion 3 is (a lmost) tight, and the bounds o f Propos i t ion 4 are tight. Fig. 1 shows simple example o f g raph with n(d + 1) nodes which requires a guarding set size n.

I f U, V are visibility relat ions on G, we say that V contains U if every pair o f nodes tha t are mutua l ly visible under U is also mutua l ly visible under V. Evi- dently, if V contains U, any guarding set for U is also a guarding set for V.

Let V be a visibility relat ion on G defined by arc pebbling. I f P , Q are neigh- bors, they are mutua l ly visible iff there is no pebble on the arc (P,Q). Hence in the subgraph G ' o f G defined by the unpebbled arcs, V contains VI. I t follows that G ' has a guarding set o f size at mos t L[NJ/2J, where N is the node set o f G (or G') . The example in Fig. 2 shows tha t this bound is tight.

A I A - ~ A ~ l A

B j B 2 B 3 B 4 B ] B

Fig. 2. An arc-pebbled graph with 2n nodes may require n guards. In this example, all the diagonal arcs are pebbled; for each i, only nodes Ai and Bi can see node Bg.

Page 7: Geodesic visibility in graphs

A. E Wu, A. Rosenfeld I Journal of Information Sciences 108 (1998) 5-12 11

AI~ A2~ A3~ A And ~ A

/ c n

Fig. 3. A node-pebbled graph with 3n unpebbled nodes may require n guards. In this example, the nodes marked D are all pebbled; for each i, only nodes Ai, Bi, and Ci can see node C~.

Let V be a visibility relation on G defined by node pebbling, and let G t be the subgraph of G defined by the unpebbled nodes. If P,Q have distance 2 in G', they cannot be neighbors in G, so they must be mutually visible; and if they are neighbors in G ', they are also neighbors in G and are mutually visible. Hence V (on G') contains V2. It follows that G' has a guarding set of size at most LINI/3J, where N is the node set of G'. The example in Fig. 3 shows that this bound is tight. We summarize these results in the following Propositions.

Proposition 5. For any visibility relation on G defined by arc pebbling, the node set N o f G has a guarding set o f size at most lINl/23

Proposition 6. For any visibility relation on G defined by node pebbling, the set N o f unpebbled nodes o f G has a guarding set o f size at most LINI/3J.

Note that the bound in Proposition 6 is the same as the minimum number of guards needed for an N-sided polygon in the plane [2].

4. Concluding remarks

We have characterized visibility relations (on a graph) in which shortest paths are possible lines of sight, and "pebbles" on the nodes or arcs obstruct visibility. We have also established bounds on the sizes of guarding sets for these types of visibility.

Some questions for further investigation are given below. 1. We have characterized various types of graphs which are "convex" with re-

spect to these visibility relations (i.e., in which every two nodes are mutually visible). Can "starshaped" graphs, in which there exists a node from which every node is visible, be characterized?

2. Can better bounds on the sizes of guarding sets be obtained for specific classes of graphs, e.g. satisfying bounds on node degrees?

3. It would be of interest to study other types of shortest-path visibility rela- tions on a graph, e.g. based on assigning "elevations" to the nodes.

Page 8: Geodesic visibility in graphs

12 A.Y. Wu, A. RosenfeM / Journal of lnformation Sciences 108 (1998) 5-12

Acknowledgements

The help o f Janice Per rone in p r epa r ing this p a p e r is gra teful ly acknowl - edged.

References

[1] A. Rosenfeld, A.Y. Wu, Geodesic convexity in discrete spaces, Information Sciences 80 (1994) 127 132.

[2] J. O'Rourke, Art Gallery Theorems and Algorithms, Oxford University Press, Oxford, UK, 1987.

[3] A. Meir, J.W. Moon, Relations between packing and covering numbers of a tree, Pacific Journal of Mathematics 61 (1975) 225-233.

[4] F. Buckley, F. Harary, Distance in Graphs, Addison-Wesley, Redwood City, CA, 1990, p. 201.