Concentric Metro Maps Martin Fink∗ , Magnus Lechner† , and Alexander Wolff∗ Email:
Lehrstuhl für Informatik I Universität Würzburg ∗ http://www1.informatik.uni-wuerzburg.de/en/staff †
[email protected]
Abstract—Drawing schematic metro maps is a well-studied problem for which several algorithms have been presented. In contrast to previous work we create concentric metro maps; that is, we set a center c and use exclusively circular arcs and radial straight-line segments with respect to c for drawing the edges of the network. Our approach is based on mixed-integer linear programming.
I.
I NTRODUCTION
The problem of drawing metro maps is almost as old as metro networks themselves. Over time, metro maps have become more and more schematic and are now in most cases drawn in the octilinear style that allows only horizontal, vertical and diagonal segments. There has been some previous work on the automatic drawing of metro maps; we just mention a few. Hong et al. [3] presented a force-directed algorithm for creating metro maps with straith-line edges (at slopes approximating the octilinear directions). Stott et al. [5] used multicriteria optimization for drawing metro maps where nearly all edges are octilinear. Nöllenburg and Wolff [4] presented a solution based on mixedinteger linear programming (MIP) that guarantees octilinearity. Recently, Fink et al. [2] presented a force-directed algorithm that draws metro maps using Bézier curves. Their approach works well for smaller networks and sparse regions; in dense regions, however, a larger number of curves is used, making the drawing rather complex. In graph drawing, Lombardi drawings [1] are known, with edges drawn as circular arcs. Concentric Metro Maps. We suggest creating concentric metro maps. In this drawing style, a center c is chosen globally for the map. Metro lines are then drawn as polylines whose individual segments are (i) circular arcs centered at c or (ii) straight-line segments whose underlying straight lines pass through c. We refer to segments of type (i) as circular segments and to segments of type (ii) as radial segments. Concentric metro maps clearly are not equally suitable for all metro networks. For networks that are quite centralized with most lines either going around the central region or traversing it, concentric metro maps can help to emphasize the structure of the network and of the individual lines; see also the (manually created) concentric metro maps of Maxwell Roberts (available on his webpage www.tubemapcentral.com). II.
P RELIMINARIES
Our main input is the metro network, represented by a graph G = (V, E) whose nodes are the stations of the network. For each station v ∈ V we are also given its geographic
position pv ∈ R2 . Additionally, we need to know which edges the metro lines traverse. Furthermore, we assume that the center c ∈ R2 of the drawing is part of the input. We use mixed-integer programming for creating concentric metro maps. We do this because it is already nontrivial to find a feasible drawing, assuming that only few bends per edge are allowed, even without any optimization. As a further simplification, we restrict edges to consist of at most three segments (and two bends), of which at most one can be radial. In our MIP, we represent the position of a vertex v ∈ V in polar coordinates (α(v), r(v)), where 0 ≤ α(v) < 2π is the angle at the center c relative to a horizontal half-line going to the right, and r(v) ∈ R≥0 is the distance to c. For an edge e = (u, v) we need just one variable α(e) with 0 ≤ α(e) < 2π representing the angle of the (possibly nonexisting) radial segment of e at c; the drawing of e is determined by α(e) and the angles and radii of u and v. Note that e = (u, v) has no bend if either α(u) = α(v) = α(e) (radial edge) or r(u) = r(v) (circular). If α(u) = α(e) or α(v) = α(e), the edge has at most one bend. III.
M IXED -I NTEGER P ROGRAM
As a main tool for ensuring that the output drawing is feasible, we use binary variables of the type Xα1 <α2 that have value 1 if angle α1 is smaller than α2 where α1 and α2 are angles of vertices (represented by a variable α(v)) or radial segments (represented by α(e)). We use the constraint α1 + ε ≤ α2 + 2π(1 − Xα1 <α2 ) where α1 and α2 represent their respective variables and ε > 0 is a (small) minimum distance of angles. If Xα1 <α2 = 1 then α1 + ε ≤ α2 has to hold. With such variables, we can model that we do not allow any crossing between a radial segment of an edge e1 = (u1 , v1 ) and a circular segment of an edge e2 = (u2 , v2 ) (e.g. the segment incident to u2 ). In a crossing-free solution, there are four possibilities for the relative position of the two segments: The circular segment is closer to (or farther away from) the center than both endpoints of the radial segment, or both endpoints of the circular segment are left (or right) of the radial segment. P Using four binary variables X1 , . . . , X4 4 and the constraint i=1 Xi ≥ 1 we distinguish the four cases. If, e.g., X1 = 1 represents the case that the circular segment is left of the radial one, we have the constraint 2X1 ≤ Xα(u2 )<α(e1 ) + Xα(e2 )<α(e1 ) . Using similar ideas, we can model further constraints: • We forbid overlaps of edge segments leaving a common station—at least if both edges are used by the same line.
Figure 1.
Concentric metro map of Vienna with octilinear input (inset).
• Stations must lie neither on nonincident edges nor on top of other stations. We optimize several criteria as a weighted sum in the objective function of our MIP: • Stations should be placed close to their geographic position, helping users to find stations on the maps. Since we can only use linear expressions, we minimize the difference in angle and radius individually. • Edges should have few bends; we can count the bends with the help of the variables of type Xa
I MPLEMENTATION AND T ESTS
For testing our approach, we used a prototype implementation in Java with the MIP-Solver Gurobi (see www.gurobi.com). The current version of the implementation does not yet include the bend minimization in all cases; the more advanced optimization criteria are also not yet included. Note that we currently do not allow lines passing through the center; such lines will require special treatment. Furthermore, most constraints are still implemented using an older formulation that is less structured than the version presented in the previous section. With the new formulation the constraints are simpler and hopefully make the method faster.
Figure 2. Concentric metro map of Montréal with octilinear input (inset).
Figures 1 and 2 show drawings for Vienna and Montréal that we created using our method. We did not draw intermediate stations of lines. In the case of Vienna, the method already worked quite well; with the full bend minimization and by adding some of the extended optimization criteria suggested in the previous section, the drawing could, nevertheless, still be improved. The runtime varies between some seconds and 15 minutes depending heavily on the constraints used; it was 13 minutes for Figure 1. In the case of Montréal, there were more problems, resulting in a worse drawing. We expect that additional optimization criteria will improve this drawing, too. V.
C ONCLUSION
We have presented a method for creating concentric metro maps based on mixed-integer linear programming. In our tests, the method proved to be able to create feasible drawings and allow the integration of optimization criteria. We plan to further improve the quality of the drawings by extending the objective function so that it takes more criteria for the quality of a drawing into account. By simplifying the constraints in our MIP, we also want to make our approach usable for larger metro networks such as Sydney or even London. R EFERENCES [1] C. A. Duncan, D. Eppstein, M. T. Goodrich, S. G. Kobourov, and M. Nöllenburg, “Lombardi drawings of graphs,” in Proc. 18 Int. Sympos. Graph Drawing (GD’10), ser. LNCS, U. Brandes and S. Cornelsen, Eds., vol. 6502. Springer-Verlag, 2011, pp. 195–207. [2] M. Fink, H. Haverkort, M. Nöllenburg, M. Roberts, J. Schuhmann, and A. Wolff, “Drawing metro maps using Bézier curves,” in Proc. 20th Int. Sympos. Graph Drawing (GD’12), ser. LNCS, W. Didimo and M. Patrignani, Eds., vol. 7704. Springer-Verlag, 2013, pp. 463–474. [3] S.-H. Hong, D. Merrick, and H. A. D. do Nascimento, “Automatic visualisation of metro maps,” J. Visual Lang. Comput., vol. 17, no. 3, pp. 203–224, 2006. [4] M. Nöllenburg and A. Wolff, “Drawing and labeling high-quality metro maps by mixed-integer programming,” IEEE Trans. Vis. Comput. Graphics, vol. 17, no. 5, pp. 626–641, 2011. [5] J. Stott, P. Rodgers, J. C. Martínez-Ovando, and S. G. Walker, “Automatic metro map layout using multicriteria optimization,” IEEE Trans. Vis. Comput. Graphics, vol. 17, no. 1, pp. 101–114, 2011.