Trying to create a path algorithm

Joined
Nov 2, 2021
Messages
3
Reaction score
2
Hello everyone,

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.
When I generate a grid I need to know the minimum number of moves and every solution.

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 :

T4uzm.jpg


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.
 
Hello everyone,

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.
When I generate a grid I need to know the minimum number of moves and every solution.

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 :

T4uzm.jpg


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.

Here is a group of 4 better math forums that can help you with advanced mathematics:

mathhelpforum.com

freemathhelp.com

mathhelpboard.com

mathforums.com

Good luck.
 


Write your reply...

Members online

No members online now.

Forum statistics

Threads
2,529
Messages
9,858
Members
696
Latest member
fairdistribution
Back
Top