动态地图标注算法

Dynamic maps that allow continuous map rotations, e.g., on mobile devices, encounter new issues unseen in static map labeling before. We study the following dynamic map labeling problem: The input is a static, labeled map, i.e., a set P of points in the plane with attached nonoverlapping horizontal rectangular labels. The goal is to find a consistent labeling of P under rotation that maximizes the number of visible labels for all rotation angles such that the labels remain horizontal while the map is rotated. A labeling is consistent if a single active interval of angles is selected for each label such that labels neither intersect each other nor occlude points in P at any rotation angle. We first introduce a general model for labeling rotating maps and derive basic geometric properties of consistent solutions. We show NP completeness of the active interval maximization problem even for unitsquare labels. We then present a constant-factor approximation for this problem based on line stabbing, and refine it further into an efficient polynomial-time approximation scheme (EPTAS). Finally, we extend the EPTAS to the more general setting of rectangular labels of bounded size and aspect ratio.

动态地图,允许连续的地图旋转,例如,在移动设备上,遇到了新的问题,在静态地图标签之前看不见。我们研究了以下动态地图标注问题:输入是一个静态的有标签的地图,即平面上带有不重叠水平矩形标签的点集P。目标是在旋转下找到一致的P标记,使在所有旋转角度下的可见标记数最大化,这样当地图旋转时,标记保持水平。标记将是持续的,如果为每个标记选择了单一的角度活动区间,使得标记在任何旋转角度上既不相互交叉,也不遮挡P中的点。本文首先介绍了地图旋转标注的一般模型,推导了一致解的基本几何性质。我们证明了即使是单位平方标签它的极大化活动区间问题仍然是NP完全的(https://www.cnblogs.com/alphablox/p/3536895.html)。在此基础上,我们提出了一种基于线刺法的常因子逼近方法,并进一步改进为一种有效的多项式时间近似格式(EPTAS)。最后,我们将EPTAS扩展到有界尺寸和长宽比的矩形标签的更一般的设置。

1 Introduction

Dynamic maps, in which the user can navigate continuously through space, are becoming increasingly important in scientific and commercial GIS applications as well as in personal mapping applications. In particular GPS-equipped mobile devices offer various new possibilities for interactive, location-aware maps. A common principle in dynamic maps is that users can pan, rotate, and zoom the map view. Despite the popularity of several commercial and free applications, relatively little attention has been paid to provably good labeling algorithms for dynamic maps.

用户可以在空间连续导航的动态地图,在科学地理信息系统(fic)、商业地理信息系统和个人地图应用中正变得越来越重要。特别是配备gps的移动设备或ffer各种新的可能性,互动的,位置感知的地图.。动态地图中的一个常见原则是用户可以平移、旋转和缩放地图视图。尽管一些商业和免费的应用很流行,但是相对较少的注意力已经被证明是好的动态地图的标记算法。

Been et al. [2] identified a set of consistency desiderata for dynamic map labeling. Labels should neither "jump" (suddenly change position or size) nor "pop" (appear and disappear more than once) during monotonous map navigation; moreover, the labeling should be a function of the selected map viewport and not depend on the user's navigation history. Previous work on the topic has focused solely on supporting zooming and/or panning of the map [2,3,11],whereas consistent labeling under map rotations has not been considered prior to this paper.

引用论文[2]确定了一套用于动态地图标注的持续性要求。在单调的地图导航中,标签既不应该"跳转"(突然改变位置或大小),也不应该"POP"(出现和消失多次);此外,标注应该是所选地图视口的功能,而不取决于用户的导航历史。以前关于这一专题的工作仅侧重于支持地图的缩放和/或平移[比如参考文献2,3,11],而在之前没有考虑地图旋转下的持续标注的论文。

Most maps come with a natural orientation (usually the northern direction facing upward), but applications such as car or pedestrian navigation often rotate the map view dynamically to be always forward facing [5]. Still, the labels must remain horizontally aligned for best readability regardless of the actual rotation angle of the map. A basic requirement in static and dynamic label placement is that labels are pairwise disjoint, i.e., in general not all labels can be placed simultaneously. For labeling point features, it is further required that each label, usually modeled as a rectangle, touches the labeled point on its boundary. It is often not allowed that labels occlude the input point of another label. Figure 1 shows an example of a map that is rotated and labeled. The objective in map labeling is usually to place as many labels as possible. Translating this into the context of rotating maps means that, integrated over one full rotation from 0 to 2π, we want to maximize the number of visible labels. The consistency requirements of Been et al. [2] can immediately be applied for rotating maps.

大多数地图都有一个自然的方向(通常是朝北的方向),但汽车或行人导航等应用程序通常会动态地旋转地图视图,使其始终面向前方[5]。尽管如此,标签必须保持水平对齐,以获得最好的可读性,而不管地图的实际旋转角度如何。静态和动态标签放置中的一个基本要求是标签是两两不相交的,即通常不是所有标签都可以同时放置。对于标注点要素,进一步要求每个标记被建模为一个矩形。通常不允许标签遮挡另一个标签的输入点。图1显示了一个被旋转和标记的地图示例。地图标注的目的通常是尽可能多地放置标签。将其转换为旋转地图的上下文意味着,集成在一次从0到2π的完整旋转中,我们希望最大限度地增加可见标签的数量。文献[2]的持续性要求可立即适用于旋转地图。

Our Results. Initially, we define a model for rotating maps and show some basic properties of the different types of conflicts that may arise during rotation. Next, we prove that consistently labeling rotating maps is NP-complete, for the maximization of the total number of visible labels in one full rotation and NP hard for the maximization of the visibility range of the least visible label. Finally, we present a new 1/4-approximation algorithm and an efficient polynomial-time approximation scheme (EPTAS) for unit-height rectangles. A PTAS is called efficient if its running time is O(f(ε)·poly(n)). Both algorithms can be extended to the case of rectangular labels with the property that the ratio of the smallest and largest width, the ratio of the smallest and largest height, as well as the aspect ratio of every label is bounded by a constant, even if we allow the anchor point of each label to be an arbitrary point of the label. This applies to most practical scenarios where labels typically consist of few and relatively short lines of text.

我们的成果。最初,我们定义了一个地图旋转模型,并展示了旋转过程中可能出现的不同类型冲突的一些基本性质。其次,我们证明了地图旋转的持续性标记问题是NP-完全的,对于在一次全旋转中可见标记总数的最大化是NP-完全的,并且对于最不可见标签的可见性范围的最大化是NP困难的。最后,我们提出了一种新的1/4近似算法和一个对于单位高度矩形的高效多项式时间近似模式(EPTAS)。如果一个PTAS(多项式时间近似模式)其运行时间为O(f(ε)·Polyn),则称为有效的。这两种算法都可以推广到矩形标签的情况(它们的最小宽度和最大宽度之比、最小高度和最大高度之比以及每个标签的长宽比都有一个常数),甚至我们允许每个标签的锚定点是标签的任意点。这适用于标签通常由很少和相对较短的文本行组成的大多数实际情况。

Related Work. Most previous algorithmic research efforts on automated label placement cover static labeling models for point, line, or area features. For static point labeling, fixed-position models and slider models have been introduced [4, 8], in which the label, represented by its bounding box, needs to touch the labeled point along its boundary. The label number maximization problem is NP-hard even for the simplest labeling models, whereas there are efficient algorithms for the decision problem that asks whether all points can be labeled in some of the simpler models (see the discussion by Klau and Mutzel [7] or the comprehensive map labeling bibliography [14]). Approximation results [1,8], heuristics [13], and exact approaches [7] are known for many variants of the static label number maximization problem.

相关工作。以前大多数关于自动标签放置的算法研究工作致力于包括点、线或区域特征的静态标记模型。对于静态点标记,引入了固定位置模型和滑块模型[4,8],其中标签以需要触摸其边界上的标记点的矩形包围盒来表示。即使对于最简单的标号模型,标签数最大化问题也是NP困难的,然而对于判定问题,存在有效的算法来要求在一些更简单的模型中是否所有的点都可以被标注(参见Klau和mutzel的讨论[7]或综合地图标号文献[14])。近似结果[1,8],启发式[13]和精确方法[7]是已知的静态标签数最大化问题的许多变体。

In recent years, dynamic map labeling has emerged as a new research topic that gives rise to many unsolved algorithmic problems. Petzold et al. [12] used a preprocessing step to generate a reactive conflict graph that represents possible label overlaps for maps of all scales. For any fixed scale and map region, their method computes a conflict-free labeling using heuristics. Mote [10] presents another fast heuristic method for dynamic conflict resolution in label placement that does not require preprocessing. The consistency desiderata of Been et al. [2] for dynamic labeling (no popping and jumping effects when panning and zooming), however, are not satisfied by either of the methods. Been et al. [3] showed NP-hardness of the label number maximization problem in the consistent labeling model and presented several approximation algorithms for the problem. N¨ollenburg et al. [11] recently studied a dynamic version of the alternative boundary labeling model, in which labels are placed at the sides of the map and connected to their points by leaders. They presented an algorithm to precompute a data structure that represents an optimal one-sided labeling for all possible scales and thus allows continuous zooming and panning. None of the existing dynamic map labeling approaches supports map rotation.

(大意是近年来有一些解决方法,但都不解决地图旋转时的动态持续性标注问题)近年来,动态地图标注作为一个新的研究课题,产生了许多尚未解决的算法问题。Petzold等人。[12]使用预处理步骤生成反应冲突图,该图表示所有比例尺地图可能的标签重叠。对于任何固定的比例尺和地图区域,他们的方法使用启发式计算无冲突标记.。Mote[10]提出了另一种不需要预处理的快速启发式方法来解决标签放置中的动态冲突。等的一致性要求。[2]对于动态标记(在平移和缩放时没有弹出和跳跃效果),这两种方法中的任何一种都不能满足fi的要求。被等人。[3]证明了一致标号模型中标签数最大化问题的NP-困难性,并给出了几种近似算法。Ollenburg等人。[11]最近研究了一种动态的替代边界标注模型,其中标签放置在地图的两侧,并由领导将标签连接到它们的点上。他们提出了一种预先计算数据结构的算法,该结构表示所有可能的尺度的最优单边标记,从而允许连续缩放和平移。现有的动态地图标注方法都不支持地图旋转。

2 Model

In this section we describe a general model for rotating maps with axis-aligned rectangular labels. Let M be a labeled input map, i.e., a set P = {p1,...,pn} of points in the plane together with a set L = {1,...,n} of pairwise disjoint, closed, and axis-aligned rectangular labels, where each point pi is a point on the boundary ∂i of its label i. We say i is anchored at pi. As M is rotated, each label i in L remains horizontally aligned and anchored at pi. Thus, label intersections form and disappear during rotation of M. We take the following alternative perspective on the rotation of M. Rather than rotating the points, say clockwise, and keeping labels horizontal we may instead rotate each label around its anchor point counterclockwise and keep the set of points fixed. It is easy to see that both rotations are equivalent and yield exactly the same results.

在这一节中,我们为拥有轴对齐矩形标签的旋转地图描述了一个通用的模型。设M是一个带标签的输入地图,在地图上有平面上点的集合P={p1,.,pn}加上以及一组不相交的、闭的和轴对的矩形标签的集合L={1,.,`n},其中每个点pi是其标签i的边界∂L上的一个点。我们说Li被锚定在pi上。当M旋转时,L中的每个标签i保持水平对齐并锚定在pi上。因此,在M的旋转过程中标签会相交并消失。我们对M的旋转采取以下替代视角,而不是按顺时针方向旋转点,并保持标签的水平方向,我们可以逆时针方向绕着每个标签的锚点旋转标注,并保持点集不变。很容易看出,这两个旋转是等价的,并产生完全相同的结果。

A rotation of L is defined by a rotation angle α ∈ [0,2π); a rotation labeling of M is a function φ: L×[0,2π) →{0,1}such that φ(,α) = 1 if label is visibleor active in the rotation of L by α, and φ(,α) = 0 otherwise. We call a labeling φ valid if, for any rotation α, the set of labels L(α) = { ∈ L | φ(,α) = 1} consists of pairwise disjoint labels and no label in L(α) contains any point in P (other than its anchor point). We note that a valid labeling is not yet consistent in terms of the definition of Been et al. [2,3]: given fixed anchor points, labels clearly do not jump and the labeling is independent of the rotation history, but labels may still pop during a full rotation from 0 to 2π, i.e., appear and disappear more than once. In order to avoid popping effects, each label may be active only in a single contiguous range of [0,2π), where ranges are circular ranges modulo 2π so that they may span the input rotation α = 0. A valid labeling φ, in which for every label the set Aφ() = {α ∈ [0,2π) | φ(,α) = 1} is a contiguous range modulo 2π, is called a consistent labeling. For a consistent labeling φ the set Aφ() is called the active range of . The length |Aφ()| of an active range Aφ() is defined as the length of the circular arc {(cosα,sinα) | α ∈ Aφ(`)} on the unit circle.

L的旋转定义为旋转角α∈[0,2π);M的旋转标注是函数φ:l×[0,2π)→{0,1}使φ(l,α)=1,如果标签l在α的旋转中可见或活跃,否则的话φ(l,α)=0.。我们称一个标注函数φ为有效的,如果对于任何旋转α,标记集L(α)={l∈L | (φ(l,α)=1}由两两不相交的标记组成,且L(α)中的任何标记都不包含P中的任何点(除了它的锚点之外)。我们注意到,有效的标记在定义等方面与参考文献[2,3]还不一致:给定固定的锚点,标签明显不跳,标签独立于旋转历史,但标签仍然可能在0到2π的全旋转期间弹出,即出现和消失不止一次。为了避免弹出效果,每个标签只能在[0,2π)的单个连续范围内活动,其中范围是模2π的圆形范围,因此它们可以跨越输入旋转α=0。一个有效的标记函数φ称为持续性标注,其中对每一个标签 l 集合 Aφ(l)={α∈[0,2π)|φ(,α)=1}是一个连续的模2π.。对于持续性标注函数φ,集合Aφ(l)称为标注l的活动范围。有效范围Aφ(l)的长度length|Aφ(l)|`定义为单位圆上的圆弧{(cosα,sinα)|α∈Aφ(l)}的长度。

静态地图标注的目标通常是寻找两两不相交标签的最大子集,即尽可能多的点。将这一目标推广到旋转地图,意味着在所有旋转上集成α∈[0,2π],我们希望显示尽可能多的标签。这对应于最大化在M的所有持续性标注函数φ的和

我们称这个优化问题为MaxTotal。另一个目标是在所有持续性标注函数φ上最大化所有活动范围的最小长度minAφ(l);这个问题称为MaxMin。

3 Properties of consistent labelings

这一部分展示持续性标注的基本属性。两个标注l和l'在旋转角度α下相交表示他们在α下有冲突,即在持续性标注下他们之中顶多有一个可以在α下展示集合 C(l,l') = {α ∈ [0,2π) | l and l' are in conflict at α}成为l和l'的冲突集合。

我们在一个更一般的模型中给出了如下引理,其中标注l的锚点p可以是l中的任意点,而不一定是边界∂l上的点。

引理1:对于任意两个带有锚点p∈l和P0∈l'的标签l和l',集合C(l,l')至多由四个不相交的连续冲突范围组成。

证明过程简单说就是标注都是保持水平对齐的,也就是说横轴与横轴平行,竖轴与竖轴平行,所以相交情况就只有四种: t∩b', b∩t', l ∩r', and r ∩l'。这四种情况随着旋转方向的变化可能出现两次,所以总共算下来是8种情况。每个冲突都定义了一个唯一的旋转角度,并且很明显,以这8个旋转角度作为端点最多可以定义4个不相交的冲突范围。下面八个图显示了八种相交方式,锚点使用黑点表示