  We study positive solutions of the following semilinear equation
$$\varepsilon^2\Delta_{\bar g} u - V(z) u+ u^{p} =0\,\hbox{ on }\,M, $$ where
$(M, \bar g )$ is a compact smooth $n$-dimensional Riemannian manifold without
boundary or the Euclidean space $\mathbb R^n$, $\varepsilon$ is a small
positive parameter, $p>1$ and $V$ is a uniformly positive smooth potential.
Given $k=1,\dots,n-1$, and $1 < p < \frac{n+2-k}{n-2-k}$. Assuming that $K$ is
a $k$-dimensional smooth, embedded compact submanifold of $M$, which is
stationary and non-degenerate with respect to the functional $\int_K
V^{\frac{p+1}{p-1}-\frac{n-k}{2}}dvol$, we prove the existence of a sequence
$\varepsilon=\varepsilon_j\to 0$ and positive solutions $u_\varepsilon$ that
concentrate along $K$. This result proves in particular the validity of a
conjecture by Ambrosetti-Malchiodi-Ni, extending a recent result by
Wang-Wei-Yang, where the one co-dimensional case has been considered.
Furthermore, our approach explores a connection between solutions of the
nonlinear Schr\"{o}dinger equation and $f$-minimal submanifolds in manifolds
with density.
