1 Introduction

Let \(G = (V(G), E(G))\) be a finite, simple, undirected, connected graph of order at least 2. A set \(W \subseteq V(G)\) is a resolving set of G if, for every pair of distinct vertices x and y of G, there exists \(z \in W\) such that \(d(x,z) \ne d(y,z)\), where d(uv) denotes the shortest-path distance between u and v. The metric dimension \(\dim (G)\) of G is the minimum of the cardinalities over all resolving sets of G. A resolving set of cardinality \(\dim (G)\) is called a metric basis for G. These concepts were independently introduced by Slater [31] and by Harary and Melter [18]. Soon after, it was noted in [13] that determining the metric dimension of a graph is an NP-hard problem. Metric dimension has found applications in fields as diverse as robot navigation, network discovery and verification, chemistry, combinatorial optimization, and strategies for the mastermind game. See [2, 7] for history and surveys and [1, 8, 25] for some of the more recent results on metric dimension.

The Maker–Breaker game, introduced in 1973 by Erdős and Selfridge [10], is played on an arbitrary hypergraph \(H = (V,E)\). Two players, named Maker and Breaker, alternately select a vertex from V not yet chosen in the course of the game. Maker wins the game if he is able to select all the vertices of one of the hyperedges from E, while Breaker wins if she is able to prevent Maker from doing so. We refer to the books of Beck [3] and of Hefetz et al. [19] for more information on this game as well as to papers [17, 27] for recent related developments.

Motivated by the Maker–Breaker game and the domination game [4], Duchêne, Gledel, Parreau, and Renault introduced the Maker–Breaker domination game [9]. This game is played on a graph G and can be described as the Maker–Breaker game on the hypergraph with the same vertex set as G and with hyperedges corresponding to the dominating sets of G. The game was further investigated in [15], while in [14] its total version was introduced, see also [12]. Inspired by these developments, we introduce in this paper the Maker–Breaker resolving game (MBRG for short) as follows.

The MBRG is played on a graph G by two players, Resolver and Spoiler, which will be denoted throughout the paper by \({R}^*\) and \({S}^*\), respectively. \({R}^*\) and \({S}^*\) alternately select (without missing their turn) a vertex of G that was not yet chosen in the course of the game. If \({R}^*\) is the first to play, we speak of an R-game; otherwise, we have an S-game. \({R}^*\) wins if at some point the vertices \({R}^*\) has chosen form a resolving set of G, whereas \({S}^*\) wins if \({R}^*\) cannot form a resolving set of G. The outcome of the MBRG on a graph G is denoted by o(G), and there are four possible outcomes as follows: (1) \(o(G)={\mathcal {R}}\), if \({R}^*\) has a winning strategy in the R-game and the S-game; (2) \(o(G)={\mathcal {S}}\), if \({S}^*\) has a winning strategy in the R-game and the S-game; (3) \(o(G)={\mathcal {N}}\), if the first player has a winning strategy; (4) \(o(G)=\widetilde{{\mathcal {N}}}\), if the second player has a winning strategy.

Now, suppose a company X tries to secure its network by installing transmitters at certain locations within the company, so that the robot is aware of its security status at all times and thus identifying the exact location (or a specific computer with virus infection) in the network, whereas a rival company Y tries to prevent X from forming a secure network by occupying or controlling strategic locations or computers within the network of X. With this application in mind and considering the time constraint (the longer it takes for a player to win a game, the more it costs for the player), we introduce the following terminology and notation.

  • The Maker–Breaker resolving number \(R_{\mathrm{MB}}(G)\) of G is the minimum number of moves of \({R}^*\) to win the R-game provided he has a winning strategy. Otherwise, we set \(R_{\mathrm{MB}}(G) = \infty \).

  • \(R'_{\mathrm{MB}}(G)\) is the minimum number of moves of \({R}^*\) to win the S-game provided he has a winning strategy. Otherwise, we set \(R'_{\mathrm{MB}}(G) = \infty \).

  • The Maker–Breaker spoiling number \(S_{\mathrm{MB}}(G)\) of G is the minimum number of moves of \({S}^*\) to win the R-game provided she has a winning strategy. Otherwise, we set \(S_{\mathrm{MB}}(G) = \infty \).

  • \(S'_{\mathrm{MB}}(G)\) is the minimum number of moves of \({S}^*\) to win the S-game provided she has a winning strategy. Otherwise, we set \(S'_{\mathrm{MB}}(G) = \infty \).

This paper is organized as follows. In the next section we obtain some general results on the outcome of the MBRG. In Sect. 3 the effect of twin equivalence classes and pairing resolving sets on the MBRG is described and as an application a large class of graphs G is constructed for which \(R_{\mathrm{MB}}(G) > \dim (G)\) holds. In Sect. 4 we determine o(G), as well as \(R_{\mathrm{MB}}(G)\) and \(R'_{\mathrm{MB}}(G)\) or \(S_{\mathrm{MB}}(G)\) and \(S'_{\mathrm{MB}}(G)\), when G is a tree, the Petersen graph, a bouquet of cycles, a complete multi-partite graph, a grid graph, or a torus grid graph.

2 Some General Properties of the MBRG

In this section, we compare parameters of the MBRG with the metric dimension, \(R_{\mathrm{MB}}(G)\) with \(R'_{\mathrm{MB}}(G)\), and \(S_\mathrm{MB}(G)\) with \(S'_{\mathrm{MB}}(G)\). Along the way we prove the so-called No-Skip Lemma for the Maker–Breaker game played on a hypergraph. But first we comment on the possible outcomes of the MBRG.

Among the four possible outcomes listed in the introduction, the outcome \(o(G)=\widetilde{{\mathcal {N}}}\) never occurs. This follows from the (No-Skip) Lemma 2.2; note that \(o(G)=\widetilde{{\mathcal {N}}}\) implies that the first player gains an advantage by skipping the first move. This also follows from a result (see [19, Proposition 2.1.6]) on the Maker–Breaker game played on an arbitrary hypergraph: If Maker has a winning strategy as the second player, then he also has a winning strategy if he starts the game, and if Breaker has a winning strategy as the second player, then she also has a winning strategy if she starts the game. In the case of the Maker–Breaker domination game, this statement and its proof are given in [9, Proposition 2]. The same argument applies also to the Maker–Breaker resolving game. The other three possible outcomes in the latter game are realized, as the reader can verify on the examples given in Fig. 1.

Fig. 1
figure 1

Three examples realizing the three outcomes

For further examples, note that if \(n \ge 2\), then \(o(P_n)={\mathcal {R}}\) and \(R_{\mathrm{MB}}(P_n)=R'_\mathrm{MB}(P_n)=\dim (P_n)=1\), which is based on the fact that each leaf of the path \(P_n\) forms a metric basis, and thus, \({R}^*\) can always select one of them in the first move. Moreover, since any two vertices of \(C_3\) form a metric basis, it follows that \(o(C_3) = {\mathcal {N}}\), and if \(n\ge 4\), then every pair of adjacent vertices of \(C_n\) forms a metric basis for \(C_n\), and thus, \({R}^*\) can always select one of such bases in the first two steps. This leads to \(o(C_n) = {\mathcal {R}}\) and \(R_{\mathrm{MB}}(C_n)=R'_\mathrm{MB}(C_n)=\dim (C_n)=2\).

The order of a graph G will be denoted by n(G). We have the following simple relations between the outcome of the MBRG and the metric dimension.

Proposition 2.1

If G is a connected graph, then the following properties hold.

(i):

If \(o(G)={\mathcal {R}}\), then \(\dim (G)\le \lfloor \frac{n(G)}{2}\rfloor \).

(ii):

If \(\dim (G) \ge \lceil \frac{n(G)}{2}\rceil +1\), then \(o(G)={\mathcal {S}}\).

Proof

  1. (i)

    Suppose that \(o(G)={\mathcal {R}}\) and consider the S-game. After the game is finished, \({R}^*\) has clearly selected at most \(\lfloor \frac{n(G)}{2}\rfloor \) vertices. As the set of vertices selected by \({R}^*\) forms a resolving set of G, we conclude that \(\dim (G)\le \lfloor \frac{n(G)}{2}\rfloor \).

  2. (ii)

    No matter whether the R-game or the S-game is played, \({R}^*\) selects at most \(\lceil \frac{n(G)}{2}\rceil \) vertices by the end of the game. As \(\dim (G) \ge \lceil \frac{n(G)}{2}\rceil +1\), these vertices do not form a resolving set of G, hence \({S}^*\) wins the R-game as well as the S-game. \(\square \)

If \(n\ge 4\), then \(\dim (K_n)=n-1 \ge \lceil \frac{n}{2}\rceil +1\); thus, \(o(K_n)={\mathcal {S}}\) by Proposition 2.1(ii). Similarly, let \(B_m\) be the graph obtained from \(m\ge 5\) disjoint copies of \(C_4\) by identifying a vertex from each \(C_4\) at a common vertex. Then \(n(B_m) = 3m+1\) and \(\dim (B_m)=2m-1 \ge \left\lceil \frac{n(B_m)}{2}\right\rceil +1\); thus, \(o(B_m)={\mathcal {S}}\) by Proposition 2.1(ii).

Next, we compare \(R_{\mathrm{MB}}(G)\) with \(R'_{\mathrm{MB}}(G)\) and \(S_\mathrm{MB}(G)\) with \(S'_{\mathrm{MB}}(G)\). To this end, we consider the possibility that a player is allowed to skip a move; equivalently, a player allows the other player to select two vertices in one move. The observation that skipping offers no advantage to a player in the Maker–Breaker domination game was proved in [15]. We next show that a parallel argument works for the Maker–Breaker game played on an arbitrary hypergraph.

Lemma 2.2

(No-Skip Lemma) If the Maker–Breaker game is played on a hypergraph H, then in an optimal strategy of \({R}^*\) to win in the minimum number of moves it is never an advantage for him to skip a move. Moreover, it never disadvantages \({R}^*\) for \({S}^*\) to skip a move.

Proof

Suppose the R-game or the S-game is played. Let \({R}^*\) and \({S}^*\) play optimally until \({S}^*\) decides to skip a move. Then \({R}^*\) imagines that \({S}^*\) played an arbitrary legal move w, and replies optimally. \({R}^*\) continues to use this strategy until the end of the game. It may happen that in the course of the game \({S}^*\) selects a vertex which was already selected in the imagined game of \({R}^*\). In that case, \({R}^*\) imagines that some other legal move has been played by \({S}^*\). In this way, the game on G will finish in no more than the minimum number of moves played in the usual Maker–Breaker game. With a strategy of \({S}^*\) parallel to the above strategy of \({R}^*\), it also follows that it is never an advantage for \({R}^*\) to skip a move. \(\square \)

No-Skip Lemma quickly implies the announced comparison of \(R_\mathrm{MB}(G)\) with \(R'_{\mathrm{MB}}(G)\) and \(S_{\mathrm{MB}}(G)\) with \(S'_\mathrm{MB}(G)\).

Proposition 2.3

If G is a connected graph, then the following properties hold.

(i):

If \(o(G)={\mathcal {R}}\), then \(R'_{\mathrm{MB}}(G) \ge R_{\mathrm{MB}}(G) \ge \dim (G)\).

(ii):

If \(o(G)={\mathcal {S}}\), then \(S_{\mathrm{MB}}(G) \ge S'_{\mathrm{MB}}(G)\).

Proof

  1. (i)

    The R-game can be viewed as the S-game in which \({S}^*\) has skipped her first move. Hence the first inequality follows from Lemma 2.2 specialized to the MBRG. The second inequality follows from the fact that when the MBRG is finished, the set of vertices selected by \({R}^*\) forms a resolving set of G.

  2. (ii)

    The S-game can be viewed as the R-game in which \({R}^*\) has skipped his first move, and thus, the inequality follows.

\(\square \)

For the lexicographic product graph \(G=C_m[K_2]\), where \(m \ge 4\), we have \(\dim (G)=R_{\mathrm{MB}}(G)=R'_\mathrm{MB}(G)=m=\left\lfloor \frac{n(G)}{2}\right\rfloor \) (see [16] for the definition of the lexicographic product, and [23, 30] for studies on the metric dimension in the lexicographic product of graphs). That is, from [23, Corollary 3.12] for instance, it follows \(\dim (G)=m=\left\lfloor \frac{n(G)}{2}\right\rfloor \). Also, from the structure of the graph G, we note that any set of vertices of cardinality m containing exactly one vertex from each copy of \(K_2\) forms a metric basis for G. This allows to observe that \({R}^*\) can always select such kind of metric basis in the first m moves (independent of the first player), which proves that \(\dim (G)=R_{\mathrm{MB}}(G)=R'_{\mathrm{MB}}(G)\). This shows the sharpness of the bounds of Proposition 2.3(i). On the other hand, at the end of Sect. 3 we will construct a large family of graphs G for which \(R_{\mathrm{MB}}(G) > \dim (G)\) holds.

3 Twin Equivalence Classes and Pairing Resolving Sets

In this section, we consider two concepts that are very useful when dealing with the MBRG; this fact will be demonstrated in the rest of the paper.

The open neighborhood of a vertex \(v \in V(G)\) is \(N(v)=\{u \in V(G) \mid uv \in E(G)\}\). Vertices u and v are twins if \(N(u){\setminus }\{v\}=N(v){\setminus } \{u\}\); notice that a vertex is its own twin. Hernando et al. [20, Lemma 2.7] observed that the twin relation is an equivalence relation and that an equivalence class under it, hereafter called a twin equivalence class, induces either a clique or an independent set. We recall the following well-known fact.

Observation 3.1

[20, Corollary 2.4] If W is a resolving set of G and u and v are distinct members of the same twin equivalence class of G, then \(W \cap \{u, v\} \ne \emptyset \).

Here is now a relation of twin equivalence classes with the MBRG.

Proposition 3.2

Let G be a connected graph with \(n(G)\ge 4\).

(a):

If G has a twin equivalence class of cardinality at least 4, then \(o(G)={\mathcal {S}}\) and \(S_{\mathrm{MB}}(G)=S'_{\mathrm{MB}}(G)=2\).

(b):

If G has two distinct twin equivalence classes of cardinality at least 3, then \(o(G)={\mathcal {S}}\) and \(S_{\mathrm{MB}}(G)=S'_{\mathrm{MB}}(G)=2\).

Proof

Let W be a resolving set of G.

(a) Let \(Q = \{u_1,\ldots , u_k\} \subseteq V(G)\) be a twin equivalence class of G, where \(k\ge 4\). Then, \(|W \cap Q| \ge k-1\) by Observation 3.1. Since \(k \ge 4\), we infer that \({S}^*\) can occupy two vertices of Q after her second move, regardless of whether \({S}^*\) plays first or second. So, \({R}^*\) can occupy at most \(k-2\) vertices of Q, and thus, \({R}^*\) fails to occupy vertices that form a resolving set of G. Thus, \(o(G)={\mathcal {S}}\) and \(S_{\mathrm{MB}}(G)=S'_{\mathrm{MB}}(G)=2\).

(b) Let \(Q_1'\) and \(Q_2'\) be different twin equivalence classes of G, each of cardinality at least 3. Clearly, \(Q_1' \cap Q_2' = \emptyset \). Let \(Q_1=\{u_1, u_2, u_3\}\subseteq Q_1'\) and \(Q_2=\{u'_1, u'_2, u'_3\}\subseteq Q_2'\). Then, \(|W \cap Q_1| \ge 2\) and \(|W \cap Q_2| \ge 2\) by Observation 3.1. Note that \({S}^*\) can occupy three vertices of \(Q_1 \cup Q_2\) after her third move, regardless of whether \({S}^*\) plays first or second. So, after the third move by \({S}^*\), there are the following four possibilities: (i) \({S}^*\) occupies all vertices of \(Q_1\); (ii) \({S}^*\) occupies two vertices of \(Q_1\) and one vertex of \(Q_2\); (iii) \({S}^*\) occupies one vertex of \(Q_1\) and two vertices of \(Q_2\); (iv) \({S}^*\) occupies all three vertices of \(Q_2\). In each case, \({R}^*\) fails to occupy vertices that form a resolving set of G. Thus, \(o(G)={\mathcal {S}}\).

Next, we determine \(S_{\mathrm{MB}}(G)\) and \(S'_{\mathrm{MB}}(G)\). If \({S}^*\) plays first, then after her second move, \({S}^*\) can occupy two vertices of \(Q_1\). If \({S}^*\) plays second, then after her second move, \({S}^*\) can occupy two vertices of \(Q_1\) (if \({R}^*\) occupies a vertex in \(Q_2\) in his first move) or \({S}^*\) can occupy two vertices of \(Q_2\) (if \({R}^*\) occupies a vertex in \(Q_1\) in his first move). So, \(S_\mathrm{MB}(G)=S'_{\mathrm{MB}}(G)=2\). \(\square \)

Let [k] denote the set \(\{1,\ldots , k\}\). Let \(A=\{\{u_1,w_1\}, \ldots , \{u_k, w_k\}\}\) be a set of 2-subsets of V(G) such that \(|\cup _{i=1}^k\{u_i, w_i\}|=2k\). We say that A is a pairing resolving set of G if every set \(\{x_1,\ldots , x_k\}\), where \(x_i\in \{u_i, w_i\}\) and \(i\in [k]\), is a resolving set of G. We note here that for the Maker–Breaker domination game, a parallel concept of pairing dominating sets was introduced in [15].

Proposition 3.3

If a graph G admits a pairing resolving set, then \(o(G)={\mathcal {R}}\).

Proof

Let A be a pairing resolving set of G with \(|A|=k\). Regardless of whether the R-game or the S-game is played, \({R}^*\) is guaranteed to select a vertex of each pair from A after his \(k^{\mathrm{th}}\) move. Thus, the vertices chosen by \({R}^*\), after his \(k^{\mathrm{th}}\) move, form a resolving set of G. So, \(o(G)={\mathcal {R}}\). \(\square \)

Despite its simplicity, Proposition 3.3 has fine applications. If \(\dim (G)=k\) and A is a pairing resolving set of G with \(|A| = k\), then we say that A is a dim-pairing resolving set of G; this, together with Proposition 3.3, immediately yields the following

Corollary 3.4

If G admits a dim-pairing resolving set, then \(R_\mathrm{MB}(G)=R'_{\mathrm{MB}}(G)=\dim (G)\).

Proof

If G admits a dim-pairing resolving set (which is also a pairing resolving set), then by Proposition 3.3, \(o(G)={\mathcal {R}}\), and by Proposition 2.3(i), \(R'_{\mathrm{MB}}(G) \ge R_{\mathrm{MB}}(G) \ge \dim (G)\). Moreover, since G admits a dim-pairing resolving set, \({R}^*\) can always select a metric basis in the first \(\dim (G)\) steps. Thus, \(\dim (G)\ge R'_\mathrm{MB}(G)\ge R_{\mathrm{MB}}(G)\ge \dim (G)\). \(\square \)

For an example, consider the graph G of Fig. 2. The graph G has the following dim-pairing resolving sets:

  • \(\{\{u_1, w_1\}, \{u_2, w_2\}, \{u_3, w_3\}, \{u_4, v_4\}\}\),

  • \(\{\{u_1, w_1\}, \{u_2, w_2\}, \{u_3, w_3\}, \{u_4, w_4\}\}\), and

  • \(\{\{u_1, w_1\}, \{u_2, w_2\}, \{u_3, w_3\}, \{v_4, w_4\}\}\);

hence, Corollary 3.4 implies that \(R_\mathrm{MB}(G) = R'_{\mathrm{MB}}(G) = 4\).

Fig. 2
figure 2

A graph which admits three dim-pairing resolving sets

To conclude the section, we are going to show how pairing resolving sets can be applied to construct a large family of graphs G for which \(R_{\mathrm{MB}}(G) > \dim (G)\) holds.

Definition 3.5

If \(k\ge 3\), then let \(G_k\) be a graph of order \(k+2(2^k-1)\) with \(V(G_k)=A\cup B\cup C\), where A, B, and C are pairwise disjoint sets with \(|A|=k\) and \(|B|=2^k-1=|C|\). The edge set of \(G_k\) is specified as follows: (i) each of the sets A, B, and C induces a clique in \(G_k\); (ii) indexing the elements of B (and separately of C) by nonempty subsets of A, let \(b_S\in B\) be adjacent to each vertex in \(S\subseteq A\); (iii) let \(b_S\in B\) be adjacent to \(c_S\in C\) for each nonempty subset S of A; (iv) there are no other edges.

We will at times subscript a vertex \(b\in B\) (and a vertex \(c\in C\)) by an element of \({\mathbb {Z}}_2^k\), where 1 (resp., 0) in the jth coordinate indicates that b is adjacent (resp., not adjacent) to the jth vertex in A. See Fig. 3 for \(G_3\) and the labeling of its vertices. From now on, for a given vertex \(x\in V(G)\) and an ordered set of vertices \(S\subseteq V(G)\), by \(\text {code}_S(x)\) we denote the vector of distances between x and all the vertices in S.

Fig. 3
figure 3

\(G_3\) satisfying \(o(G_3) = {\mathcal {R}}\) and \(R_\mathrm{MB}(G_3)>\dim (G_3)=3\)

Theorem 3.6

If \(k \ge 3\) and \(G_k\) is as in Definition 3.5, then the following holds.

  1. (i)

    \(\dim (G_k)=k\).

  2. (ii)

    The set A is the unique metric basis of \(G_k\).

  3. (iii)

    The set \(\displaystyle \bigcup \nolimits _{\emptyset \ne S\subseteq A}\{\{b_S,c_S\}\}\) is a pairing resolving set of \(G_k\).

Proof

  1. (i)

    First, we show that A is a metric basis of \(G_k\). Clearly, A forms a resolving set of \(G_k\); thus, \(\dim (G_k) \le |A| =k\). To show \(\dim (G_k) \ge k\), suppose S is a metric basis of \(G_k\) with \(S \ne A\). If \(S \cap A=\emptyset \), then, for any distinct \(\alpha \) and \(\beta \), \(S \cap \{b_{\alpha }, b_{\beta }, c_{\alpha }, c_{\beta }\} \ne \emptyset \); otherwise, \(\text {code}_S(b_{\alpha })=\text {code}_S(b_{\beta })\) and \(\text {code}_S(c_{\alpha })=\text {code}_S(c_{\beta })\); then, \(|S|\ge 2^k-2 \ge k+1\) for \(k\ge 3\). Thus, \(S\cap A \ne \emptyset \). By relabeling the vertices of A if necessary, we can assume that \(S \cap A=\cup _{i=1}^{t}\{a_i\}\), where \(1 \le t \le k-1\). Then, there are \(2^{k-t}\) vertices of B that are not resolved by \(S \cap A\), and there are \(2^{k-t}\) vertices of C that are not resolved by \(S \cap A\); thus, \(|S \cap (V(G_k)-A)| \ge 2^{k-t}-1 \ge k-t\), where the last inequality holds since \(2^x-x-1 \ge 0\) for \(x\ge 1\). So, \(\dim (G_k)=|S|=|S\cap A|+|S\cap (V(G_k)-A)| \ge t+(k-t)=k\). Thus, \(\dim (G_k)=k\).

  2. (ii)

    Suppose \(S\ne A\) is a metric basis of \(G_k\); then, we have \(S \cap A \ne \emptyset \) from above argument. If \(|S \cap A|=t \le k-2\), then \(|S \cap (V(G_k)-A)| \ge 2^{k-t}-1 \ge k-t+1\) for \(k-t \ge 2\), where the last inequality holds since \(2^x-x-2 \ge 0\) for \(x\ge 2\). If \(|S \cap A|=k-1\), then there exist (\(2^{k-1}-1\)) pairs in B not resolved by \(S\cap A\). So, \(|S \cap (V(G_k)-A)| \ge 2^{k-1}-2\ge 2\) for \(k\ge 3\), and thus, \(|S|\ge k+1\). In both cases, we find \(|S|>k\), contradicting the assumption of S being a metric basis.

  3. (iii)

    First, note that B and C are resolving sets of \(G_k\). To see that B resolves \(G_k\), set \(B = \{b_1,\ldots , b_{2^k-1}\}\). Notice that \(\text {code}_B(c_i)\) has 1 in the ith entry and 2 in the rest of its entries, while \(\text {code}_B(a_j)\) has 1 in exactly \(2^{k-1}\) of its entries and 2 in the rest of its entries. And \(\text {code}_B(a_i) \ne \text {code}_B(a_j)\) for \(i\ne j\), since there is \(b\in B\) such that \(N(b)\cap A=\{a_i\}\). The set C is seen to be a resolving set by a very similar argument.

Now, let \(R=\cup _{\alpha =1}^{2^k-1}\{x_{\alpha }\}\), where \(x_{\alpha } \in \{b_{\alpha }, c_{\alpha }\}\), and assume that \(R \ne B\) and \(R \ne C\). We show that R resolves any two vertices of \(G_k\) by considering memberships of the two vertices with respect to the sets A, B, and C; there are altogether six cases to consider.

For distinct vertices \(a_i,a_j \in A\), there exists a vertex \(b_{\gamma }\in B\) such that \(d(b_{\gamma }, a_i)=2=1+d(b_{\gamma }, a_j)\) and \(d(c_{\gamma }, a_i)=3=1+d(c_{\gamma }, a_j)\). Since \(R \cap \{b_{\gamma }, c_{\gamma }\} \ne \emptyset \), \(\text {code}_R(a_i) \ne \text {code}_R(a_j)\).

Let distinct vertices \(b_{\alpha }, b_{\beta } \in B\) be given. If \(R \cap \{b_{\alpha }, b_{\beta }\} \ne \emptyset \), then \(\text {code}_R(b_{\alpha }) \ne \text {code}_R(b_{\beta })\). If \(R \cap \{b_{\alpha }, b_{\beta }\}= \emptyset \), then \(\{c_{\alpha }, c_{\beta }\} \subset R\). Then, \(d(c_{\alpha }, b_{\beta })=2=1+d(c_{\alpha }, b_{\alpha })\), and thus, \(\text {code}_R(b_{\alpha })\ne \text {code}_R(b_{\beta })\). The case of distinct vertices \(c_{\alpha }, c_{\beta } \in C\) is handled in the same manner.

If \(a_i \in A\) and \(b_{\alpha } \in B\), then \(\text {code}_R(a_i) \ne \text {code}_R(b_{\alpha })\) since \(R \cap \{b_{\alpha }, c_{\alpha }\} \ne \emptyset \).

Let \(a_i \in A\) and \(c_{\beta } \in C\) be given. There exists a vertex \(c_{\gamma }\in R\) such that \(d(c_{\gamma }, c_{\beta })\le 1<2\le d(c_{\gamma }, a_i)\), and thus \(\text {code}_R(a_i) \ne \text {code}_R(c_{\beta })\).

Let \(b_{\alpha } \in B\) and \(c_{\beta } \in C\) be given. If \(\alpha =\beta \), then \(|R \cap \{b_{\alpha }, c_{\alpha }\}|=1\), and thus, \(\text {code}_R(b_{\alpha }) \ne \text {code}_R(b_{\beta })\). If \(\alpha \ne \beta \) and \(R \cap \{b_{\alpha }, c_{\beta }\} \ne \emptyset \), then \(\text {code}_R(b_{\alpha }) \ne \text {code}_R(c_{\beta })\). If \(\alpha \ne \beta \) and \(R \cap \{b_{\alpha }, c_{\beta }\} = \emptyset \), then there exists \(\gamma \not \in \{\alpha , \beta \}\) such that \(|\{b_{\gamma },c_{\gamma }\}\cap R|=1\), and this yields \(\text {code}_R(b_{\alpha })\ne \text {code}_R(c_{\beta })\): taking the case \(c_{\gamma }\in R\) for example, we have \(d(c_{\gamma }, b_{\alpha })=2=1+d(c_{\gamma }, c_{\beta })\). \(\square \)

From Theorem 3.6, we immediately conclude the following

Corollary 3.7

For each \(k\ge 3\), we have \(o(G_k)={\mathcal {R}}\) and \(R_\mathrm{MB}(G_k)>\dim (G_k)\).

Proof

From Theorem  3.6, \(G_k\) has a pairing resolving set. Thus, by Proposition 3.3, \(o(G_k)={\mathcal {R}}\), and by Proposition 2.3(i), \(R_{\mathrm{MB}}(G_k) \ge \dim (G_k)\). In addition, there is no dim-pairing resolving set for \(G_k\). Together with the fact that \(G_k\) has a unique metric basis this implies that \({R}^*\) cannot select a resolving set in the first \(\dim (G_k)\) steps. Consequently, \(R_{\mathrm{MB}}(G_k)>\dim (G_k)\). \(\square \)

4 Some Applications

With the help of the results from the previous section, we now determine o(G) for some classes of graphs G. We also determine \(R_{\mathrm{MB}}(G)\) and \(R'_{\mathrm{MB}}(G)\) when \({R}^*\) has a winning strategy, and we determine \(S_{\mathrm{MB}}(G)\) and \(S'_{\mathrm{MB}}(G)\) when \({S}^*\) has a winning strategy.

4.1 Trees

Fix a tree T. A support vertex is a vertex that is adjacent to a vertex of degree one, a major vertex is a vertex of degree at least three. A vertex \(\ell \) of degree 1 is called a terminal vertex of a major vertex v if \(d(\ell , v)<d (\ell , w)\) for every other major vertex w in T. The terminal degree, ter(v), of a major vertex v is the number of terminal vertices of v in T, and an exterior major vertex is a major vertex that has positive terminal degree. We denote by ex(T) the number of exterior major vertices of T, and \(\sigma (T)\) the number of leaves of T. Let M(T) be the set of exterior major vertices of T. Let \(M_1(T)=\{w\in M(T): ter(w)=1\}\) and let \(M_2(T)=\{w \in M(T):ter(w) \ge 2\}\); note that \(M(T)=M_1(T) \cup M_2(T)\). For each \(v \in M(T)\), let \(T_v\) be the subtree of T induced by v and all vertices belonging to the paths joining v with its terminal vertices, and let \(L_v\) be the set of terminal vertices of v in T.

Theorem 4.1

[6, 26, 28] If T is a tree that is not a path, then \(\dim (T)=\sigma (T)-ex(T)\).

Theorem 4.2

[28] Let T be a tree with \(ex(T)=k \ge 1\), and let \(v_1, \ldots , v_k\) be the exterior major vertices of T. For each \(i \in [k]\), let \(\ell _{i,1}, \ldots , \ell _{i, \sigma _i}\) be the terminal vertices of \(v_i\) with \(ter(v_i)=\sigma _i \ge 1\), and let \(P_{i,j}\) be the \(v_i-\ell _{i,j}\) path, where \(j \in [\sigma _i]\). Let \(W \subseteq V(T)\). Then, W is a metric basis of T if and only if W contains exactly one vertex from each of the paths \(P_{i,j}-v_i\), where \(j \in [\sigma _i]\) and \(i\in [k]\), with exactly one exception for each \(i\in [k]\) and W contains no other vertices of T.

Theorem 4.3

If T is a tree that is not a path, then

$$\begin{aligned} o(T)=\left\{ \begin{array}{ll} {\mathcal {S}}; &{} |N(v) \cap L_v| \ge 4 \text{ for } \text{ some } v \in M_2(T),\\ {} &{} \text{ or } |N(u) \cap L_u|=3=|N(w) \cap L_w| \text{ for } \text{ distinct } u,w \in M_2(T),\\ {\mathcal {N}}; &{} |N(w) \cap L_w|=3 \text{ for } \text{ exactly } \text{ one } w\in M_2(T)\\ {} &{} \text{ and } |N(v) \cap L_v| \le 2 \text{ for } \text{ each } v \in M_2(T)-\{w\},\\ {\mathcal {R}}; &{} |N(v) \cap L_v| \le 2 \text{ for } \text{ each } v \in M_2(T). \end{array}\right. \end{aligned}$$

Moreover, if \(o(T)={\mathcal {S}}\), then \(S_{\mathrm{MB}}(T)=S'_\mathrm{MB}(T)=2\); if \(o(T)={\mathcal {R}}\), then \(R_{\mathrm{MB}}(T)=R'_\mathrm{MB}(T)=\dim (T)=\sigma (T)-ex(T)\).

Proof

Let T be a tree that is not a path. Hence \(ex(T) \ge 1\).

First, suppose that there exists an exterior major vertex \(x \in M_2(T)\) such that \(|N(x) \cap L_x| \ge 4\). Since \(N(x) \cap L_x\) is a twin equivalence class of cardinality at least 4, by Proposition 3.2(a), \(o(T)={\mathcal {S}}\) and \(S_\mathrm{MB}(T)=S'_{\mathrm{MB}}(T)=2\).

Second, suppose that \(|N(v) \cap L_v| \le 3\) for each \(v \in M_2(T)\). If there exist distinct \(x,y \in M_2(T)\) such that \(|N(x) \cap L_x|=|N(y) \cap L_y|=3\), then \(N(x) \cap L_x\) and \(N(y) \cap L_y\) are distinct twin equivalence classes of cardinality 3; thus, by Proposition 3.2(b), \(o(T)={\mathcal {S}}\) and \(S_\mathrm{MB}(T)=S'_{\mathrm{MB}}(T)=2\).

Now, suppose there exists exactly one \(z\in M_2(T)\) with \(|N(z) \cap L_z|=3\), and \(|N(v) \cap L_v| \le 2\) for each \(v\in M_2(T)-\{z\}\). Let \(L_z=\{\ell '_1, \ldots , \ell '_a\}\), where \(a \ge 3\) and \(d(z, \ell '_i)=1\) for \(i\in [3]\); if \(a \ge 4\), let \(s'_j\) be the support vertex that lies on the \(z-\ell '_j\) path for each \(j \in [a]-[3]\). Note that, for any resolving set W of T, Observation 3.1 yields \(|W \cap \{\ell '_1, \ell '_2, \ell '_3\}| \ge 2\). If there exists a vertex \(v\in M_2(T)-\{z\}\) with \(|N(v) \cap L_v| \le 2\), then, for a fixed \(w\in M_2(T)-\{z\}\), let \(L_w=\{\ell _1, \ldots , \ell _{b}\}\) such that \(d(w, \ell _1) \le \cdots \le d(w, \ell _b)\); if \(b\ge 3\), let \(s_i\) be the support vertex that lies on the \(w-\ell _i\) path for each \(i\in [b]-[2]\). Then \(R_w=\{\{\ell _1, \ell _2\}\} \cup (\cup _{i=3}^{b}\{\{s_i, \ell _i\}\})\) is a dim-pairing resolving set of \(T_w\). In the S-game, \({S}^*\) can occupy two vertices of \(\{\ell '_1, \ell '_2, \ell '_3\}\) after her second move; thus, \({R}^*\) fails to occupy vertices that form a resolving set of G, and hence \({S}^*\) wins. In the R-game, \({R}^*\) can occupy two vertices of \(\{\ell '_1, \ell '_2, \ell '_3\}\) after his second move, and occupy exactly one vertex of each pair in \((\cup _{i=4}^{a}\{\{s'_i, \ell '_i\}\})\cup (\cup _{w\in M_2(T)-\{z\}} R_w)\) thereafter until he completes his \(\dim (T)^{\mathrm{th}}\) move; thus, the set of vertices selected by \({R}^*\), after his \(\dim (T)^{\mathrm{th}}\) move, forms a resolving set of T, and hence \({R}^*\) wins. Therefore, \(o(G)={\mathcal {N}}\).

Third, suppose that \(|N(v) \cap L_v| \le 2\) for each \(v \in M_2(T)\). For a fixed \(v \in M_2(T)\) with \(ter(v)=k \ge 2\), let \(\ell _1, \ldots , \ell _k\) be the terminal vertices of v such that \(d(v, \ell _1) \le \cdots \le d(v, \ell _k)\); if \(d(v, \ell _i) \ge 2\), let \(s_i\) be the support vertex that lies on the \(v-\ell _i\) path. Then \(W_v=\{\{\ell _1, \ell _2\}\} \cup (\cup _{i=3}^{k}\{\{s_i, \ell _i\}\})\) is a dim-pairing resolving set of \(T_v\), and \(\cup _{v\in M_2(T)} W_v\) is a dim-pairing resolving set of T. So, \(o(T)={\mathcal {R}}\) by Proposition 3.3, and \(R_{\mathrm{MB}}(T)=R'_{\mathrm{MB}}(T)=\dim (T)\) by Corollary 3.4. \(\square \)

4.2 The Petersen Graph

For the Petersen graph \({\mathcal {P}}\) (see Fig. 4), we first recall the following results.

Theorem 4.4

[24] For the Petersen graph \({\mathcal {P}}\), \(\dim ({\mathcal {P}})=3\).

Porism 4.5

[11] If W is a metric basis of the Petersen graph \({\mathcal {P}}\), then the subgraph of \({\mathcal {P}}\) induced by W is an edge-less graph.

Fig. 4
figure 4

Petersen graph

Lemma 4.6

Let the vertices of the Petersen graph \({\mathcal {P}}\) be labeled as shown in Fig. 4. Let \(W_1=\{u_1,w_2,w_3\}\), \(W_2=\{u_1,u_4,w_2\}\), \(W_3=\{u_1,w_4,w_5\}\), \(W_4=\{u_1,u_3,w_5\}\), \(W_5=\{u_1,u_4,w_3\}\) and \(W_6=\{u_1,u_3,w_4\}\). Then, W is a metric basis of \({\mathcal {P}}\) with \(u_1\in W\) if and only if \(W=W_i\) for some \(i\in [6]\).

Proof

(\(\Leftarrow \)) Let \(W=W_1=\{u_1,w_2,w_3\}\). Then \(\text {code}_W(u_2)=(1,1,2)\), \(\text {code}_W(u_3)=(2,2,1)\), \(\text {code}_W(u_4)=(2,2,2)\), \(\text {code}_W(u_5)=(1,2,2)\), \(\text {code}_W(w_1)=(1,2,1)\), \(\text {code}_W(w_4)=(2,1,2)\) and \(\text {code}_W(w_5)=(2,1,1)\). So, \(W_1\) is a metric basis of \({\mathcal {P}}\) by Theorem 4.4. For \(i\in [6]-[1]\), one can easily check that \(W_i\) is a metric basis of \({\mathcal {P}}\).

(\(\Rightarrow \)) Let W be a metric basis of \({\mathcal {P}}\) with \(u_1\in W\). By Porism 4.5, \(W \cap \{u_2,w_1,u_5\}=\emptyset \); thus, \(W \cap \{w_2, w_5\} \ne \emptyset \) or \(W \cap \{w_3, w_4\} \ne \emptyset \) or \(W \cap \{u_3, u_4\} \ne \emptyset \).

First, let \(W \cap \{w_2, w_5\} \ne \emptyset \). If \(w_2\in W\), say \(X_1=\{u_1,w_2\} \subset W\), then \(W \cap \{u_2, u_5, w_1, w_4, w_5\}=\emptyset \) by Porism 4.5 and \(\text {code}_{X_1}(u_3)=\text {code}_{X_1}(u_4)=\text {code}_{X_1}(w_3)=(2,2)\). Since \(d(u_3,w_3)=d(u_3,u_4)\), either \(w_3 \in W\) (i.e., \(W=W_1\)) or \(u_4\in W\) (i.e., \(W=W_2\)). Similarly, if \(w_5 \in W\), then \(w_4\in W\) (i.e., \(W=W_3\)) or \(u_3\in W\) (i.e., \(W=W_4\)).

Second, let \(W \cap \{w_3, w_4\} \ne \emptyset \). If \(w_3 \in W\), say \(X_2=\{u_1, w_3\} \subset W\), then \(W \cap \{u_2, u_3, u_5, w_1, w_5\}=\emptyset \) by Porism 4.5 and \(\text {code}_{X_2}(u_4)=\text {code}_{X_2}(w_2)=\text {code}_{X_2}(w_4)=(2,2)\). Since \(d(w_4,w_2)=d(w_4, u_4)\), either \(w_2 \in W\) (i.e., \(W=W_1\)) or \(u_4\in W\) (i.e., \(W=W_5\)). Similarly, if \(w_4 \in W\), then \(w_5\in W\) (i.e., \(W=W_3\)) or \(u_3\in W\) (i.e., \(W=W_6\)).

Third, let \(W \cap \{u_3, u_4\} \ne \emptyset \). If \(u_3 \in W\), say \(X_3=\{u_1, u_3\} \subset W\), then \(W \cap \{u_2, u_4, u_5, w_1, w_3\}=\emptyset \) by Porism 4.5 and \(\text {code}_{X_3}(w_2)=\text {code}_{X_3}(w_4)=\text {code}_{X_3}(w_5)=(2,2)\). Since \(d(w_2,w_4)=d(w_2,w_5)\), either \(w_4 \in W\) (i.e., \(W=W_6\)) or \(w_5\in W\) (i.e., \(W=W_4\)). Similarly, if \(u_4 \in W\), then \(w_2\in W\) (i.e., \(W=W_2\)) or \(w_3\in W\) (i.e., \(W=W_5\)). \(\square \)

Theorem 4.7

\(o({\mathcal {P}})={\mathcal {R}}\) and \(R_{\mathrm{MB}}({\mathcal {P}})=R'_\mathrm{MB}({\mathcal {P}})=3=\dim ({\mathcal {P}})\).

Proof

Let the vertices of \({\mathcal {P}}\) be labeled as shown in Fig. 4, and let \(A_1=\{w_2,w_5\}\), \(A_2=\{w_3,w_4\}\), and \(A_3=\{u_3,u_4\}\). First, we consider the R-game. Since \({\mathcal {P}}\) is vertex-transitive (see [21]), we may assume that \({R}^*\) occupies \(u_1\) after his first move. If \({S}^*\) selects a vertex in \(N(u_1)\) on her first move, \({R}^*\) can select a vertex of an \(A_i\), \(i\in [3]\), on his second move; if \({S}^*\) selects a vertex of an \(A_j\), \(j\in [3]\), on her first move, then \({R}^*\) can select the other vertex of \(A_j\) on his second move. If \({R}^*\) selects a vertex of \(A_1=\{w_2,w_5\}\), say \(w_2\), on his second move, he can select a vertex in \(\{u_4, w_3\}\) on his third move; if \({R}^*\) selects a vertex of \(A_2=\{w_3, w_4\}\), say \(w_3\), on his second move, he can select a vertex of \(\{u_4, w_2\}\) on his third move; if \({R}^*\) selects a vertex of \(A_3=\{u_3, u_4\}\), say \(u_3\), on his second move, he can select a vertex in \(\{w_4, w_5\}\) on his third move. In each case, the set of vertices occupied by \({R}^*\), after his third move, forms a resolving set of \({\mathcal {P}}\) by Lemma 4.6.

Second, we consider the S-game. Since \({\mathcal {P}}\) is edge-transitive (see [21]), we may assume that \({S}^*\) selects \(u_5\) on her first move and \({R}^*\) selects \(u_1\) on his first move. If \({S}^*\) selects a vertex of an \(A_i\), \(i\in [3]\), on her second move, then \({R}^*\) can select the other vertex of \(A_i\) on his second move; if \({S}^*\) selects a vertex of \(N(u_1)-\{u_5\}=\{u_2, w_1\}\) on her second move, \({R}^*\) can select a vertex of an \(A_j\), \(j\in [3]\), on his second move. By applying the above argument for the R-game, it is easy to see that \({R}^*\) can occupy a resolving set of \({\mathcal {P}}\) after his third move.

Thus, \(o({\mathcal {P}})={\mathcal {R}}\) and \(R_\mathrm{MB}({\mathcal {P}})=R'_{\mathrm{MB}}({\mathcal {P}})=3\). \(\square \)

4.3 Bouquet of Cycles

Let \(B_m\), \(m\ge 2\), be a bouquet of m cycles (i.e., the vertex sum of m cycles at one common vertex), and let w be the cut-vertex of \(B_m\) (see Fig. 5). Let \(C^1, \ldots , C^m\) be the m cycles of \(B_m\). For each \(i \in [m]\), let \(P^i=C^i-w\).

Fig. 5
figure 5

A bouquet of four cycles \(B_4\)

Theorem 4.8

[22] If \(B_m\) is a bouquet of \(m\ge 2\) cycles of which x cycles are even, then

$$\begin{aligned} \dim (B_m)=\left\{ \begin{array}{ll} m; &{}\quad x=0,\\ m+x-1; &{}\quad x \ge 1. \end{array}\right. \end{aligned}$$

Lemma 4.9

[22] If W is a resolving set of a bouquet of cycles \(B_m\), \(m \ge 2\), then

(a):

for each \(i\in [m]\), \(|W \cap V(P^i)| \ge 1\); and

(b):

for any two distinct even cycles \(C^i\) and \(C^j\) of \(B_m\), \(| W \cap (V(P^i) \cup V(P^j))| \ge 3\).

Theorem 4.10

If \(B_m\) is a bouquet of \(m\ge 2\) cycles of which z are 4-cycles, then

$$\begin{aligned} o(B_m)=\left\{ \begin{array}{ll} {\mathcal {R}}; &{}\quad z \le 2,\\ {\mathcal {N}}; &{}\quad z = 3,\\ {\mathcal {S}}; &{}\quad z \ge 4. \end{array}\right. \end{aligned}$$

Moreover, if \(o(B_m)={\mathcal {R}}\), then \(R_{\mathrm{MB}}(B_m)=R'_\mathrm{MB}(B_m)=\dim (B_m)\); if \(o(B_m)={\mathcal {S}}\), then \(S_\mathrm{MB}(B_m)=S'_{\mathrm{MB}}(B_m)=4\).

Proof

Let w be the cut-vertex of \(B_m\), where \(m \ge 2\). Let \(C^1, \ldots , C^z\) be cycles isomorphic to \(C_4\), let \(C^{z+1}, \ldots , C^x\) be even cycles that are not isomorphic to \(C_4\), and let \(C^{x+1}, \ldots , C^m\) be odd cycles of \(B_m\); notice \(x \ge z\). If \(C^i\) is an odd cycle of length \(2k_i+1\), let \(C^i\) be given by \(w, u_{i,1}, u_{i,2}, \ldots , u_{i, k_i}, u_{i, k_i+1}, \ldots , u_{i, 2k_i}, w\); if \(C^j\) is an even cycle of length \(2k_j\), let \(C^j\) be given by \(w, u_{j,1}, u_{j,2}, \ldots , u_{j, k_j-1}, u_{j,k_j}, u_{j, k_j+1}, \ldots , u_{j, 2k_j-1}, w\) (see Fig. 5 for the labeling of the vertices of a \(B_4\)). We note that \(u_{i,1}\) and \(u_{i,3}\) are twins for each \(i\in [z]\).

Case 1: \(z \le 2\).

If \(z=0\) and \(x=0\), then \(\cup _{i=1}^{m} \{\{u_{i, k_i}, u_{i, k_i+1}\}\}\) is a dim-pairing resolving set of \(B_m\). If \(z=0\) and \(x \ge 1\), then \(\{\{u_{1, k_1-1},u_{1, k_1+1}\}\} \cup (\cup _{i=2}^{x} \{\{u_{i,1}, u_{i,k_i-1}\},\{u_{i, k_i+1}, u_{i, 2k_i-1}\}\}) \cup (\cup _{j=x+1}^{m}\{\{u_{j, k_j}, u_{j, k_j+1}\}\})\) is a dim-pairing resolving set of \(B_m\). If \(z=1\), then

$$\begin{aligned} \{\{u_{1,1}, u_{1,3}\}\} {\cup } (\cup _{i=2}^x \{\{u_{i,1}, u_{i,k_i-1}\},\{u_{i, k_i+1}, u_{i, 2k_i-1}\}\}) \cup (\cup _{j=x+1}^{m}\{\{u_{j, k_j}, u_{j, k_j+1}\}\}) \end{aligned}$$

is a dim-pairing resolving set of \(B_m\). If \(z=2\), then

$$\begin{aligned} \{\{u_{1,1}, u_{1,3}\}, \{u_{2,1}, u_{2,3}\}, \{u_{1,2},u_{2,2}\}\}&\cup&(\cup _{i=3}^x \{\{u_{i,1}, u_{i,k_i-1}\},\{u_{i, k_i+1}, u_{i, 2k_i-1}\}\}) \\&\cup&(\cup _{j=x+1}^{m}\{\{u_{j, k_j}, u_{j, k_j+1}\}\}) \end{aligned}$$

is a dim-pairing resolving set of \(B_m\). So, in each case, \(o(B_m)={\mathcal {R}}\) by Proposition 3.3 and \(R_\mathrm{MB}(B_m)=R'_{\mathrm{MB}}(B_m)=\dim (B_m)\) by Corollary 3.4.

Case 2: \(z =3\).

Note that \(|\cup _{i=1}^{3}V(P^i)|=9\) and, for any resolving set W of \(B_m\), \(|W \cap (\cup _{i=1}^{3}V(P^i))| \ge 5\) by Lemma 4.9(b). In the S-game, \({S}^*\) can occupy five vertices of \(\cup _{i=1}^{3}V(P^i)\) after her fifth move. Thus, \({R}^*\) fails to occupy vertices that form a resolving set of \(B_m\). In the R-game, \({R}^*\) can occupy one vertex of each pair in \((\cup _{i=1}^{3}\{\{u_{i,1}, u_{i,3}\}\}) \cup (\cup _{i=4}^x \{\{u_{i,1}, u_{i,k_i-1}\},\{u_{i, k_i+1}, u_{i, 2k_i-1}\}\}) \cup (\cup _{j=x+1}^{m}\{\{u_{j, k_j}, u_{j, k_j+1}\}\})\) and two vertices of \(\cup _{i=1}^3\{u_{i,2}\}\); thus, \({R}^*\) can occupy vertices that form a resolving set of \(B_m\). So, \(o(B_m)={\mathcal {N}}\).

Case 3: \(z \ge 4\).

Note that \(|\cup _{i=1}^{4}V(P^i)|=12\) and, for any resolving set W of \(B_m\), \(|W \cap (\cup _{i=1}^{4}V(P^i))| \ge 7\) by Lemma 4.9(b). Regardless of whether \({S}^*\) plays first or second, \({S}^*\) can occupy 6 vertices of \(\cup _{i=1}^{4}V(P^i)\) after her sixth move. So, \({R}^*\) fails to occupy vertices that form a resolving set of \(B_m\); thus \(o(B_m)={\mathcal {S}}\). In determining \(S_{\mathrm{MB}}(B_m)\) and \(S'_\mathrm{MB}(B_m)\), we note that the optimal strategy for \({R}^*\) is to occupy at least a vertex in each pair of \(\cup _{i=1}^{z}\{\{u_{i,1}, u_{i,3}\}\}\), and the optimal strategy for \({S}^*\) is to occupy two vertices each in \(V(P^i)\) and \(V(P^j)\) for distinct \(i,j\in [z]\). By relabeling the vertices of \(\cup _{i=1}^z V(P^i)\) if necessary, we may assume that the two players occupy the vertices of \(B_m\) in the order of \(V(P^1), \ldots , V(P^z)\). In the S-game, \({S}^*\) can occupy two vertices of \(V(P^1)\) after her second move, \({R}^*\) would have occupied a vertex in \(\{u_{1,1}, u_{1,3}\} \subset V(P^1)\) and a vertex in \(\{u_{2,1}, u_{2,3}\} \subset V(P^2)\) after his second move, and \({S}^*\) can occupy two vertices of \(V(P^3)\) on her third and fourth move; thus, \({S}^*\) wins after her fourth move. In the R-game, \({R}^*\) occupies a vertex in \(\{u_{1,1}, u_{1,3}\}\) after his first move, and \({S}^*\) can occupy two vertices of \(V(P^2)\) after her second move (\({R}^*\) would have occupied a vertex in \(\{u_{2,1}, u_{2,3}\}\) on his second move). If \({R}^*\) occupies a vertex in \(\cup _{i=1}^{3}V(P^i)\) that has not yet been taken on his third move, \({S}^*\) can occupy two vertices of \(V(P^4)\) on her third and fourth move. So, in the R-game, \({S}^*\) wins after her fourth move. Thus, \(S_\mathrm{MB}(B_m)=S'_{\mathrm{MB}}(B_m)=4\). \(\square \)

4.4 Complete Multi-Partite Graphs

The metric dimension of complete multi-partite graphs was determined in [29].

Theorem 4.11

[29] If \(G=K_{a_1, \ldots , a_k}\), where \(k \ge 2\), \(n=\sum _{i=1}^{k}a_i\), and s is the number of partite sets of G consisting of one element, then

$$\begin{aligned} \dim (G)=\left\{ \begin{array}{ll} n-k; &{}\quad s = 0,\\ n+s-k-1; &{}\quad s \ne 0. \end{array}\right. \end{aligned}$$

For the MBRG, we have the following description.

Theorem 4.12

If \(G=K_{a_1, \ldots , a_k}\), where \(k \ge 2\), and s is the number of partite sets of G consisting of one element, then

$$\begin{aligned} o(G)=\left\{ \begin{array}{ll} {\mathcal {S}}; &{}\quad s \ge 4 \text{ or } a_i\ge 4 \text{ for } \text{ some } i \in [k],\\ {} &{}\quad \ \text{ or } s=a_i=3 \text{ for } \text{ some } i \in [k],\\ {} &{}\quad \text{ or } a_i=a_j=3 \text{ for } \text{ distinct } i,j \in [k],\\ {\mathcal {N}}; &{}\quad s=3 \text{ and } a_i \le 2 \text{ for } \text{ each } i\in [k],\\ {} &{}\quad \text{ or } s \le 2 \text{ and } a_i=3 \text{ for } \text{ exactly } \text{ one } i\in [k],\\ {\mathcal {R}}; &{}\quad \max \{s, a_i\} \le 2 \text{ for } \text{ each } i \in [k]. \end{array}\right. \end{aligned}$$

Moreover, if \(o(G)={\mathcal {S}}\), then \(S_{\mathrm{MB}}(G)=S'_\mathrm{MB}(G)=2\); if \(o(G)={\mathcal {R}}\), then \(R_{\mathrm{MB}}(G)=R'_\mathrm{MB}(G)=\dim (G)\).

Proof

Let V(G) be partitioned into \(V_1, \ldots , V_k\) such that \(V_i=\{u_{i,1}, \ldots , u_{i, a_i}\}\) with \(|V_i|=a_i\), where \(i \in [k]\) and \(k \ge 2\). We may without loss of generality assume that \(a_1 \le \cdots \le a_k\).

First, suppose that \(s \ge 4\) or \(a_i \ge 4\) for some \(i\in [k]\). If \(s \ge 4\), then \(\cup _{i=1}^{s} V_i\) is a twin equivalence class of cardinality at least 4. If \(a_i \ge 4\) for some \(i \in [k]\), then \(V_k\) is a twin equivalence class of cardinality at least 4. By Proposition 3.2(a), \(o(G)={\mathcal {S}}\) and \(S_\mathrm{MB}(G)=S'_{\mathrm{MB}}(G)=2\).

Second, suppose that \(\max \{s, a_i\} \le 3\) for each \(i\in [k]\); further, let \(s=3\) or \(a_i=3\) for some \(i\in [k]\). If \(s=a_x=3\) for some \(x \in [k]\) or \(a_y=a_z=3\) for distinct \(y,z\in [k]\), then G has distinct twin equivalence classes of cardinality three; thus, by Proposition 3.2(b), \(o(G)={\mathcal {S}}\) and \(S_\mathrm{MB}(G)=S'_{\mathrm{MB}}(G)=2\).

So, suppose \(s=3\) or \(a_i=3\) for exactly one \(i\in [k]\), but not both. Let W be any resolving set of G. By Observation 3.1, we have the following: (1) if \(s=3\), then \(|W \cap \{u_{1,1}, u_{2,1}, u_{3,1}\}| \ge 2\); (2) if \(a_i=3\) for exactly one \(i\in [k]\), then \(a_k=3\) and \(|W \cap V_k| \ge 2\). In the S-game, \({S}^*\) can occupy two vertices of \(\{u_{1,1}, u_{2,1}, u_{3,1}\}\) after her second move (when \(s=3\)), or \(\mathrm{S}^*\) can occupy two vertices of \(V_k=\{u_{k,1}, u_{k,2}, u_{k,3}\}\) after her second move (when \(a_k=3\)); thus, in each case, \({R}^*\) fails to occupy vertices that form a resolving set of G. Now, we consider the R-game. If \(s=3\) (and thus \(a_i \le 2\) for each \(i\in [k]\)), then \({R}^*\) can occupy two vertices of \(\{u_{1,1}, u_{2,1}, u_{3,1}\}\) after his second move, and occupy exactly one vertex of each pair in \(\cup _{j=4}^{k}\{\{u_{j,1}, u_{j,2}\}\}\) thereafter until he completes his \((k-1)^{\mathrm{th}}\) move. If \(a_k=3\) (and thus \(s \le 2\) and \(a_i \le 2\) for each \(i \in [k-1]\)), then \({R}^*\) can occupy two vertices of \(V_k=\{u_{k,1}, u_{k,2}, u_{k,3}\}\), after his second move, and occupy additional vertices (if any) thereafter as follow: (1) if \(s=0\), then \({R}^*\) can occupy exactly one vertex of each pair in \(\cup _{i=1}^{k-1}\{\{u_{i,1}, u_{i,2}\}\}\); (2) if \(s=1\), then \({R}^*\) can occupy exactly one vertex of each pair in \(\cup _{i=2}^{k-1}\{\{u_{i,1}, u_{i,2}\}\}\); (3) if \(s=2\), then \({R}^*\) can occupy exactly one vertex of each pair in \(\{\{u_{1,1}, u_{2,1}\}\} \cup (\cup _{i=3}^{k-1}\{\{u_{i,1}, u_{i,2}\}\})\). So, in each case of the R-game, the vertices chosen by \({R}^*\) form a resolving set of G; thus, \({R}^*\) wins. Therefore, \(o(G)={\mathcal {N}}\).

Third, suppose that \(\max \{s, a_i\} \le 2\) for each \(i\in [k]\). If \(s=0\), then \(\cup _{i=1}^{k}\{\{u_{i,1}, u_{i,2}\}\}\) is a dim-pairing resolving set of G. If \(s=1\), then \(\cup _{i=2}^{k}\{\{u_{i,1}, u_{i,2}\}\}\) is a dim-pairing resolving set of G. If \(s=2\), then \(\{\{u_{1,1}, u_{2,1}\}\} \cup (\cup _{i=3}^{k}\{\{u_{i,1}, u_{i,2}\}\})\) is a dim-pairing resolving set of G. In each case, \(o(G)={\mathcal {R}}\) by Proposition 3.3 and \(R_\mathrm{MB}(G)=R'_{\mathrm{MB}}(G)=\dim (G)\) by Corollary 3.4. \(\square \)

4.5 Some Grid-Like Graphs

The Cartesian product \(G \,\square \,H\) of graphs G and H is the graph with the vertex set \(V(G) \times V(H)\) such that (uv) is adjacent to \((u', v')\) if and only if either \(u = u'\) and \(vv' \in E(H)\), or \(v= v'\) and \(uu' \in E(G)\). Products \(P_s \,\square \,P_t\) are known as grid graphs. For the rest of this section we set \(V(P_s) = \{u_1, \ldots , u_s\}\) and \(V(P_t) = \{v_1, \ldots , v_t\} \), see Fig. 6 for the labeling of \(P_8 \,\square \,P_4\).

Fig. 6
figure 6

Labeling of \(P_8 \,\square \,P_4\)

Recall the following results of grid graphs.

Proposition 4.13

[5] If \(s,t \ge 2\), then \(\dim (P_s \,\square \,P_t)= 2\).

Lemma 4.14

[11] Let \(s,t \ge 2\), and let \(W_1 = \{(u_1,v_1),(u_1,v_t)\}\), \(W_2= \{(u_1,v_1),(u_s,v_1)\}\), \(W_3=\{(u_1,v_t),(u_s,v_t)\}\), and \(W_4=\{(u_s,v_1),(u_s,v_t)\}\). Then, W is a metric basis of \(P_s \,\square \,P_t\) if and only if \(W=W_i\) for some \(i \in [4]\).

For the MBRG on grid graphs we have:

Proposition 4.15

If \(s,t \ge 2\), then \(o(P_s \,\square \,P_t)={\mathcal {R}}\) and

$$\begin{aligned} R_{\mathrm{MB}}(P_s \,\square \,P_t) = R'_{\mathrm{MB}}(P_s \,\square \,P_t) = \dim (P_s \,\square \,P_t)=2. \end{aligned}$$

Proof

Since \(\{\{(u_1, v_1),(u_s,v_t)\}, \{(u_s,v_1),(u_1,v_t)\}\}\) is a dim-pairing resolving set of \(P_s \,\square \,P_t\), Proposition 3.3 implies that \(o(P_s \,\square \,P_t)={\mathcal {R}}\). Moreover, \(R_{\mathrm{MB}}(P_s \,\square \,P_t) = R'_\mathrm{MB}(P_s \,\square \,P_t) = \dim (P_s \,\square \,P_t)\) by Corollary 3.4. \(\square \)

Continuing with some grid-related graphs, we next study how the MBRG behaves on the torus grid graphs, that is, the Cartesian product of cycles. We recall the following results that will be used in proving Proposition 4.19.

Theorem 4.16

[5] If \(s,t \ge 3\), then

$$\begin{aligned} \dim (C_s\,\square \,C_t)=\left\{ \begin{array}{ll} 3; &{}\quad s \text{ or } t \text{ is } \text{ odd, }\\ 4; &{}\quad s \text{ and } t \text{ are } \text{ even. } \end{array} \right. \end{aligned}$$

Proposition 4.17

[5] Let \(s,t \ge 3\) be integers.

  1. (a)

    If s is odd, let \(W=\{x,y,z\} \subseteq V(C_s\,\square \,C_t)\) such that xy are diametral in a copy of \(C_s\), and z is adjacent to x in a copy of \(C_t\). Then, W is a metric basis for \(C_s\,\square \,C_t\).

  2. (b)

    If s and t are even, let \(W=\{x,y,z,w\} \subseteq V(C_s\,\square \,C_t)\) such that xy are diametral in a copy of \(C_s\), z is adjacent to x in a copy of \(C_s\), and w is adjacent to x in a copy of \(C_t\). Then, W is a metric basis for \(C_s\,\square \,C_t\).

Lemma 4.18

[5] For even integers \(s,t\ge 4\), let W be a resolving set of \(C_s\,\square \,C_t\) with \(u\in W\). If u and \(u'\) are diametral in \(C_s \,\square \,C_t\), then \((W-\{u\})\cup \{u'\}\) is also a resolving set of \(C_s \,\square \,C_t\).

Proposition 4.19

If \(s,t \ge 3\), then \(o(C_s \,\square \,C_t)={\mathcal {R}}\) and

$$\begin{aligned} R_{\mathrm{MB}}(C_s \,\square \,C_t) = R'_{\mathrm{MB}}(C_s \,\square \,C_t) = \dim (C_s \,\square \,C_t). \end{aligned}$$

Proof

Let \(s,t\ge 3\) be integers and consider the following two cases.

Case 1: s and t are even.

Let \(W=\{x,y,z,w\}\) be a metric basis for \(C_s \,\square \,C_t\) as described in Proposition 4.17(b); note that no two vertices in W are diametral in \(C_s \,\square \,C_t\). Let \(x', y', z'\), and \(w'\) be diametral vertices of xyz, and w, respectively, in \(C_s \,\square \,C_t\). Then, Lemma 4.18 implies that \(\{\{x,x'\}, \{y,y'\}, \{z,z'\}, \{w,w'\}\}\) is a dim-pairing resolving set of \(C_s \,\square \,C_t\), and hence Proposition 3.3 and Corollary 3.4 yield the conclusion.

Case 2: s is odd.

First, we consider the R-game. Suppose \(R^*\) selects an arbitrary vertex, say x, in \(C_s\,\square \,C_t\) on his first move. Note that there are two distinct vertices, say y and \(y'\), that are diametral to x in the copy of \(C_s\) containing x and there are two distinct vertices, say z and \(z'\), that are adjacent to x in the copy of \(C_t\) containing x. By Proposition 4.17(a), the set \(\{x,y^*, z^*\}\), where \(y^*\in \{y,y'\}\) and \(z^*\in \{z,z'\}\), is a metric basis for \(C_s \,\square \,C_t\). Since \(R^*\) can select a vertex in \(\{y,y'\}\) and a vertex in \(\{z,z'\}\) in his second and third move, \(R^*\) wins the R-game.

Second, we consider the S-game. Suppose \(S^*\) selects a vertex, say \(x'\), in \(C_s\,\square \,C_t\) on her first move. Then, \(R^*\) can choose a neighbor x of \(x'\) in the copy of \(C_t\) that contains \(x'\). Note that there are two distinct vertices, say y and \(y'\), that are diametral to x in the copy of \(C_s\) containing x and there are two distinct vertices, say \(z_1\) and \(z_1'\) (\(z_2\) and \(z'_2\), respectively), that are adjacent to y (\(y'\), respectively) in the copy of \(C_t\) containing y (\(y'\), respectively). By Proposition 4.17(a), both \(\{x,y, z_1^*\}\) and \(\{x,y',z_2^*\}\), where \(z_1^*\in \{z_1,z'_1\}\) and \(z_2^*\in \{z_2,z'_2\}\), form metric bases for \(C_s \,\square \,C_t\). So, \(R^*\) can select a vertex in \(\{y,y'\}\) on his second move. If \(R^*\) selects y on his second move, he can select a vertex in \(\{z_1,z'_1\}\) in his third move; if \(R^*\) selects \(y'\) on his second move, he can select a vertex in \(\{z_2,z'_2\}\) in his third move. In each case, \(R^*\) wins the S-game.

Therefore, we conclude that \(o(C_s \,\square \,C_t)={\mathcal {R}}\) and \(R_\mathrm{MB}(C_s \,\square \,C_t) = R'_{\mathrm{MB}}(C_s \,\square \,C_t) = \dim (C_s \,\square \,C_t)\)\(\square \)

In concordance with the previous results for the Cartesian product of two paths and of two cycles, we suspect that a result in the style of Propositions 4.15 and 4.19 can also be deduced for the Cartesian product of a cycle with a path.

5 Concluding Remarks

Erdős and Selfridge introduced the Maker–Breaker game back in 1973. In this paper, we initiate the study of this game in the context of the metric dimension of graphs. Our study raises new and interesting questions; below we indicate a few of them.

Question 5.1

It is known that determining the metric dimension of a general graph is an NP-hard problem (see [13]). What can we say about the computational complexity of determining the outcome of MBRG?

Question 5.2

For product graphs G, such as the Cartesian product, the lexicographic product, the corona product, and the direct product, can we determine o(G), as well as \(R_{\mathrm{MB}}(G)\) and \(R'_\mathrm{MB}(G)\) (or \(S_{\mathrm{MB}}(G)\) and \(S'_{\mathrm{MB}}(G)\))?

Question 5.3

It is easy to see that \(R_{\mathrm{MB}}(G)=1\) (\(R'_{\mathrm{MB}}(G)=1\), respectively) if and only if \(G=P_n\) for \(n \ge 2\). For any positive integer \(k\in [\lfloor \frac{n(G)}{2}\rfloor ]-\{1\}\), can we characterize graphs G satisfying \(R_{\mathrm{MB}}(G)=k\) as well as \(R'_{\mathrm{MB}}(G)=k\)?