# Beyond Maximum Independent Set: An Extended Integer Programming Formulation for Point Labeling

^{1}

^{2}

^{*}

## Abstract

**:**

## 1. Introduction

- The running time of an exact method for an NP-hard problem can be high and difficult to predict.

- The quality of a solution obtained with a heuristic can be arbitrarily far away from optimum and difficult to predict.
- With our exact method, we directly profit from every algorithmic speedup that is introduced to mathematical solvers for the class of problems to which our problem belongs. Such improvements are being made constantly [11].
- Often, an exact method can be transformed into a faster inexact (that is, heuristic) method, without much engineering effort. Though the development of a heuristic is not our primary goal, we will present such a transformation for our method.
- Even though an exact method can be too slow, for example, for real-time applications, the optimal solutions obtained with it can be used as benchmarks to assess the quality of faster heuristics.

## 2. Related Work

## 3. Methodology

#### 3.1. A Basic Integer Linear Program

#### 3.2. Discussion of the Basic ILP

- (C1)
- priorities of features,
- (C2)
- priorities of label positions,
- (C3)
- overlapping of labels or symbols for the corresponding features with other map features,
- (C4)
- percentage of water under a label for a point representing a coastal place.

- (C5)
- magnitude of ambiguity between neighboring point features and their names,
- (C6)
- proximity of placed labels, which can lead to clutter.

#### 3.3. Penalizing Ambiguous Label–Feature Associations

#### 3.4. Controlling the Graphic Density of the Map

#### 3.5. An Alternative Constraint Formulation to Forbid Label–Label Conflicts

- Given a good estimate of the optimal objective value, it is possible to prune large parts of the search tree (termed the branch-and-bound tree) that is explored to find an optimal integer solution. Therefore, a strong ILP formulation may result in lower running times.
- If the ILP formulation is strong, one can often find good integer solutions by solving the LP-relaxation of the ILP and rounding the fractional values of the variables. Generally, the resulting integer values do not constitute an optimal integer solution, but it is very common to use LP-based rounding as a heuristic.

- ILP 1 consists of
- -
- Objective (7), which considers both weights of labels and costs for interferences that may cause ambiguous label–point associations,
- -
- Constraint (3), which avoids intersecting labels,
- -
- -
- Constraint (8), which ensures that every translated copy of $\mathrm{\Gamma}$ intersects at most ${K}_{\mathrm{\Gamma}}$ labels.

- ILP 2 differs from ILP 1 only as follows:

#### 3.6. An LP-Based Rounding Heuristic

Algorithm 1: LP-based rounding heuristic |

## 4. Experimental Results

#### 4.1. Randomly Generated Instances of Constant Density

#### 4.2. Randomly Generated Instances of a Constant Spatial Extent

#### 4.3. Instances with Existing Point Data

## 5. Conclusions

## Supplementary Materials

## Acknowledgments

## Author Contributions

## Conflicts of Interest

## References

- Wolff, A.; Knipping, L.; van Kreveld, M.; Strijk, T.; Agarwal, P.K. A Simple and Efficient Algorithm for High-Quality Line Labeling. In Innovations in GIS VII: GeoComputation; Atkinson, P.M., Martin, D.J., Eds.; Taylor & Francis: London, UK, 2000; Chapter 11; pp. 147–159. [Google Scholar]
- Rylov, M.; Reimer, A. A Practical Algorithm for the External Annotation of Area Features. Cartogr. J.
**2017**, 54, 61–76. [Google Scholar] [CrossRef] - Haunert, J.H.; Wolff, A. Beyond Maximum Independent Set: An Extended Model for Point-Feature Label Placement. In Proceedings of the International Archives of the Photogrammetry, Remote Sensing and Spatial Information Sciences, XXIII ISPRS Congress, Prague, Czech Republic, 12–19 July 2016; Volume XLI-B2, pp. 109–114. [Google Scholar]
- Zoraster, S. Integer Programming Applied to the Map Label Placement Problem. Cartographica
**1986**, 23, 16–27. [Google Scholar] [CrossRef] - Agarwal, P.K.; van Kreveld, M.; Suri, S. Label Placement by Maximum Independent Set in Rectangles. Comput. Geom. Theory Appl.
**1998**, 11, 209–218. [Google Scholar] [CrossRef] - Ribeiro, G.M.; Mauri, G.R.; Lorena, L.A.N. A Lagrangean Decomposition for the Maximum Independent Set Problem Applied to Map Labeling. Oper. Res.
**2011**, 11, 229–243. [Google Scholar] [CrossRef] - Bertin, J. Semiology of Graphics: Diagrams, Networks, Maps, 1st ed.; The University of Wisconsin Press: Madison, WI, USA, 1983. [Google Scholar]
- Kern, J.P.; Brewer, C.A. Automation and the Map Label Placement Problem: A Comparison of Two GIS Implementations of Label Placement. Cartogr. Perspect.
**2008**, 60, 22–45. [Google Scholar] [CrossRef] - Rylov, M.; Reimer, A. A Comprehensive Multi-criteria Model for High Cartographic Quality Point-Feature Label Placement. Cartographica
**2014**, 49, 52–68. [Google Scholar] [CrossRef] - Formann, M.; Wagner, F. A Packing Problem with Applications to Lettering of Maps. In Proceedings of the 7th Annual ACM Symposium on Computation Geometry (SoCG’91), North Conway, NH, USA, 10–12 June 1991; pp. 281–288. [Google Scholar]
- Achterberg, T.; Wunderling, R. Mixed Integer Programming: Analyzing 12 Years of Progress. In Facets of Combinatorial Optimization: Festschrift for Martin Grötschel; Jünger, M., Reinelt, G., Eds.; Springer: Berlin, Germany, 2013; pp. 449–481. [Google Scholar]
- Nemhauser, G.L.; Wolsey, L. Integer and Combinatorial Optimization; John Wiley & Sons: Hoboken, NJ, USA, 1988. [Google Scholar]
- Yoeli, P. The Logic of Automated Map Lettering. Cartogr. J.
**1972**, 9, 99–108. [Google Scholar] [CrossRef] - Imhof, E. Positioning Names on Maps. Am. Cartogr.
**1975**, 2, 128–144. [Google Scholar] [CrossRef] - Alinhac, G. Cartographie Théorique et Technique; Institut Géographique National: Paris, France, 1962; Chapter IV. [Google Scholar]
- Doerschler, J.S.; Freeman, H. An Expert System for Dense-Map Name Placement. In Proceedings of the 9th International Symposium on Computer-Assisted Cartography (Auto-Carto 9), Baltimore, MD, USA, 2–7 April 1989; pp. 215–224. [Google Scholar]
- Zoraster, S. The Solution of Large 0–1 Integer Programming Problems Encountered in Automated Cartography. Oper. Res.
**1990**, 38, 752–759. [Google Scholar] [CrossRef] - Verweij, B.; Aardal, K. An Optimisation Algorithm for Maximum Independent Set with Applications in Map Labelling. In Proceedings of the 7th Annual European Symposium on Algorithms (ESA’99), Prague, Czech Republic, 16–18 July 1999; Springer: Berlin, Germany, 1999; pp. 426–437. [Google Scholar]
- Christensen, J.; Marks, J.; Shieber, S. An Empirical Study of Algorithms for Point-Feature Label Placement. ACM Trans. Graph.
**1995**, 14, 203–232. [Google Scholar] [CrossRef] [Green Version] - Wagner, F.; Wolff, A.; Kapoor, V.; Strijk, T. Three Rules Suffice for Good Label Placement. Algorithmica
**2001**, 30, 334–349. [Google Scholar] [CrossRef] - Van Kreveld, M.; Strijk, T.; Wolff, A. Point Labeling with Sliding Labels. Comput. Geom. Theory Appl.
**1999**, 13, 21–47. [Google Scholar] [CrossRef] - Strijk, T.; van Kreveld, M. Practical Extensions of Point Labeling in the Slider Model. GeoInformatica
**2002**, 6, 181–197. [Google Scholar] [CrossRef] - Meng, Y.; Zhang, H.; Liu, M.; Liu, S. Clutter-aware label layout. In Proceedings of the IEEE Pacific Visualization Symposium (PacificVis 2015), Hangzhou, China, 14–17 April 2015; pp. 207–214. [Google Scholar]
- Wu, H.Y.; Takahashi, S.; Poon, S.H.; Arikawa, M. Introducing Leader Lines into Scale-Aware Consistent Labeling. In Advances in Cartography and GIScience: Selections from the International Cartographic Conference 2017; Peterson, M.P., Ed.; Springer International Publishing: Basel, Switzerland, 2017; pp. 117–130. [Google Scholar]
- Been, K.; Nöllenburg, M.; Poon, S.H.; Wolff, A. Optimizing Active Ranges for Consistent Dynamic Map Labeling. Comput. Geom. Theory Appl.
**2010**, 43, 312–328. [Google Scholar] [CrossRef] - Raidl, G.R. A Genetic Algorithm for Labeling Point Features. In Proceedings of the International Conference on Imaging Science, Systems, and Technology (CISST’98), Las Vegas, NV, USA, 6–9 July 1998; pp. 189–196. [Google Scholar]
- Ribeiro, G.M.; Lorena, L.A.N. Lagrangean relaxation with clusters for point-feature cartographic label placement problems. Comput. Oper. Res.
**2008**, 35, 2129–2140. [Google Scholar] [CrossRef] - Yamamoto, M.; Camara, G.; Lorena, L.A.N. Tabu Search Heuristic for Point-Feature Cartographic Label Placement. GeoInformatica
**2002**, 6, 77–90. [Google Scholar] [CrossRef] - Alvim, A.C.F.; Taillard, É.D. POPMUSIC for the Point Feature Label Placement Problem. Eur. J. Oper. Res.
**2009**, 192, 396–413. [Google Scholar] [CrossRef] - Bae, W.D.; Alkobaisi, S.; Narayanappa, S.; Vojtechovský, P.; Bae, K.Y. Optimizing Map Labeling of Point Features Based on an Onion Peeling Approach. J. Spat. Inf. Sci.
**2011**, 2, 3–28. [Google Scholar] [CrossRef] - Gomes, S.P.; Ribeiro, G.M.; Lorena, L.A.N. Dispersion for the Point-Feature Cartographic Label Placement Problem. Expert Syst. Appl.
**2013**, 40, 5878–5883. [Google Scholar] [CrossRef] - Gomes, S.P.; Lorena, L.A.N.; Ribeiro, G.M. A Constructive Genetic Algorithm for Discrete Dispersion on Point Feature Cartographic Label Placement Problems. Geogr. Anal.
**2016**, 48, 43–58. [Google Scholar] [CrossRef] - Mauri, G.R.; Ribeiro, G.M.; Lorena, L.A.N. A New Mathematical Model and a Lagrangean Decomposition for the Point-Feature Cartographic Label Placement Problem. Comput. Oper. Res.
**2010**, 37, 2164–2172. [Google Scholar] [CrossRef] - Rabello, R.L.; Mauri, G.R.; Ribeiro, G.M.; Lorena, L.A.N. A Clustering Search Metaheuristic for the Point-Feature Cartographic Label Placement Problem. Eur. J. Oper. Res.
**2014**, 234, 802–808. [Google Scholar] [CrossRef] - Haunert, J.; Wolff, A. Area aggregation in map generalisation by mixed-integer programming. Int. J. Geogr. Inf. Sci.
**2010**, 24, 1871–1897. [Google Scholar] [CrossRef] - Been, K.; Daiches, E.; Yap, C. Dynamic Map Labeling. IEEE Trans. Vis. Comput. Graph.
**2006**, 12, 773–780. [Google Scholar] [CrossRef] [PubMed] - De Berg, M.; Cheong, O.; van Kreveld, M.; Overmars, M. Computational Geometry: Algorithms and Applications, 3rd ed.; Springer TELOS: Santa Clara, CA, USA, 2008. [Google Scholar]

**Figure 1.**The four label candidates for a point in the four-position model (

**left**) and the additional four label candidates in the eight-position model (

**right**).

**Figure 2.**A point p with a label ℓ, which can be misinterpreted as the label for q, since q is within distance $\lambda $ from ℓ. When labeling p with ℓ, the label for q can be r, s, or t.

**Figure 3.**(

**left**): a labeling of four labels that intersect a disk of radius $\delta $; such a solution can be avoided with our model by defining $\mathrm{\Gamma}$ as a disk of radius $\delta $ centered in $(0,0)$ and ${K}_{\mathrm{\Gamma}}=3$; (

**middle**): the same situation with a square-shaped region $\mathrm{\Gamma}$, which is the setting that we used in our experiments; (

**right**): the same situation with a triangular region $\mathrm{\Gamma}$—we use this setting in the following discussion to show that $\mathrm{\Gamma}$ is not required to be symmetric.

**Figure 4.**A label ℓ, a region $\mathrm{\Gamma}$, and the region $M\left(\ell \right)=\ell \oplus -\mathrm{\Gamma}$. The definition of $M\left(\ell \right)$ implies that translating $\mathrm{\Gamma}$ with a vector $\overrightarrow{v}\in M\left(\ell \right)$ yields a region intersecting ℓ.

**Figure 5.**Three labels ${\ell}_{1}$, ${\ell}_{2}$, and ${\ell}_{3}$ with the regions $M\left({\ell}_{1}\right)$, $M\left({\ell}_{2}\right)$, and $M\left({\ell}_{3}\right)$ (

**top**) as well as the faces of the arrangement $\mathcal{A}$ resulting from the overlay of $M\left({\ell}_{1}\right)$, $M\left({\ell}_{2}\right)$, and $M\left({\ell}_{3}\right)$ (

**bottom**).

**Figure 6.**The seven faces of the arrangement formed by the three labels ${\ell}_{1},{\ell}_{2},{\ell}_{3}$ in Figure 5.

**Figure 7.**Different labelings for an instance with 400 points in a square of size $20\times 20$ (left side) and in a square of size $10\times 10$ (right side). Selected labels are displayed with black boundaries, unselected labels with gray boundaries. (

**a**,

**a**${}^{\prime}$) maximum-weight solution; (

**b**,

**b**${}^{\prime}$) solution of the extended model; $\mathrm{\Gamma}$ is a square of size $1\times 1$ and ${K}_{\mathrm{\Gamma}}=2$; (

**c**,

**c**${}^{\prime}$) solution of the extended model; $\mathrm{\Gamma}$ is a square of size $2\times 2$ and ${K}_{\mathrm{\Gamma}}=2$.

**Figure 8.**The labels of a solution for the instance that we generated from an existing data set, using the eight-position model. In the three magnified rectangles all point features and label candidates in the corresponding region of the map are displayed. The gray shaded rectangle is magnified in Figure 9.

**Figure 9.**The two maps show the same section of two labelings for the instance in Figure 8. Yellow lines represent pairs of labels whose corresponding y-variables have been constrained to 1; only in the second labeling, costs for those variables have been charged to avoid ambiguous label–point associations. Red areas represent points where centering $\mathrm{\Gamma}$ would cause intersections with more than two labels (from light red to dark red: three, four, five intersections). Because of Constraint (8), there are no such areas in the second solution. Unlabeled points are displayed gray and will not be visible in the final map. Country borders were not considered for labeling but are displayed to provide context.

**Table 1.**Experimental results for instances with different numbers of points but a constant spatial density of one point per area unit. Four rectangles of size $1.0\times 0.5$ were generated for each point. Every square of size $1\times 1$ was required to intersect at most two labels. Running times are in seconds CPU time. Every value is the average over ten instances.

ILP 1 | ILP 2 | ILP 1 & 2 | Heuristic with ILP 1 | Heuristic with ILP 2 | ||||
---|---|---|---|---|---|---|---|---|

$\left|\mathcal{F}\right|$ | $\left|\mathit{L}\right|$ | Time (s) | Time (s) | Quality | Time (s) | Quality | Time (s) | Quality |

100 | 400 | 0.9 | 1.0 | 100% | 0.4 | 86.7% | 0.5 | 95.9% |

200 | 800 | 3.7 | 3.8 | 100% | 0.7 | 87.3% | 0.7 | 95.7% |

300 | 1200 | 26.9 | 30.1 | 100% | 1.2 | 86.7% | 1.1 | 95.9% |

400 | 1600 | 96.6 | 102.4 | 100% | 1.7 | 86.7% | 1.6 | 94.7% |

**Table 2.**Experimental results with the same setting as in Table 1, except that this time every square of size $2\times 2$ was required to intersect at most two labels.

ILP 1 | ILP 2 | ILP 1 & 2 | Heuristic with ILP 1 | Heuristic with ILP 2 | ||||
---|---|---|---|---|---|---|---|---|

$\left|\mathcal{F}\right|$ | $\left|\mathit{L}\right|$ | Time (s) | Time (s) | Quality | Time (s) | Quality | Time (s) | Quality |

100 | 400 | 2.4 | 2.2 | 100% | 1.3 | 90.5% | 1.3 | 97.6% |

200 | 800 | 7.4 | 7.1 | 100% | 2.7 | 90.0% | 2.6 | 97.6% |

300 | 1200 | 43.5 | 46.1 | 100% | 4.5 | 89.2% | 4.4 | 95.3% |

400 | 1600 | 190.4 | 127.2 | 100% | 6.3 | 89.7% | 6.1 | 95.4% |

**Table 3.**Experimental results for instances with different numbers of points in a constant-sized area of size $10\times 10$ and four labels of size $1.0\times 0.5$ for each point. Every square of size $1\times 1$ was required to intersect at most two labels. Running times are in seconds CPU time. Every value is an average over ten instances.

ILP 1 | ILP 2 | ILP 1 & 2 | Heuristic with ILP 1 | Heuristic with ILP 2 | ||||
---|---|---|---|---|---|---|---|---|

$\left|\mathcal{F}\right|$ | $\left|\mathit{L}\right|$ | Time (s) | Time (s) | Quality | Time (s) | Quality | Time (s) | Quality |

100 | 400 | 0.9 | 0.9 | 100% | 0.4 | 86.7% | 0.4 | 95.6% |

200 | 800 | 17.6 | 19.2 | 100% | 2.0 | 88.6% | 2.0 | 93.9% |

300 | 1200 | 185.9 | 229.2 | 100% | 6.4 | 88.1% | 6.2 | 93.2% |

400 | 1600 | 698.5 | 792.4 | 100% | 14.2 | 87.8% | 14.3 | 90.4% |

**Table 4.**Experimental results with the same setting as in Table 3, except that this time every square of size $2\times 2$ was required to intersect at most two labels.

ILP 1 | ILP 2 | ILP 1 & 2 | Heuristic with ILP 1 | Heuristic with ILP 2 | ||||
---|---|---|---|---|---|---|---|---|

$\left|\mathcal{F}\right|$ | $\left|\mathit{L}\right|$ | Time (s) | Time (s) | Quality | Time (s) | Quality | Time (s) | Quality |

100 | 400 | 2.4 | 2.2 | 100% | 1.3 | 90.5% | 1.3 | 97.6% |

200 | 800 | 18.0 | 16.2 | 100% | 8.6 | 94.2% | 8.4 | 98.3% |

300 | 1200 | 72.6 | 59.1 | 100% | 31.3 | 93.6% | 30.7 | 98.1% |

400 | 1600 | 189.4 | 153.1 | 100% | 81.3 | 93.9% | 79.2 | 95.7% |

**Table 5.**Experimental results for the data set of 7322 places from the Internet. The first row refers to experiments with the four-position model; for the second row, the eight-position model was used.

ILP 1 | ILP 2 | ILP 1 & 2 | Heuristic with ILP 1 | Heuristic with ILP 2 | |||||
---|---|---|---|---|---|---|---|---|---|

$\left|\mathcal{F}\right|$ | pos. | $\left|\mathit{L}\right|$ | Time (s) | Time (s) | Quality | Time (s) | Quality | Time (s) | Quality |

7322 | 4 | 29,288 | 229.4 | 463.0 | 100% | 5.2 | 89.9% | 5.9 | 96.8% |

7322 | 8 | 58,576 | 2092.8 | 31,770.0 | 100% | 30.6 | 89.6% | 28.7 | 96.8% |

© 2017 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Haunert, J.-H.; Wolff, A.
Beyond Maximum Independent Set: An Extended Integer Programming Formulation for Point Labeling. *ISPRS Int. J. Geo-Inf.* **2017**, *6*, 342.
https://doi.org/10.3390/ijgi6110342

**AMA Style**

Haunert J-H, Wolff A.
Beyond Maximum Independent Set: An Extended Integer Programming Formulation for Point Labeling. *ISPRS International Journal of Geo-Information*. 2017; 6(11):342.
https://doi.org/10.3390/ijgi6110342

**Chicago/Turabian Style**

Haunert, Jan-Henrik, and Alexander Wolff.
2017. "Beyond Maximum Independent Set: An Extended Integer Programming Formulation for Point Labeling" *ISPRS International Journal of Geo-Information* 6, no. 11: 342.
https://doi.org/10.3390/ijgi6110342