• 沒有找到結果。

Many-to-One Boundary Labeling

N/A
N/A
Protected

Academic year: 2021

Share "Many-to-One Boundary Labeling"

Copied!
19
0
0

加載中.... (立即查看全文)

全文

(1)

Many-to-One Boundary Labeling

Chun-Cheng Lin

1

Hao-Jen Kao

1

Hsu-Chun Yen

1,2 1Department of Electrical Engineering

National Taiwan University, Taipei, Taiwan 106, ROC 2Department of Computer Science

Kainan University, Taoyuan, Taiwan 338, ROC

Abstract

In boundary labeling, each point site is uniquely connected to a label placed on the boundary of an enclosing rectangle by a leader, which may be a rectilinear or straight line segment. To our knowledge, all the results reported in the literature for boundary labeling deal with the so-called one-to-one boundary labeling, i.e., different sites are labelled differently. In certain applications of boundary labeling, however, more than one site may be required to be connected to a common label. In this case, the presence of crossings among leaders often becomes inevitable. Minimiz-ing the total number of crossMinimiz-ings in boundary labelMinimiz-ing becomes a critical design issue as crossing is often regarded as the main source of confu-sion in visualization. In this paper, we consider the crossing minimiza-tion problem for multi-site-to-one-label boundary labeling, i.e., finding the placements of labels and leaders such that the total number of crossings among leaders is minimized. We show the crossing minimization problem to be NP-complete under certain one-side and two-side labeling schemes. Subsequently, approximation algorithms or heuristics are derived for the above intractable problems.

Submitted: June 2007 Reviewed: September 2007 Revised: February 2008 Accepted: April 2008 Final: August 2008 Published: October 2008 Article type: Regular Paper Communicated by: S.-H. Hong

H. Yen is the corresponding author of this paper. Research supported in part by NSC Grant 96-2221-E-002-027, and Research Grant 95-EC-17-A-02-S1-049, Taiwan.

E-mail addresses: sanlin@cobra.ee.ntu.edu.tw(Chun-Cheng Lin) khr@cobra.ee.ntu.edu.tw (Hao-Jen Kao) yen@cc.ee.ntu.edu.tw (Hsu-Chun Yen)

(2)

1

Introduction

In information visualization, cartography, geographic information systems (GIS), and graph drawing, map labeling is an important task which is concerned with efficiently placing extra information, in the form of text labels, next to features (such as points, lines, or areas) in a drawing (map). In order to ensure read-ability, unambiguity and legibility, it is suggested that the labels be pairwise disjoint and close to the features to which they belong [13]. A detailed bibliog-raphy and survey on map labeling can be found in [21], [17], respectively. ACM Computational Geometry Impact Task Force [7] has identified label placement as an important area of research. The majority of map labeling problems are known to be NP-complete [11, 14] in general. (The interested reader is also referred to [19, 20] for various approximations and heuristics for map labeling.) Map labeling problems are classified by the following three kinds of graphical features according to their dimensions, namely, point features, line features, and area features. For example, in a geographical map, a city (resp., river and lake) is typically represented by a point (resp., line and area) feature. Note that a point or a line feature label is normally located next to the associated object, while an area feature label is usually placed within the boundary of the feature to be labeled.

Most of the research on map labeling has primarily focused on labeling point features, and the basic requirement in this case is that all the labels should be pairwise disjoint. It is clear that such a requirement is difficult to be achieved in the case where large labels are placed on dense points. In practice, large labels are usually used in technical drawings or medical atlases where certain site-features are explained with blocks of texts. To address this problem, Bekos et al. proposed the so-called boundary labeling [1, 3, 4], in which all labels are attached to the boundary (four sides) of a rectangle R enclosing all sites, and each site is connected to a unique label by a leader, which may be a rectilinear or straight line segment. In such a setting, they investigated how to place the labels and leaders in a drawing such that there are no crossings among leaders and either the total leader length or the bends of leaders are minimized under a variety of constraints. In a recent article, Bekos et al. [2] investigated a similar problem for labeling polygonal sites under the framework of boundary labeling. For the work reported in [1, 2, 3, 4] regarding boundary labeling, each label is uniquely associated with a site (point feature). In practice, however, it is not uncommon to see more than one site to be associated with the same label. Such examples include the religion distribution in each state of a country, the language distribution of the world, or the association or organization composed of some countries in the world, etc. In view of the above, in this paper we investigate the multi-site-to-one-label boundary labeling (a.k.a., many-to-one boundary labeling) in which the mapping from sites to labels is a many-to-one function, i.e., more than one site is allowed to be connected to a common label and each site is connected only by a leader. Unlike the conventional boundary labeling, this kind of labeling inevitably leads to a high possibility of crossings among leaders in the drawing. Therefore, an important objective for many-to-one boundary labeling

(3)

is to find the placements of labels and leaders such that the total number of crossings among leaders is minimized. Aside from minimizing the total number of crossings, we also consider the issue of minimizing the total leader length under the framework of many-to-one boundary labeling in this paper.

Labeling key components of a motherboard is an example used in [5] for illustrating the usefulness of the technique of one-to-one boundary labeling. For motherboards used in servers or parallel computers, it is common to find multiple copies of components such as CPUs, chipsets, memory DIMMs, I/O ports, expansion slots, and so on, on the same motherboard. In this case, placing labels along the sides of a motherboard involves connecting multiple sites to a single label, suggesting an example to which many-to-one boundary labeling can apply. Figure 1 gives the boundary labeling of the ASUS KFN5-Q/SAS motherboard in a many-to-one fashion. For comparison purpose, the motherboard is also labeled by two other approaches in Figure 2, where area labeling in Figure 2(a) places a text label within the boundary of each object, and legend labeling in Figure 2(b) attaches an assigned number to each object of the same component, and places a legend table with those numbers as well as the text information of their corresponding components on the right side of the motherboard.

8 DIMMs ATX Power Supply

2 LAN Ports Battery BIOS 2 Chipsets 6 SATA Connectors IDE Slot PS2 Port USB Port COM Port VGA Port 4 CPUs 6 Expansion Slots

Figure 1: An example of many-to-one boundary labeling.

In comparison with Figure 2(a) (where text labels are of different sizes caus-ing some of them to be too tiny to read), Figure 1 displays clearer and more readable text labels on such a dense motherboard, though more space is re-quired. If the motherboard is colored (as shown in Figure 1), then the area labeling which places lots of redundant texts inside the motherboard tends to cause unnecessary confusion in visualization. As for Figure 2(b), the legend labeling can be viewed as an alternative to many-to-one boundary labeling. In practice, choosing the right labeling scheme often depends on the application, and an integrated solution might turn out to be better in some cases.

Conventionally, boundary labeling is identified as k-side labeling with type-t leaders (where k ∈ {1, 2, 4} and t ∈ {opo, po, s}) if the labels are allowed to be

(4)

1. Four CPUs 2. Two Chisets 3. BIOS 4. Eight DIMMs 5. Six Expansion Slots 6. Six SATA Connectors 7. IDE Slot

8. Two LAN Port 9. VGA Port 10. PS2 Port 11. USB Port 12. COM Port 13. ATX Power Supply 14. Battery

(a) Area labeling. (b) Legend labeling. Figure 2: Other labeling approaches.

attached to the k sides of the enclosing rectangle R by only type-t leaders. The parameter t specifies the way a leader is drawn to connect a site to a label. The opo, po, and s stand for orthogonal-parallel-orthogonal, parallel-orthogonal and straight-line, respectively, which can easily be understood from the examples given in Figures 3 (a), (b) and (c). For each type-opo leader, we further assume that the parallel (i.e., ‘p’) segment lies immediately outside R in the so-called track routing area, as shown in Figure 3 (a).

R l1 l2 l3 l4 l5 (a) Type-opo leaders

Track Routing Area

(b) Type-po leaders (c) Type-s leaders

R l1 l2 l3 l4 l5 R l1 l2 l3 l4 l5

Figure 3: Illustration of leaders.

Very recently, in order to improve one-side one-to-one boundary labeling with type-po leaders, Benkert et al. [6] introduced a new notation of so-called type-do leaders, in which the do stands for diagonal-orthogonal. As shown in Figure 4, the only difference between type-po and type-do leaders is that the leader starts with a diagonal segment of fixed angle oriented towards the la-bel. They suggested to apply type-do leaders to producing smoother shapes of leaders such that it becomes easier to comprehend the assignment from sites to labels. Intuitively, we observe from Figure 4 that the model of type-do leaders can obtain shorter total leader length than that of type-po. Therefore, they investigated the problem of minimizing the total leader length, without any crossings of leaders.

(5)

(a) Type-po leaders (b) Type-do leaders R R l2 l3 l4 l5 l1 l1 l2 l3 l4 l5

Figure 4: Comparison between type-do and type-do leaders in one-to-one bound-ary labeling.

As listed in Table 1, the main contributions of this paper include:

1. Crossing minimization problems for both one-side and two-side many-to-one labeling with type-opo leaders are proved to be NP-complete (Sec-tions 3 and 4). We also design approximation algorithms to cope with such intractable problems.

2. Crossing minimization problems for one-side and two-side many-to-one labeling with type-po leaders are proved to be NP-complete (Sections 5 and 6). Heuristic algorithms with satisfactory experimental results are also given for these problems.

3. In Section 7, we discuss the many-to-one labeling with the objective of minimizing the total leader length to be solvable in polynomial time, along a similar line of the work of [1].

Table 1: The main contributions of this paper.

number leader time solution

objective of sides type complexity

Minimize the crossing number one opo NPC approximation

Minimize the crossing number two opo NPC approximation

Minimize the crossing number one po NPC heuristic

Minimize the crossing number two po NPC heuristic

Minimize total leader length any opo, po P following [1, 4]

A wide variety of variants of one-to-one boundary labeling have been pro-posed and studied from an algorithmic viewpoint in the literature. Table 2 summarizes those that are related to our work. By comparing Table 1 with Table 2, it is interesting to note that in the one-one case, minimizing the to-tal leader length while respecting the no-crossing constraint is always tractable, whereas in the many-to-one case, minimizing the crossing number becomes in-tractable. Also note that the total leader length minimization problem remains solvable in polynomial time even in the many-to-one case.

(6)

Table 2: Variants of one-to-one boundary labeling problems and their complex-ities.

number leader time

objective of sides type complexity reference

Minimize total leader length∗ one, four s O(n2+ǫ) [3, 4]

Minimize total leader length∗ one opo O(n log n) [3, 4]

Minimize total leader length∗ two opo O(n2) [3, 4]

Minimize total leader length∗ four opo O(n2

log3

n) [1, 4]

Minimize total leader length∗ one, two po O(n2

) [3, 4]

All the problems are subject to the constraint that there are no crossings among leaders; the positions of ports are fixed; each label is of uniform (maximum) size.

In one-to-one boundary labeling, it is always possible to find a layout without crossings among leaders; in the many-to-one case, however, leader crossings are inevitable in general. This disparity is exactly the reason why minimizing the number of crossings is the most critical issue in many-to-one boundary labeling.

2

Preliminaries

A k-side type-t many-to-one boundary labelled map (or k-side type-t map, for short), where k ∈ {1, 2, 4} and t ∈ {opo, po, s}, is M = (P, L, n1, n2, n3, n4, f ) where

• P = {p1, p2, ..., pN}, pi∈ R2, 1 ≤ i ≤ N , is the set of sites (points) on the plane enclosed in a rectangle R,

• L is the set of labels with |L| = n1+ n2+ n3+ n4,

• n1, n2, n3, n4 ∈ N are the numbers of labels to the East, West, South, and North, respectively, of the axis-parallel rectangle enclosing all sites in P , • f : P → L is an onto function which assigns each site in P to a label in

L. Note that f is a many-to-one function in general.

W.l.o.g., we assume that for k=1 (resp., 2), labels are only placed on the East side (resp., East and West sides) of the enclosing rectangle of P . Hence, n2+ n3+ n4 = 0 for k = 1 and n3+ n4 = 0 for k = 2. On the other hand, labels can be placed on the four sides of the rectangle when k = 4. The parameter t, t ∈ {opo, po, s}, refers to the type of leaders allowed for connecting sites to labels. The opo, po, and s stand for orthogonal-parallel-orthogonal, parallel-orthogonal and straight-line, respectively. See Figure 3 for these three types of leaders. For notational convenience, we refer to the East, West, South, and North sides to be the 1st, 2nd, 3rd, and 4th sides throughout the rest of this paper. One should also note that every label l is connected with |f−1(l)| sites; hence, l has to have |f−1(l)| ports to which the sites are connected. Although f−1 is not a

(7)

function, the slight abuse of notation is simply for convenience of understanding. For simplicity, we assume that there are no two sites with the same x- or y-coordinates, and the locations of ports of each label are predefined (see label l3 with three ports in Figure 3 (a)). Note that if part of a leader is overlapped with a certain other leader in a boundary labeling, then the overlapping can be removed by slightly adjusting the location of port of one of the two leaders. Therefore, it is reasonable to assume that leaders never overlap. In addition, the leader connecting site u to label l is denoted by ul.

A boundary labeling of a map M is a sequence of labels (l1

1, ..., ln11, l12, ..., ln2

2 , l13, ..., ln33, l41, ..., l4n4) such that ∀1 ≤ i ≤ 4, 0 ≤ j ≤ ni, lji ∈ L. W.l.o.g., we assume that all the labels are different. Intuitively speaking, l1

i, ..., lini is the sequence of labels along the i-th side. W.l.o.g., for i = 1 and 2 (i.e., East and West sides, resp.) a top-down ordering is assumed; for i = 3 and 4 (i.e., South and North sides, resp.) a left-to-right ordering is assumed. Figure 5 illustrates a 4-side type-s boundary labeling. For simplicity, we assume labels (drawn as rectangles) along the same side to be of uniform and maximum size; hence, the ordering of labels along each side is sufficient to determine the exact positions of labels. As f is a many-one function in general, there might be several sites connecting to the same label. For example, three sites are connected to label l3 in Figures 3(a) and 3(b). It is easy to observe from that to minimize the number of crossings (or the total leader length) in the case of type-opo leaders show in Figure 3(a) (resp., type-po leaders show in Figure 3(b)), the ordering of ports at which the three leaders touch label l3 (drawn as a rectangle) must respect the ordering (in increasing order) of the y-coordinates (resp., x-coordinates) of the three sites connected to label l3. The crossing number is the number of crossings among leaders in a drawing.

R l4 l2 l5 l8 l10 l1 l3 l7 l12 l11 l6 l9 n1 n2 n4 n3

Figure 5: A four-side many-to-one labeling with type-s leaders.

(8)

The Crossing Problem for k-Side Many-to-One Labeling with Type-t (CPkML-Type-t, for shorType-t): Given a k-side Type-type-Type-t map M, deType-termine a boundary labeling for M so that the crossing number is minimized.

Before deriving our main results, we first recall three NP-complete problems, namely, the Decision Crossing Problem (DCP) [8], the Max-Bisection Problem [22], and the Min-Bisection Problem for directed graphs [10] that are closely related to our problems.

Consider a two-layered network G = (L0, L1, E) consisting of disjoint sets L0 and L1of nodes and a set E ⊆ L0× L1 of edges. Assume that the nodes in L0 and L1appear on the vertical lines x = 0 and x = 1, respectively, and the edges in E are straight line segments joining two nodes from L0 and L1 respectively. A drawing of G is generated by assigning each node v ∈ Li, i = 0, 1, to a y-coordinate yi(v). Hence, two edges uv and tw, where u, t ∈ L0 and w, v ∈ L1, cross in the drawing if and only if (y0(u) − y0(t))(y1(v) − y1(w)) < 0. Let the number of crossings in a drawing of G specified by y0 and y1 be denoted by cross(G, y0, y1). In fact, the crossing number is affected only by the ordering of the nodes of L0and L1, not by their precise positions; so y0and y1 are said the ordering of L0and L1, respectively. The DCP is stated as follows:

The Decision Crossing Problem (DCP)

Instance: A two-layered network G = (L0, L1, E), an ordering y0of L0, and an integer M .

Question: Is there an ordering y1 of L1, so that cross(G, y0, y1) ≤ M ?

The Max-Bisection Problem is stated as follows. So far the best approxima-tion ratio for the Max-Bisecapproxima-tion problem is 1.431 [22].

The Max-Bisection Problem: Given an undirected graph G = (V, E) with non-negative weights wi,j for each edge in E (and wi,j = 0 if (i, j) 6∈ E), partition the nodes in V into two sets S and V \ S of equal cardinality so that w(S) :=P

i∈S,j∈V \Swi,j is maximized.

Contrary to the Max-Bisection Problem, the Min-Bisection Problem is the problem of computing a bisection for an input graph G so that w(S) is min-imized. Note that if the graph is directed, then the objective of the problem is to minimize w(S) :=P

(i,j)∈(S,V \S)wi,j. The problem for undirected graphs is known to be NP-hard [12], and the problem for directed graphs can be eas-ily shown to be NP-hard as well [10]. For the case of undirected graphs, an O(log1.5n)-approximation algorithm is known [9]. In practice, Kernighan-Lin heuristic (a.k.a., K-L heuristic) [15] is a well-known algorithm for handling the problem for undirected case. As for the case of directed graphs, Feige and Ya-halom [10] showed that the Min-Bisection Problem for directed graphs is not approximable at all.

(9)

3

The Crossing Problem for One-Side

Many-to-One Labeling with Type-opo Leaders

In this section, we show that the crossing problem for one-side many-to-one labeling with type-opo leaders (CP1ML-opo) is NP-complete (Subsection 3.1). We also give an approximation algorithm guaranteed to yield a solution which is less than or equal to three times the optimal solution (Subsection 3.2). Note that in the restricted case in which each label is associated with at most two sides, an analysis used in [16] can be applied to showing the algorithm presented in Subsection 3.2 to be optimal.

3.1

CP1ML-opo is NP-complete

Consider the case where all the labels are placed on the East side of rectangle R which encloses all the sites in the given map. Recall that we assume that there are no two sites with the same x- or y- coordinates. In addition, since every leader goes from a site through the right borderline of rectangle R orthogonally, there is no crossing between leaders inside rectangle R. We can arbitrarily adjust the x-coordinate of the bend of every type-opo leader in the track routing area (see Figure 3 (a)) so that two leaders cross only when the y-coordinate order of their corresponding sites is different from that of their corresponding labels. That is, the crossing number is affected only by the y-coordinate orders of sites and labels, not by their x-coordinate orders. As a result, if every type-opo leader is replaced by a straight line segment and all the sites are on a vertical line, then the problem under consideration is similar to the DCP except our problem allows more than one site to be connected to a common label. In what follows, we show the concerned problem to be NP-complete. In the case where every leader is replaced by a straight line segment and every site is placed on a vertical line, the decision version of the problem can be captured by the decision many-to-one crossing problem (DMCP) as follows:

The Decision Many-to-One Crossing Problem (DMCP)

Instance: A two-layered network G = (L0, L1, E) where the mapping from nodes in L0to nodes in L1is a many-to-one function, an ordering y0of L0, an integer M .

Question: Is there an ordering y1 of L1, so that cross(G, y0, y1) ≤ M ? Theorem 1 DMCP is NP-complete.

Proof: It is clear that DMCP is in NP because we can guess an ordering of L1 and then check if the crossing number is no more than M in polynomial time.

It remains to show the NP-hardness, which is established by a reduction from DCP as follows.

DCP differs from DMCP only in the restriction that each node in L0 is connected only by an edge. From a DCP instance G = (L0, L1, E), M (note that M refers to both a part of the instance of DCP and the number of crossings

(10)

G' (L0', L1', E') p1 p2 p3 p4 G (L0, L1, E) 1 1 p 2 1 p 3 1 p 4 1 p 1 2 p 2 2 p 1 3 p 2 3 p 3 3 p 4 3 p 1 4 p 2 4 p 3 4 p 4 4 p 5 4 p 6 4 p

Figure 6: An example reducing from DCP to DMCP.

qs qt in G' t i p   2| 1| i p t i p   2| 1| i p s i p s i p

Figure 7: The first category of crossings.

pi pj qs qt qs qt 1 crossing in G 4 crossings in G'   2| 1| i p k i p   2| 1| i p l j p k i p l j p

(11)

of DCP), we construct a DMCP instance G′= (L

0, L′1, E′), M′ as follows. Let L′

1= L1. We denote the node with the i-th maximal y-coordinate in L0 by pi, and {l1

i, l2i, ..., lki} is the set of the nodes in L1to which piis connected, i.e., there are k edges connecting pi to k nodes in L1. For each node piin L0, we create a set of 2k nodes, say Pi= {p1i, p2i, ..., p2ki }, in L′0, where p

j

i has the j-th maximal y-coordinate among all. Then for j = 1 to k, we connect pji and p

2k−j+1

i to l

j i. That is, we connect p1

i and p2ki to l1i, p2i and p2k−1i to l2i, ... , and pki and pk+1i to lk

i. An example is illustrated in Figure 6.

We denote the cardinality of Pi by |Pi| and the number of the nodes in L0 by |L0|. Let M′ be |L0| X i=1 2|Pi|/2 2  + 4M

We show that there exists an ordering y1′ of L′1such that cross(G′, y′0, y1′) ≤ M′ if and only if there exists an ordering y1 of L1such that cross(G, y0, y1) ≤ M . The crossings in G′ can be divided into the following two categories: the edge incident to a node in Pi crosses the edge incident to a node 1) in the same Pi or 2) in Pj for i 6= j. For the first category of crossings, as shown in Figure 7, for i = 1, ..., |L0|, for any two pairs of nodes in Pi, (psi, p

2|pi|−s+1

i ) and

(pt i, p

2|pi|−t+1

i ), s 6= t, there are two crossings regardless of the order of qsand qt, and hence there are 2 |Pi|/2

2  crossings for all permutations of selecting 2 from {p1

i, p2i, ..., p |Pi|

i }. So the crossing number for the first category is P|L0|

i=12 |Pi|/2

2 . For the second category of crossings, as shown in Figure 8, the edge piqt crosses the edge pjqs in G if and only if there are the four crossings shown in the right of Figure 8 in G′, regardless of the order of q

sand qt. Therefore, there are 4M crossings for the second category in G′ if and only if G has M crossings. 2 Based on the above, we have the following corollary.

Corollary 1 CP1ML-opo is NP-complete.

Proof: (Sketch) To yield the lower bound, it suffices to show a reduction from DMCP to CP1ML-opo.

Consider an instance of DMCP, i.e., a two-layered network G = (L0, L1, E), ordering y0 of L0. With those information, Algorithm 1 constructs a one-side type-opo map M.

In what follows, we discuss all the possible cases of whether any two leaders, say palband pcld, cross in M. W.l.o.g., we assume that the y-coordinate of pais greater than that of pc; leaders palband pcldare not straight-line segments (i.e., there are bends on palband pcld). Note that, in a boundary labeling for type-opo leaders, we only need to consider the crossings of leaders in track routing area because all the type-opo leaders go from a site through the right borderline of rectangle R orthogonally so that there are no crossings inside rectangle R. We discuss the following two cases: the bends of type-opo leaders palb and pcld are drawn in 1) the same category; 2) different categories. In the first case, w.l.o.g.,

(12)

Algorithm 1 DMCP-to-CP1ML-opo

Input: A two-layered network G = (L0, L1, E) where the mapping form nodes in L0 to nodes in L1 is a many-to-one function, ordering y0 of L0, ordering y1 of L1 (e.g., see Figure 9(a)).

Output: A one-side type-opo map M (e.g., see Figure 9(b)).

1: Construct a one-side type-opo map M where every site represents every node in L0; the locations of sites are determined so that the y-coordinate order of sites is the same as ordering y0 of L0 while the x-coordinate order of sites is determined arbitrarily; every label represents every nodes in L1; the y-coordinate order of labels is the same as ordering y1 of L1.

2: Vertically slice the track routing area of map M into two regions, where the right (resp., left) region is denoted by T1(resp., T2), as shown in Figure 9(b). 3: Now we connect each leader in M representing each edge in E. According to the locations of two endpoints of each leader, all the leaders are classified into two categories: the first category is denoted by C1, where the corresponding site of every leader has larger y-coordinate than its corresponding label port; the second category is denoted by C2, which includes the leaders that are not in C1.

4: Sort the labels connected by the leaders in each category according to their y-coordinates.

5: Now we draw every leader as follows. In order not to induce the crossings among the leaders connected to a common label, one should notice that the y-coordinate increasing ordering of the ports at which the leaders touch a label must respect the y-coordinate increasing ordering of the sites connected to the label. As shown in Figure 9(b), the bends of all the type-opo leaders in C1 (resp., C2) are drawn in region T1 (resp., T2), and the x-coordinate increasing order of the bends of the leaders in C1 (resp., C2) respects the y-coordinate increasing order (resp., y-coordinate decreasing order) of their corresponding sites. R l1 l2 p1 p2 p3 p5 T2 T1

track routing area

(b) (a) p4 p1 p2 p3 p4 l1 l2 p5

Figure 9: (a) A instance of two-layered network. (b) The boundary labeling corresponding to (a).

(13)

we assume the bends of type-opo leaders palb and pcld to be drawn in region T1. Since from Step 5 of Algorithm 1 the x-coordinate increasing order of the bends of leaders palband pcldrespects the y-coordinate increasing order of sites pa and pc, hence, the two leaders must be drawn as Figure 10(a1) or 10(a2). In the second case, w.l.o.g., we assume the bends of leaders palb and pcld to be drawn in regions T1 and T2, respectively. By Step 5 of Algorithm 1, the two leaders must be drawn as Figure 10(b1), 10(b2), or 10(b3). We observe from Figure 10 that there is one crossing between leaders palb and pcldif and only if the y-coordinate increasing order of sites paand pcdiffers from that of labels lb and ld. Note that by Algorithm 1 there is at most one crossing between leaders palb and pcld. (a2) (a1) pa lb pc ld T2 T1 pa lb pc ld T2 T1 (b2) (b1) (b3) pa lb pc ld T2 T1 pa lb pc ld T2 T1 pa lb pc ld T2 T1

Figure 10: (a) All the possible cases where bends of two leaders are drawn in region T1. (b) All the possible cases where the bend of leader palb (resp., pcld) is drawn in region T1 (resp., T2).

In light of the above, two edges (leaders) palb and pcld in G (in M) cross if and only if the y-coordinate increasing order of nodes (sites) pa and pc differs from that of nodes (labels) lb and ld. Hence, we obtain that two edges palb and pcldin G cross if and only if there is one crossing between two leaders in M. 2

3.2

An approximation algorithm

Our approximation algorithm is similar to the so-called median algorithm pro-posed by Eades and Wormald in [8]. The idea of the median algorithm is to place the labels in “median order”. For convenience and simplicity, we view the labeling problem as finding an ordering y1 of L1 in a two-layered network G = (L0, L1, E) such that the crossing number is as small as possible. Define Nu of u ∈ L1 as the nodes {v1, v2, ..., vj} ∈ L0 incident to u. The median or-der is, for each node u ∈ L1, to choose the median of the y-coordinates of the neighbors of u as the y-coordinate of u. Precisely, if Nu = {v1, v2, ..., vj} with y0(v1) < y0(v2) < y0(v3) < ... < y0(vj), then define med(u) = y0(v⌊j/2⌋). The median algorithm sets y1(u) = med(u) for each node u ∈ L1, and separates the two nodes with the same median by an infinitesimal amount.

The crossing number in the output of the median algorithm is denoted by med(G, y0), while the crossing number in the output of the optimal labeling is denoted by opt(G, y0).

(14)

Theorem 2 For all two-layered networks G where the mapping from L0 to L1 is a many-to-one function and for all orderings y0, med(G, y0) ≤ 3opt(G, y0). Proof: Along a similar line of the proof of [8], our proof is given as follows.

Define cuv of u, v ∈ L1 as the number of crossings that the edges incident to u make with the edges incident to v when y1(u) < y1(v). More formally, for u 6= v ∈ L1,

cuv= |{{su, tv} ⊆ E : y0(s) > y0(t)}|

and cuu= 0. The degree of u is denoted by du. For proving the theorem , we claim that if u, v ∈ L1, and med(u) ≤ med(v), then cuv < 3cvu. Divide the edges incident with u and v into 4 groups α, β, γ, and δ, where

α = {wu : y0(w) ≤ med(u)}, β = {wv : y0(w) ≥ med(v)}, γ = {wv : y0(w) < med(v)}, δ = {wu : y0(w) > med(u)},

į ȕ į į ȕ Ȗ Į Į v u

Figure 11: An example for the groups α, β, γ, and δ.

An example is illustrated in Figure 11. Let a = |α|, b = |β|, c = |γ|, d = |δ|. If med(u) = y1(u) ≤ med(v) = y1(v), then edges in α cannot cross edges in β. Furthermore, the number of crossings between edges in α and edges in γ is at most ac, and similarly for crossings between edges in β and edges in δ. Also, the number of crossings between edges in γ and edges in δ is at most cd. So

cuv≤ ac + bd + cd.

Furthermore, if u and v are placed so that y1(u) > y1(v), then edges in α must cross edges in β; hence

cvu ≥ ab.

The claim can be discussed by four cases where du and dv are odd or even. In the following we only consider the case where duand dvare both odd; the other cases are similar and simpler.

(15)

a = du+ 1 2 , d = du− 1 2 , b = dv+ 1 2 , c = dv− 1 2 ⇒ cuv≤ ac + bd + cd = du+ 1 2 × dv− 1 2 + dv+ 1 2 × du− 1 2 + dv− 1 2 × du− 1 2 ≤ 3 4(du+ 1)(dv+ 1), cvu≥ ab = du+ 1 2 × dv+ 1 2 = 1 4(du+ 1)(dv+ 1) ⇒ cuv≤ 3cvu Therefore, med(G, y0) = X med(u)≤med(v);y1(u)<y1(v) cuv ≤ X u,v∈L1

3 min{cvu, cuv} (Since cuv≤ 3cvu and cuv ≤ 3cuv)

≤ 3 X

u,v∈L1

min{cvu, cuv} ≤ 3opt(G, y0)

2 It should be noticed that finding improved approximation algorithms for the CP1ML-opo problem remains an interesting open question.

An experimental result using the approximation algorithm described earlier is given in Figure 12, which illustrates the distribution of some wildlife animals in Taiwan, where leaders are drawn by Algorithm 1. Intuitively many-to-one boundary labeling is more suitable for static maps, for which the leaders allow the user to easily trace the corresponding label of each site. When the number of labels gets larger, such an advantage becomes more obvious.

4

The Crossing Problem for Two-Side

Many-to-One Labeling with Type-opo Leaders

From our previous result that the crossing problem is NP-complete for CP1ML-opo, the intractability result clearly holds for CP2ML-opo as well. (CP1ML-opo is a special case of CP2ML-opo with n2 = 0.) In this section, we consider CP2ML-opo under the restriction that n1 = n2 (i.e., the East and West sides contain the same number of labels). The reason why such a restriction makes sense is given as follows. Recall that we assume labels along the same side to be of equal size. If n1= n2 (e.g., see Figure 13(a)), then labels on both sides are of equal size, which may give us a high degree of balance in visibility because labels on two sides can be viewed as a reflectional symmetry along a vertical axis, regardless of leaders and sites. On the other hand, if there is a significant

(16)

Legend:

Brown booby Taiwan hill partridge Masked palm civet Hawk Melogale moschata Bamboo partridge Chinese pangolin Mallard Taiwan hill partridge Masked palm civet Melogale moschata Bamboo partridge Chinese pangolin Mallard Hawk Brown booby

Figure 12: The distribution of some animals in Taiwan, which is represented by one-side many-to-one labeling with type-opo leaders.

(17)

difference in the number of labels on the two sides, then the texts inside the labels along the denser side may not be readable as Figure 13(b) shows.

R (a) n1 = n2 = 5 (b) n1z n2 (n1 = 8, n2 =2) l6 l7 l8 l9 l10 l8 l9 R l1 l2 l3 l4 l5 l2 l3 l10 l4 l1 l5 l7 l6

Figure 13: Two boundary labeling layouts with type-opo leaders for the same map.

Note that if the number of labels is not even, we can just add a dummy label to make the number even. In this section, we first show the concerned crossing problem to be NP-complete, and then provide an approximation algorithm for the intractable problem.

4.1

CP2ML-opo is NP-complete even when n

1

= n

2

Since the labeling in this section applies type-opo leaders (which is the same as the previous section), hence the crossing number is influenced only by the differences between the y-coordinate orderings of sites and either the labels in the right side or the labels in the left side, respectively. Therefore, the problem can be modeled as an analogy of three-layered network, of which definition is given as follows. A three-layered network G = (L0, LL, LR, E) consists of three disjoint sets L0, LL, and LR of nodes and a set E ⊆ L0× LL∪ L0× LR of edges. Assume that the nodes in L0, LL, and LR appear in the vertical lines x = 0, x = −1, and x = 1, respectively. Similar to the definition of two-layered network, y0, yL, yRcan be defined. Notice that the crossing number in a three-layered network is influenced by altering the orderings yL and yR or swapping the nodes in LR with those in LL. In what follows, we show the concerned labeling problem to be NP-complete. The decision version of the problem can be stated as follows:

The Decision Three-Layered Many-to-One Crossing Problem with |LL| = |LR| (D3MCP)

Instance: A three-layered network G = (L0, LL, LR, E) with |LL| = |LR| where the mapping from the nodes in L0 to the nodes in LR∪ LL is a many-to-one function, an ordering y0 of L0, an integer M .

Question: Can we find the orderings yL of LL and yR of LR and swap some nodes in LR with those in LL, so that the crossing number is no more than M ? Theorem 3 D3MCP is NP-complete.

Proof:It is clear that D3MCP is in NP; to prove its NP-hardness, the reduction from the DMCP (mentioned in Theorem 1) is established as follows. Starting

(18)

References

[1] M. Bekos, M. Kaufmann, K. Potika, and A. Symvonis. Boundary labelling of optimal total leader length. In Proceedings of the 10th Panhellenic Con-ference on Informatics (PCI 2005), volume 3746 of LNCS, pages 80–89, 2005.

[2] M. Bekos, M. Kaufmann, K. Potika, and A. Symvonis. Polygons labelling of minimum leader length. In Proceedings of Asia Pacific Symposium on Information Visualisation 2006 (APVIS2006), volume 60 of CRPIT, pages 15–21, 2006.

[3] M. Bekos, M. Kaufmann, A. Symvonis, and A. Wolff. Boundary labeling: models and efficient algorithms for rectangular maps. In Proceedings of the 12th International Symposium on Graph Drawing (GD 2004), volume 3383 of LNCS, pages 49–59, 2004.

[4] M. Bekos, M. Kaufmann, A. Symvonis, and A. Wolff. Boundary label-ing: models and efficient algorithms for rectangular maps. Computational Geometry: Theory and Applications, 36(3):215–236, 2006.

[5] M. Bekos and A. Symvonis. BLer: a boundary labeller for technical draw-ings. In Proceedings of the 13th International Symposium on Graph Drawing (GD 2005), volume 3843 of LNCS, pages 503–504, 2006.

[6] M. Benkert, H. Haverkort, M. Kroll, and M. N¨ollenburg. Algorithms for multi-criteria one-sided boundary labeling. In Proceedings of the 15th Inter-national Symposium on Graph Drawing (GD 2007), volume 4875 of LNCS, pages 243–254, 2008.

[7] B. Chazelle and 36 co-authors. The computational geometry impact task force report. In B. Chazelle, J. E. Goodman, and R. Pollack, editors, Advances in Discrete and Computational Geometry, volume 223, pages 407– 463. AMS, 1999.

[8] P. Eades and N. C. Wormald. Edge crossings in drawings of bipartite graphs. Algorithmica, 11:379–403, 1994.

[9] U. Feige and R. Krauthgamer. A polylogarithmic approximation of the minimum bisection. SIAM Review, 48(1):99–130, 2006.

[10] U. Feige and O. Yahalom. On the complexity of finding balanced oneway cuts. Information Processing Letter, 87(1):1–5, 2003.

[11] M. Formann and F. Wagner. A packing problem with applications to let-tering of maps. In Proceedings of the 7th Annual ACM Symposium on Computational Geometry (SoCG 1991), pages 281–288. ACM Press, 1991. [12] M. R. Garey and D. S. Johnson. Computers and Interactability. A Guide to the Theory of NP-Completeness. A Series of Books in the Mathematical Sciences. Freemann And Company, 1979.

(19)

[13] E. Imhof. Positioning names on maps. The American Cartographer, 2(2):128–144, 1975.

[14] C. Iturriaga and A. Lubiw. NP-hardness of some map labeling problems. Technical Report CS-97-18, University of Waterloo, 1997.

[15] B. W. Kernighan and S. Lin. An efficient heuristic procedure for partition-ing graphs. The Bell System Technical Journal, 49(2):291–307, 1970. [16] X. Munoz, W. Unger, and I. Vrt’o. One sided crossing minimization is

NP-hard for sparse graphs. In Proceedings of the 9th International Symposium on Graph Drawing (GD 2001), volume 2265 of LNCS, pages 115–123, 2002. [17] G. Neyer. Map labeling with application to graph drawing. In D. Wagner and M. Kaufman, editors, Drawing Graphs: Methods and Models, volume 2025 of LNCS, pages 247–273. 2001.

[18] P. M. Vaidya. Geometry helps in matching. SIAM Journal on Computing, 18(6):1201–1225, 1989.

[19] F. Wagner. Approximate map labeling is in ω(n log n). Information Pro-cessing Letter, 52(3):161–165, 1994.

[20] F. Wagner and A. Wolff. Map labeling heuristics: provably good and practically useful. In Proceedings of the 11th Annual ACM Symposium on Computational Geometry (SoCG 1995), pages 109–118. ACM Press, 1995. [21] A. Wolff and T. Strijk. The map-labeling bibliography.

http://i11www.ira.uka.de/map-labeling/bibliography/, 1996.

[22] Y. Ye. A .699-approximation algorithm for max-bisection. Mathematical Programming, 90(1):101–111, 2001.

數據

Figure 1: An example of many-to-one boundary labeling.
Figure 2: Other labeling approaches.
Figure 4: Comparison between type-do and type-do leaders in one-to-one bound- bound-ary labeling.
Table 2: Variants of one-to-one boundary labeling problems and their complex- complex-ities.
+6

參考文獻

相關文件

The underlying idea was to use the power of sampling, in a fashion similar to the way it is used in empirical samples from large universes of data, in order to approximate the

We would like to point out that unlike the pure potential case considered in [RW19], here, in order to guarantee the bulk decay of ˜u, we also need the boundary decay of ∇u due to

In Section 3, the shift and scale argument from [2] is applied to show how each quantitative Landis theorem follows from the corresponding order-of-vanishing estimate.. A number

It’s easy to check that m is a maximal ideal, called the valuation ideal. We can show that R is a

• To explore the roles of English Language curriculum leaders in planning the school-based curriculum in primary schools under Learning to Learn 2.0.. • To introduce

Now, nearly all of the current flows through wire S since it has a much lower resistance than the light bulb. The light bulb does not glow because the current flowing through it

To tie in with the implementation of the recommendations of the Task Force on Professional Development of Teachers and enable Primary School Curriculum Leaders in schools of a

Then, it is easy to see that there are 9 problems for which the iterative numbers of the algorithm using ψ α,θ,p in the case of θ = 1 and p = 3 are less than the one of the