I have the shape file for DC PSA's as defined in 2012 (see below). I would like to be able to identify in semi-automatic fashion which PSA's are neighbors - that is, which PSA's are nearest neighbors to one another (for example, 201 and 401 are nearest neighbors).
With this information, one could define a sort of spatial distance metric between PSA $i$ and PSA $j$, call it $d(i,j)$, populating a distance matrix, call it $D$. Then $d(i,j)=0$ is pure autocorrelation (it is the diagonal of $D$). If $d(i,j)=1$, you have nearest neighbor spatial autocorrelation. One can then handle $d(i,j)>1$ separately. With certain physical systems this seems like a simplistic but natural way of thinking about distance.
Does anyone know of a simple way to be able to calculate $d(i,j)$ as define here, without doing it manually?