On Vertices Contained in All or in No Metric Basis

A set $R \subseteq V(G)$ is a resolving set of a graph $G$ if for all distinct vertices $v,u \in V(G)$ there exists an element $r \in R$ such that $d(r,v) \neq d(r,u)$. The metric dimension $\dim(G)$ of the graph $G$ is the minimum cardinality of a resolving set of $G$. A resolving set with cardinality $\dim(G)$ is called a metric basis of $G$. We consider vertices that are in all metric bases, and we call them basis forced vertices. We give several structural properties of sparse and dense graphs where basis forced vertices are present. In particular, we give bounds for the maximum number of edges in a graph containing basis forced vertices. Our bound is optimal whenever the number of basis forced vertices is even. Moreover, we provide a method of constructing fairly sparse graphs with basis forced vertices. We also study vertices which are in no metric basis in connection to cut-vertices and pendants. Furthermore, we show that deciding whether a vertex is in all metric bases is co-NP-hard, and deciding whether a vertex is in no metric basis is NP-hard.


Introduction
Metric dimension in graphs is a classical invariant that has been studied from a lot of different points of view, starting from pure theoretical aspects and including some applied models mainly arising from computer science, among others. Specifically, in the last decade, there has been an increasing number of investigations on the metric dimension of graphs, and a large number of them are specifically centered on variations of the standard metric dimension concept. The classical metric dimension parameter, although it is nowadays very well studied, strong interest still remains. Indeed, a significant number of works specifically dealing with it appear frequently. For some latest remarkable articles we suggest for instance [6,7,13,15,18].
For a given connected graph G, the distance d G (u, v) (the subindex can be removed if it is clear from context) between two vertices u, v ∈ V (G) is the length of a shortest path between u and v. A set of vertices R ⊆ V (G) is called a resolving set for G if for any pair of distinct vertices u, v ∈ V (G), there exists a vertex w ∈ R such that d G (w, u) = d G (w, v). In this sense, it is also said that the set R resolves the graph G, and that w resolves the vertices u, v (or that u, v are resolved by w). The cardinality of the smallest possible resolving set for G is the metric dimension of G, denoted by dim(G). A resolving set of cardinality dim(G) is a metric basis of G. Such concepts were (independently) introduced in [19] and [11].
It is natural to ask if a graph contains a unique metric basis, or to ask a broader question, whether a graph has vertices belonging to every metric basis. Such ideas were already investigated in [1,3]. For instance, it was shown in [3], that for every integers k, r with k ≥ 2 and 0 ≤ r ≤ k, there exists a graph G with metric dimension k having r vertices that belong to every metric basis of G. However, no more contributions on this direction, concerning the classical metric dimension invariant, have appeared so far. Such questions are widely studied in other contexts such as dominating sets and stable sets in [5,10,16], for example. For some other variants of metric In connection with the existent models related to metric dimension in graphs, like that of navigation of robots in networks, the existence of basis forced vertices means that a metric basis cannot be formed without them. In consequence, they need to be included at any possible set of "landmarks" used to uniquely identify the vertices of the graph.
Clearly, all graphs do not have basis forced vertices. For example, the path P n has two disjoint metric bases (the endpoints), and thus no basis forced vertices. The graph in Figure 1(b) has two basis forced vertices, which are illustrated as black vertices. This graph has a unique metric basis that consists of only these two vertices. Consequently, the white vertices are in no metric basis. These are the opposite of basis forced vertices, and thus we have the following definition.
Definition 2. A vertex v ∈ V (G) is a void vertex of the graph G if it is in no metric basis of G.
In [2], the set of vertices belonging to all maximum stable sets of a graph is called the core of G. In the same spirit, we could call the set of basis forced vertices a core for the metric bases of G and the set of void vertices an anticore for the metric bases of G.
The vertices of any graph can be divided into three categories: basis forced vertices, void vertices and vertices that do not fit in either category, that is, vertices that are in some metric bases but not all. The endpoints of a path are in some metric bases but not all, whereas the rest of the vertices of a path are void vertices. The vertices of a complete graph or a cycle are also all in some bases but not all. If a graph has a unique metric basis (like the graph in Figure 1(b)), then each of its vertices is either a basis forced vertex or a void vertex. All three types of vertices can be present simultaneously in the same graph. This is the case for the graph later shown in Figure 2(a).
In [8] and [9], forced vertices of ℓ-solid-resolving sets for all ℓ, and {ℓ}-resolving sets for ℓ ≥ 2 were characterised. These characterisations used the local properties of the vertices and their neighbourhoods. In contrast, it seems that achieving a similar local characterisation for basis forced vertices is a very challenging problem (see Section 5 for issues concerning the algorithmic complexity). For instance, if the graph changes even slightly, the metric bases may look very different even in places that are far away from where the change occurred. This allows to realize that basis forced vertices are very sensitive to changes in the graph. Consider the graph in Figure  1(a). The metric dimension of this graph is 2, and the vertices that appear in some metric basis are illustrated as gray vertices. When we add the edge v 1 v 2 we obtain the graph illustrated in Figure 1(b). The metric dimension of this graph is also 2. However, this graph has only one metric basis, the elements of which are illustrated as black vertices. Consequently, this graph has two basis forced vertices and ten void vertices. When we add the edge u 1 u 2 to this graph, we obtain the graph in Figure 1(c). The metric dimension of this graph is 3, and there is only one void vertex. The rest of the vertices appear in some metric bases but not all. We next include some terminology and notations that we shall use throughout our exposition. Whenever two distinct vertices v, u ∈ V (G) are adjacent, we denote v ∼ u (possibly with a subindex ∼ G when such distinction is necessary), and when v and u are not adjacent, we denote v ∼ u. The vertex v is a pendant if there exists exactly one element u ∈ V (G) \ {v} such that v ∼ u. Let S ⊆ V (G). The induced subgraph G[S] is the graph with the vertex set S and the edge set consisting of the edges of G that are between two elements of S. Let v ∈ V (G). The graph G − v is obtained from G by removing the vertex v and all edges that have v as an endpoint. The vertex v ∈ V (G) is a cut-vertex of a connected graph G if the graph G − v is disconnected. A connected graph G is unicyclic if it contains only one cycle (i.e., the number of edges is equal to the number of vertices in G). From now on, all the graphs considered are connected.
The structure of this article is as follows. In Section 2, we consider cut-vertices and pendants. More precisely, in Section 2.1 we show that cut-vertices are not basis forced vertices, and that in fact most of them are void vertices. In Section 2.2, we show that pendants are not basis forced vertices in most cases. However, we also give an example of a graph that has pendants as basis forced vertices. In Section 3, we consider sparse and dense graphs and their basis forced vertices.
We investigate, what are the sparsest and densest graphs that have basis forced vertices. In Section 4, we give two bounds on the number of basis forced vertices of a graph by using a new colouring method of visualising which pairs of vertices are resolved by which elements of a metric basis. Finally, we consider the algorithmic complexity of deciding whether a vertex is a basis forced or void vertex in Section 5.

On Cut-Vertices and Pendants
In this section, we consider cut-vertices and pendants, and establish whether they can be void vertices or basis forced vertices. In the first subsection, we will show that in most cases cutvertices are void vertices. However, not all cut-vertices are void vertices. For example, the set {v 1 , v 2 } is a metric basis of the graph in Figure 1(a) and it consists of only cut-vertices. We will show that the cut-vertices that are not void vertices are not basis forced either. In the latter subsection, we consider pendants. We show that pendants are not basis forced vertices in most cases. However, there are some graphs that have pendants as basis forced vertices.

Cut-vertices
Let us first prove a lemma that we will use in this section and the section on pendants. This lemma essentially says that if there are elements of a resolving set in multiple connected components of G − v for a cut-vertex v, then any pair of vertices that the cut-vertex v resolves is also resolved by other elements of the resolving set. However, the set R is not required to be a resolving set for the following lemma to hold.
Thus, there exists an element r ∈ R such that d(r, x) = d(r, y). Suppose then that no such i exists. Since there are at least two connected components with elements of R, we have x ∈ V (G i ) and y ∈ V (G j ), i = j, and R i , R j = ∅. If for some r ∈ R i we have d(r, x) = d(r, y), then we are done. Suppose that for all r ∈ R i we have d(r, x) = d(r, y).
However, now for all s ∈ R j , we have Thus, d(s, x) = d(s, y) for any s ∈ R j .
Showing that the cut-vertex v is not in a metric basis is most difficult when there is a path dangling from v, i.e. a path with one end adjacent to v. More precisely, there exists a connected component This path-like structure does not necessarily contain any elements of a metric basis, so we need to be careful when using Lemma 3. To help us differentiate the easy cases from the hard ones, we have the following lemma that already appeared in [19]. We include its proof by completeness of our work, and mainly based on the difficulty of finding reference [19]. Lemma 4. [19,Proposition 2] Let v be a cut-vertex of a connected graph G, and let R be a resolving set of G. For any connected component Now the set R is not a resolving set, a contradiction.
To prove the latter claim, suppose that The following theorem considers the case where we can use Lemma 3 straight away. In Theorem 6, we consider the case not covered by Theorem 5.
Proof. Let R be a resolving set of G such that v ∈ R. Let us denote the connected components of G − v by G i , i ∈ N. Due to our assumptions on G − v and Lemma 4, there are at least two connected components in G − v that contain elements of R.
For any x, y ∈ V (G) such that d(v, x) = d(v, y) there exists an element r ∈ R \ {v} such that d(r, x) = d(r, y). Suppose then that x, y ∈ V (G) are such that d(v, x) = d(v, y). According to Lemma 3, for any such pair x, y there exists an element r ∈ R \ {v} such that d(r, x) = d(r, y). Thus, the set R \ {v} is a resolving set, and v is not in any metric basis.
In many proofs, where we prove that some vertex is not a basis forced vertex, we use a replacing technique. Let R be a metric basis of G. Consider a fixed r ∈ R. There exist some x, y ∈ V (G) such that d(r, x) = d(r, y) and d(s, x) = d(s, y) for all s ∈ R \ {r}. Otherwise, the set R \ {r} would be a resolving set that is smaller than the metric basis R. If there exists a vertex v ∈ V (G) such that d(v, x) = d(v, y) for all x, y ∈ V (G) for which r is the only element of R that resolves them, then we can replace r in R with v and obtain a metric basis of G (i.e. the set (R \ {r}) ∪ {v} is a metric basis of G). We denote Theorem 6. Let G be a connected graph. Let v ∈ V (G) be a cut-vertex such that G − v has only two connected components G 1 and G 2 . If G[V (G i ) ∪ {v}] ≃ P n for i = 1 or i = 2, then v is not a basis forced vertex.
Proof. Suppose that G[V (G 1 ) ∪ {v}] ≃ P n and that R is a metric basis of G such that v ∈ R. Let u be the vertex of G 1 that is furthest away from v in G.
Let us show that R[v ← u] is a metric basis of G. To that end, let x, y ∈ V (G) be such that It is sufficient to show that for every such x and y we also have d(u, x) = d(u, y). If x ∈ V (G 1 ) or y ∈ V (G 1 ) (or both), then we clearly have either d(u, x) < d(u, y) or d(u, y) < d(u, x), since the shortest paths from u to y go through x or vice versa. Suppose that x, y ∈ V (G 2 ) ∪ {v}. Now all the shortest paths from u to x and y go through v. Thus, we have According to Theorem 5 and the proof of Theorem 6 a cut-vertex either is not in any metric basis or it can be replaced with a pendant. Thus, the following corollary is immediate.

Corollary 7. Any finite graph has a metric basis that does not contain any cut-vertices.
The graph has to be finite for Corollary 7 to hold. For example, the bi-infinite path consists of only cut-vertices, and thus any resolving set contains only cut-vertices.

Pendants
Consider the graph in Figure 1(b). This graph has a unique metric basis illustrated as black vertices in the figure. The two pendants that form the unique metric basis are also basis forced vertices. Thus, there does indeed exist graphs that have pendants as basis forced vertices. However, our goal is to prove that in most cases the pendants are not basis forced vertices. Proof. Let R be a metric basis of G such that u ∈ R. Let us denote the connected components of G − {v, u} by G i , i ∈ N, and let R i = R ∩ V (G i ). Since R is a metric basis, there exists at least one pair of vertices x, y ∈ V (G) such that u is the only element in R that resolves that pair. In other words, d(u, x) = d(u, y) and d(r, x) = d(r, y) for all r ∈ R \ {u}.
Case 1: Suppose that there exist two connected components G i such that R i = ∅. Let us show that the pair x, y is unique. We will first prove that either x = u or y = u. Suppose to the contrary that x = u and y = u. Now According to Lemma 3 (when applied to the set R \ {u}), the pair x, y is resolved by some r ∈ R \ {u}, a contradiction. Thus, either x = u or y = u.
Suppose without loss of generality that x = u. Let us show that y is unique. First of all, we have y = v, since any r ∈ R \ {u} resolves u and v. Thus, y ∈ V (G i ) for some i. There exists some j = i such that R j = ∅. Since d(r, y) = d(r, u) for all r ∈ R j , we have y ∈ N (v) ∩ V (G i ). Thus, d(u, y) = 2. Suppose that y is not unique, that is, there exists y ′ ∈ N (v) \ {u, y} such that d(r, y ′ ) = d(r, u) for all r ∈ R \ {u}. Now we cannot resolve y and y ′ with R: d(u, y) = 2 = d(u, y ′ ) and d(r, y) = d(r, u) = d(r, y ′ ) for all r ∈ R \ {u}. Thus, y is unique.
Since all pairs other than u, y are resolved by R \ {u}, the set R[u ← y] is a metric basis of G. Therefore, u is not a basis forced vertex.
Case 2: Suppose then that there is only one connected component G i such that R i = ∅. Due to Lemma 4, there are only two connected components G 1 and G 2 . Suppose that R 2 = ∅. Then G[V (G 2 ) ∪ {v}] ≃ P n for some n ∈ N.
Let w ∈ V (G 2 ). We will show that R[u ← w] is a resolving set of G. Let x, y ∈ V (G) be such that d(u, x) = d(u, y). Suppose that d(v, x) = d(v, y). According to Lemma 3 there exists an element r ∈ R[u ← w] such that d(r, x) = d(r, y). Suppose then that d(v, x) = d(v, y). Since we assumed that d(u, x) = d(u, y), we now have either x = u or y = u.
Suppose without loss of generality that x = u. Then y ∈ N (v). If y ∈ V (G 2 ), then d(w, y) < d(w, u), since the shortest path from w to u goes through y. Suppose then that y ∈ V (G 1 ). Denote by y ′ the unique element in N (v)∩V (G 2 ). Since R is a metric basis and d(u, y) = d(u, y ′ ), we have d(r, y) = d(r, y ′ ) for some r ∈ R \ {u}. Since R 2 = ∅, we have r ∈ R 1 . Thus, d(r, u) = d(r, y ′ ) = d(r, y). Therefore, if R 2 = ∅, then the set R[u ← w] is a metric basis for any w ∈ V (G 2 ).
In the proofs of Theorems 5 and 6, our goal was to replace the cut-vertex to something else or remove it entirely from the resolving set. However, in the following theorem we do the opposite; we replace a pendant with a cut-vertex in a metric basis.
Theorem 9. Let G be a connected graph such that G ≃ P n . Let u be a pendant adjacent to a cut-vertex v such that deg(v) = 2. Then u is not a basis forced vertex.
Proof. Suppose that R is a metric basis of G such that u ∈ R. We will show that R Since G ≃ P n , there exists an element r ∈ R \ {v, u} due to Lemma 4. Since deg(v) = 2 and y ∈ N (v), the shortest paths from r to u go through y. Thus, d(r, u) = d(r, y).
Based on the results on the metric bases of trees presented in [4,14,19], we can see that trees do not have any basis forced vertices. Now we can also prove that trees have no basis forced vertices with the results obtained in Sections 2.1 and 2.2. According to Corollary 7 cut-vertices are not basis forced vertices. If the tree in question is not P 2 , then any pendant is adjacent to a cut-vertex that fulfils the requirements of either Theorem 8 or Theorem 9. Thus, neither the pendants of a tree are basis forced vertices.
Let us then consider a general graph G. Suppose that G has a cut-vertex v. If there is a pathor tree-like structure attached to v, then there are no basis forced vertices in this structure. More precisely, let G i be a connected component of G − v such that G i is isomorphic to a tree or a path of length at least 2. According to Corollary 7 and Theorems 8 and 9, G i does not contain basis forced vertices.
Suppose that there is a pendant u adjacent to v. If there is a path-or tree-like structure attached to v, then the graph fulfils the conditions of Theorem 8 or 9 and u is not a basis forced vertex. Thus, if u is a basis forced vertex, then every edge {v, x} ∈ E(G) where x ∈ V (G) \ {u} is along a cycle. However, all pendants of the graph in Figure 1(b) satisfy this condition, but only two of them are basis forced vertices and the rest are void vertices.

Sparse and Dense Graphs
In this section, we again consider connected graphs. We describe a graph as sparse if it has few edges compared to the number of vertices. Conversely, a graph is dense if it has many edges compared to the number of vertices. We want to find out what restrictions the existence of basis forced vertices places on the number of edges.
(a) A unicyclic graph with a basis forced vertex and metric dimension 3.
An example of the idea behind the construction in Theorem 10.

Sparse Graphs
As we saw in Section 2, trees do not have any basis forced vertices. However, the graph in Figure  1(b) has two basis forced vertices. Thus, the sparsest graphs that have basis forced vertices are unicyclic graphs.
The basis forced vertices of the graph in Figure 1(b) are pendants. A unicyclic graph can also have a basis forced vertex along the cycle; the vertex u of the graph in Figure 2(a) is such a vertex. All metric bases of this graph are of the form {u, v i , v j }, where i, j ∈ {1, 2, 3} and i = j. Both of these example graphs have only one or two basis forced vertices. Indeed, later in Section 3.1.1 we obtain a result which states that a unicyclic graph can have at most two basis forced vertices.
We want to construct connected graphs with, say, k basis forced vertices and as few edges as possible. In this endeavour, the following construction will be useful. The general idea and the structure of the end-result of this construction is illustrated in Figure 2 [4,14]. Thus, the resolving sets of the components G i in the following theorem have at least two elements.
Theorem 10. Let G i be a connected graph such that G i ≃ P n for i = 1, . . . , k, and let all G i be vertex disjoint. Let g i be a fixed element of V (G i ) such that g i is in some metric basis of G i (i.e. g i is not a void vertex). Let W be the graph with i.e. the graph we obtain by connecting every g i with one another.
Proof. We will first show that a set R ⊆ V (W ) is a resolving set of W if and only if where R i is a resolving set of G i that contains g i for each i = 1, . . . , k.
Let R ⊆ V (W ) be a resolving set of W . Since the vertices g i are cut-vertices of W and G i ≃ P n for all i, we have S i = R ∩ V (G i ) = ∅ for all i due to Lemma 4.

Let us show that the set S
Let us show that R is a resolving set of W by showing that we can resolve every pair x, y ∈ V (W ). We divide the proof into two cases: connected components, neither of which is isomorphic to a path, since G i ≃ P n for all i. Thus, both connected components of W − g i (and similarly W − g j ) contain elements of R according to Lemma 4. Thus, we can use Lemma 3 for either g i or g j and obtain that for some r ∈ R we have d(r, x) = d(r, y). Let us then consider the cardinalities of these resolving sets. If R is a metric basis of W , then by the equivalence shown above, we have dim Conversely, we can choose the resolving sets R i to be metric bases of G i for all i = 1, . . . , k, and thus dim( Example 11. Consider the graph G in Figure 3. This graph has only three metric bases: {v 2 , v 5 }, {v 3 , v 6 } and {v 5 , v 6 }. Let us construct a new graph W by using Theorem 10 and two copies of G. Let us choose g 1 = v 3 and g 2 = v 2 . Since there is only one metric basis that contains v 3 and one metric basis that contains v 2 , the only metric basis of W is {v 1 5 , v 2 6 }, where the superscripts indicate in which copy of G the vertex is. Thus, W is a graph with a unique metric basis and metric dimension 2. Consequently, the graph W contains two basis forced vertices.
In general, there are two ways to use Theorem 10. If we want to use k graphs, we can connect them all in one go or iterate the use of Theorem 10. In the first option, the vertices g i induce a clique in the constructed graph. In the latter option, we first use Theorem 10 on two graphs, then Figure 3: An example where we construct a graph with 2 basis forced vertices from a graph that has no basis forced vertices. choose a new g 1 from the resulting graph and connect another graph to that. We can also use a combination of these two methods. The following example further demonstrates the difference of these two options.
Example 12. Consider the graph G in Figure 2(a). Let us combine three of these graphs by using Theorem 10. Let us indicate with a superscript from which copy of the graph G the vertices are from. We choose Figure 4(a). There are two metric bases of G that contain v 1 : Thus, the metric dimension of W 1 is 6, and it has three basis forced vertices.
Let us then iterate Theorem 10. Let us first use Theorem 10 on two copies of G. We again choose g 1 = v 1 1 and g 2 = v 2 1 . The metric bases of the resulting graph W 2 are of the form Let us then use Theorem 10 again, but this time on the graph W 2 and another copy of G. We choose g 1 = v 2 3 and g 2 = v 3 1 . The resulting graph W 3 is illustrated in Figure 4(b). The only metric bases of W 2 that contain v 2 3 are of the form . Now, we have constructed a graph with metric dimension 5 and three basis forced vertices.
The graph W 3 has one edge less than the graph W 1 . If we use the construction on more graphs, then this difference will only grow. Indeed, if we used m copies of the graph G, then the first method would produce m(m − 1) edges to the resulting graph in addition to the edges already present in G. Thus, the resulting graph would have 12m + m(m − 1) edges. However, if we iterate the construction, then each step adds only one edge in addition to those present in G. If we iterate the construction on m copies of G, we will use Theorem 10 m − 1 times, and the resulting graph has only 12m + m − 1 edges.
We have now demonstrated a way to construct a graph that has k basis forced vertices, n = 12k vertices and n + k − 1 edges. So far, we have not found any sparser graph with k basis forced vertices.

An Upper Bound for the Number of Basis Forced Vertices of Unicyclic Graphs
According to the terminology given in [17], a unicyclic graph of type 1 is a unicyclic graph G of maximum degree 3 and such that every vertex of maximum degree belongs to the unique cycle of G. Any other unicyclic graph is called there as of type 2. It was proved in [17] that any unicyclic graph of type 1 with unique cycle C n has metric dimension 2 when n is odd, and otherwise its metric dimension is between 2 and 3. We notice the following straightforward observation (see [17]).
Remark 13. If G is a unicyclic graph of type 1 with unique cycle C = v 0 v 1 · · · v r−1 v 0 , r ≥ 3, then any set S = {v i , v i+1 , v i+⌊r/2⌋ } (operations with subindex are done modulo r) is a resolving set for G.
As a consequence of the remark above, if G is a unicyclic graph of type 1 with metric dimension 3, then G does not contain basis forced vertices. Thus, a unicyclic graph of type 1 can have at most two basis forced vertices. We next consider unicyclic graphs of type 2. From [17], lower and upper bounds for the metric dimension of such unicyclic graphs are known. However, from [18], we can easier proceed with our deduction. For a unicyclic graph G, let b(G) be the number of vertices on the cycle that have something other than one pendant or path attached to it outside of the cycle. Furthermore, let where ℓ(v) is the number of pendants and paths attached to v. The following result was proved in [18].
We must remark that the set of vertices of G that contributes to the value of L(G) is a set that can be partitioned into subsets each of cardinality at least two, and one can always leave any one vertex from each of these subsets out of a metric basis of G. These facts and the way of computing L(G), allow to deduce that no vertex of such set is basis forced. Thus, since b(G) ≥ 0, we have 0 ≤ max{2 − b(G), 0} ≤ 2, and the two possible values for dim(G), from the theorem above, leads to observe that G could have between 0 and 3 basis forced vertices. However, if there are 3 basis forced vertices in G, then it must happen that dim(G) = L(G) + max{2 − b(G), 0} + 1 with b(G) = 0. But then it follows that every vertex of G has degree at most 3 and every vertex of degree 3 belongs to the unique cycle of G. Consequently, G is a unicyclic graph of type 1 (according to [17]), and we have seen that such graphs can have at most 2 basis forced vertices. Thus, we have the following corollary.

Dense Graphs
We want to find out, how many edges a graph can have and still contain basis forced vertices. We will show that a graph with n vertices and some basis forced vertices can have at most n(n−1) 2 − 4 edges. We will also show that the graph attaining this bound is unique for each n. To obtain these results, we will consider graphs that can be constructed from K n by removing up to four edges. The relevant edge deletion patterns (i.e. connected components of the complement graph) are illustrated in Figure 5.
, and false twins if N (v) = N (u). We simply say that two vertices are twins if they are true or false twins but it does not matter which. As the graphs we consider are quite dense, the graphs will most likely contain twins. The following lemma follows directly from Corollary 2.4 of [12], although an independent proof would not be too difficult either.
Lemma 16. Let G be a connected graph, and let T ⊆ V (G) be such that all its elements are true twins with one another or all its elements false twins with one another. If |T | ≥ 2, then |R ∩ T | ≥ |T | − 1 for all resolving sets R of G.
Notice that if some resolving set contains only |T | − 1 elements of the set T , then it does not matter which twin is left out of the resolving set. Indeed, the elements of the set T are isomorphic with one another and have the exact same properties.
Lemma 17. Let G be a connected graph with a universal vertex v. Then the vertex v is not a basis forced vertex. Proof. Let R be a metric basis of G such that v ∈ R. Then the set R \ {v} is not a resolving set. There exist distinct x, y ∈ V (G) such that d(v, x) = d(v, y) and d(r, x) = d(r, y) for all r ∈ R \ {v}.
Since v is universal, we have either x = v or y = v. Suppose without loss of generality that x = v. Now, d(r, y) = 1 for all r ∈ R, and the vertex y is unique. Consequently, the set R[v ← y] is a resolving set. Thus, the vertex v is not a basis forced vertex.
We like to describe the graphs we consider by giving the complement graphs, since the complement graph is often far simpler in structure. The connected components of the complement graph also give us a natural way to partition the vertices. Consider a graph G such that the complement graph G has two connected components: G 1 and G 2 . Any two vertices x ∈ V (G 1 ) and y ∈ V (G 2 ) are adjacent in G. Thus, d G (x, y) = 1. We cannot resolve any pair of vertices in V (G 1 ) with a vertex in V (G 2 ) in G. In order to find the metric bases of G, we need to make sure that each connected component of G contains enough elements of a metric basis to resolve the pairs within that connected component. In addition to that, we need to be able to resolve pairs of vertices that are in different connected components of G.
Lemma 18. Let G be a connected graph. Let G i be a connected component of G such that G i ≃ K n for some n ≥ 2. Then no vertex v ∈ V (G i ) is a basis forced vertex of G.
Proof. One example of the graph G is illustrated in Figure 6(a).
For simplicity, let i = 1 and let us denote V (G 1 ) = {v 1 , . . . , v n }. Since G 1 ≃ K n , we have v i ∼ G v j for all i = j and v i ∼ G u for all i and u ∈ V (G) \ V (G i ). Thus, N G (v i ) = N G (v j ) for all i = j and the vertices v i are false twins in G. According to Lemma 16, every resolving set of G contains at least n − 1 vertices v i .
If there exists a metric basis R such that v 1 / ∈ R, then none of the vertices v i are basis forced vertices. Indeed, then the set R[v 1 ← v i ] is also a metric basis of G as the vertices v i are twins with each other.
Suppose then that R is a metric basis of G such that v i ∈ R for all i = 1, . . . , n. We will show that such metric basis cannot in fact exist by proving that the set R \ {v i } is a resolving set of G for any i = 1, . . . , n. Let us consider a fixed v i . In what follows, the distances we consider are distances in G, and we omit the subscript G from the notation of distance. Since d(v i , u) = 1 if and only if u / ∈ V (G 1 ), the vertex v i can only resolve pairs where one or both vertices are some v j , j ∈ {1, . . . , n}. However, all of these pairs can be resolved with other elements of R: • Consider the vertices v j and v k where j = k. Suppose without loss of generality that • Consider the vertex v i and some u / ∈ V (G 1 ). Let v j be such that j = i. Then v j ∈ R \ {v i } and d(v j , v i ) = 2 = 1 = d(v j , u).
• Consider some vertex v j , where j = i, and some u / In conclusion, the set R \ {v i } is a resolving set for any v i . This contradicts the assumption that the set R is a metric basis of G. Consequently, for every v i ∈ V (G 1 ) there exists a metric basis R such that v i / ∈ R, and thus the vertex v i is not a basis forced vertex.

Lemma 19. Let G be a connected graph. Let G i be a connected component of G such that
Proof. One example of the graph G is illustrated in Figure 6(b). Let G 1 ≃ K 1,n for some n ≥ 2, and denote V ( Let us then show that v 0 is not a basis forced vertex. Let R be a metric basis of G such that v 0 ∈ R. Due to what we have already shown above, we may assume that v i / ∈ R for some i ∈ {1, . . . , n} and v j ∈ R for all j = i. Let us show that the set R[v 0 ← v i ] is a metric basis of G. Since R is a metric basis, the set R \ {v 0 } is not a resolving set. Suppose that the pair x, y ∈ V (G) is not resolved by any element of R \ {v 0 }. We will show that then either y) = 1 and the pair x, y is not resolved by any element of R, which contradicts the assumption that the set R is a metric basis of G. For any j = i we have d(v j , v 0 ) = 2 and d(v j , u) = 1 for all u ∈ V (G) \ {v 0 }. If x = v 0 or y = v 0 , then v j (where j = i) resolves x and y, which contradicts the assumption that no element of R \ {v 0 } resolves x and y, since we have v j ∈ R for all j = i. Thus, we have x = v 0 and y = v 0 , and the only option we now have left is that either x = v i or y = v i . Consequently, the set R[v 0 ← v i ] is a metric basis of G and v 0 is not a basis forced vertex of G.
Lemma 20. Let G be a connected graph with at least 5 vertices. Let G i be a connected component of G such that G i ≃ P 4 . Then the vertices v ∈ V (G i ) are not basis forced vertices of G.
Proof. One example of the graph G is illustrated in Figure 7(a).
Since the path P 4 is self-complementary, we have G[V (G i )] ≃ P 4 . Let us denote the elements of V (G i ) by v i so that v 1 v 2 v 3 v 4 is a path in G. Since G has at least 5 vertices, In conclusion, it is enough for a resolving set to contain two elements of V (G i ); v 1 and v 2 , or v 3 and v 4 by symmetry. Let us show that a metric basis of G contains at most two vertices of V (G i ). No element of V (G i ) can resolve x and y if both x / ∈ V (G i ) and y / ∈ V (G i ). Thus, it is sufficient to consider distinct x, y ∈ V (G) such that x ∈ V (G i ). Let us show that we can resolve any such pair x, y with v 1 and v 2 . Clearly, if x ∈ {v 1 , v 2 } or y ∈ {v 1 , v 2 }, then x and y are resolved. Suppose then that x = v 3 . Now, d(v 2 , x) = 2. The only vertices that are at distance 2 from v 2 are v 1 and v 3 .
Thus, none of the elements of V (G i ) are basis forced vertices.
The following lemma is used in this section for k = 2. We will, however, use the following lemma for other values of k later in Section 4.
However, this more general form will be used later in Section 4.
Lemma 22. Let k be an even positive integer. Let G be a connected graph such that G ≃ P 5 ∪ · · · ∪ P 5 ∪ K m where P 5 appears k 2 times and m ≥ 1. The graph G has k basis forced vertices and dim(G) = k + m − 1.
Proof. The graph G for k = 2 and m = 1 is illustrated in Figure 7(c).
Let us denote the copies of P 5 by P i 5 where i = 1, . . . , k 2 . We denote the vertices of each P i 5 by v i 1 , . . . , v i 5 where the vertices are numbered in the order natural for paths. We further denote the vertices of K m by u j .
It is clear that in order to resolve all pairs x, y ∈ V (P i 5 ) in G, we need at least two elements of V (P i 5 ). The vertices u j are twins with one another. Thus, according to Lemma 16, there exists at most one u j such that u j / ∈ R for any resolving set R. Therefore, dim(G) ≥ 2· k 2 +m−1 = k+m−1. Let us consider how we can resolve the elements of V (P i 5 ) in G. It is easy to verify that the only two element subsets of V (P i Let us show that R is a resolving set of G. To that end, consider distinct vertices x, y ∈ V (G). If x, y ∈ V (P i 5 ) for some i, then the set R resolves x and y by the observation above.
. Suppose finally that x, y / ∈ V (P i 5 ) for all i. In other words, x, y ∈ V (K m ). Since u j / ∈ R for only one vertex u j ∈ V (K m ), the vertices x and y are resolved by some element of R. Therefore, the set R is a resolving set of G. Since |R| = 2 · k 2 + m − 1, the set R is a metric basis of G and dim(G) = k + m − 1.
Suppose then that R is a resolving set of G. Let us denote S = R ∩ V (P i 5 and v i 4 is a basis forced vertex of G and G has k basis forced vertices in total.
Now we are ready for the main result in this section.
Theorem 23. Let G be a connected graph with n ≥ 6 vertices and at least one basis forced vertex. Then If |E(G)| = n(n−1) 2 − 4, then G ≃ P 5 ∪ K n−5 and G has two basis forced vertices.
Proof. Let us consider G as constructed from K n by removing edges. Suppose that G is obtained from K n by removing up to three edges. Then the graph G can be presented as a union of some of the following graphs (see Figure 5 (a-e)): K 2 , K 1,2 , P 4 , K 1,3 , K 3 and K n−k for some k. Lemmas 17,18,19 and 20 cover all possible cases, and in each case the graph G does not have any basis forced vertices.
We have now shown that if |E(G)| ≥ n(n−1) 2 − 3, then the graph G does not have any basis forced vertices. Consequently, if G has basis forced vertices, then |E(G)| ≤ n(n−1) 2 − 4. Let us then prove the latter claim. Let G be a graph that is obtained from K n by removing four edges. Suppose that G can be presented as the union of some of the following graphs (see Figure 5(a-e,h,i)): K 2 , K 1,2 , P 4 , K 1,3 , K 3 , K 1,4 , C 4 and K n−k for some k. As before, we can use Lemmas 17,18,19,20 and now 21 also, and obtain that in all cases the graph G does not have any basis forced vertices. Thus, if G has basis forced vertices, then there are only three possibilities for the edge deletion pattern: the graphs in Figure 5(f,g,j). Let us consider each case separately.
Suppose that G is the disjoint union of the graph in Figure 5(g) and K n−5 . Let us denote the elements as in Figure 8(a), that is, the isolated vertices are denoted by u i and the five other vertices are denoted by v i . It is easy to verify that the sets V (G) \ {v 2 , v 3 , v 5 } and V (G) \ {v 1 , v 4 , u i } are metric bases for any i. Thus, the graph G does not have any basis forced vertices.
Suppose that G is the disjoint union of the graph in Figure 5(j) and K n−4 . Let us denote the elements of V (G i ) by v 1 , . . . , v 4 as in Figure 8(b). It is clear that in order to resolve we need at least two elements of V (G i ). It is easy to verify that {v 1 , v 3 } and {v 2 , v 4 } do the job. Both of these options also resolve any pair x ∈ V (G i ) and y ∈ V (G) \ V (G i ). Indeed, for any x ∈ V (G i ) one of the distances d(x, v 1 ) and d(x, v 3 ) is 2 or 0 (and similarly for v 2 and v 4 ). Thus, the graph G does not have any basis forced vertices. Thus, if G has basis forced vertices, then G ≃ P 5 ∪ K n−5 . The graph G is illustrated in Figure  9(a). According to Lemma 22, this graph does indeed have exactly two basis forced vertices.
It is a bit odd that the densest graphs that have basis forced vertices have two of them. If a graph G has one basis forced vertex, then |E(G)| ≤ n(n−1) 2 − 5. A graph that attains this bound is illustrated in Figure 9(b). The black vertex is the basis forced vertex. The metric dimension of this graph is 2. It has two metric bases; in addition to the black vertex we must include either of the gray vertices.
If a graph has three or more basis forced vertices, then the densest graph that we have found has n(n−1) 2 − 7 edges. It seems that in general the bound in Theorem 23 leaves room for improvement. Indeed, in Theorem 27 we will show a more general bound on the number of edges that depends also on the number of basis forced vertices that the graph contains.  4 The Colour Graph G R Let G be a graph and R ⊆ V (G). Let r ∈ R. We denote The set U R (r) consists of the pairs of vertices for which r is the unique element in R that resolves the pairs. We denote by G R the graph with the same vertex set as G and the edge set r∈R U R (r). Figure 10: The graph G with the resolving set R = {r 1 , r 2 } and the colour graph G R .
Each r ∈ R is assigned a colour, and we colour the edges in G R given by U R (r) with the colour associated with r.
Example 24. Consider again the familiar graph G illustrated in Figure 10(a). Let us construct the graph G R with respect to the resolving set R = {r 1 , r 2 }. We have U R (r 1 ) = When we assign black to r 1 and 'dashed' to r 2 , we can visualise the graph G R as in Figure 10(b).
Let us explore some basic properties of G R . If there is no edge between x and y in G R , then either R does not resolve x and y or there are at least two elements in R that resolve x and y. If R is a resolving set, then only the latter is possible.
Since both r ∈ R and s ∈ R resolve the pair r, s, the edge {r, s} is not present in G R . Consequently, the set R is independent in G R . Moreover, if there does exist an edge incident to r ∈ R in G R , then that edge has the colour associated with r, since r resolves any pair where r itself is included.
If the colour associated with some r ∈ R is not present in G R , then any pair that r resolves is resolved by some other element of R. Thus, the set R \ {r} is a resolving set of G. Consequently, if R is a metric basis of G, then the graph G R has at least one edge of the colour associated with each r ∈ R. In other words, the set U R (r) is nonempty for all r ∈ R.
Lemma 25. Let G be a graph. The following properties hold.
(i) Any colour that appears in a cycle of G R appears at least twice in that cycle.
(ii) Let R be a resolving set of G and x, y, z ∈ V (G). If the edges {x, y} and {x, z} have the same colour in G R , then the edge {y, z} also has the same colour in G R . (iii) If b ∈ V (G) is a basis forced vertex of G and R is a metric basis of G, then the graph G R has at least two edges of the colour associated with b. (iv) If b ∈ V (G) is a basis forced vertex of G and R is a metric basis of G, then the graph G R has at least one edge {x, y}, x, y ∈ V \ R, of the colour associated with b.
Proof. (i) Suppose to the contrary that the edge {v 1 , v k } is the only edge of its colour (associated (s, z). As R is a resolving set of G, we have d(r, y) = d(r, z). Thus, {y, z} ∈ U R (r).
(iii) Suppose U R (b) = {{u, v}}. Since every pair r, s ∈ R is resolved by both r and s, we can assume that v / ∈ R. The vertex v resolves the pair {u, v} and all other pairs are resolved by the elements of R \ {b}. Thus, the set R[b ← v] is a metric basis of G, a contradiction.
(iv) Suppose to the contrary that no such edge exists. According to (iii) the graph G R has at least two edges of the colour associated with b. Let these edges be {x 1 , x 2 } and {y 1 , y 2 }. Due to our assumption, both of these edges have at least one endpoint in R. If there is an edge incident to r ∈ R in G R , then that edge has the colour associated with r, since r resolves any pair r, x, where x ∈ V (G). Thus, we may assume that x 1 = b = y 1 . Since every pair r, s ∈ R is resolved by both r and s, we have x 2 / ∈ R and y 2 / ∈ R. Now, the edge {x 2 , y 2 } has the colour associated with b due to (ii), a contradiction.
Suppose that R is a resolving set of G. Due to Lemma 25 (i) and (ii), all cliques of G R are monochromatic. The subgraph of G R that consists of only the edges of the colour associated with r ∈ R is a disjoint union of cliques.
Lemma 17 states that universal vertices are not basis forced vertices. We can obtain the same result using Lemma 25 (iv): if u is a universal vertex of G and R is a metric basis of G that contains u, then d(u, x) = d(u, y) for all x, y ∈ V (G) \ R and (iv) cannot be satisfied for u.
Theorem 26. If G is a graph with n vertices and k > 0 basis forced vertices, then k ≤ n − dim(G) − 1. Moreover, we have k ≤ n−1 2 . Proof. Let R be a metric basis of G. Denote U = V \ R and m = |U |. Due to Lemma 25 (iv), G R [U ] contains at least k differently coloured edges. Let us consider k differently coloured edges in G R [U ]. If m ≤ k, then some (or all) of these edges form a cycle that contradicts Lemma 25 (i). Thus, m ≥ k + 1 and k ≤ m − 1 = n − dim(G) − 1. Since k ≤ dim(G), we also have k ≤ n−1 2 . We have not found a graph that attains this bound. However, for the graph G described in Lemma 22 we have k = n − dim(G) − 2 when k = 2. Indeed, let G be such that G ≃ P 5 ∪ K n−5 . According to Lemma 22, the graph G has two basis forced vertices and dim(G) = n − 4.
Thus, at least one of the edges v i x and v i y is an edge in G. Therefore, every basis forced vertex v i is not adjacent to some vertex u that is not a basis forced vertex.
Suppose that v i u is the only edge in G from v i to V (G)\R. Now, d(v i , v) = 1 for all v ∈ V (G)\R such that v = u.
As we stated earlier, according to Lemma 25 (iv) there exist distinct x, y ∈ V (G) \ R such that d(v i , x) = d(v i , y) and d(r, x) = d(r, y) for all r ∈ R \ {v i }. Now, either x = u or y = u, since otherwise we have d(v i , x) = 1 = d(v i , y), a contradiction.
Suppose without loss of generality x = u. Then y is unique due to Lemma 25 (ii) and the fact that d(v i , v) = 1 for all v ∈ V (G) \ R, v = u. According to Lemma 25 (iii) the graph G R has at least two edges of the colour associated with v i . The edge uy is one such edge. However, the edge uy is the only edge within V (G) \ R of the colour associated with v i . Since the set R is independent in G R , there exists a vertex w ∈ V (G) \ R such that the edge v i w has the colour associated with v i in G R .
Suppose that w ∈ {u, y}. Then according to Lemma 25 (ii) both edges v i u and v i y have the colour associated with v i in G R . Now, the three edges uy, v i u and v i y are the only edges of the colour associated with v i in G R . Otherwise, we have a contradiction due to Lemma 25 (ii) and the fact that is a metric basis of G, and v i is not a basis forced vertex.
Suppose then that w / ∈ {u, y}. Now the vertex w is unique. Otherwise, we again have a contradiction due to Lemma 25 (ii) and the fact that Let us show that now v i is not a basis forced vertex. The set R \ {v i } resolves all but two pairs of vertices: v i , w and u, y. Now, if some vertex z = v i resolves both of these pairs, then the set is a metric basis of G and v i is not a basis forced vertex. Let us show that such a vertex z exists.
If d(w, u) = d(w, y), then the vertex w resolves the two aforementioned pairs and is a metric basis of G. If d(w, u) = d(w, y) = 2, then d(y, v i ) = d(y, w) and the set R[v i ← y] is a metric basis of G. In all cases, the set R[v i ← z] is a metric basis of G for some z ∈ {w, u, y}, and thus the vertex v i is not a basis forced vertex of G.
In conclusion, for any basis forced vertex v i there exist at least two edges from v i to V (G) \ R in G. Since G has k basis forced vertices, we have |E(G)| ≤ n(n−1) Let G be a graph such that G ≃ P 5 ∪ · · · ∪ P 5 ∪ K m , where P 5 appears k 2 times in the disjoint graph union. According to Lemma 22 the graph G has k basis forced vertices, two in each complement of P 5 . The following corollary is now immediate.
Corollary 28. For every even positive integer k there exists a graph G with k basis forced vertices and where n is the number of vertices of G.
The bound in Theorem 27 does not seem attainable for odd k. However, we have found a graph family whose members have an odd (≥ 3) number of basis forced vertices and n(n−1) 2 − 2k − 1 edges. Let H be the graph we obtain by attaching a pendant to the middle vertex of the path v 1 . . . v 7 . If G is a graph such that G ≃ H ∪ K m , then the graph G has n(n−1) 2 − 2 · 3 − 1 edges and three basis forced vertices: v 2 , v 4 and v 6 (this can be shown using similar techniques as in the proof of Lemma 22). Moreover, it is possible to show that the graph G for which G ≃ H ∪ P 5 ∪ · · · ∪ P 5 ∪ K m where P 5 appears k−3 2 times has three basis forced vertices in V (H) and two basis forced vertices in each V (P 5 ). All in all, the graph G has 3 + 2 · k−3 2 = k basis forced vertices and n(n−1)

Algorithmic complexity
In this section, we consider the algorithmic complexity of determining whether a given vertex is a basis forced or void vertex of a metric basis. In particular, we show that the first problem is co-NP-hard and the latter problem is NP-hard. The proofs are based on a polynomial-time reduction from the well-known 3-SAT problem. Previously, in [14], it has been shown that given an arbitrary graph G = (V, E) and an integer k, it is NP-complete to decide whether dim(G) ≤ k.
The reductions of the proofs of this section are inspired by the one presented in [14]. In what follows, this reduction is briefly recapped. For the 3-SAT problem, denote the set of variables by X = {x 1 , x 2 , . . . , x n } and the set of literals by U = {x 1 , x 2 , . . . , x n , x 1 , x 2 , . . . , x n }, where x i denotes the negation of the variable x i . Let F be an instance of the 3-SAT problem; more precisely, let F be a formula F = C 1 ∧C 2 ∧· · ·∧C m , where each clause C j contains exactly three literals, i.e., each clause is of the form C j = u j,1 ∨ u j,2 ∨ u j,3 , where u j,1 , u j,2 , u j,3 ∈ U . Based on the given formula F , we form a graph G = (V, E) as follows: • For each variable x i ∈ X, we construct a variable gadget of x i with vertices a i,1 , a i,2 , b i,1 , b i,2 , T i and F i and edges as given in Figure 11(a).
• For each clause C j = u j,1 ∨ u j,2 ∨ u j,3 , we construct a clause gadget C j with vertices c j,1 , c j,2 , c j,3 , c j,4 , and c j,5 and edges as given in Figure 11(b). Moreover, if u j,k = x i (where k = 1, 2, 3), then c j,3 is adjacent to F i , else u j,k = x i and c j,3 is adjacent to T i . In addition, c j,3 is adjacent to both T i and F i for all variables x i not occurring in C j and c j,1 is adjacent to both T i and F i for any variables x i occurring in C j .
The variable gadget of xi.
c j,2 c j,3 c j,1 c j,5 c j,4 (b) The clause gadget of Cj.

Figure 11
It is clear that the graph G can be constructed in polynomial time. In [14], it is shown that the formula F is satisfiable if and only if dim(G) = n + m. This implies that the problem of deciding whether dim(G) ≤ k is NP-complete.
Inspired by the previous reduction, we show in the following theorem that determining whether a given vertex is a basis forced one or a void one are algorithmically difficult.
Theorem 29. Let G be a graph and u be a vertex of G.
(i) Deciding whether u is a basis forced vertex of G is a co-NP-hard problem.
(ii) Deciding whether u is a void vertex of G is an NP-hard problem.
Proof. In order to prove the first claim (i), we show that the problem of deciding whether a given 3-SAT formula is not satisfiable -a co-NP-complete problem -can be reduced in polynomial time to the problem of determining if a given vertex is basis forced one of a graph. For the second claim (ii), we similarly prove that the problem of deciding whether a given 3-SAT formula is satisfiable -an NP-complete problem -can be reduced in polynomial time to the problem of determining if a given vertex is basis void one of a graph. Using the notation introduced above, let F be an instance of the 3-SAT problem. Based on the given formula F , we form a graph G ′ = (V ′ , E ′ ) as follows: • Let G 1 = (V 1 , E 1 ) and G 2 = (V 2 , E 2 ) be two disjoint copies of the graph G constructed in the reduction of [14] (with respect to F ). Denote the vertices of the graphs by a k i,1 , a k i,2 , b k i,1 , b k i,2 , T k i , F k i , c k j,1 , c k j,2 , c k j,3 , c k j,4 and c k j,5 , where k ∈ {1, 2}. • Furthermore, an edge is added from each c 1 j,1 and c 1 j,3 to T 2 i and F 2 i for all i ∈ {1, . . . , n}. Analogously, an edge is added from each c 2 j,1 and c 2 j,3 to T 1 i and F 1 i for all i ∈ {1, . . . , n}. • Finally, add a vertex w such that it is adjacent to c k j,3 for all k = 1, 2 and j = 1, . . . , m. It is immediate that the graph G ′ = (V ′ , E ′ ) = (V 1 ∪V 2 ∪{w}, E ′ ) can be constructed in polynomial time. Before diving into the proofs of (i) and (ii), we need to discuss some preliminary results.
Let R be a resolving set of G ′ . We first present the following simple observations, which mimic the ones given in Lemmas A.2 and A.3 of [14]: (a) Observe that for k = 1, 2 and i = 1, . . . , n, at least one of the vertices a k i,1 , a k i,2 , b k i,1 and b k i,2 belongs to the resolving set R. Indeed, suppose to the contrary that R∩{a k i,1 , a k i,2 , b k i,1 , b k i,2 } = ∅. This implies that a k i,1 and a k i,2 are not resolved (a contradiction) since the corresponding variable gadget is connected to the rest of the graph only through the vertices T k i and F k i . (b) Observe that for k = 1, 2 and j = 1, . . . , m, at least one of the vertices c k j,4 and c k j,5 belongs to the resolving set R. Indeed, if R ∩ {c k j,4 , c k j,5 } = ∅, then c k j,4 and c k j,5 are clearly not resolved (a contradiction). By the observations, we immediately obtain that the metric dimension of G ′ is at least 2n + 2m.
In what follows, we show that dim(G ′ ) = 2n + 2m if and only if the formula F is satisfiable.
Let us first show that if the formula F is satisfiable, then the metric dimension dim(G ′ ) = 2n + 2m. Let A be a satisfiable truth assignment of F . Construct then a set C as follows: C consists of all the vertices c k j,4 , where k = 1, 2 and j = 1, . . . , m, and if the assignment of x i is true in A, then a 1 i,1 and a 2 i,1 belong to C, and otherwise b 1 i,1 and b 2 i,1 are in C. We immediately notice that C contains exactly 2n + 2m vertices. In what follows, we show that C is a resolving set of G ′ . For this purpose, we first observe that all the pairs x, y ∈ V ′ of distinct vertices except c k j,1 and c k j,3 are resolved by some element of C: • Suppose first that x = c k j,l with l ∈ {1, . . . , 5} and y is any other vertex not in the same clause gadget as x. Then d(c k j,4 , x) ≤ 2 and d(c k j,4 , y) > 2, and we are immediately done. Furthermore, if y belongs to the same clause gadget as x, then some element of C clearly resolves x and y unless the vertices are c k j,1 and c k j,3 . • Suppose then that x = w. Now the distance of x to any vertex of C is exactly three. Clearly, this is not the case for any other vertex y and we are done.
• Finally, suppose that x belongs to some variable gadget. Without loss of generality, we may assume that x belongs to the copy of the gadget of x 1 in G 1 and that a 1 1,1 ∈ C. Now it is immediate that if y is in the same variable gadget as x, then either a 1 1,1 or any c 2 j,4 resolves x and y. By the previous cases, we are also immediately done if y does not belong to any variable gadget. Hence, we may assume that y belongs to some variable gadget other than the one of x 1 . Now, if x = b 1 1,2 , then d(a 1 1,1 , x) ≤ 2 and d(a 1 1,1 , y) > 2. Furthermore, if x = b 1 1,2 and d(a 1 1,1 , x) = d(a 1 1,1 , y), then d(a 1 1,1 , x) = d(a 1 1,1 , y) = 3 and y is equal to T k i or F k i for some k and i. This further implies that there exists a vertex c ∈ C in the same variable gadget as y such that d(c, y) ≤ 2 and d(c, x) > 2. Hence, we are done.
Thus, it is enough to consider the pairs of vertices x = c k j,1 and y = c k j,3 . It is immediate that the distance of c k j,1 to any vertex of C in the variable gadgets corresponding to u j,1 , u j,2 and u j,3 is equal to 2. However, by the fact that A is a satisfiable truth assignment of F and the construction of C, the distance of c k j,3 to some vertex of C in the variable gadgets corresponding to u j,1 , u j,2 and u j,3 is equal to 3. Thus, in conclusion, C is a resolving set of G ′ and dim(G ′ ) = 2n + 2m.
Let us then show that if the metric dimension of G ′ is 2n+2m, then the formula F is satisfiable. Let C be a resolving set of G ′ with 2n + 2m vertices. Due to the observations (a) and (b), we know that for each k ∈ {1, 2} and i ∈ {1, . . . , n} exactly one of the vertices a k i,1 , a k i,2 , b k i,1 and b k i,2 belongs to C and for each k ∈ {1, 2} and j ∈ {1, . . . , m} exactly one of the vertices c k j,4 and c k j,5 belongs to C. Form then a truth assignment A of F as follows: if a 1 i,1 or a 1 i,2 belongs to C, then set the variable x i to be true, else (b 1 i,1 or b 1 i,2 belongs to C and) set x i to be false. In what follows, we show that the truth assignment A satisfies the formula F . Suppose to the contrary that a clause C j is not satisfied by A. This implies that the distance of c 1 j,1 and c 1 j,3 to any vertex of C in the variable gadgets corresponding to u j,1 , u j,2 and u j,3 is equal to 2. Furthermore, it is straightforward to verify that the distance of c 1 j,1 and c 1 j,3 to any vertex of C in other variable gadgets is also equal to 2 and that their distances are equal to 4 to any other vertices of C (in the clause gadgets). Thus, they are not resolved by any element of C and a contradiction follows. Thus, the truth assignment A satisfies the formula F .
Let us next show that dim(G ′ ) ≤ 2n + 2m + 1 regardless of the existence of a satisfiable truth assignment for the formula F . For this purpose, let C be a set consisting of w and all the vertices a k i,1 and c k j,4 , where k = 1, 2, i = 1, . . . , n and j = 1, . . . , m. Clearly, the cardinality of C is equal to 2n + 2m + 1. As above, it can be shown that a pair of distinct vertices is resolved even without taking into account the vertex w unless the pair is c k j,1 and c k j,3 . However, it is immediate that they are resolved since d(w, c k j,1 ) = 3 = 1 = d(w, c k j,3 ). Therefore, the set C is a resolving set of G ′ and dim(G ′ ) ≤ 2n + 2m + 1.
(i) Now we are ready to prove that w is a basis forced vertex of G ′ if and only if the formula F is not satisfiable. Observe first that if w is a basis forced vertex of G ′ , then by the observations (a) and (b), we obtain that dim(G ′ ) ≥ 2n + 2m + 1. Therefore, we have dim(G ′ ) = 2n + 2m + 1 and F is not satisfiable. For the other direction, assume that F is not satisfiable. Hence, we have dim(G ′ ) = 2n + 2m implying dim(G ′ ) = 2n + 2m + 1. Suppose to the contrary that w is not a basis forced vertex of G ′ and there exists a metric basis C of G ′ with 2n + 2m + 1 vertices such that w / ∈ C. By the observations (a) and (b), we obtain that either G 1 or G 2 contains exactly n + m vertices of C; without loss of generality, we may assume that G 1 is such a graph. Notice that c 1 j,1 and c 1 j,3 are resolved for all j = 1, . . . , m since C is a metric basis of G ′ . As above, it can now be shown that F is satisfiable (a contradiction). Therefore, w is a basis forced vertex of G ′ . Thus, there exists a polynomial-time reduction of the complement of the 3-SAT problem to the problem of deciding whether a given vertex is a basis forced vertex. Hence, the studied problem is co-NP-hard.
(ii) Let us then show that w is a void vertex of G ′ if and only if the formula F is satisfiable. Observe first that if F is satisfiable, then dim(G ′ ) = 2n + 2m. Hence, if C is any metric basis of G ′ (with cardinality 2n + 2m), then w does not belong to C by the observations (a) and (b). Therefore, w is a void vertex of G ′ . For the other direction, assume that w is a void vertex of G ′ . Recall that F is satisfiable if and only if dim(G ′ ) = 2n+ 2m. Suppose to the contrary that F is not satisfiable, i.e., dim(G ′ ) = 2n + 2m. This implies that dim(G ′ ) = 2n + 2m + 1. Let C be a metric basis of G ′ (with cardinality 2n + 2m + 1 and w / ∈ C). As above, we obtain that G 1 or G 2 contains exactly n + m vertices of C; without loss of generality, we may assume that G 1 is such a graph. Analogously, as in the case (i), we can show that F is satisfiable since w / ∈ C (a contradiction). Hence, if w is a void vertex, then F is satisfiable. Thus, there exists a polynomial-time reduction of the 3-SAT problem to the problem of deciding whether a given vertex is a void vertex. Hence, the studied problem is NP-hard.

Future Works
Here are some open problems related to the questions in this paper.
• Find graphs with k basis forced vertices but fewer edges than in our construction in Section 3.1.
• Find a characterisation of graphs with k basis forced vertices and metric dimension k.
• Improve the bound k ≤ n − dim(G) − 1 in Theorem 26 or find a graph attaining it.