Niching and sharing
In nature, all environments are further divided into multiple sub-environments, or niches, populated by various species taking advantage of the unique resources available in each niche, such as food and shelter. For example, a forest environment is comprised of treetops, shrubs, the forest floor, tree roots, and so on; each of these accommodates different species that are specialized for living in that niche and take advantage of its resources.
When several different species coexist in the same niche, they all compete over the same resources, and a tendency is created to search for new, unpopulated niches and populate them.
In the realm of genetic algorithms, this niching phenomenon can be used to maintain the diversity of the population, as well as to find several optimal solutions, each considered a niche.
For example, suppose our genetic algorithm seeks to maximize a fitness function that has several peaks of varying heights, such as the one in the following...