  If $S=\{v_1,\ldots, v_k\}$ is an ordered subset of vertices of a connected
graph $G$ and $e$ is an edge of $G$, then the vector $r_G(e|S) = (d_G(v_1,e),
\ldots, d_G(v_k,e))$ is the edge metric $S$-representation of $e$. If the
vertices of $G$ have pairwise different edge metric $S$-representations, then
$S$ is an edge metric generator for $G$. The cardinality of a smallest edge
metric generator is the edge metric dimension ${\rm edim}(G)$ of $G$. A general
sharp upper bound on the edge metric dimension of hierarchical products
$G(U)\sqcap H$ is proved. Exact formula is derived for the case when $|U| = 1$.
An integer linear programming model for computing the edge metric dimension is
proposed. Several examples are provided which demonstrate how these two methods
can be applied to obtain the edge metric dimensions of some applicable graphs.
