  We consider the nonlinear Schr\"{o}dinger equation $-\Delta u+(\lambda
a(x)+1)u=|u|^{p-1}u$ on a locally finite graph $G=(V,E)$. We prove via the
Nehari method that if $a(x)$ satisfies certain assumptions, for any
$\lambda>1$, the equation admits a ground state solution $u_\lambda$. Moreover,
as $\lambda\rightarrow \infty$, the solution $u_\lambda$ converges to a
solution of the Dirichlet problem $-\Delta u+u=|u|^{p-1}u$ which is defined on
the potential well $\Omega$. We also provide a numerical experiment which
solves the equation on a finite graph to illustrate our results.
