Hello everyone,
I work on a game in which you have to fill a grid with a minimum of moves.
Here are the rules :
My method is to suppose that the minimum of move is the number of white cells plus n = 0 blue cells ans to find solutions. If I don't then I try with n+1 blue cell etc.. For each hypothesis I create every possible path, and I have to gradually analyze them with an algorithm which will tell me if they are good or not.
My problem is that I don't know how to create the algorithm I need.
Let's take this grid for example :
To fill it the shortest way I have found (by trying) that the path has to go through 4 blue cells. There is several possible paths and all of them go through 4 blue cells, which become white and they go through them again.
I am trying to create that algorithm which will analyse the grid and will tell me how many blue cells has to be gone through, but I don't know where to begin.
Do you think this is a problem mathematics can solve? If yes, which field?
Thanks for reading me.
I work on a game in which you have to fill a grid with a minimum of moves.
Here are the rules :
- Starting on the cell with a black square, we move on the grid horizontally or vertically.
- When we move on a cell we invert its color (white cell becomes blue and blue cell becomes white).
- We can move on a cell multiple times and each time we invert its color.
My method is to suppose that the minimum of move is the number of white cells plus n = 0 blue cells ans to find solutions. If I don't then I try with n+1 blue cell etc.. For each hypothesis I create every possible path, and I have to gradually analyze them with an algorithm which will tell me if they are good or not.
My problem is that I don't know how to create the algorithm I need.
Let's take this grid for example :

To fill it the shortest way I have found (by trying) that the path has to go through 4 blue cells. There is several possible paths and all of them go through 4 blue cells, which become white and they go through them again.
I am trying to create that algorithm which will analyse the grid and will tell me how many blue cells has to be gone through, but I don't know where to begin.
Do you think this is a problem mathematics can solve? If yes, which field?
Thanks for reading me.