# How can I calculate the "mean best fitness" measure in genetic algorithms?

I've just started to learn genetic algorithms and I have found these measurements of runs that I don't understand:

MBF: The mean best fitness measure (MBF) is the average of the best fitness values over all runs.

AES: The average number of evaluation to solution.

I have an initial random population. To evolve a population I do:

1. Tournament selection
2. One point crossover.
3. Random resetting.
4. Age based replacement with elitism (I replace the population with all offsprings generated).
5. If I have generated G generations (in other words, I have repeated these four points G times) or I have found the solution, the algorithm ends, otherwise, it comes back to point 1.

Is the mean of the best fitness the mean fitness of all of each generations (G best fitness)?

MBF = (BestFitness_0 + ... + BestFitness_G) / G


I'm not English and I don't understand the meaning of "run" here.

The typical way you'll see a GA measured is that an algorithm with a population size of $$N$$ is ran $$K$$ times from new random seeds each time. That gives you $$K$$ total runs of the algorithm, each of which, at the end, had a final population of $$N$$ individuals. If you take the best of those $$N$$ from each run, you get $$K$$ "best" solutions found. The average fitness value of those $$K$$ solutions is your MBF.
For sudoku, you might have a fitness function that counted the number of rows, columns, or blocks that don't contain the correct digits of 1-9 and you minimize that function. You run your algorithm $$K$$ times from random seeds, and for each run, you record how many times you had to evaluate that fitness function before you found a $$0$$ (i.e., the puzzle was successfully solved). Average all $$K$$ of those counts, and that's your AES.