Locating–dominating codes: Bounds and extremal cardinalities

Locating–dominating codes: Bounds and extremal cardinalities

Applied Mathematics and Computation 220 (2013) 38–45 Contents lists available at SciVerse ScienceDirect Applied Mathematics and Computation journal ...

714KB Sizes 0 Downloads 50 Views

Applied Mathematics and Computation 220 (2013) 38–45

Contents lists available at SciVerse ScienceDirect

Applied Mathematics and Computation journal homepage: www.elsevier.com/locate/amc

Locating–dominating codes: Bounds and extremal cardinalities José Cáceres a,1, Carmen Hernando b,2, Mercè Mora c,2, Ignacio M. Pelayo d,3, María Luz Puertas a,⇑,1 a

Department of Mathematics, Universidad de Almería, Spain Department of Applied Maths I, Universitat Politècnica de Catalunya, Barcelona, Spain c Department of Applied Maths II, Universitat Politècnica de Catalunya, Barcelona, Spain d Department of Applied Maths III, Universitat Politècnica de Catalunya, Barcelona, Spain b

a r t i c l e

i n f o

Keywords: Network problems Graph theory Codes on graphs Covering codes Locating dominating codes

a b s t r a c t In this work, two types of codes such that they both dominate and locate the vertices of a graph are studied. Those codes might be sets of detectors in a network or processors controlling a system whose set of responses should determine a malfunctioning processor or an intruder. Here, we present our contributions on k-codes and g-codes concerning bounds, extremal values and realization theorems. Ó 2013 Elsevier Inc. All rights reserved.

1. Introduction Assume a building floor modeled as a graph. Minimum locating–dominating sets or k-codes [21,22] can be used to determine the exact location of an object in the graph provided that the object cannot occupy the same vertex as the detection device, for instance a fire alarm placed on a wall or the ceiling. Each alarm sends a signal when detecting a fire in any of its adjacent vertices and the activated signals will univocally determine the place of the fire. Thus locating–dominating sets are also covering codes and have been studied in different graph classes [1,7,8,16,19]. Very often, the detection range of the device is not as limited as in the previous example; imagine a surveillance camera instead of a fire alarm. Here the detector gives the distance to the object, say an intruder, and the set of distances unambiguously locates the object. However, in order to prevent failures and maintain the properties of a covering (or dominating) code, it will be interesting to ensure that any location under surveillance is next to at least one camera (perhaps for identifying the intruder). Then a minimum metric-locating–dominating set or g-code [13] is needed. Another application comes from multiprocessor architecture. Here each vertex corresponds to a processor and each edge to a dedicated link between two processors and some processors have the task to check the rest of the system. In this context, it would be interesting that any set of outputs determines a faulty processor. If the processors are only able to check its immediate neighbors then a k-code is necessary. On the other hand, if the checking processors have an unlimited range of action within the system then the best covering code that one could use is a g-code. Whenever the processors should be checked by themselves, another popular class of codes such as identifying codes are necessary [17]. However, the

⇑ Corresponding author. E-mail addresses: [email protected] (J. Cáceres), [email protected] (C. Hernando), [email protected] (M. Mora), [email protected] (I.M. Pelayo), [email protected] (M.L. Puertas). 1 Partially supported by J. Andaluca FQM-305, EUROCORES programme EuroGIGA – ComPoSe IP04 – MICINN Project EUI-EURC-2011-4306. 2 Partially supported by Gen. Cat. DGR 2009SGR1040, MTM2009-07242, EUROCORES programme EuroGIGA – ComPoSe IP04 – MICINN Project EUI-EURC2011-4306. 3 Partially supported by Gen. Cat. DGR 2009SGR1387, MTM2011-28800-C02-01. 0096-3003/$ - see front matter Ó 2013 Elsevier Inc. All rights reserved. http://dx.doi.org/10.1016/j.amc.2013.05.060

39

J. Cáceres et al. / Applied Mathematics and Computation 220 (2013) 38–45

existence of those codes is not guaranteed for any graph, and then a locating–dominating code is the next best alternative. A complete list of continuously updated papers involving different kinds of codes is to be found in [18]. The immediate problem here is to determine the minimum number of detectors needed for a graph. It is also interesting to know some trade-offs between using k-codes and g-codes. The rest of the paper is organized as follows. In Section 2, the main concepts and definitions are presented. In Section 3, tight bounds of both parameters are given. Those cases with extremal cardinalities of k-codes and g-codes are discussed in Section 4, and in Section 5 several realization theorems for any possible values are provided. 2. Formal definitions and related work All the graphs considered are finite, undirected, simple, and connected. Given a graph G ¼ ðV; EÞ, the open neighborhood of a vertex v 2 V is Nðv Þ ¼ fu 2 Vjuv 2 Eg and its degree degðv Þ ¼ jNðv Þj. The distance between two vertices v and w is denoted by dðv ; wÞ and the diameter diamðGÞ is the maximum distance within two vertices of G. For undefined basic concepts we refer the reader to the introductory graph theoretical literature, e.g. [6]. This work relies on two main concepts which are domination and location. Thus, a set D # V is dominating if for every vertex v 2 V n D; Nðv Þ \ D – ;. The domination number cðGÞ is the minimum cardinality of a dominating set of G and a dominating set of cardinality cðGÞ is called a c-code [12]. On the other hand, let S ¼ fx1 ; . . . ; xk g be a subset of vertices. For any v 2 V n S, the vector of metric coordinates of v with respect to S is the ordered k-tuple cS ðv Þ ¼ ðdðv ; x1 Þ; . . . ; dðv ; xk ÞÞ. The set S will be locating if for every pair of distinct vertices u; v 2 V, cS ðuÞ – cS ðv Þ. The metric dimension bðGÞ is the minimum cardinality of a locating set of G [11,20]. A locating set of cardinality bðGÞ is called a metric code. Undoubtedly, it is of interest for a code to be dominating and locating, and there exist several ways to define it. For instance, a metric-locating–dominating set is just a dominating and locating set. The metric-location–domination number gðGÞ is the minimum cardinality of a metric-locating–dominating set of G and a metric-locating–dominating set of cardinality gðGÞ is called an g-code [13]. A different and more restrictive definition is the following: a set D # V is a locating–dominating set if every two vertices u; v 2 VðGÞ n D satisfy that ; – NðuÞ \ D – Nðv Þ \ D – ;. The location-domination number kðGÞ is the minimum cardinality of a locating–dominating set. A locating–dominating set of cardinality kðGÞ is called a k-code [21,22]. Certainly, every locating–dominating set is both locating and dominating. However, a set which locates and dominates is not necessarily a locating–dominating set. For example, consider the path P6 with vertices f0; . . . ; 5g. Then the set D ¼ f1; 4g is both dominating and locating, but it is not a locating–dominating set since Nð3Þ \ D ¼ Nð5Þ \ D ¼ f4g. Location and domination are preserved under taking supersets. Particularly, if for two subsets S1 ; S2  V the set S1 is locating and S2 is dominating, then S1 [ S2 is both locating and dominating. A straightforward consequence of the above definitions follows: Proposition 1. For every graph G, maxfcðGÞ; bðGÞg 6 gðGÞ 6 minfcðGÞ þ bðGÞ; kðGÞg In the rest of this paper, Pn ; C n and K n denote the path, cycle and complete graph of order n, respectively. In all cases, unless otherwise stated, the set of vertices is f0; 1;    ; n  1g. In addition, K p;np and W n denote the complete bipartite graph (with stable sets of size p and n  p) and the wheel with n vertices. The values of the domination and location numbers of these graphs can be found in Table 1. Finally, the strong grid Pn P m has as vertices the pairs of integers ði; jÞ such that 0 6 i 6 n  1; 0 6 j 6 m  1, and two ver0 0 0 0 tices ði; jÞ and ði ; j Þ are adjacent when ji  i j 6 1 and jj  j j 6 1. This operation can be iterated to obtain the k-dimensional strong grid Pn1  . . . Pnk [10]. 3. Bounds In this section, we bound the values of g and k. These bounds are given in terms of the order n and the diameter D of the graph as it is usual for locating and dominating parameters. Similar studies can be found in [9] for identifying codes, in [4] when the action range of a locating–dominating code is r > 1 and in [14] for Nordhaus–Gaddum bounds.

Table 1 Domination and location parameters of some basic families. G

c

b

g

k

Pn ; n > 3

dn3e

1

dn3e

d2n 5e

Cn ; n > 6

dn3e

2

dn3e

Kn; n > 1 K 1;n1 ; n > 2 K r;nr ; 1 < r 6 n  r W 1;n1 ; n > 7

1 1 2 1

n1 n2 n2

n1 n1 n2

d2n 5e n1 n1 n2

b2n 5c

d2n2 5 e

d2n2 5 e

40

J. Cáceres et al. / Applied Mathematics and Computation 220 (2013) 38–45

g1 Theorem 1. Let G be a graph such that jVðGÞj ¼ n; diamðGÞ ¼ D P 3 and gðGÞ ¼ g. Then g þ d2D , and both 3e 6 n 6 gþg3 bounds are tight.

Proof. Let P be a diameter joining a diametral pair u and v with vertices VðPÞ ¼ fu ¼ 0; 1; . . . ; v ¼ Dg. If e  2gg, then the set S ¼ fVðGÞ n VðPÞg [ A has n  d2D e elements and it is clearly dominating A ¼ f1; 4; 7; . . . ; minfD; 3dDþ1 3 3 e. Moreover, the lower bound g þ d2D e is tight since gðPn Þ ¼ d3ne for every n > 3. and locating. Hence, g 6 n  d2D 3 3 To prove the upper bound, consider an g-code S ¼ fv 1 ; . . . ; v g g and an arbitrary vertex u 2 VðGÞ n S. As S is a dominating set then, for some vertex v i 2 S; dðu; v i Þ ¼ 1. Let v j 2 S where j – i. Clearly jdðv i ; v j Þ  dðu; v j Þj 6 1, since dðu; v j Þ 6 dðu; v i Þ þ dðv i ; v j Þ ¼ 1 þ dðv i ; v j Þ and dðv i ; v j Þ 6 dðv i ; uÞ þ dðu; v j Þ ¼ 1 þ dðu; v j Þ. This means that the cardinality of fcS ðv Þgv 2V nS is at most g  3g1 . In other words, n 6 g þ g  3g1 . Finally, we prove that this upper bound is tight. Let g P 2 be an arbitrary integer and consider the g-dimensional strong Sg g g grid P 5 ¼ P 5     P5 . Let Gg denote the induced subgraph of P5 , whose vertex set is VðGg Þ ¼ i¼0 Ai , where:  A0 ¼ fv 1 ¼ ð0; 3; . . . ; 3Þ; . . . ; v g ¼ ð3; . . . ; 3; 0Þg,  For every i 2 f1; . . . ; gg, Ai ¼ fðx1 ; . . . ; xg Þjxi ¼ 1; and j – i ) 2 6 xj 6 4g So the order of Gg is g þ g  3g1 . It is easy to check that A0 is an g-code of this graph. h In [5], it is proved that n 6 kðGÞ þ 2kðGÞ  1 in any graph G of order n and it is a tight bound. In the following result we provide a lower bound which turns out to be also tight. Theorem 2. Let G be a graph of order n, diameter D P 3 and kðGÞ ¼ k. Then k þ d3D1 5 e 6 n, and the bound is tight. Proof. Let u; v 2 VðGÞ be two diametral vertices and let P be the diameter joining them. If VðPÞ ¼ fu ¼ 0; 1; . . . ; v ¼ Dg and D ¼ 5h þ k with 0 6 k 6 4, then it is easy to check that, for 0 6 k 6 1 (resp. 2 6 k 6 4), the set e elements and A ¼ f1; 3; 6; 8; 11; 13 . . . ; 5h  4; 5h  2; Dg (resp. A ¼ f1; 3; 6; 8; 11; 13 . . . ; 5h  4; 5h  2; 5h þ 1; Dg) has d2Dþ2 5 e elements and it is a locating–dominating set it is a k-set of P. In other words, the set S ¼ ðVðGÞ n VðPÞÞ [ A has n  d3D1 5 3D1 e. Moreover, the lower bound kðGÞ þ d e is tight since, for every n > 3; kðPn Þ ¼ d2n e. h of G. Hence, kðGÞ 6 n  d3D1 5 5 5 An interesting case occurs when the graph is a tree T of order n (see [2,3]). A vertex of degree 1 is called a leaf, a vertex adjacent to a leaf is a support vertex, and if a vertex is adjacent to, at least, two leaves then it is called a strong support vertex. The number of leaves and support vertices are denoted lðTÞ and sðTÞ respectively. In [13], it was proved that there is no constant k such that kðGÞ 6 kgðGÞ, for every graph G. However, it is also showed that kðTÞ 6 2gðTÞ for every tree T and that gðTÞ ¼ cðTÞ þ lðTÞ  sðTÞ. Going a step further, we obtain the following result which turns out to give tight bounds. Theorem 3. Let T be a tree of order at least 3, different from P 6 and such that gðTÞ ¼ g and kðTÞ ¼ k. Then g 6 k 6 2g  2, and both bounds are tight. Proof. If T is the star K 1;n1 , then g ¼ k ¼ n  1. Assume thus that T is a tree of order n P 4 and diameter D P 3, and proceed by induction on n. It is easy to check that the result is true for every tree of order at most 4. By hypothesis of induction, assume that it is also true for any tree of order less or equal than n  1 and let T be a tree of order n. We distinguish two cases: Case 1: There is no strong support vertex in T. Let x; y be a diametral pair of leaves, and let z be the support vertex of y, which clearly satisfies degðzÞ ¼ 2. Let u be the vertex adjacent to z and different from y in the diameter joining x and y. Again, we have three subcases:  Suppose that degðuÞ ¼ 2 and consider the tree T 0 ¼ T  fu; z; yg. Observe that gðTÞ ¼ cðTÞ ¼ cðT 0 Þ þ 1 ¼ gðT 0 Þ þ 1 and kðTÞ 6 kðT 0 Þ þ 2. Hence, kðTÞ 6 kðT 0 Þ þ 2 6 2gðT 0 Þ  2 þ 2 ¼ 2ðgðTÞ  1Þ ¼ 2gðTÞ  2.  Assume that u is a support vertex of T such that degðuÞ P 3 and consider the tree T 0 ¼ T  fz; yg. Then gðTÞ ¼ gðT 0 Þ þ 1 and kðTÞ 6 kðT 0 Þ þ 1. Hence, kðTÞ 6 kðT 0 Þ þ 1 6 2gðT 0 Þ  2 þ 1 ¼ 2ðgðTÞ  1Þ  1 ¼ 2gðTÞ  3.  Suppose that u is not a support vertex of T and its degree is at least 3, which means that there exists a leaf y0 , different from y, adjacent to a support vertex z0 which is adjacent to u. We build the tree T 0 ¼ T  fz; z0 ; y; y0 g. Note that gðT 0 Þ þ 1 6 gðTÞ 6 gðT 0 Þ þ 2 and kðTÞ 6 kðT 0 Þ þ 2. Thus, kðTÞ 6 kðT 0 Þ þ 2 6 2gðT 0 Þ  2 þ 2 6 2ðgðTÞ  1Þ ¼ 2gðTÞ  2. Case 2: T is a tree with at least one strong support vertex w. Consider the tree T 0 ¼ T  fyg, where y is a leaf adjacent to w. Notice that gðTÞ ¼ gðT 0 Þ þ 1 and kðTÞ ¼ kðT 0 Þ þ 1. Hence, kðTÞ ¼ kðT 0 Þ þ 1 6 2gðT 0 Þ  2 þ 1 ¼ 2ðgðTÞ  1Þ  1 ¼ 2gðTÞ  3. k These bounds are tight since they are attained in the families of spiders Sk;3 and Sk;4 (see Fig. 1). Notice that fbr gr¼1 [ fxg is k k k both an g-code and a k-code of Sk;3 , and observe also that fcr gr¼1 [ fxg and far gr¼1 [ fcr gr¼1 are an g-code and a k-code of Sk;4 , respectively. h

41

J. Cáceres et al. / Applied Mathematics and Computation 220 (2013) 38–45

c1 c2

b1 b2

d1

ck

a2

a1 x

ar

c1

bk ck−1

ak ak−1

bk−1

d2

c2

b2

a1 a2 x ar

ar+1 br+1

cr

cr+1

ck b1

br

br

dk

cr

bk ak ak−1

dk−1

ar+1 br+1 cr+1

dr

η =λ=k+1

bk−1

ck−1

dr+1 η = k + 1, λ = 2k

Fig. 1. Spiders Sk;3 and Sk;4 on k legs, all of them having 3 and 4 edges, respectively.

4. Extremal values This section is devoted to establish sufficient conditions for an arbitrary graph G for it to exhibit extremal values for gðGÞ and kðGÞ. Graphs with order n and with g or k equal to 1 or n  1 have been characterized, as well as those graphs with g ¼ n  2 [13]. As a step further, we characterized here all the graphs with g ¼ 2; k ¼ 2 and k ¼ n  2. To begin with, the next result provides conditions for those graphs G having gðGÞ ¼ kðGÞ. Proposition 2. Let G be a graph of order n, diameter D and metric dimension b. If either D ¼ 2 or b P n  3, then gðGÞ ¼ kðGÞ. Proof. Suppose that D ¼ 2 and let S be an g-code of G. Since the maximum distance between vertices is 2, the vector of metric coordinates of any vertex with respect to S contains only digits 1 and 2. Thus, S must be also a k-code. On the other hand, suppose bðGÞ P n  3. In [15], it is proved that b þ D 6 n and all the graphs having metric dimension n  3 are given. Hence, the diameter of G is at most 3. If D ¼ 1, then G ¼ K n and thus gðGÞ ¼ kðGÞ ¼ n  1. The case D ¼ 2 has been proved above and for the case D ¼ 3 it is straightforward to check that all the graphs provided in [15] satisfy gðGÞ ¼ kðGÞ. h Remark 1. This result is tight in the sense that there are graphs having diameter greater than 2 and/or metric dimension less than n  3, satisfying gðGÞ < kðGÞ. For example, path P 6 satisfies diamðP6 Þ ¼ 5; bðP6 Þ ¼ 1; gðP 6 Þ ¼ 2 and kðP6 Þ ¼ 3. Next, we characterize the family of graphs satisfying 1 6 g ¼ k 6 2. To begin with, it is clear that the unique graph with order n P 2 and g ¼ 1 is P2 , which certainly also satisfies k ¼ 1. The case g ¼ 2 is mainly solved using the following results. Lemma 1. Let G be a graph of order n and gðGÞ ¼ 2. Then, (i) 3 6 n 6 8. (ii) If S ¼ fu; v g is an g-code, then dðu; v Þ 6 3. (iii) The graph G can be isometrically embedded into the king grid P5 P 5 .

Proof. (i) These inequalities are obtained as a consequence of Theorem 1, having also in mind that gðK 2 Þ ¼ 1. (ii) It is enough to realize that if dðu; v Þ P 4, then S is not a dominating set. (iii) Let G be a graph with gðGÞ ¼ 2 and let S ¼ fu; v g be an g-code of G. Since dðu; v Þ 6 3 and every vertex of G is adjacent either to u or to v, we have that fðdðu; xÞ; dðv ; xÞÞ : x 2 VðGÞg is a subset of ½0; 4  ½0; 4. As S is locating, we have cS ðxÞ ¼ ðdðu; xÞ; dðv ; xÞÞ – ðdðu; yÞ; dðv ; yÞÞ ¼ cS ðyÞ for every pair of distinct vertices x; y, so there is an injection from VðGÞ to VðP 5 P 5 Þ simply by identifying every vertex x of G with its metric coordinates ðdðu; xÞ; dðv ; xÞÞ as a vertex in P5 P 5 . Moreover, if two vertices x and y are adjacent in G, then dðu; yÞ 6 dðu; xÞ þ dðx; yÞ ¼ dðu; xÞ þ 1 and dðu; xÞ 6 dðu; yÞ þ dðy; xÞ ¼ dðu; yÞ þ 1, which means that jdðu; xÞ  dðu; yÞj 6 1. Similarly, we obtain that jdðv ; xÞ  dðv ; yÞj 6 1. Hence, ðdðu; xÞ; dðv ; xÞÞ and ðdðu; yÞ; dðv ; yÞÞ are adjacent in P5 P 5 , therefore the above injection is an isometric embedding of G in P5 P 5 . h

42

J. Cáceres et al. / Applied Mathematics and Computation 220 (2013) 38–45

Theorem 4. There exist 51 non-isomorphic graphs satisfying gðGÞ ¼ 2 (see Fig. 3). Proof. Let S ¼ fu; v g be an g-code of G. We label every vertex w 2 VðGÞ with the pair of integers ðdðu; wÞ; dðv ; wÞÞ. According to Lemma 1, 3 6 n 6 8 and 1 6 dðu; v Þ 6 3. We distinguish three cases, depending on the distance between vertices u and v. Case 1. If dðu; v Þ ¼ 1 then VðGÞ n S # fð1; 1Þ; ð1; 2Þ; ð2; 1Þg, and hence 3 6 n 6 5. Following a similar reasoning as in the proof of Lemma 1, we obtain that G can be isometrically embedded into the king grid P3 P3 , as showed in Fig. 2(i). Case 2. Suppose dðu; v Þ ¼ 2. Then VðGÞ n S # fð1; 1Þ; ð1; 2Þ; ð1; 3Þ; ð2; 1Þ; ð3; 1Þg, so 3 6 n 6 7. Again using the injection defined in the proof of Lemma 1, G can be embedded isometrically into P 4 P4 (see Fig. 2(ii)). Case 3. Finally, if dðu; v Þ ¼ 3, now VðGÞ n S # fð1; 2Þ; ð1; 3Þ; ð1; 4Þ; ð2; 1Þ; ð3; 1Þ; ð4; 1Þg and 4 6 n 6 8. Lemma 1 gives us again the isometric embedding of G into P 5 P5 (see Fig. 2(iii)). The properties above give us the set of non-isomorphic graphs satisfying gðGÞ ¼ 2, which has 51 elements, that can de redrawn as showed in Fig. 3. It consists of two graphs of order 3, four graphs of order 4, ten graphs of order 5, fifteen graphs of order 6, seventeen graphs of order 7, and three graphs of order 8. h As a consequence of the previous theorem, it is also possible to obtain a similar list of graphs for k. Corollary 1. There are 16 non-isomorphic graphs satisfying kðGÞ ¼ 2 (see Fig. 3). Proof. Let G be a graph of order n satisfying kðGÞ ¼ 2. From Proposition 1, Theorem 2 and property n 6 kðGÞ þ 2kðGÞ  1 [5], it is immediately derived that 3 6 n 6 5 and gðGÞ ¼ 2, which means that G must be one of the graphs displayed in the first row of Fig. 3. For finishing the proof, it is enough to check that each of these 16 graphs satisfies kðGÞ ¼ 2. h We finish this section by characterizing the family of graphs for which n  2 6 gðGÞ ¼ kðGÞ 6 n  1. In [13] (resp. [22]), it was proved that if G is a graph such that gðGÞ ¼ n  1 (resp. kðGÞ ¼ n  1), then G is either the complete graph K n or the star K 1;n . Also in [13], all graphs G such that gðGÞ ¼ n  2 were completely characterized. As a consequence, all these graphs must also fulfill kðGÞ ¼ n  2. Next, we show that these are the unique graphs satisfying the equation kðGÞ ¼ n  2. Lemma 2. Let G be a graph with diameter D, order n and kðGÞ P n  2. Then D 6 3. Proof. Suppose that D P 4 and take u; v 2 VðGÞ such that dðu; v Þ ¼ 4. If P is a shortest path joining u and v such that VðPÞ ¼ fu; a; w; b; v g, then it is straightforward to check that the set VðGÞ n fu; w; v g is locating–dominating. h Theorem 5. Let G be a graph of order n P 3. Then, kðGÞ ¼ n  2 if and only if gðGÞ ¼ n  2. Proof. Since gðGÞ 6 kðGÞ and gðGÞ ¼ n  1 if and only if kðGÞ ¼ n  1, it is clear that gðGÞ ¼ n  2 implies that kðGÞ ¼ n  2. To prove the converse, assume on the contrary that there exists a graph G with kðGÞ ¼ n  2 and gðGÞ < n  2. Let S ¼ VðGÞ n fx; y; zg be a metric-locating–dominating set of cardinality n  3. Since S is not locating–dominating, suppose without loss of generality that NðxÞ \ S ¼ NðyÞ \ S – ; and call N ¼ NðxÞ \ S ¼ NðyÞ \ S. However NðxÞ – NðyÞ because S is locating, that is, either x or y but not both must be adjacent to z. Assume hence that yz 2 EðGÞ and xz R EðGÞ (see Fig. 4(i)). Since S is a locating set, there exists a vertex w 2 S n N such that dðx; wÞ – dðy; wÞ. Notice that no vertex in N is adjacent to w, as otherwise dðx; wÞ ¼ dðy; wÞ ¼ 2 (see Fig. 4(ii)). According to Lemma 2, 2 6 dðx; wÞ; dðy; wÞ 6 3 and so dðy; wÞ ¼ 2 and dðx; wÞ ¼ 3, since NðwÞ \ NðxÞ ¼ ;. Moreover, it also follows that NðwÞ \ NðyÞ ¼ fzg (see Fig. 4(ii)).

Fig. 2. Graphs verifying gðGÞ ¼ 2 isometrically embedded in P 5 P 5 . White vertices are optional, provided that the graph has at least three vertices. Discontinuous edges are optional and black vertices are compulsory.

J. Cáceres et al. / Applied Mathematics and Computation 220 (2013) 38–45

43

Fig. 3. All graphs satisfying gðGÞ ¼ 2. Discontinuous edges are optional and the framed graph is forbidden. The graphs in the first row are all the graphs having k ¼ 2.

Fig. 4. Solid edges join adjacent vertices and dashed edges join non-adjacent vertices.

Finally, consider the set S0 ¼ V n fx; y; wg and note that  NðxÞ \ S0 ¼ N – ;,  NðyÞ \ S0 ¼ N [ fzg – ;,  z 2 NðwÞ \ S0 – ; and N  NðwÞ \ S0 . In other words, NðxÞ \ S0 ; NðyÞ \ S0 and NðwÞ \ S0 are pairwise different and non-empty. Therefore, S0 is a locating–dominating set of cardinality n  3, which leads to a contradiction. Remark 2. As a consequence of the above result it is immediately concluded that gðGÞ ¼ n  3 implies kðGÞ ¼ n  3. However, the reciprocal is not true. For example, the path P 6 verifies gðP6 Þ ¼ 2 ¼ n  4 and kðP 6 Þ ¼ 3 ¼ n  3. Remark 3. As showed in [13], graph families satisfying g ¼ n  2 are the following:     

K r;s , the complete bipartite graph, with r; s P 2, K r þ K s , with r; s P 2, K 1 þ ðK r [ K s Þ, with r; s P 2, K r þ ðK 1 [ K s Þ, with r P 1 and s P 2, K 2 ðr; sÞ, the double star, that is r and s pendant vertices from the two vertices of K 2 ,

44

J. Cáceres et al. / Applied Mathematics and Computation 220 (2013) 38–45

 K 1 þ ðK 1;r [ K s Þ, with r P 2 and s P 1,  any graph obtained by adding a new vertex adjacent to s leaves of the star K 1;r , with 2 6 s 6 r  1. As a consequence of Theorem 5, those are also the graphs with k ¼ n  2. 5. Realization theorems In this section, we characterize when it is possible to construct examples for a variety of values for g; k; b and c. Theorem 6. Given three positive integers a; b; c verifying that maxfa; bg 6 c 6 a þ b, there always exists a graph G such that cðGÞ ¼ a; bðGÞ ¼ b and gðGÞ ¼ c, except for the case 1 ¼ b < a < c ¼ a þ 1. Proof. We distinguish different cases: Case 1. Suppose that b ¼ 1. Certainly, bðGÞ ¼ 1 if and only if G is a path Pn . Moreover, according to Table 1, cðP2 Þ ¼ bðP2 Þ ¼ gðP2 Þ ¼ 1; cðP3 Þ ¼ bðP2 Þ ¼ 1 < 2 ¼ gðP2 Þ and bðPn Þ ¼ 1 < cðPn Þ ¼ gðPn Þ ¼ dn3e whenever n P 4. Hence, P2 satisfies case a ¼ b ¼ c ¼ 1; P3 fulfill the case 1 ¼ a ¼ b < c ¼ a þ b ¼ 2. The case 1 ¼ b < a < c ¼ a þ 1 is not realizable, and for every k P 2; P3k verifies the case 1 ¼ b < a ¼ c ¼ k. Case 2. Suppose now that a ¼ 1 and b P 2. Notice that if cðGÞ ¼ 1, then bðGÞ 6 gðGÞ 6 bðGÞ þ 1 and moreover there exists a vertex which is adjacent to the rest of the vertices of the graph. So the case 1 ¼ a < b ¼ c is achieved by considering the complete graph K bþ1 , and the case 1 ¼ a < b < c ¼ b þ 1 is realized with the star K 1;bþ1 . Case 3. Finally if a P 2 and b P 2 we need to consider several subcases. Recall that in every case c 6 a þ b. Case 3.1. When 2 6 a 6 b ¼ c, the graph showed in Fig. 5(i) realizes this case for r ¼ a  1 P 1 and l ¼ b  a þ 1 P 1. Note that fxi gri¼1 [ fwg is a c-code of cardinality r þ 1 ¼ a and fxi gri¼1 [ fai gli¼1 is both a b-code and an g-code of cardinality r þ l ¼ b ¼ c. Case 3.2. If 2 6 a ¼ b < c, then the graph displayed in Fig. 5(ii) does the work by taking r ¼ 2a  c P 0 and s ¼ c  a P 1. It is straightforward to prove that fxi gri¼1 [ fv i gsi¼1 is a c-code of cardinality r þ s ¼ a, fxi gri¼1 [ fzi gsi¼1 is a b-code of cardinality r þ s ¼ a ¼ b, and fxi gri¼1 [ fzi gsi¼1 [ fv i gsi¼1 is an g-code of cardinality r þ 2s ¼ c. Case 3.3. Let 2 6 a < b < c. Consider the graph displayed in Fig. 5(iii) and take r ¼ a þ b  c P 0; s ¼ c  b  1 P 0 and l ¼ b  a þ 1 P 2. Notice that r and s are not both 0, otherwise c ¼ a þ b ¼ b þ 1 implying that a ¼ 1, which is a contradiction. Therefore, fxi gri¼1 [ fv i gsi¼1 [ fwgis a c-code of cardinality r þ s þ 1 ¼ a, fxi gri¼1 [ fzi gsi¼1 [ fai gli¼1 is a b-code of cardinality r þ s þ l ¼ b, and fxi gri¼1 [ fzi gsi¼1 [ fai gli¼1 [ fv i gsi¼1 [ fwg is an g-code of cardinality r þ 2s þ l þ 1 ¼ c. Case 3.4. For the case 2 6 b < a ¼ c, consider the graph in Fig. 5(iv) and take r ¼ b  1 P 1 and l ¼ a  b P 1. Then fxi gri¼1 [ fdgis a b-code of cardinality r þ 1 ¼ b and fxi gri¼1 [ fwi gli¼1 [ fdgis both a c-code and an g-code of cardinality r þ l þ 1 ¼ a ¼ c.

δ βl

αl

w

δ

αl wl

δ αl wl

αl

w

α2 w2 α1 w1 yr x r ur

α2 α1 yr xr

y2 x 2 u2 y1 x 1 u1

y2 x2 y1 x1

vs

ts zs

α1 yr x r ur

yr x r ur

α2 w2 α1 w1 yr x r ur

y2 x 2 u2 y1 x 1 u1

y2 x 2 u2 y1 x 1 u1

y2 x 2 u2 y1 x 1 u1

vs

ts vs zs

ts zs

t2 v2 z2 t1 v1 z1

t2 z2 t1 z1

β1

ur u2 u1

v2 v1 (i)

(ii)

(iii)

t2 z2 t1 z1

v2 v1 (iv)

Fig. 5. Cases a P 2; b P 2.

(v)

J. Cáceres et al. / Applied Mathematics and Computation 220 (2013) 38–45

45

d1 c1 d2

c2

ck b1

b2

a1 a2 x ar br

cr

bk ak ak−1

bk−1

ck−1

ar+1 br+1 cr+1

dr η = k + 1, λ = k + r + 1 Fig. 6. Spider Sr;4;kr;3 on k legs, r of them having 4 edges, and the rest 3 edges.

Case 3.5. When 2 6 b < a < c, consider the graph in Fig. 5(v) and let r ¼ a þ b  c P 0; s ¼ c  a  1 P 0 and l ¼ a  b þ 1 P 2. Notice that r and s are not both 0, otherwise c ¼ a þ 1 ¼ a þ b implying b ¼ 1, which is a contradiction. Then fxi gri¼1 [ fv i gsi¼1 [ fwi gli¼1 is a c-code of cardinality r þ s þ l ¼ a, fxi gri¼1 [ fzi gsi¼1 [ fdg is a b-code of cardinality r þ s þ 1 ¼ b and fxi gri¼1 [ fzi gsi¼1 [ fdg [ fv i gsi¼1 [ fwi gli¼1 is an g-code of cardinality r þ 2s þ l þ 1 ¼ c. Moreover, in the special case of trees, we can obtain the following result. Theorem 7. Given two integers a and b verifying 3 6 a 6 b 6 2a  2, there always exists a tree T such that gðTÞ ¼ a and kðTÞ ¼ b. Proof. Let r; k be integers such that 2 6 k and 0 6 r 6 k. Consider the spider Sr;4;kr;3 showed in Fig. 6. Notice that k k fci gri¼1 [ fbi gi¼rþ1 [ fxg is an g-code and fci gri¼1 [ fai gri¼1 [ fbi gi¼rþ1 [ fxg is a k-code of Sr;4;kr;3 . Hence, given any two integers a; b such that 3 6 a 6 b 6 2a  2, the spider Sba;4;2ab1;3 satisfies g ¼ a and k ¼ b. h References [1] N. Bertrand, I. Charon, O. Hudry, A. Lobstein, Identifying and locating–dominating codes on chains and cycles, Eur. J. Comb. 25 (2004) 969–987. [2] M. Blidia, M. Chellali, F. Maffray, J. Moncel, A. Semri, Locating–domination and identifying codes in trees, Australas. J. Comb. 39 (2007) 219–232. [3] M. Blidia, M. Chellali, R. Lounes, F. Maffray, Characterizations of trees with unique minimum locating–dominating sets, J. Comb. Math. Comb. Comput. 76 (2011) 225–232. [4] I. Charon, O. Hudry, A. Lobstein, Possible cardinalities for locating–dominating codes in graphs, Australas. J. Comb. 34 (2006) 23–32. [5] I. Charon, O. Hudry, A. Lobstein, Extremal cardinalities for identifying and locating–dominating codes in graphs, Discrete Math. 307 (3-5) (2007) 356– 366. [6] G. Chratrand, L. Lesniak, P. Zhang, Graphs & Digraphs, fifth ed., CRC Press, Boca Raton, FL, 2011. [7] C. Chen, C. Lu, Z. Miao, Identifying codes and locating–dominating sets on paths and cycles, Discrete Appl. Math. 159 (2011) 1540–1547. [8] G. Exoo, V. Junnila, T. Laihonen, Locating–dominating codes in paths, Discrete Math. 311 (2011) 1863–1873. [9] G. Exoo, T. Laihonen, S. Ranto, Improved upper bounds on binary identifying codes, IEEE Trans. Inf. Theory 53 (11) (2007) 4255–4260. [10] R. Hammack, W. Imrich, S. Klavzar, Handbook of Product Graphs, second ed., CRC Press, Boca Raton, FL, 2011. [11] F. Harary, R.A. Melter, On the metric dimension of a graph, Ars Comb. 2 (1976) 191–195. [12] T.W. Haynes, S.T. Hedetniemi, P.J. Slater, Fundamentals of Domination in Graphs, Marcel Dekker, New York, 1998. [13] M.A. Henning, O. Oellermann, Metric-locating–dominating sets in graphs, Ars Comb. 73 (2004) 129–141. [14] C. Hernando, M. Mora, I.M. Pelayo, Nordhaus–Gaddum bounds for locating domination, Eur. J. Comb. http://dx.doi.org/10.1016/j.ejc.2013.04.009. [15] C. Hernando, M. Mora, I.M. Pelayo, C. Seara, D. Wood, Extremal graph theory for metric dimension and diameter, Electron. J. Comb. 17 (2010) R30. [16] I. Honkala, An optimal locating–dominating set in the infinite triangular grid, Discrete Math. 306 (2006) 2670–2681. [17] M.G. Karpovsky, K. Chakrabarty, L.B. Levitin, On a new class of codes for identifying vertices in graphs, IEEE Trans. Inf. Theory 44 (2) (1998) 599–611. [18] A. Lobstein, Watching systems, identifying, locating–dominating and discriminating codes in graphs. Available: . [19] S.J. Seo, P.J. Slater, Open neighborhood locating–dominating in trees, Discrete Appl. Math. 159 (2011) 484–489. [20] P.J. Slater, Leaves of trees, in: Proceedings of Sixth Southeastern Conference on Combinatorics, Graph Theory, and Computing, Congressus Numerantium, vol. 14, 1975, pp. 549–559. [21] P.J. Slater, Domination and location in acyclic graphs, Networks 17 (1987) 55–64. [22] P.J. Slater, Dominating and reference sets in a graph, J. Math. Phys. Sci. 22 (1988) 445–455.