lution for a given map size, for all algorithms discussed. Note the logarithmic scale for the amount of label-intersection tests. Measuring label-intersection tests allows us to compare the genetic algorithms (a population-based approach, requir- ing global evaluations of a map) with simulated annealing (an algorithm using a single search point, and capable of doing local evaluations). The figure doesn’t show results for maps with 1500 points, since we were not able to reliably count the number of label-intersection tests, due to overflow of the counter in some ex- periments. In addition, recall that we used very large population sizes for the GAs, which is of course a disadvantage for the GA. Better running times for the GA can be obtained by using smaller populations—see Chapter 4.
As the maps get more dense, the problem becomes more complex. As a result, we don’t expect a map with double the number of features to require twice the amount of computation, due to the added complexity. For maps with constant density, we show in Chapter 4 that the GA has quadratic scale-up behavior: a map twice as large takes four times as much computation time.
Comparing the running times of simulated annealing with those of our genetic algorithm, we see that SA takes less time on the densest maps. We may conclude, therefore, that it is the algorithm of choice when one wants to solve the basic map- labeling problem on very dense maps. In reality, the map-labeling problem is more complex and multi-faceted. A deciding factor in the choice of algorithm for a map- labeling problem is how well the algorithm is extendible with new cartographic rules. We will discuss this in the next section.
3.4
Discussion
As described in the Chapter 1, there are two reasons why the map-labeling prob- lem is hard:
• The basic, combinatorial problem has a large, complex search space. • The problem can include many cartographic rules of a local nature. A good
labeling strikes a balance between these rules.
In this chapter, we have concentrated on the combinatorial part of the problem, and have developed a genetic algorithm for the basic map-labeling problem. We have shown that it finds good solutions and is competitive with other map-labeling algorithms. We didn’t consider any cartographic rules, but we designed the GA specifically with their incorporation at a later stage in mind. In Chapter 5, we will show how the GA can be extended with cartographic rules.
Figure 3.24: Comparison of running times. Note the logarithmic scale for the amount of label-intersection tests. The following abbreviations are used in the key. “GA” refers to our GA for map labeling. “GA, 8 pos.” is the same GA using the eight-position placement model. “GA, name sel.” is the same GA with integrated name selection. Similarly, “SA” refers to the simulated-annealing algorithm, “SA, 8 pos.” to the variant using the eight-position placement model, and “SA, name sel.” to the variant with name selection. “Vern. GA” refers to our implementation of the GA by Verner et al. “Vern. GA, no neighbors” refers to our implementation of their GA which does not use neighbors (see the discussion on page 67).
3.4 Discussion 73 In order to be a viable solution for the map-labeling problem, an algorithm should be robust. That is, it should be possible to integrate the algorithm in a geographical information system (GIS), where it can be used transparently by the user of the GIS, and easily extended by the maintainer of the algorithm. This means, for example, that we have to be careful in introducing parameters that are difficult to set, like Prc, Prm, and the population size. We have handled these
parameters in a number of ways: Prc can safely be set to 1.0 thanks to the elitist
recombination scheme, and Prmwas set to 0.0 because its role has been taken over
by the geometrically local optimizer. The population size remains as a parameter which has to be set, but there is an intuitive relation between this parameter and the running time of the GA. Using a small population size gives poor solutions, in little time. Using a large population gives better solutions, which takes more time. However, if desired, one can adopt one of the adaptive population-sizing schemes mentioned in Section 2.1.1 (see page 21). In the next chapter we will explore the topic of choosing a good population size further.
It is also important to avoid a tuning phase, for all the reasons mentioned in Section 3.2.3 (on page 49): the cartographic rules can degrade the combinatorial rule, evaluating a map is hard, tuning takes time, and it makes the algorithm inflex- ible. We managed to keep our fitness function simple by using the geometrically local optimizer, in which we will incorporate the cartographic rules.
Summarizing, in order to be robust, the following properties should hold:
• It should be possible to extend the definition with additional constraints
(cartographic rules) without dramatic changes to the algorithm or much loss of quality.
• The number of parameters that are difficult to set, like Prc, Prm, and weight-
ing factors should be kept at a minimum.
• No tuning should be necessary.
How robust are other algorithms for map labeling? It is hard to give a general answer to that question, but we would like to draw attention to the necessity of making the algorithm extendible with additional cartographic rules. We briefly discussed in Chapter 1 the simulated-annealing algorithm of Edmondson et al., which added rules by using multiple functions in the cost function. We sum- marized the problems with that approach above. We have proposed a new tech- nique for incorporating additional rules—the geometrically local optimizer—that provides an elegant way to combine combinatorial optimization with enforcing cartographic rules. It seems difficult to incorporate the same technique in other algorithms. The GA uses a population to maintain a set of different candidates for any locally bounded region (say, a rival group). It would be interesting to see
whether algorithms which don’t use a population could be extended with the geo- metrically local optimizer. Recall, however, that the straightforward inclusion of the GLO in the simulated-annealing algorithm did not work very well (see Figure 3.20 on page 68).
The general technique we described in this chapter is applicable to more prob- lems that have a geometrically determined structure. We will discuss the tech- niques more formally in Chapter 5. There, we will also show how cartographic rules can be incorporated in the map-labeling GA, and how a GA for two dif- ferent GIS-problems (line simplification and a certain generalization task) can be designed.