The fitness function should be defined for the solution to meet the specification of the optimal solution. Each problem has different fitness function, there is no particular rule that defines what fitness function should be used for a particular problem.
Fitness function should be clearly defined, giving the reader clarity on it.
Fitness function should be implemented efficiently, not bottleneck the algorithm
Fitness function should quantitatively measure how fit a given solution is
Fitness function should generate intuitive result
Fitness function has to be something that measures how good the solution is given the problem. It should be able to handle the solutions generated and show how to improve them.
The function should give low values for bad solution and high values for good solution.
TL;DR
The fitness function should be defined for the solution to meet the specification of the optimal solution. Each problem has different fitness function, there is no particular rule that defines what fitness function should be used for a particular problem.
Article Link
How to define a fitness function in a genetic algorithm
Author
Vijini Mallawaarachchi
Key Takeaways
Fitness function should meet these requirements:
Fitness function has to be something that measures how good the solution is given the problem. It should be able to handle the solutions generated and show how to improve them.
The function should give low values for bad solution and high values for good solution.