Mosaic drawings and cartograms

Citation for published version (APA): Cano, R. G., Buchin, K. A., Castermans, T. H. A., Pieterse, A., Sonke, W. M., & Speckmann, B. (2015). Mosaic drawings and cartograms. 153-156. Abstract from 31st European Workshop on Computational (EuroCG 2015), Ljubljana, Slovenia.

Document status and date: Published: 17/03/2015

Document Version: Publisher’s PDF, also known as Version of Record (includes final page, issue and volume numbers)

Please check the document version of this publication:

• A submitted manuscript is the version of the article upon submission and before peer-review. There can be important differences between the submitted version and the official published version of record. People interested in the research are advised to contact the author for the final version of the publication, or visit the DOI to the publisher's website. • The final author version and the galley proof are versions of the publication after peer review. • The final published version features the final layout of the paper including the volume, issue and page numbers. Link to publication

General rights Copyright and moral rights for the publications made accessible in the public portal are retained by the authors and/or other copyright owners and it is a condition of accessing publications that users recognise and abide by the legal requirements associated with these rights.

• Users may download and print one copy of any publication from the public portal for the purpose of private study or research. • You may not further distribute the material or use it for any profit-making activity or commercial gain • You may freely distribute the URL identifying the publication in the public portal.

If the publication is distributed under the terms of Article 25fa of the Dutch Copyright Act, indicated by the “Taverne” license above, please follow below link for the End User Agreement: www.tue.nl/taverne

Take down policy If you believe that this document breaches copyright please contact us at: [email protected] providing details and we will investigate your claim.

Download date: 03. Oct. 2021 EuroCG 2015, Ljubljana, Slovenia, March 16–18, 2015

Mosaic Drawings and Cartograms

R. G. Cano∗ K. Buchin‡ T. Castermans‡ A. Pieterse‡ W. Sonke‡ B. Speckmann‡

Figure 1: US election 2012, electorial college votes. Diffusion cartogram by M. Newman (Univ. Michigan), square mosaic cartogram (Wikipedia), square and hexagonal mosaic cartograms computed by our algorithm.

1 Introduction larized by the New York Times, usually in the context of the US elections, but also to show changing de- Cartograms visualize quantitative data about a set mographics. Mosaic cartograms using are of regions such as countries or states by scaling each less frequent, examples are the “Indices of Depriva- region such that its area is proportional to its data tion 2010” by the Leicestershire County Council. value. There are several different types of cartograms Mosaic cartograms communicate data well that and some algorithms to construct them automatically consist of, or can be cast into, small integer units exist. The most common cartograms are contiguous (for example, electorial college votes), they allow users area cartograms [8] (Fig. 1 left). Here the regions to accurately compare regions, and they can often are deformed in such a way that adjacencies are kept. maintain a (schematized) version of the input regions’ Contiguous area cartograms perform well if the data shapes. We propose the first method to construct values are positively correlated to the land areas of mosaic cartograms fully automatically. To do so, we the input regions, but producing good cartograms if first introduce mosaic drawings of triangulated pla- this is not the case remains a challenge. nar graphs. We then modify mosaic drawings into The size of regions in contiguous area cartograms mosaic cartograms with zero cartographic error while is generally hard to judge. To remedy this situation maintaining correct adjacencies between regions. several types of cartograms depict regions using sim- Quality criteria. ple geometric shapes like disks, squares or rectangles. There are several quality criteria When using rectangles, adjacencies and relative posi- for (mosaic) cartograms. One of the most important tions can be maintained [2, 10]. However, the rectan- ones is the cartographic error, which is defined for |A − A | /A A gular shape is not very recognizable and hence Mum- each region as c s s,where c is the area of A ford et al. [4, 5] initiated the study of rectilinear car- the region in the cartogram and s is the specified tograms where each region is represented by a recti- area depending on the data value to be shown. In a linear polygon. But the areas of general rectilinear mosaic cartogram a region is represented by an edge- polygons are again difficult to estimate and compare. connected set of tiles, which we call a configuration. This is much easier if the polygons are composed of Each configuration must be simple, that is, contain no a small number of unit squares (Fig. 1 middle two). holes. The mosaic resolution measures the (maximum We focus on this type of cartograms, or more gener- and average) number of tiles used per region. We ally cartograms which use multiples of simple tiles – consider the following quality criteria in this paper: usually squares or hexagons (Fig. 1 right) – to repre- • Average and maximum cartographic error sent regions. In absence of a dedicated name in the • Correct adjacencies of configurations: two config- literature we call such cartograms mosaic cartograms. urations are adjacent if and only the correspond- Mosaic cartograms using squares have been popu- ing input regions are adjacent ∗ Institute of Computing, University of Campinas, Brazil, • Shape of the regions [email protected]. Supported by FAPESP under projects 2012/00673-2 and 2013/23571-3. • Relative positions of regions ‡ Dept. of Mathematics and Computer Science, TU Eind- • Mosaic resolution hoven, The Netherlands, [k.a.buchin|b.speckmann]@tue.nl, [t.h.a.castermans|a.pieterse|w.m.sonke]@student.tue.nl. It is generally challenging to simultaneously satisfy all K.B. and B.S. supported by the Netherlands Organisation for Scientific Research (NWO) under project no. 612.001.106 criteria well. We decided to enforce correct adjacen- and 639.023.208, respectively. cies in our algorithm, that is, we produce only mosaic 153

This is an extended abstract of a presentation given at EuroCG 2015. It has been made public for the benefit of the community and should be considered a preprint rather than a formally reviewed paper. Thus, this work is expected to appear in a conference with formal proceedings and/or in a journal. 31st European Workshop on Computational Geometry, 2015

cartograms which have exactly the same configuration but imply them by the contact of the configurations. adjacencies as the corresponding regions of the input For which tilings do mosaic drawings exist? Below map. There is a clear trade-off between mosaic reso- we show – with the help of results from the Graph lution and recognizability of the map. A low mosaic Drawing and VLSI layout literature – that simple resolution, that is a small to medium number of tiles mosaic drawings exist for both square and hexagonal per region, allows users to explicitly count tiles and tilings. For a given (style of) mosaic drawings we can compare regions. A high mosaic resolution makes it then consider various quality criteria, such as the size easier to preserve shapes and relative positions and (number of tiles) of the drawing and the area (number to achieve zero cartographic error. Fortunately our of tiles inside a bounding box). method can create mosaic cartograms with zero car- Square and hexagonal tilings. We show that any tographic error for relatively low mosaic resolutions. plane triangulation has a mosaic drawing on a square Most mosaic cartograms which are made by hand and via orthogonal (grid) drawings [6] do neither preserve the adjacencies of all input re- of a graphs. Here the vertices are placed on an integer gions nor their shapes. A common semi-automated grid and the edges are routed along the grid. approach is to take a map or a contiguous area car- Given a plane triangulation we can obtain a mosaic togram and to overlay it with a suitable grid. This drawing in the following way as illustrated in Fig. 3: requires a rather high mosaic resolution, since other- We first take the weak dual of the triangulation, which wise rounding errors will easily destroy or create ad- has a vertex for each triangle of the triangulation, and jacencies. Furthermore, mosaic cartograms created in an edge for any pair of adjacent triangles. The dual this way usually do not have zero cartographic error. of a triangulation has a maximum degree of three and can be laid out orthogonally on a grid. To obtain a 2 Mosaic Drawings mosaic drawing on a square tiling, we represent every grid point of the orthogonal drawing by four squares We define mosaic drawings for plane triangulated of the tiling and consistently distribute them to the graphs, that is, planar graphs with a given embed- configurations of the triangulation. On a hexagonal ding where every interior face is a triangle. Mosaic grid we can proceed in exactly the same way but shear drawings are drawn on a tiling of the plane. Of par- the orthogonal drawing; alternatively we can directly ticular interest are the uniform, and especially the embed the dual on a hexagonal grid [9]. regular tilings, although other types of tilings might The construction above shows that we can obtain also result in intriguing drawings. There are three mosaic drawings that are linear in the size of the cor- types of regular tilings: the triangular, the square, responding orthogonal drawings. This allows us to and the hexagonal tiling. The uses derive complexity results for mosaic drawings from two different rotations of the basic triangular shape existing results for orthogonal drawings. Orthogonal and hence is visually a little more complex than the drawings on small-area grids have been studied ex- square or the hexagonal tiling. tensively [6, 12]. For instance, if the triangulation We call a set of edge-connected tiles of a tiling T a induces an outerplanar graph, we can obtain a mo- configuration. We say that a configuration C is simple saic drawing of relatively small area by making use of if its tiles are simply connected (C has no holes). Two configurations C1 and C2 are adjacent if and only if 3 there is at least one tile t1 ∈ C1 and at least one tile t2 ∈ C2 such that t1 and t2 are edge-connected. A 1 6 D G 5 mosaic drawing T ( ) of plane triangulated graph 4 G =(V,E)onT represents every vertex v ∈ V by a simple configuration C(v) of edge-adjacent tiles from 7 2 T in such a way that two vertices v and u of G are connected by an edge e =(v, u) if and only if the con- C v C u figurations ( )and ( ) are adjacent (see Fig. 2). 1 1 We say that 3 6 a mosaic draw- 2 4 3 5 ing is simple if 2 4 6 7 the union of all 5 configurations is simply con- 7 nected, that is, Figure2:Simplemosaicdrawing. the drawing has no holes. Mosaic drawings are a type of contact rep- Figure 3: Transformation from orthogonal drawing to resentation, since they do not draw edges explicitly, mosaic drawings via the (weak) dual. 154 EuroCG 2015, Ljubljana, Slovenia, March 16–18, 2015

1 1 1 7 236712 7 6 8 36 45 8 3 11 8 91011 9 1 2 11 9 4 7 5 5 6 8 1010 4 11 3 1 11 12 10 7 2 9 12 12 2 6 8 4 10 1 3 5 11 7 6 8 3 2 9 12 11 4 10 9 2 5 4 5 10 12

Figure 4: Constructing simple mosaic drawings for square and hexagonal tilings via an orderly spanning tree (inspired by [3]). the fact that the dual is a binary tree [7]. However, retain any of the relative positions of the input nodes minimizing the size (area, length, etc.) of an orthogo- and are hence a rather poor starting point for mosaic nal drawing is NP-hard even if the orientations of the cartograms (see Fig. 5 left). However, the spanning edges used are already given [1, 13], which makes it trees induced by a Schnyder labeling are also orderly unlikely that we can efficiently minimize the area of a spanning trees [11] and lead to mosaic drawings which mosaic drawing. do capture a significant part of the relative positions of the input (see Fig. 5 right top). 3 Mosaic cartograms We use an iterative method to grow (or shrink) the configurations according to the input data. While Our input is now a triangulated planar graph G = doing so, we maintain the correct adjacencies at all (V,E) together with integer weights w(v)foreachver- times. We use so-called guiding shapes – configura- tex v ∈ V . A mosaic cartogram for G is a simple tions which represent the desired final state of each mosaic drawing of G where each configuration C(v) configuration C(v) – to slowly nudge each configura- consists of exactly w(v) tiles for each vertex v ∈ V . tion towards the correct number of tiles and the cor- The construction of mosaic drawings from orthogonal rect shape. Guiding shapes are iteratively moved us- drawings of the dual as sketched above does not nec- ing a force-directed approach to reduce overlap while essarily produce simple mosaic drawings. While we moving the configurations into appropriate relative could extend this construction and fill faces in a con- positions. Note that the configurations never over- sistent way, we instead choose an alternative method lap, only their guiding shapes might. We maintain a which is based on orderly spanning trees [3] and pro- proper mosaic drawing at all times, although it might duces compact simple mosaic drawings (see Fig. 4). Orderly spanning trees are spanning trees with cer- tain order relations between the nodes. Chiang et al. [3] show how to compute an orderly spanning tree ST for a planar triangulation G. They then con- struct a (vertical) visibility drawing for ST,whichis stretched into a 2-visibility drawing of G.Theygrow horizontal branches to fill up gaps and finally shrink thick branches to height 1. The result is a square mo- saic drawing of G. Since at most three regions meet at each intersection, we can directly shear the same drawing onto a hexagonal grid and so obtain a hexag- onal mosaic drawing with the same complexity. To compute mosaic cartograms, we start with a mosaic drawing of the (augmented) dual of the in- put map. Unfortunately the orderly spanning trees Figure 5: US: mosaic drawing based on Chiang et created by Chiang et al. [3] have a tendency to “curl al. [3] (left) and on Schnyder labeling (top right), area 2 inwards”. The resulting mosaic drawings often do not cartogram with 1 square ≈ 5000 km . 155 31st European Workshop on Computational Geometry, 2015

Figure 6: EU GDP in 2013: 1 per 20 billion USD, 1122 tiles, 1 incorrect hexagon (left), 1 hexagon per 15 billion USD, 1499 tiles, no error (right). not always be simple. Each configuration, however, is tograms. In Proc. 6th Intern. Conference on Geogr. always simple. This process stops as soon as no more Information Science, LNCS 7478, pages 29–42, 2012. progress can be made. Now most configurations have [3] Y.-T. Chiang, C.-C. Lin, and H.-I. Lu. Orderly span- a good shape and the correct number of tiles, a few ning trees with applications. SIAM Journal on Com- might have some tiles too many or too few. The final puting, 34(4):924–945, 2005. step of our algorithm uses a minimum cost flow for- [4] M. de Berg, E. Mumford, and B. Speckmann. On rec- mulation to assign the correct number of tiles to each tilinear duals for vertex-weighted plane graphs. Dis- configuration. This process maintains the correct ad- crete Mathematics, 309(7):1794–1812, 2009. jacencies and disturbs the shapes as little as possible. [5] M. de Berg, E. Mumford, and B. Speckmann. Op- It also removes any holes in the drawing which might timal BSPs and rectilinear cartograms. Interna- have arisen during the iterative resizing and moving. tional Journal of Computational Geometry and Ap- plications, 20(2):203–222, 2010. 4 Future Work [6] C. A. Duncan and M. T. Goodrich. Planar orthogonal and polyline drawing algorithms. In R. Tamassia, ed- An obvious direction for future work are other types itor, Handbook of Graph Drawing and Visualization, of tilings, most notably the triangular tiling. Our Chapter 7, pages 223–246. CRC Press, 2013. method in principle extends to any , if [7] F. Frati. Straight-line orthogonal drawings of binary one interprets it as a square or hexagonal tiling by and ternary trees. In Proc. 15th Intern. Conference grouping adjacent tiles appropriately (Fig. 7). How- on Graph Drawing, LNCS 4875, pages 76–87, 2008. ever, more direct approaches and corresponding size [8] M. Gastner and M. Newman. Diffusion-based and area bounds would be of interest. method for producing density-equalizing maps. Proc. National Academy of Sciences of the USA, 101(20):7499–7504, 2004. [9] G. Kant. Hexagonal grid drawings. In Graph- Theoretic Concepts in Computer Science, LNCS 657, pages 263–276, 1993. [10] M. v. Kreveld and B. Speckmann. On rectangular cartograms. Computational Geometry: Theory and Applications, 37(3):175–187, 2007. Figure 7: Interpreting the hexagonal tiling as a square tiling and the trihexagonal tiling as a hexagonal tiling. [11] K. Miura, M. Azuma, and T. Nishizeki. Canonical decomposition, realizer, Schnyder labeling and or- derly spanning trees of plane graphs. Intern. Journal Found. of Computer Science, 16(1):117–141, 2005. References [12] A. Papakostas and I. G. Tollis. Algorithms for area- efficient orthogonal drawings. Computational Geom- [1] M. J. Bannister, D. Eppstein, and J. Simons. In- etry: Theory and Applications, 9(12):83—110, 1998. approximability of orthogonal compaction. J. Graph Algorithms and Applications, 16(3):651–673, 2012. [13] M. Patrignani. On the complexity of orthogonal com- paction. Computational Geometry: Theory and Ap- [2] K. Buchin, B. Speckmann, and S. Verdonschot. plications, 19(1):47–67, 2001. Evolution strategies for optimizing rectangular car- 156