• No results found

It is NP-hard to obtain an approximation solution with a factor better than 2 using discrete labels for the MLUS-AP problem.

3 Algorithm

Corollary 1. It is NP-hard to obtain an approximation solution with a factor better than 2 using discrete labels for the MLUS-AP problem.

Notice that how to reduce the gap between 1.33−!and 2for approximating MLUS-AP remains an open problem. From Corollary 1, apparently we have to use sliding labels to improve the factor-2approximation.

References

1. P.Agarwal, M.van Kreveld and S.Suri.Label placement by maximum independent set in rectangles. Comp. Geom. Theory and Appl.,11:209–218, 1998.

2. M.Blum, R.W.Floyd, V.R.Pratt, R.L.Rivest and R.E.Tarjan.Time Bounds for Selection. J. of Computer and System Sciences, 7(4):448–461, 1973.

3. T.H.Cormen, C.E.Leiserson and R.L.Rivest.Introduction to algorithms.MIT Press, 1990.

4. J.Christensen, J.Marks, and S.Shieber. An Empirical Study of Algorithms for Point-Feature Label Placement,ACM Transactions on Graphics,14:203–222, 1995.

5. J.Doerschler and H.Freeman. A rule-based system for cartographic name place- ment. CACM, 35:68–79, 1992.

6. A.Datta, II.-P.Lenhof, C.Schwarz, and M.Smid.Static and dynamic algorithms for k-point clustering problems, J. Algorithms,19:474–503, 1995.

7. S.Doddi, M.Marathe and B.Moret, Point set labeling with specified positions. InProc. 16th Annu. ACM Sympos. Comput. Geom., pages 182–190, June, 2000. 8. S.Doddi, M.Marathe, A.Mirzaian, B.Moret and B.Zhu, Map labeling and its gen-

eralizations.InProc. 8th ACM-SIAM Symp on Discrete Algorithms (SODA’97), New Orleans, LA, pages 148–157, Jan, 1997.

9.R.Duncan, J.Qian, A.Vigneron and B.Zhu. Polynomial time algorithms for three-label point labeling, Invited paper accepted by TCS, a special issue for CO- COON’01, March, 2002.

10. D.Eppstein and J.Erickson.Iterated nearest neighbors and finding minimal poly- topes, Discrete & Comput. Geom.,11:321–350, 1994.

11. S.Even, A.Itai and A.Shamir. On the complexity of timetable and multicom- modity flow problem. SIAM J. Comput., 5:691–703, 1976.

12. M.Formann and F.Wagner. A packing problem with applications to lettering of maps.InProc. 7th Annu. ACM Sympos. Comput. Geom., pages 281–288, 1991. 13.C.Iturriaga and A.Lubiw. Elastic labels: the two-axis case. In Proc. Graph

Drawing’97, pages 181–192, 1997.

14.E.Imhof. Positioning names on maps.The American Cartographer, 2:128–144, 1975.

15.C.Jones.Cartographic name placement with Prolog.Proc. IEEE Computer Graph- ics and Applications, 5:36–47, 1989.

16.M.van Kreveld, T.Strijk and A.Wolff. Point set labeling with sliding labels. Comp. Geom. Theory and Appl.,13:21–47, 1999.

17. K.Kakoulis and I.Tollis.An algorithm for labeling edges of hierarchical drawings. InProc. Graph Drawing’97, pages 169–180, 1997.

18. K.Kakoulis and I.Tollis.A unified approach to labeling graphical features.Proc. 14th Annu. ACM Sympos. Comput. Geom., pages 347–356, 1998.

19. D.Knuth and A.Raghunathan.The problem of compatible representatives.SIAM J. Disc. Math., 5:422–427, 1992.

20. F.P. Preparata and M.I. Shamos. Computational Geometry: An Introduction. Springer-Verlag, 1985.

21. C.K.Poon, B.Zhu and F.Chin, A polynomial time solution for labeling a recti- linear map.InProc. 13th Annu. ACM Sympos. Comput. Geom., pages 451–453, 1997.

22. Z.P.Qin, A.Wolff, Y.Xu and B.Zhu.New algorithms for two-label point labeling, InProc. 8th European Symp. on Algorithms (ESA’00),pages 368–379, Springer- Verlag, LNCS series, 2000.

23. Z.P.Qin, B.Zhu and R.Cimikowski.A simple factor-3 approximation for labeling points with circles, Submitted to IPL, April, 2002.

24. T.Strijk and A.Wolff. Labeling points with circles.Intl. J. Computational Ge- ometry and Applications, 11(2):181–195, 2001.

25. F.Wagner and A.Wolff. Map labeling heuristics: Provably good and practically useful.InProc. 11th Annu. ACM Sympos. Comput. Geom., pages 109–118, 1995. 26.B.Zhu and C.K.Poon. Efficient approximation algorithms for two-label point labeling, Intl. J. Computational Geometry and Applications, 11(4):455–464, 2001. 27. B.Zhu and Z.P.Qin.New approximation algorithms for map labeling with sliding

Problem

Sasanka Roy1, Partha P. Goswami2, Sandip Das1, and Subhas C. Nandy1

1 Indian Statistical Institute, Calcutta 700 035, India 2 Computer Center, Calcutta University, Calcutta 700 009, India

Abstract. We investigate a special class of map labeling problem.Let

P ={p1, p2, . . . , pn}be a set of point sites distributed on a 2D map.A label associated with each point is a axis-parallel rectangle of a constant height but of variable width.Here height of a label indicates the font size and width indicates the number of characters in that label.For a point

pi, its label contains the point pi at its top-left or bottom-left corner,

and it does not obscure any other point inP.Width of the label for each point inP is known in advance.The objective is to label the maximum number of points on the map so that the placed labels are mutually non- overlapping.We first consider a simple model for this problem.Here, for each pointpi, the corner specification (i.e., whether the point pi would

appear at the top-left or bottom-left corner of the label) is known.We formulate this problem as finding the maximum independent set of a chordal graph, and propose anO(nlogn) time algorithm for producing the optimal solution.If the corner specification of the points inP is not known, our algorithm is a 2-approximation algorithm.Next, we develop a good heuristic algorithm that is observed to produce optimal solutions for most of the randomly generated instances and for all the standard benchmarks available in [13].

1 Introduction

Labeling a point set is a classical problem in the geographic information systems, where the points represent cities on a map which need to be labeled with city names. The point set labeling problem finds many important statistical applica- tions, e.g., scatter plot of principal component analysis [6], in spatial statistics where the aim is to post the field measures against the points, etc. The ACM Computational Geometry Impact Task Force report [2] lists label placement as an important research area.

In general, the label placement problem includes positioning labels for area, line and point features on a 2D map. A good labeling algorithm has two basic require- ments: the label of a site should touch the site at its boundary, and the labels of two sites must not overlap. Another important requirement is that the label of one site should not obscure the other sites on the map. Many other aesthetic

M. Penttonen and E. Meineche Schmidt (Eds.): SWAT 2002, LNCS 2368, pp. 110–120, 2002. c

requirements for map labeling are listed in [7]. Given the basic requirements, two major types of problems are considered: (1) label as many sites as possible, and (2) find the largest possible size of the label such that all the sites can be labeled in a non-overlapping manner. In general, both of these problems are NP-hard [4]. In this paper, we shall consider a special case of the first variation of the point-site labeling problem.

LetP ={p1, p2, . . . , pn}be a set ofnpoints in the plane. For each pointpi∈P,

we have a rectangular label ri of specified size, and a set πi of marked posi-

tions on the boundary of ri. The label of a point pi must be placed parallel

to the coordinate axes, and must contain pi on one of the marked positions

on πi. A feasible configuration is a family of axis-parallel rectangles (labels) R ={r1, r2, . . . , rk}, where all the i ∈ {1,2, . . . , k} are different andri is

represented by a tuple {(pi, xi) | pi P, xi ∈πi and ri is placed withpi

at the position xi on its boundary}, such that the members inR are mutually

non-overlapping. The label placement problem is to find the largest feasible con- figuration [1]. Typical choices of πi include (i) the end points of the left edge

of ri, (ii) the four corners of ri, or (iii) the four corners and the center points

of four edges ofri, etc. In [1], anO(logn)-approximation algorithm is proposed

for this problem which runs in O(nlogn) time. An α-approximation algorithm produces a solution of size at least

α, where is the size of the optimal solu-

tion. In particular, if the labels are of the same height, a dynamic programming approach is adopted to get a (1 + 1

k)-approximation algorithm which runs in O(nlogn+n2k−1) time [1]. This case is of particular importance since it models

the label placement problem when all labels have the same font size. In [15], a simple heuristic algorithm for the point labeling problem is proposed which is easy to implement and produces near-optimal solution, but the running time is

O(nlogn+k), wherekmay beO(n2) in the worst case. The point labeling with

sliding labels is introduced in [8], where the point pi can assume any position

on the boundary ofri. The problem has shown to be NP-hard, and using plane

sweep paradigm, a 2-approximation algorithm has been presented whose time complexity is O(nlogn). The label placement problem in the slider model has been extended for the map containing several polygonal obstacles, and the ob- jective is to label a set of npoint sites avoiding those obstacles [10]. The time complexity of this algorithm isO((n+m)log(n+m)), wherem and n are re- spectively the total number of vertices of all the polygons, and the number of point sites to be labeled. In [11], a decision theoretic version of the map labeling problem is introduced where the sites are horizontal and vertical line segments. Each label has unit height and is as long as the segment it labels. The problem is to decide whether it is possible to label all the sites. The problem is trans- formed to the well known 2-SATISFIABILITY problem, and an algorithm for this decision problem is proposed which runs in O(n2) time. Later, in [9], the

time complexity was improved to O(nlogn). Good heuristics are proposed for labeling arbitrary line segments and polygonal areas [3].

In our model, the labels of the points on the map are axis-parallel rectangles of a constant height (h) but of variable width. The width (wi) of the label of

a point pi is pre-specified. The point pi appears either on the top-left or the

bottom-left corner of its label. A label said to be valid if it does not contain any other point(s) of P. Thus, for each point, it may not have any valid label, or it can have one valid label or it can have two valid labels. We consider the following two variations of the problem:

P1:For each pointpi∈P, the corner specification (i.e., whetherpiwould appear

at the top-left or bottom-left corner of the label) is known.

P2:The corner specifications of the points inP are not known.

Problem P1 is modeled using maximum independent set of a chordal graph, and anO(nlogn) time algorithm is proposed which produces optimum solution. A minor modification of this algorithm is proved to be a 2-approximation al- gorithm for problem P2. Finally, we propose an efficient heuristic algorithm for the problem P2. This heuristic is tested on several randomly generated examples and the standard benchmarks [13]. In most of the randomly generated examples, and for all the benchmarks it produces optimum solution. Surely, we have en- countered few random instances where it fails to produce optimum solution. However, for all instances, we have tried, our algorithm outputs better result than the algorithm presented in [1].

2 Problem P1

Let P = {p1, p2, . . . , pn} be a set of points in the plane. Each point pi is as-

sociated with a label ri which is a closed region bounded by an axis-parallel

rectangle. We assume that the heights of allri are same, but their width may

vary. The placement of label ri must coincide with the point pi at either of

its top-left and bottom-left corners which is specified. A label ri is said to be valid if it does not contain any point pj P(j =i) in its interior. In Fig. 1,

we demonstrate the valid and invalid labels (using solid and dashed rectangles, respectively). We construct a graph, called label graph LG= (V, E), whose set of vertices (V) correspond to the valid labels of the points inP. An edgee∈E

connects a pair of nodes vi, vj if their corresponding labels have a non-empty

intersection. In the worst case,|V|=nand|E|=O(n2). Our problem is to find

the largest subsetP P such that valid labels corresponding to the members ofP are mutually non-overlapping. We show that the above problem reduces to finding the maximum independent set of the label graphLG. In the next section, we mention some important characterization of the label graph.

2.1 Some Useful Results

Definition 1. [5] An undirected graph is a chordal graph if and only if every