A set of vertices S resolves a connected graph G if every vertex is uniquely
determined by its vector of distances to the vertices in S. The metric dimension of
G is the minimum cardinality of a resolving set of G. Let G ,D be the set of graphs
with metric dimension and diameter D. It is well-known that the minimum order
of a graph in G ,D is exactly + D. The first contribution of this paper is to
characterise the graphs in G ,D with order + D for all values of and D. Such
a characterisation was previously only known for D 6 2 or 6 1. The second
contribution is to determine the maximum order of a graph in G ,D for all values of
D and . Only a weak upper bound was previously known.Postprint (published version