Solution (source code)

= Solution

Let the square contain the Euclidean ball of radius $R$, set $r_x=\max(1,\lVert x\rVert)$, and define the logarithmic cutoff
$$
\varphi_x=
\begin{cases}
1,&r_x=1,\\
\dfrac{\log(R/r_x)}{\log R},&1<r_x<R,\\
0,&r_x\geq R.
\end{cases}
$$
Then $\varphi_0=1$ and $\varphi=0$ on the boundary. On an edge at radius comparable to $r$, the <mean value theorem> gives $|\varphi_x-\varphi_y|\leq C/(r\log R)$. There are $O(r)$ edges in the annulus of radius $r$, hence the <discrete Dirichlet energy> satisfies
$$
\sum_{xy\in\bar E}(\varphi_x-\varphi_y)^2
\leq\frac C{(\log R)^2}\sum_{r=1}^{R}\frac1r
\leq\frac C{\log R}\longrightarrow0.
$$
This logarithmic cutoff is the discrete manifestation of recurrence in two dimensions.