\begin{tikzpicture}[
    squarednode/.style={rectangle, draw=black!20, fill=white!5, very thick, minimum size=5mm},
    squarednodeG/.style={rectangle, draw=black!20, fill=green!20, very thick, minimum size=5mm},
    squarednodeY/.style={rectangle, draw=black!20, fill=yellow!20, very thick, minimum size=5mm},
    ]
    ;
    \node[squarednodeG] at (0.25,0.25) (int) {1};
    \node[squarednodeG] at (0.75,0.25) (int) {2};
    \node[squarednode] at (1.25,0.25) (int) {4};
    \node[squarednode] at (1.75,0.25) (int) {7};
    \node[squarednodeG] at (0.25,0.75) (int) {3};
    \node[squarednodeG] at (0.75,0.75) (int) {5};
    \node[squarednode] at (1.25,0.75) (int) {8};
    \node[squarednodeG] at (0.25,1.25) (int) {6};
    
    \draw[step=0.5,gray, very thin] (0,0) grid (3,2);
    \draw (0,2)--(3,0);
    \draw[very thick] (0,0)--(2,0)--(2,0.5)--(1.5,0.5)--(1.5,1)--(0.5,1)--(0.5,1.5)--(0,1.5)--cycle;
    \draw[green, ultra thick] (0,0)--(1,0)--(1,1)--(0.5,1)--(0.5,1.5)--(0,1.5)--cycle;
    
    \draw[->] (3.5,1) --(4.5,1);
    
    \node[squarednodeY] at (5.25,0.25) (int) {1};
    \node[squarednodeY] at (5.75,0.25) (int) {2};
    \node[squarednode] at (6.25,0.25) (int) {4};
    \node[squarednode] at (6.75,0.25) (int) {7};
    \node[squarednodeG] at (5.25,0.75) (int) {3};
    \node[squarednodeG] at (5.75,0.75) (int) {5};
    \node[squarednode] at (6.25,0.75) (int) {8};
    \node[squarednodeG] at (5.25,1.25) (int) {6};
    \draw[step=0.5,gray, very thin] (5,0) grid (8,2);
    \draw (5,2)--(8,0);
    \draw[very thick] (5,0)--(7,0)--(7,0.5)--(6.5,0.5)--(6.5,1)--(5.5,1)--(5.5,1.5)--(5,1.5)--cycle;
    \draw[green, ultra thick] (5,0)--(6,0)--(6,1)--(5.5,1)--(5.5,1.5)--(5,1.5)--cycle;
    \draw[->, red!60, thick] (5.25,1.1) -- (5.25,0.4);
    \draw[->, red!60, thick] (5.75,0.6) -- (5.75,0.4);
    \draw[->, red!60, thick] (6.1,0.125) -- (5.4,0.125);
    \draw[->, red!60, thick] (6.1,.375) -- (5.9,0.375);
    
    \end{tikzpicture}