I'm trying to create a GA to solve Sudoku problems. For this i have to create a population, i am using a class to hold the 9 by 9 grid and the fitness of each grid. However when i iterate through my ArrayList which holds the populate i am generating random numbers to fill in all the blank squares. However what happens is that every grid turns out the same. The random number works and is generating random numbers but it creates the same numbers for each grid. Heres my code:

suduko su = new suduko();

su.grid = game;

Random Random = new Random();

int dummy = 0;

for (int i = 0; i < PopSize; i++) pop.Add(su);

// populate population with random numbers

for (int k = 0; k < PopSize; k++)

{

for (int i = 0; i < 9; i++)

{

for (int j = 0; j < 9; j++)

{

dummy = Random.Next(1, 10);

if (((suduko)pop[k]).grid[i, j] == 0) ((suduko)pop[k]).grid[i, j] = dummy;

}

}

//((suduko)pop[k]).Fitness = fitness((suduko)pop[k]);

}

I don't quite know whats going on with the random number becuase i am not creating a new number just calling next every time. By chance does the number repeat itself every 81 times

Thanks

Daniel