Consider the following "board":
$$\begin{bmatrix} 1 & 0 & 0 & 0 & 1\\ 0 & 0 & 1 & 0 & 0\\ 0 & 1 & 1 & 1 & 0\\ 0 & 0 & 1 & 0 & 0\\ 1 & 0 & 0 & 0 & 1 \end{bmatrix}$$
We have an operation such that flipping any of the $1$'s in the $a_{i,j}$ position will also flip the state of the $a_{i+1,j}, a_{i-1,j}, a_{i,j+1}, a_{i,j-1}$ from a 0 to a 1 or vice versa for $i,j \in\{1,\dots,5\}$ (We may not choose an $a_{i,j}$ if $a_{i,j} = 0$). In the case when $i$ or $j = 0$ or $i$ or $j = 6$, the board wraps around such that $0 = 5$ and $6 = 1$.
For example:
$$\begin{bmatrix} 1 & 0 & 0 & 0 & 1\\ 0 & 0 & 1 & 0 & 0\\ 0 & 1 & 1 & 1 & 0\\ 0 & 0 & 1 & 0 & 0\\ 1 & 0 & 0 & 0 & 1 \end{bmatrix}\underset{\longrightarrow}{a_{3,3}}\begin{bmatrix} 1 & 0 & 0 & 0 & 1\\ 0 & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 0\\ 1 & 0 & 0 & 0 & 1 \end{bmatrix} \underset{\longrightarrow}{a_{1,1}}\begin{bmatrix} 0 & 1 & 0 & 0 & 0\\ 1 & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 1 \end{bmatrix}\underset{\longrightarrow}{a_{1,2}}\begin{bmatrix} 1 & 0 & 1 & 0 & 0\\ 1 & 1 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 0\\ 0 & 1 & 0 & 0 & 1 \end{bmatrix}$$
However, we may not do
$$\begin{bmatrix} 1 & 0 & 0 & 0 & 1\\ 0 & 0 & 1 & 0 & 0\\ 0 & 1 & 1 & 1 & 0\\ 0 & 0 & 1 & 0 & 0\\ 1 & 0 & 0 & 0 & 1 \end{bmatrix}\underset{\longrightarrow}{a_{1,2}}\begin{bmatrix} 0 & 1 & 1 & 0 & 1\\ 0 & 1 & 1 & 0 & 0\\ 0 & 1 & 1 & 1 & 0\\ 0 & 0 & 1 & 0 & 0\\ 1 & 1 & 0 & 0 & 1 \end{bmatrix}$$
The goal is to choose a sequence of $a_{i,j}$'s such that there is exactly a single $1$ left on the board.
I am interested in knowing what kind of mathematics is used to determine a solution, or know the existence of a solution given any initial board.
In the example I've given here, one solution is $a_{1,1},a_{1,2},a_{1,3}, a_{1,4},a_{1,5},a_{2,2},a_{2,4},a_{5,3}$. That is,
$$\begin{bmatrix} 1 & 0 & 0 & 0 & 1\\ 0 & 0 & 1 & 0 & 0\\ 0 & 1 & 1 & 1 & 0\\ 0 & 0 & 1 & 0 & 0\\ 1 & 0 & 0 & 0 & 1 \end{bmatrix}\underset{\longrightarrow}{a_{1,1}} \begin{bmatrix} 0 & 1 & 0 & 0 & 0\\ 1 & 0 & 1 & 0 & 0\\ 0 & 1 & 1 & 1 & 0\\ 0 & 0 & 1 & 0 & 0\\ 0 & 0 & 0 & 0 & 1 \end{bmatrix}\underset{\longrightarrow}{a_{1,2}} \begin{bmatrix} 1 & 0 & 1 & 0 & 0\\ 1 & 1 & 1 & 0 & 0\\ 0 & 1 & 1 & 1 & 0\\ 0 & 0 & 1 & 0 & 0\\ 0 & 1 & 0 & 0 & 1 \end{bmatrix}\underset{\longrightarrow}{a_{1,3}}\\\begin{bmatrix} 1 & 1 & 0 & 1 & 0\\ 1 & 1 & 0 & 0 & 0\\ 0 & 1 & 1 & 1 & 0\\ 0 & 0 & 1 & 0 & 0\\ 0 & 1 & 1 & 0 & 1 \end{bmatrix}\underset{\longrightarrow}{a_{1,4}}\begin{bmatrix} 1 & 1 & 1 & 0 & 1\\ 1 & 1 & 0 & 1 & 0\\ 0 & 1 & 1 & 1 & 0\\ 0 & 0 & 1 & 0 & 0\\ 0 & 1 & 1 & 1 & 1 \end{bmatrix}\underset{\longrightarrow}{a_{1,5}}\begin{bmatrix} 0 & 1 & 1 & 1 & 0\\ 1 & 1 & 0 & 1 & 1\\ 0 & 1 & 1 & 1 & 0\\ 0 & 0 & 1 & 0 & 0\\ 0 & 1 & 1 & 1 & 0 \end{bmatrix}\underset{\longrightarrow}{a_{2,2}}\\\begin{bmatrix} 0 & 0 & 1 & 1 & 0\\ 0 & 0 & 1 & 1 & 1\\ 0 & 0 & 1 & 1 & 0\\ 0 & 0 & 1 & 0 & 0\\ 0 & 1 & 1 & 1 & 0 \end{bmatrix}\underset{\longrightarrow}{a_{2,4}}\begin{bmatrix} 0 & 0 & 1 & 0 & 0\\ 0 & 0 & 0 & 0 & 0\\ 0 & 0 & 1 & 0 & 0\\ 0 & 0 & 1 & 0 & 0\\ 0 & 1 & 1 & 1 & 0 \end{bmatrix}\underset{\longrightarrow}{a_{5,3}}\begin{bmatrix} 0 & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 0\\ 0 & 0 & 1 & 0 & 0\\ 0 & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 0 \end{bmatrix}$$
There are other solutions that do not seem equivalent up to some reasonable definition of symmetry such as $a_{1,1},a_{5,5},a_{5,1},a_{1,5},a_{2,3},a_{4,3},a_{3,2},a_{3,4},a_{1,4},a_{5,2},a_{2,5},a_{4,1}$.
Thoughts I wrote up the "board" as an adjacency matrix hoping the solution can be solved by linear algebra, but I don't think there is a way to use elementary row operations, or things such as the rank of the matrix to glean any insight into the problem.
Aside from that, both of these solutions end with a $1$ in the middle, however, since the board wraps around, I am pretty certain that the final $1$'s position doesn't matter and it's sufficient to consider only solutions that leave the $1$ in the middle.
What area of mathematics has the best tool to solve this problem? I assume this is already equivalent to something well known in algebra or graph theory, but I have no idea what it might be.