Search⌘ K
AI Features

Crafting Fitness Functions

Explore how to craft fitness functions that evaluate chromosomes effectively in genetic algorithms. Learn about the role of heuristics, schemas, and fitness landscapes to better guide solution optimization.

Objectives of fitness functions

In the previous few lessons, we explored the importance of evaluation through the context of a modified knapsack problem. While the problem shows the importance of crafting a good fitness function, we learned only one way to evaluate a specific type of problem. Countless problems exist, each requiring unique evaluation tools. Unfortunately, we can’t generalize one fitness function to all problems. We need to fully understand what fitness functions aim to accomplish.

Understanding fitness

Recall from the lesson Role of Exploration and Exploitation in Genetic Algorithms, the problem of being lost in the woods. Now imagine that some of the trees are marked, indicating how close we are to escaping the woods. The markings on the trees show the value of your current position; they tell you how to navigate the woods and where to go next. Without this information, we’d likely never escape.

Fitness is, in essence, the same as the markings on the trees. Specifically, fitness is the value ...