On the Maximal Shortest Paths Cover Number

A shortest path P of a graph G is maximal if P is not contained as a subpath in any other shortest path. A set S ⊆ V(G) is a maximal shortest paths cover if every maximal shortest path of G contains a vertex of S. The minimum cardinality of a maximal shortest paths cover is called the maximal shortest paths cover number and is denoted by ξ(G). We show that it is NP-hard to determine ξ(G). We establish a connection between ξ(G) and several other graph parameters. We present a linear time algorithm that computes exact value for ξ(T) of a tree T.


Introduction and Preliminaries
Distance is one of essential terms in mathematics and has inspired many important results in different areas of mathematics. As the concept comes from real life, this gives rise to several applications. A theoretical model for a possible scenario of such an application is presented also in this work. Consider a complex system that can be modeled by a graph. When it is not possible to control every part of a system, usually due to technical or economical reasons, one would like to position the control points to strategic places of the underlying graph. We propose here to put these controls into the particular elements of the system, represented by vertices of a graph, in such a way that all the maximal shortest paths of the graph can be monitored and controlled from these elements.
In this work we consider finite simple graphs. Let G be a graph and u, v be vertices of G. The distance between two vertices u, v ∈ V(G) is the minimum number of edges on a path that starts at u and ends at v and is denoted by d G (u, v) or for short d(u, v). A vertex x ∈ V(G) strongly distinguishes vertices u and v of G if u is on a shortest path between x and v or v is on a shortest path between x and u. Set S is a strong metric generator if for any pair u, v of different vertices of G there exists x ∈ S such that x strongly distinguishes u and v. The minimum cardinality of a strong metric generator is called the strong metric dimension of G and is denoted by sdim(G). The strong metric dimension was introduced in [1], but later, in [2], Oellermann and Peters-Fransen connected strong metric dimension with so-called mutually maximal distant pairs of vertices. Vertices u and v form such a pair if the distance between v and every neighbor w of u does not exceed d(u, v) and symmetrically if the distance between u and every neighbor w of v does not exceed d (u, v). But this simply means that a shortest path P between u and v is a maximal shortest path, meaning that P is not included in any other longer shortest path as a subpath.
In [2] the authors also showed that sdim(G) is the minimum number of vertices that cover every mutually maximal distant pair of vertices. This approach was later more developed in several other papers (see, e.g., [3][4][5][6][7] for a flavor). Here we relax the conditions mentioned above and we only require that all maximal shortest paths in a graph are covered. One can wonder whether this requirement really leads to a relaxation. Indeed, there could be many shortest paths between the same pair of vertices. However, we can always take one vertex of a considered pair of vertices and it obviously lies on all maximal shortest paths between them in G. Hence, in this way we can cover all maximal shortest paths with a set of cardinality sdim(G). Therefore, our approach actually yields to a relaxation of maximal distant pair cover.
Such an approach is also a generalization of another well-known concept, namely the vertex cover number of a graph G that belongs to the essential 21 NP-complete problems described by Karp in [8]. We recall that the vertex cover number β(G) is the minimum number of vertices that cover all edges of a graph G. Here we need to limit ourselves to graphs without isolated vertices, because every isolated vertex forms a maximal shortest path of length zero, but it does not contribute to β(G). On the other hand, every other maximal shortest path contains at least one edge e ∈ E(G) and at least one end-vertex of e must be contained in a vertex cover of G. The other generalization of the minimum vertex cover was introduced in [9]. The k-path vertex cover number ψ k (G) denotes the minimum cardinality of a minimal set of vertices of G that have a non-empty intersection with a vertex set of every path of order k. One can easily see that ψ 1 (G) and ψ 2 (G) coincide with the order of G and β(G), respectively. For results concerning k-path vertex cover for product of graphs see, e.g., [10][11][12] and relationships to other invariants can be found in [13].
The same topic as it is considered in this paper was recently studied in [14] under the name The geodesic-transversal problem. Some results from the mentioned paper overlap with the results from this work; however, the used methods are different. The other results on maximal shortest paths cover can be found in [15], where the maximal shortest paths cover number is investigated for the joins and lexicographic products of two graphs.
A wheel graph W n , n ≥ 4, is a graph obtained from a cycle C n−1 = v 1 . . . v n−1 v 1 by adding a new vertex u and edges v i u for every i ∈ {1, . . . , n − 1}. The vertex u of W n is universal and is called the central vertex of W n . A star S k , k ≥ 2, is a special kind of complete bipartite graph, namely K 1,k−1 . For some positive integers k, t 1 , . . . , t k a generalized star is a graph S t 1 ,...,t k with the central vertex v of degree k and with S t 1 ,...,t k − v isomorphic to k paths P k 1 , . . . , P k t . It is easy to see that if t 1 = · · · = t k = 1, then S t 1 ,...,t k ∼ = S k .
A grid graph or a Cartesian product of two paths P q P r has vertices v i,j where i ∈ {1, . . . , q} and j ∈ {1, . . . , r}. Two vertices v i,j and v k, of P q P r are adjacent if either |i − k| = 1 and j = or i = k and |j − | = 1. In [7] (see Proposition 30) among other results, also the strong metric dimension of grids was determined as sdim(P q P r ) = 2. (1)

Definition and Complexity
A path between u and v of length d(u, v) is called a u, v-shortest path or a u, v-geodesic. The diameter of G is denoted by diam(G) and is the length of a longest geodesic in G. A u, vgeodesic P is said to be extendible if there exist vertices x, y in G such that {u, v} = {x, y} and P is a subpath of a x, y-geodesic. If a path P is not extendible, then P is not contained in any other shortest path and is therefore a maximal shortest path. If there exists a maximal shortest path between u and v, then all u, v-geodesics are maximal shortest paths. The path yxt at Figure 1 is extendible because it is a proper subpath of the path yxtv-a shortest path between y and v. The path zxt is not extendible because it is not a proper subpath of any shortest path of the graph. A subset S of the set of vertices of a graph G is called a maximal shortest paths cover if it has non-empty intersection with vertex set of every maximal shortest path of G. The vertex set {z, t} at Figure 1 is the maximal shortest paths cover of the given graph since the paths yxtv and yzuv and zxt are maximal shortest paths (i.e., the cardinality of the cover must be at least 2) and the paths yx and uv are extendible.
The cardinality of a smallest maximal shortest paths cover in a graph G is denoted by ξ(G) and is called the maximal shortest paths cover number of G. Every maximal shortest paths cover of G of cardinality ξ(G) is called a ξ(G) set.
Let G and H be two graphs. The disjoint union of G and H is the graph G ∪ H that is obtained from one copy of G and one copy of H. The following observation ensures that it is enough to handle connected graphs. It holds because every maximal shortest path of G ∪ H is contained either in G or in H.

Proposition 1. If G and H are arbitrary disjoint graphs, then ξ(G ∪ H) = ξ(G) + ξ(H).
We start with determining ξ(G) for some classic families of graphs to get a better grip on the problem.

Proposition 2.
If k is a positive integer, then

Proof.
(i) A path P k contains exactly one maximal shortest path and any vertex of P n is its maximal shortest paths cover. Therefore, ξ(P k ) = 1.
Suppose that ξ(C k ) = 1 and that, with the possible change of notation, {v 1 } is a maximal shortest paths cover. Path v 2 v 3 . . . v t+2 is of length t and does not contain v 1 , a contradiction. Hence, ξ(C k ) ≥ 2. On the other hand, set {v 1 , v t+1 } is a maximal shortest paths cover and ξ(C k ) = 2 follows. (iii) Every maximal path of S k contains the central vertex v of S k and {v} is the maximal shortest paths cover of S k . Therefore, ξ(S k ) = 1. (iv) Clearly, ξ(K 1 ) = 1. In K k , k ≥ 2, every edge is a maximal shortest path. Therefore, Conversely, any path of order 1 is extendible and therefore any set of cardinality k − 1 is a maximal shortest paths cover set of K k when k ≥ 2. This yields ξ(K k ) = k − 1 for k ≥ 2. (v) For k = 4 we have W 4 = K 4 . For k = 5 it is easy to check that two consecutive vertices of cycle C 4 form a maximal shortest paths cover of W 5 and that one vertex is not sufficient to cover all maximal shortest paths of W 5 .
Let C k−1 = v 1 . . . v k−1 v 1 and let u be the central vertex of W k , k ≥ 6. Notice that every path of length two on C k−1 is a maximal shortest path of W k . This means that at least one vertex among three consecutive vertices of C k−1 must be in every maximal shortest paths cover of W k . Hence, ξ(W k ) ≥ k−1 3 . Moreover, u is on a maximal shortest path between any two non-consecutive vertices of C k−1 . As k ≥ 6 there always exist two non-consecutive vertices of C k−1 that are not in a subset of 3 −2 } is a maximal shortest paths cover, which is clear from the previous analysis of all maximal shortest paths of W k .
Next we deal with the complexity of the Maximal Shortest Paths Cover Problem (or MSPC problem for short) that is defined as follows.
Maximal Shortest Paths Cover Problem (MSPC problem) INSTANCE: A graph G of order n ≥ 3 and an integer 1 ≤ r ≤ n − 1. QUESTION: Is ξ(G) ≤ r?
Since the maximal shortest paths cover is a generalization of some well known problems that are NP-complete, it is not very surprising that MSPC problem is NP-complete as well.
Proof. Let us reduce the well-known Vertex Cover Problem to MSPC problem. Let G be an instance of the Vertex Cover Problem without isolated vertices. We construct G * by attaching a pending edge to every vertex of G.
Let S be a minimum vertex cover of G. Evidently it covers all shortest paths of the original graph G. Moreover, if a shortest path of G * is not extendible, then it must contain at least one edge from G. Therefore, it is covered by S.
On the other hand, for every edge e of the original graph G there is a maximal shortest path between new vertices of G * of length three containing e and no other edge belonging to G. Therefore, any maximal shortest paths cover must contain at least one vertex from such a path and evidently we can choose an end-vertex of e. In such a manner we obtain a maximal shortest paths cover of G * that is simultaneously a minimum vertex cover of G.

General Bounds
First we present relationships of ξ(G) to the both invariants which we used for a motivation in Introduction. We remind that these two invariants are strong metric dimension sdim(G) and vertex cover number β(G). We start with the latter one.

Proposition 3. If G is a graph without isolated vertices, then
Proof. Evidently, every shortest path in G must be of order at least two and therefore it contains at least one vertex from the vertex cover.
The previous bound is sharp and it is obtained for stars and for complete graphs. On the other hand, β(G) can exceed ξ(G) with an arbitrary big difference. Such a difference can be achieved even for paths and cycles.
The next proposition provides another bound for ξ(G).

Proposition 4.
If G is a graph without isolated vertices, then Proof. Let P be any maximal shortest path of G and let S be an sdim(G) set. As it was mentioned in the first section, S must contain at least one end-vertex of P. Since P was chosen arbitrary, this means that S is also a maximal shortest paths cover of G and the result follows.
The above bound is sharp for paths and complete graphs. The difference between sdim(G) and ξ(G) can be arbitrary large as we can see it on even cycles where sdim(C 2k ) − ξ(C 2k ) = k − 2. Stars present another example with big difference between sdim(G) and ξ(G).
Next we provide a classification for all graphs with ξ(G) = 1.
On the other hand, let ξ(G) = 1 and suppose that {v} covers all maximal shortest paths.
If G is not connected, then at least one component does not contain v and obviously any maximal shortest path from this component is not covered by v. Therefore, G is connected.
Assume first that G is a tree. Moreover, suppose that G has more than one vertex of degree at least three. If x and y are two such vertices with maximum possible distance in G, then G − x contains at least two components that are isomorphic to paths and end with leaves 1 and 2 , respectively. Similarly, G − y contains at least two components that are isomorphic to paths and end with leaves 3 and 4 , respectively. The choice of x and y implies that 1 , 2 , 3 , 4 are pairwise different. The unique 1 , 2 -geodesic and 3 , 4 -geodesic are disjoint and they are maximal shortest paths of G. Hence, v cannot belong to both, a contradiction. Therefore, either G is a path or contains exactly one vertex w of degree at least three. In both cases G is isomorphic to some S t 1 ,t 2 ,...,t k .
Assume now that G contains a cycle. Let us denote by C t = x 1 x 2 . . . x t x 1 , t ≥ 3 a shortest cycle of G. Firstly suppose that v belongs to C t . Without loss of generality we can assume that v = x 1 . Let i = 1 + t 4 and j = 1 + t 4 + t 2 . There exists the shortest path P on C t between x i and x j that does not contain x 1 . Since C t is a shortest cycle, P is also a shortest x i x j -path in G. If P is a maximum shortest path, then we have an immediate contradiction as v / ∈ V(P). Hence, let P be a maximal shortest path that contains P. Since {x 1 } is the maximum shortest paths cover we know that x 1 ∈ V(P ). If x j is between x i and x 1 on P , then d P (x 1 , x i ) > t 2 ≥ t 4 = d G (x 1 , x i ), a contradiction with the existence of P . Symmetrically we obtain a contradiction when x i is between x j and x 1 on P . Therefore, v is not a vertex of C t .
Let Q be a shortest path between v and C t . With a possible suitable modification of notation, we may assume that x 1 is the other end-vertex of Q. Let now P be the shortest path on C t between x 2 and x t . If t = 3, then P is the edge x 2 x t . When t = 4 we have two shortest paths between x 2 and x t on C t and let P be the one that contains x 1 . Moreover, if t > 4, then P contains x 1 . Now, P is not a maximal shortest path because v is not on P. Let P be a maximal shortest path through v that contains P as a subpath. Without loss of generality we may assume that x 2 is closer to v than x t on P . If t ≥ 4, then , which provides the same contradiction as before. Therefore, we have d Q (v, x 1 ) = d P (v, x 2 ). Now the edge x 1 x 2 is a maximal shortest path itself or it is properly contained in some maximal shortest path R that does not contain v. However, this is not possible since {v} is a maximal shortest paths cover of G. This means, that G with ξ(G) = 1 does not contain any cycle and we are done. Proposition 4, together with (1) and Theorem 2 directly imply the following result on grid graphs.
The following proposition provides us another useful bound on ξ(G).

Proposition 5.
For every graph G the following is true: Proof. Let P be a diametrical path of G. Set S contains all the vertices outside P and one vertex of P. Clearly P is covered by S. Every maximal shortest path different than P contains a vertex outside of P that belongs to S. Hence, S is a maximal shortest paths cover of cardinality |V(G)| − diam(G) and the result follows.
From Theorem 2 we also deduce the following connection.
In the light of the previous corollary one can ask whether similar relationship is valid also for higher degrees of connectivity. However, one can easily see that such an extension is not true. Indeed, by Proposition 2 we have ξ(W 5 ) = 2 and evidently W 5 is 3-connected.

Trees
A vertex v of degree at least 3 in a tree T is called a support if there exists at least one path component in T − v. Clearly such a path component of T − v ends in a leaf and we say that corresponds to a support v. A support v is a light support if it has just one path component in T − v, otherwise it is called a strong support. Notice that the term support is often used for neighbors of leafs in other publications, while we use it for the vertex that is closest to a leaf and has degree at least three. Paths have no support vertices and the star S q has one strong support vertex when q ≥ 3. It is an easy observation that every tree is either a path or it contains a strong support vertex. We can immediately bound ξ(T) as it is shown next. A tree T shown in Figure 2 has two strong supports u and w and one weak support v.
u v w Figure 2. Caterpillar with one weak support v and two strong supports u and w.
Theorem 3. Let k, , r, q be non-negative integers. Let T be a tree different from a path having k strong supports v 1 , . . . , v k and light supports. If T − {v 1 , . . . , v k } contains r components with at least one light support of T and q components with at least two light supports of T, then Proof. Every maximal shortest path in a tree is a path between two leaves. Let S and L be the sets of strong and light supports of T, respectively. Further let L be a set obtained from L by deleting one light support from every component of T − S that contains a light support. Let x and y be arbitrary leaves. The x, y-geodesic P in T contains at least one support. Moreover, if the number of supports on P is exactly one then x and y correspond to the same strong support. Hence, the set S ∪ L covers P when P contains exactly one (strong) support. Similarly, P is covered by S ∪ L when P contains at least one strong support. So suppose that V(P) ∩ S = ∅. Now P contains at least two light supports, which means that both light supports are in the same component of T − S and at least one of them is in L . Hence, P is again covered by S ∪ L and the upper bound follows.
Let now D be a ξ(T) set. Let v be a strong support vertex of T. Let P 1 and P 2 be two path components of T − v and let 1 and 2 be leaves of T that correspond to v and belong to P 1 and P 2 , respectively. Path P in T that starts at 1 and ends at 2 is a maximal shortest path containing exactly one vertex of degree three, namely v. As D is a ξ(T) set, there exists a vertex from D that belongs to P. Hence, for every strong support vertex we have at least one vertex in D. Moreover, as follows from the previous analysis and the definition of strong supports, these vertices are pairwise different. Let D be set obtained from D by deleting all vertices that correspond to strong support vertices. Now, let us consider an arbitrary component of T − S that contains at least two light supports, say u and v. Let x and y be the leaves that correspond to u and v, respectively. Evidently, no vertex from D − D lies on the x, y-geodesic. Hence, for every component of T − S with at least two light supports we need at least one additional vertex in D . Hence, ξ(t) ≥ k + q and we are done.
Last theorem immediately implies the result for trees without light supports.

Corollary 3.
If T is a tree with k > 0 strong supports and without light supports, then ξ(T) = k.
Let T be a tree. By T − we denote the forest of paths obtained from T by deleting all vertices of degree at least three. Let v be a strong support of T. The star neighborhood of v, denoted by SN T (v), contains v and all the vertices belonging to path components of T − that containins a neighbor of v in T.
Let v 1 be a leaf of T that corresponds to a strong support u. We order V(T) by BFS algorithm that starts at v 1 . In addition, we adjust BFS algorithm in such a way that for a vertex x it remembers also its closest ancestor (with respect to the constructed order) of degree more than two whenever such an ancestor exists and keeps it in a(x). When such an ancestor does not exist, for all the vertices on the v 1 , u-geodesic we set a(x) = u for x = u and a(u) = v 1 . Hence, after the completion of the run of the designed algorithm, each variable a( ), associated with a leaf , possesses the reference to the corresponding support of . Those vertices that appear more than once among the values a( ), is any leaf, are strong supports and those which appear only once are light supports. Now, let us restrict our attention to all the vertices of T of degree at least three accompanied with v 1 . For these vertices reverse the order constructed by the enhanced BFS algorithm. We put them in list A together with information whether they are strong or light supports or no supports at all. This can be achieved with two Boolean functions s(x) and (x) where s(x) = 1 means that x is a strong support and (x) = 1 that x is a light support. If s(x) = 0 = (x), then x is not a support vertex. Moreover, the state s(x) = 1 means that (x) = 0 and vice versa. Clearly, A ends with v 1 .
Let x be the first vertex from A and T = T − SN T (x). If T contains more than one vertex of degree three, then T is a tree and exactly one of the following cases occurs: (a) a(x) is a strong support of T with deg(a(x)) > 3 and it is a strong support of T as well; (b) a(x) is a light or strong support of T with deg(a(x)) = 3 and is a vertex of degree two in T -the later case occurs only when T has exactly two vertices of degree at least three; (c) a(x) is a light support of T with deg(a(x)) > 3 and is a light support of T as well; (d) a(x) is not a support of T and is not a support of T .
In particular, (b) means that the ancestor of y of degree at least three that is closest to a(x) in T , i.e., y = a(a(x)) if it exists, either becomes a light support (providing y was not a support vertex of T) or becomes a strong support (whenever y was a support of T). In the special case, when T has exactly two vertices of degree at least three and one of them, say u, that is closer to v 1 , has degree three, then T is a path. It is also worth to mention that in the case (d) the vertex a(x) has degree two in T providing deg(a(x)) = 3 in T. Therefore, in such a case one needs to delete a(x) from A (see the first condition in if sentence in the line 6 of Algorithm 1).
For an arbitrary tree T the value ξ(T) and the corresponding ξ(T) set D are computed in the main loop of Algorithm 1. The loop is repeated while A is not empty and, in addition, in every step we adjust the parameters s(a(a(x))), (a(a(x))) and a(x) when needed. If the processed vertex satisfies the conditions described in the cases (a), (c) or (d), then nothing needs to be done (except, as it is explained above, for case (d) and deg(a(x)) = 3). If we have the case (b), then a(x) is a vertex of degree two in T and we change the value a(x) to a(a(x)) in the leaf t that corresponds to a(x) in T, i.e., a(t) = a(a(x)) after this operation. However, one can avoid this and just adopt the status of a(a(x)) directly, see if sentences in lines 9-11 and 12-14 of Algorithm 1 for this. We need to consider also the second condition in if sentence of line 6 of Algorithm 1. If a(x) = v 1 , then v 1 corresponds to x and all maximal shortest paths that starts at v 1 contain x. Therefore, we delete v 1 from A. However, it is possible that v 1 corresponds to a(x), where a(x) is a strong support of T with exactly two leaves corresponding to a(x). This means that the maximal shortest path between v 1 and the other leaf that corresponds to a(x) is not covered yet. In such a case v 1 remains in A and it is added to D in the last step of the algorithm. Since v 1 belongs to A, Algorithm 1 works correctly also for paths.
Next we prove the correctness and estimate the time complexity of Algorithm 1. Proof. Let T be a tree and let S = {u 1 , . . . , u k } be all strong support vertices of T ordered by BFS algorithm starting from a leaf v 1 (the ordering is arbitrary but fixed). We prove the correctness of Algorithm 1 by induction on the number of light support vertices of T. Let first = 0. We prove the basis again by induction on the number k of strong supports of T. If T has also no strong supports, then T ∼ = P r and the output of Algorithm 1 is z = 1 and D = {v 1 } which is correct. If T has exactly one vertex of degree at least three, then T is a generalized star and we have ξ(T) = 1 and D = {u 1 } by Theorem 2. The same result is obtained by Algorithm 1, because line 5 is executed exactly once and v 1 is deleted from A in line 7.
Proof. For the first statement it is sufficient to consider the path P n for sufficiently large n. We have already shown by Proposition 2 that ξ(P n ) = 1 and by [10] we have ψ k (P n ) = n k . For the second statement consider the caterpillar G ∼ = CTP n (2, 2, . . . , 2) of order 3n. The maximal shortest paths cover of G is formed by n vertices of spine by Theorem 4 and we have ξ(G) = n. On the hand ψ k (G) ≤ n 2 whenever k ≥ 4. This means ξ(G) − ψ k (G) ≥ n − n 2 ≥ n − n 2 = n 2 and for sufficiently large n we obtain the desired result.
Author Contributions: I.P. and G.S. contributed equally to all stages of the research and paper preparation. Both authors have read and agreed to the published version of the manuscript.

Funding:
The research of the first author was partially supported by the Slovenian research agency by the grants P1-0297, J1-1693 and J1-9109. The research of the second author was partially supported by the Slovak Grant Agency for Science (VEGA) under contract 1/0177/21. This work was done during the visit of the first author at the Pavol Jozef Šafárik University in Košice, Slovakia using infrastructure developed by the project UVP Technicom ITMS 313011D232.
Institutional Review Board Statement: Not applicable.