A set of vertices W {\em resolves} a graph G if every vertex of G is
uniquely determined by its vector of distances to the vertices in W. The {\em
metric dimension} for G, denoted by dim(G), is the minimum cardinality of
a resolving set of G. In order to study the metric dimension for the
hierarchical product G2u2⊓G1u1 of two rooted graphs
G2u2 and G1u1, we first introduce a new parameter, the {\em
rooted metric dimension} \rdim(G_1^{u_1}) for a rooted graph G1u1. If
G1 is not a path with an end-vertex u1, we show that
\dim(G_2^{u_2}\sqcap G_1^{u_1})=|V(G_2)|\cdot\rdim(G_1^{u_1}), where
∣V(G2)∣ is the order of G2. If G1 is a path with an end-vertex u1,
we obtain some tight inequalities for dim(G2u2⊓G1u1).
Finally, we show that similar results hold for the fractional metric dimension.Comment: 11 page