I'm using the code below to generate the grid, however it's not connecting all points in the grid.
Could anyone help with this? Thank you!
\begin{tikzpicture}[darkstyle/.style={circle,draw,minimum size=9}]
\foreach \x in {1, 2, 3}
\foreach \y in {1, 2, 3}
{\pgfmathtruncatemacro {\label}{\x \y}
\node [darkstyle] (\x\y) at (1.5*\x,1.5*\y) {$U_{\label}$};}
\foreach \x in {1,2,3}
\foreach \y [count=\yi] in {1,2}
\draw (\x\y)--(\x\yi) (\y\x) --(\yi\x) ;
\end{tikzpicture}
\pgfmathtruncatemacro {\label}{\x \y}
, you could use\node [darkstyle] (\x\y) at (1.5*\x,1.5*\y) {$U_{\x\y}$};}
without any detour. – user121799 Nov 16 '18 at 14:00