  In a graph G, cardinality of the smallest ordered set of vertices that
distinguishes every element of V (G) is the (vertex) metric dimension of G.
Similarly, the cardinality of such a set is the edge metric dimension of G, if
it distinguishes E(G). In this paper these invariants are considered first for
unicyclic graphs, and it is shown that the vertex and edge metric dimensions
obtain values from two particular consecutive integers, which can be determined
from the structure of the graph. In particular, as a consequence, we obtain
that these two invariants can differ for at most one for a same unicyclic
graph. Next we extend the results to graphs with edge disjoint cycles showing
that the two invariants can differ at most by c, where c is the number of
cycles in such a graph. We conclude the paper with a conjecture that
generalizes the previously mentioned consequences to graphs with prescribed
cyclomatic number c by claiming that the difference of the invariant is still
bounded by c.
