1. 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
be vertices of
G. The distance between two vertices
is the minimum number of edges on a path that starts at
u and ends at
v and is denoted by
or for short
. A vertex
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
of different vertices of
G there exists
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
. 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
and symmetrically if the distance between
u and every neighbor
w of
v does not exceed
. 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
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
. 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
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
. On the other hand, every other maximal shortest path contains at least one edge
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
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
and
coincide with the order of
G and
, 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 , , is a graph obtained from a cycle by adding a new vertex u and edges for every . The vertex u of is universal and is called the central vertex of . A star , , is a special kind of complete bipartite graph, namely . For some positive integers a generalized star is a graph with the central vertex v of degree k and with isomorphic to k paths . It is easy to see that if , then .
A grid graph or a Cartesian product of two paths
has vertices
where
and
. Two vertices
and
of
are adjacent if either
and
or
and
. In [
7] (see Proposition 30) among other results, also the strong metric dimension of grids was determined as
2. Definition and Complexity
A path between
u and
v of length
is called a
-shortest path or a
-geodesic. The diameter of
G is denoted by
and is the length of a longest geodesic in
G. A
-geodesic
P is said to be extendible if there exist vertices
in
G such that
and
P is a subpath of a
-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
-geodesics are maximal shortest paths. The path
at
Figure 1 is extendible because it is a proper subpath of the path
—a shortest path between
y and
v. The path
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
at
Figure 1 is the maximal shortest paths cover of the given graph since the paths
and
and
are maximal shortest paths (i.e., the cardinality of the cover must be at least 2) and the paths
and
are extendible.
The cardinality of a smallest maximal shortest paths cover in a graph G is denoted by and is called the maximal shortest paths cover number of G. Every maximal shortest paths cover of G of cardinality is called a set.
Let G and H be two graphs. The disjoint union of G and H is the graph 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 is contained either in G or in H.
Proposition 1. If G and H are arbitrary disjoint graphs, then .
We start with determining for some classic families of graphs to get a better grip on the problem.
Proposition 2. If k is a positive integer, then
- (i)
, ;
- (ii)
, ;
- (iii)
, ;
- (iv)
, , and = 1;
- (v)
, and , .
Proof. - (i)
A path contains exactly one maximal shortest path and any vertex of is its maximal shortest paths cover. Therefore, .
- (ii)
Let . A path P is a maximal shortest path of if and only if P is of the length . Suppose that and that, with the possible change of notation, is a maximal shortest paths cover. Path is of length t and does not contain , a contradiction. Hence, . On the other hand, set is a maximal shortest paths cover and follows.
- (iii)
Every maximal path of contains the central vertex v of and is the maximal shortest paths cover of . Therefore, .
- (iv)
Clearly, . In , , every edge is a maximal shortest path. Therefore, for . Conversely, any path of order 1 is extendible and therefore any set of cardinality is a maximal shortest paths cover set of when . This yields for .
- (v)
For we have . For it is easy to check that two consecutive vertices of cycle form a maximal shortest paths cover of and that one vertex is not sufficient to cover all maximal shortest paths of .
Let and let u be the central vertex of , . Notice that every path of length two on is a maximal shortest path of . This means that at least one vertex among three consecutive vertices of must be in every maximal shortest paths cover of . Hence, . Moreover, u is on a maximal shortest path between any two non-consecutive vertices of . As there always exist two non-consecutive vertices of that are not in a subset of of cardinality . Therefore, . To show the equality one needs to show that is a maximal shortest paths cover, which is clear from the previous analysis of all maximal shortest paths of . □
Next we deal with the complexity of the Maximal Shortest Paths Cover Problem (or MSPC problem for short) that is defined as follows.
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.
Theorem 1. MSPC problem is NP-complete.
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 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 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 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 that is simultaneously a minimum vertex cover of G. □
3. General Bounds
First we present relationships of to the both invariants which we used for a motivation in Introduction. We remind that these two invariants are strong metric dimension and vertex cover number . 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, can exceed with an arbitrary big difference. Such a difference can be achieved even for paths and cycles.
The next proposition provides another bound for .
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 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 and can be arbitrary large as we can see it on even cycles where . Stars present another example with big difference between and .
Next we provide a classification for all graphs with .
Theorem 2. Graph G has if and only if G is isomorphic to for some positive integers .
Proof. It is easy to verify that .
On the other hand, let and suppose that 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 contains at least two components that are isomorphic to paths and end with leaves and , respectively. Similarly, contains at least two components that are isomorphic to paths and end with leaves and , respectively. The choice of x and y implies that are pairwise different. The unique -geodesic and -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 .
Assume now that G contains a cycle. Let us denote by , a shortest cycle of G. Firstly suppose that v belongs to . Without loss of generality we can assume that . Let and . There exists the shortest path P on between and that does not contain . Since is a shortest cycle, P is also a shortest -path in G. If P is a maximum shortest path, then we have an immediate contradiction as . Hence, let be a maximal shortest path that contains P. Since is the maximum shortest paths cover we know that . If is between and on , then , a contradiction with the existence of . Symmetrically we obtain a contradiction when is between and on . Therefore, v is not a vertex of .
Let Q be a shortest path between v and . With a possible suitable modification of notation, we may assume that is the other end-vertex of Q. Let now P be the shortest path on between and . If , then P is the edge . When we have two shortest paths between and on and let P be the one that contains . Moreover, if , then P contains . Now, P is not a maximal shortest path because v is not on P. Let be a maximal shortest path through v that contains P as a subpath. Without loss of generality we may assume that is closer to v than on . If , then and with this , a contradiction with being a shortest path. Hence, . If , then , which provides the same contradiction as before. Therefore, we have . Now the edge 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 is a maximal shortest paths cover of G. This means, that G with 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.
Corollary 1. For positive integers , .
The following proposition provides us another useful bound on .
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 and the result follows. □
From Theorem 2 we also deduce the following connection.
Corollary 2. If a graph G is 2-connected, then .
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 and evidently is 3-connected.
4. 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
. Clearly such a path component of
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
, 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
has one strong support vertex when
. It is an easy observation that every tree is either a path or it contains a strong support vertex. We can immediately bound
as it is shown next. A tree
T shown in
Figure 2 has two strong supports
u and
w and one weak support
v.
Theorem 3. Let be non-negative integers. Let T be a tree different from a path having k strong supports and ℓ light supports. If 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 be a set obtained from L by deleting one light support from every component of that contains a light support. Let x and y be arbitrary leaves. The -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 covers P when P contains exactly one (strong) support. Similarly, P is covered by when P contains at least one strong support. So suppose that . Now P contains at least two light supports, which means that both light supports are in the same component of and at least one of them is in . Hence, P is again covered by and the upper bound follows.
Let now D be a set. Let v be a strong support vertex of T. Let and be two path components of and let and be leaves of T that correspond to v and belong to and , respectively. Path P in T that starts at and ends at is a maximal shortest path containing exactly one vertex of degree three, namely v. As D is a 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 be set obtained from D by deleting all vertices that correspond to strong support vertices. Now, let us consider an arbitrary component of 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 lies on the -geodesic. Hence, for every component of with at least two light supports we need at least one additional vertex in . Hence, and we are done. □
Last theorem immediately implies the result for trees without light supports.
Corollary 3. If T is a tree with strong supports and without light supports, then .
Let T be a tree. By 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 , contains v and all the vertices belonging to path components of that containins a neighbor of v in T.
Let be a leaf of T that corresponds to a strong support u. We order by BFS algorithm that starts at . 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 . When such an ancestor does not exist, for all the vertices on the -geodesic we set for and . Hence, after the completion of the run of the designed algorithm, each variable , associated with a leaf ℓ, possesses the reference to the corresponding support of ℓ. Those vertices that appear more than once among the values , ℓ 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 . 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 and where means that x is a strong support and that x is a light support. If , then x is not a support vertex. Moreover, the state means that and vice versa. Clearly, A ends with .
Let x be the first vertex from A and . If T contains more than one vertex of degree three, then is a tree and exactly one of the following cases occurs:
- (a)
is a strong support of T with and it is a strong support of as well;
- (b)
is a light or strong support of T with and is a vertex of degree two in — the later case occurs only when T has exactly two vertices of degree at least three;
- (c)
is a light support of T with and is a light support of as well;
- (d)
is not a support of T and is not a support of .
In particular, (b) means that the ancestor of y of degree at least three that is closest to in , i.e., 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 , has degree three, then is a path. It is also worth to mention that in the case (d) the vertex has degree two in providing in T. Therefore, in such a case one needs to delete from A (see the first condition in if sentence in the line 6 of Algorithm 1).
For an arbitrary tree
T the value
and the corresponding
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
and
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
). If we have the case (b), then
is a vertex of degree two in
and we change the value
to
in the leaf
t that corresponds to
in
T, i.e.,
after this operation. However, one can avoid this and just adopt the status of
directly, see if sentences in lines 9–11 and 12–14 of Algorithm 1 for this.
Algorithm 1: Computing of a tree T. |
|
We need to consider also the second condition in if sentence of line 6 of Algorithm 1. If , then corresponds to x and all maximal shortest paths that starts at contain x. Therefore, we delete from A. However, it is possible that corresponds to , where is a strong support of T with exactly two leaves corresponding to . This means that the maximal shortest path between and the other leaf that corresponds to is not covered yet. In such a case remains in A and it is added to D in the last step of the algorithm. Since belongs to A, Algorithm 1 works correctly also for paths.
Next we prove the correctness and estimate the time complexity of Algorithm 1.
Theorem 4. Algorithm 1 correctly computes and set D for any tree T in time where .
Proof. Let T be a tree and let be all strong support vertices of T ordered by BFS algorithm starting from a leaf (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 . We prove the basis again by induction on the number k of strong supports of T. If T has also no strong supports, then and the output of Algorithm 1 is and which is correct. If T has exactly one vertex of degree at least three, then T is a generalized star and we have and by Theorem 2. The same result is obtained by Algorithm 1, because line 5 is executed exactly once and is deleted from A in line 7.
Let now and let . As there are no light support vertices in T, we have, by (a), (b) and (d) no new supports in . Hence, has at most strong supports (and no light supports) and Algorithm 1 correctly computes and set . It is not hard to see, that when and when . By Corollary 3 we have and . For T Algorithm 1 gives and . So, Algorithm 1 correctly computes and set D for a tree T without light supports.
Suppose now that T has light supports and let w be the last light support in the fixed BFS order of T. By the assumption on input, corresponds to a strong support which is different from w. Let be all descendants of w that belong to S ordered by the fixed BFS ordering. For we define inductively for . So, we end with and let . At this stage strong supports were already processed by Algorithm 1, which means that and . In particular, notice that in the last step , and the case (b) occurs for w. Hence, has one light support less than T and, by the induction hypothesis, Algorithm 1 correctly computes and set . Therefore, at the end of the run of the algorithm we obtain and .
It remains to show that where D is a set as . For this notice that the path between two leaves x and y that belongs to some is covered by by induction hypothesis. Otherwise, a shortest path between x and y contains a strong support for some and is also covered by D. Hence, . Conversely, we can show as in the proof of Theorem 3 that for every strong support there must be a vertex from a shortest path between two leaves corresponding to in every set. So, if , then we have for a set . Thus is not a set and there exist two leaves x and y of such that the -geodesic P is not covered by . But then P is not covered by in T, a contradiction. Therefore, and the equality follows.
For the time complexity notice that adjusted BFS algorithm can be computed in linear time . For every vertex of list A Algorithm 1 performs constant number of operations (three in line 6 and either one in line 7 or two in line 10 or one in line 13). As there are less then n vertices in A the time complexity is linear. □
The previous theorem enable us to show that the maximal shortest paths cover number of an (induced) subgraph can exceed the maximal shortest paths cover number of the original graph, that is
is not monotone with respect to taking neither subgraphs nor induced subgraphs (see [
16,
17]). A tree
T is a caterpillar if the path
, called the spine, remains after deleting all leaves from
T. Let
be non negative integers where
. We denote by
the caterpillar with the spine
and
leaves attached to the
i-th vertex of the spine for
. A caterpillar
is depicted in
Figure 2.
Corollary 4. The parameter is not monotone neither with respect to taking subgraphs nor to taking induced subgraphs.
Proof. We have by Corollary 1. However, the caterpillar is a subgraph of the graph when and we have by Theorem 4. Similarly, is an induced subgraph of for an odd q and, according to Theorem 4, we have . □
The result on tress allows us to describe also the relationship of to the invariant k-path vertex cover number . By Proposition 4 we already have . However, this inequality cannot be extended for higher values of k.
Proposition 6. If C is a positive constant and an integer, then
- (i)
there exists a graph G with ;
- (ii)
there exists a graph G with .
Proof. For the first statement it is sufficient to consider the path
for sufficiently large
n. We have already shown by Proposition 2 that
and by [
10] we have
.
For the second statement consider the caterpillar of order . The maximal shortest paths cover of G is formed by n vertices of spine by Theorem 4 and we have . On the hand whenever . This means and for sufficiently large n we obtain the desired result. □
Notice that the first item of the above proposition holds also for . The example for an odd n shows that equality is attainable. In contrast we have . Clearly, the inequality is not attainable, by Proposition 3, for a connected graph G as .