It is also helpful to see how other GAs that try to solve the map-labeling problem cope with the problems sketched above.
Three other GAs that solve the map-labeling problem are known: the GAs by Djouadi,18 by Verner et al.,107 and by Raidl.79 We will not discuss the GA by Djouadi in this thesis, since he uses rather unorthodox methods and does not give results which can be used to compare against.
In the light of the analysis of the previous subsection, it is interesting to see how the GAs of Verner et al. and Raidl cope with the problems of disruption and obtaining good mixing. Both algorithms report good performance, similar or slightly better than the simulated-annealing algorithm of Christensen et al. We
will say more about the latter study in Section 3.3, where we will discuss compar- isons with the GAs.
The GA of Verner et al.
The GA of Verner et al. uses fitness-proportionate selection and the same genera- tional replacement scheme that was described in Chapter 2 (shown in Algorithm 1 on page 19). The encoding is the same as described in Section 3.1. The fitness function (to be minimized) is a sum of several subfunctions:
ffit(x) = w1· overlap(x) + w2· area(x) − w3· distFact(x) + w4· pref (x) .
The number of overlapping labels is measured by overlap(·) and the total area of all overlapping labels is given by area(·). The function distFact(·) measures the distance factor of a point feature with an overlapping label, defined as the sum of distances from the center of its label and the centers of the labels from the four nearest features. The distance factor of a point feature with a non-intersecting label is zero. The last subfunction, pref (·), gives a measure of quality for the placement of the label with respect to the preferred positions. The weighting factors w1. . . w4were empirically set.
Crossover occurs with probability Prc= 0.9. After crossover, mutation stores
a randomly-chosen allele in a randomly-chosen gene with a probability of 0.1. The crossover operator battles disruption by using masking to preserve building blocks. Each chromosome has a bit string, or mask, associated with it. A bit is set to 1 for a specific gene if the corresponding point has a good labeling. A labeling for a point is considered good when the label does not intersect another label, and the point is not a neighbor of a point with an intersecting label. Otherwise, the labeling is considered bad. A neighbor of a point p is defined as one of the four points that are closest to p (using the Euclidean metric). Note the contrast with our use of a rival, where the number of rivals of a point is related to the density of the map.
Crossover is performed by looking at a random bit mask and the two masks of the parents (see Figure 3.9). For every location an allele is copied to a child from either the first or the second parent, depending on the mask. If the mask of the first parent signifies that the location is good, the contents are copied to the first child. If the mask of the second parent signifies a bad location, the contents of the first parent is also copied to the second child. If the masks of both parents signify a bad location, the random bit mask determines whether to copy from the first or the second parent. The procedure is symmetric for the other child. So if a location is considered good in one parent and bad in the other parent, both children get the information from the same parent.
3.2 Applying theoretical insights 47
Figure 3.9: The crossover operator of the GA by Verner et al.
This scheme, although very exploitive, works quite well. Results are given in Section 3.3. If masking is turned off, the crossover is simply uniform crossover and performance drops. It is clear that knowledge about the structure of the prob- lem is used to make the GA work well. It is used when it is decided whether an allele should survive crossover, which depends on the placement of the labels of close-by points. Disruption is reduced by preserving good labelings.
The GA of Raidl
The GA of Raidl uses tournament selection and an incremental replacement scheme. In this scheme, an iteration starts with selecting two parents. Crossover is applied with probability Prc. If no crossover is performed, two copies are made of the
parents. The resulting individuals are immediately placed back in the population, replacing the worst individuals. The encoding is again the same as described in Section 3.1. The fitness function (to be minimized) is expressed as follows:
ffit(x) = overlap(x) +
l
∑
i=1
normPref (xi) ,
where normPref (·) gives a penalty for the position of a label, and l is the length of the chromosome. The penalty is normalized, which means that the improvement of the fitness by placing an intersected label in a free position is never less than the penalty for that position. This way the GA also optimizes for position preferences, without degrading the number of free labels. Note that the use of weighting factors is carefully avoided.
Uniform crossover is always applied, and mutation is applied with probability 0.01 for each newly created individual. Mutation stores a randomly-chosen allele at a randomly-chosen gene.
The disruption of uniform crossover is repaired by using a local optimizer. The local optimizer examines all the labels of the map and, if possible, moves each to
a more desirable position. If the label intersects another label, any position where the label can be placed freely is more desirable. A position is also more desirable when it is more preferred in the order of positions.