TITLE: Largest sphere in a "grid graph"
QUESTION [6 upvotes]: Let $G=(V,E)$ be an undirected graph, such that $V$ is a subset of
$\{1,\dotsc,N\} \times \{1,\dotsc,N\}$ and there is an edge between $2$ vertices if and only if they have one identical coordinate and differ by exactly $1$ in the other coordinate (we can think about it as a grid, with some points omitted, such that we can move up/down/right/left).
The graph $G$ defines a metric (by $d(v_1,v_2)=$minimum number of edges in a path from $v_1$ to $v_2$).
A sphere is defined as usual: for $v \in V$, we let
$S(v,r)=\{u \in V \mid d(v,u)=r\}$.
What is $\max\limits_{v,r}|S(v,r)|$? An asymptotic expression in terms of $N$ would be enough. I strongly suspect it is $O(N)$ because that is what we get if $V=\{1,\dotsc,N\} \times \{1,\dotsc,N\}$ (i.e: no point omitted) and take $v=(N/2,N/2)$ and $r=N/2$.

REPLY [6 votes]: It is possible to achieve a sphere of size $O(n^2)$ by using "the H fractal".
Define
$$V=\left\{
(x,y)\in\{1,\ldots,N\}\times\{1,\ldots,N\}
{\ \Huge|\ }
\begin{aligned}
2\mid x \ \ \wedge\ \ l(x)+1 \in g(y) \\
or\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \,\,\\
4\mid y \ \ \wedge\ \ l(y) \in g(x) \ \ \ \ \ \ \ \,\,
\end{aligned}
\right\}$$
where $g(n)$ is the set of $k$ for which the binary "$2^k$s" and "$2^{k+1}$s" digits of $n$ differ, and $l(n)=\mbox{min}(g(n))$.
Here is a picture for $N=15$.
   . . . . . . . # . . . . . . .
   . # . . . # . # . # . . . # .
   . # . . . # . # . # . . . # .
   . # # # # # . # . # # # # # .
   . # . # . # . # . # . # . # .
   . # . # . # . # . # . # . # .
   . . . # . . . # . . . # . . .
   . . . # # # # # # # # # . . .
   . . . # . . . . . . . # . . .
   . # . # . # . . . # . # . # .
   . # . # . # . . . # . # . # .
   . # # # # # . . . # # # # # .
   . # . . . # . . . # . . . # .
   . # . . . # . . . # . . . # .
   . . . . . . . . . . . . . . .

The size of a large sphere centered at the top, when $N$ is a power of 2, is $N^2/16$.  Considering the connectivity as $N$ grows, we can see that for all $N$, there is a sphere of size at least $N^2/36$.

(The problem with "the Plus fractal" (underlying Joriki's very nice animations) is that although it is space-filling, the nearest of the four pluses (not drawn in those animations) is closer than the other three and so does not contribute to the sphere.  The H fractal doesn't have this problem because the route to any part of the H starts by going to the center.)

[added by joriki]
Here's an animation for this very nice solution – as with the others, you can right-click to open it in a new window in full size or open it in Mac OS Preview to browse the individual frames at leisure.
very nice solution http://home.arcor.de/joriki/hfractal.gif