Shape‐Guided Mixed Metro Map Layout

Abstract Metro or transit maps, are schematic representations of transit networks to facilitate effective route‐finding. These maps are often advertised on a web page or pamphlet highlighting routes from source to destination stations. To visually support such route‐finding, designers often distort the layout by embedding symbolic shapes (e.g., circular routes) in order to guide readers' attention (e.g., Moscow map and Japan railway map). However, manually producing such maps is labor‐intensive and the effect of shapes remains unclear. In this paper, we propose an approach to generalize such mixed metro maps that take user‐defined shapes as an input. In this mixed design, lines that are used to approximate the shapes are arranged symbolically, while the remaining lines follow classical layout convention. A three‐step algorithm, including (1) detecting and selecting routes for shape approximation, (2) shape and layout deformation, and (3) aligning lines on a grid, is integrated to guarantee good visual quality. Our contribution lies in the definition of the mixed metro map problem and the formulation of design criteria so that the problem can be resolved systematically using the optimization paradigm. Finally, we evaluate the performance of our approach and perform a user study to test if the embedded shapes are recognizable or reduce the map quality.


Abstract
Metro or transit maps, are schematic representations of transit networks to facilitate effective route-finding.These maps are often advertised on a web page or pamphlet highlighting routes from source to destination stations.To visually support such route-finding, designers often distort the layout by embedding symbolic shapes (e.g., circular routes) in order to guide readers' attention (e.g., Moscow map and Japan railway map).However, manually producing such maps is labor-intensive and the effect of shapes remains unclear.In this paper, we propose an approach to generalize such mixed metro maps that take user-defined shapes as an input.In this mixed design, lines that are used to approximate the shapes are arranged symbolically, while the remaining lines follow classical layout convention.A three-step algorithm, including (1) detecting and selecting routes for shape approximation, (2) shape and layout deformation, and (3) aligning lines on a grid, is integrated to guarantee good visual quality.Our contribution lies in the definition of the mixed metro map problem and the formulation of design criteria so that the problem can be resolved systematically using the optimization paradigm.Finally, we evaluate the performance of our approach and perform a user study to test if the embedded shapes are recognizable or reduce the map quality.

CCS Concepts
• Human-centered computing → Visualization techniques; Interactive systems and tools;

Introduction
A metro or transit map used to show transportation line services is an intuitive, schematic representation of a transit network.Here, a schematic representation is a simplified network geometry (e.g., straightened lines, uniform spacing of stations, etc.), to facilitate effective way-finding activities [Rob14b].Such nicely arranged representations make transit maps popular visual metaphors for network visualization in physics, biology, engineering, etc. [WNTN19].However, manually creating schematic maps is not straightforward and requires intensive iterative processes.Automatic approaches have been thus investigated to solve this high-complexity problem [WNT * 20], however, most existing approaches aim for one single style.For example, an octolinear (also octilinear) layout limits all edge orientations to horizontal, vertical, or diagonal at 45   A curvilinear layout constrains metro lines as continuous and smooth curves [FHN * 12].Other styles such as concentric circles [FLW14] that align metro lines along concentric circles, or multilinear [NN20] designs that relax octolinear layout by allowing multiple edge directions were also proposed and their algorithmic complexity and perceptual effectiveness were investigated.
However, in reality, if we take a close look at the handcrafted metro maps by professional designers [Cer16,ZER21,Tra21], multiple styles are often incorporated in a single diagram.Designers often distinguish primary and secondary information to emphasize the difference between specific lines in the system.To achieve this, some lines in the map are arranged using a simple geometry (e.g., circle, etc.) or an iconic shape (e.g., heart, etc.), while the remaining lines follow the layout convention.The official Moscow map with a circular route highlighted is a typical example [Mos19], while maps with more complicated shapes [ZER21] are more often used for advertising purposes or special events [KSH * 16, WCZ * 19]. Figure 2 shows more examples, where a designer embedded the Vienna metro map to create a workshop logo [The19], and Cerović explains the influence of shapes in mental map development [Cer16].Nevertheless, as summarized by Wu et al. [WNT * 20], creating transit maps is an iterative process, and an automatic approach provides opportunities for scientists to effectively investigate advantages and disadvantages of various metro maps.
There exist automatic approaches for synthesizing metro maps with more than one style; however, supported geometry (i.e., shape) is limited to either polylines [WTLY12] or circles [WPT * 15] to the best of our knowledge.This paper presents a more general approach to the mixed layout problem, which allows the integration of specific shapes and classical metro map layout.This is achieved by introducing a user-defined guide shape, represented as single or multiple polylines, as input.Figure 1 shows an example, where we embed a heart shape into the Taipei metro system.This is done with a three-step approach by firstly matching routes for shape approximation, then deforming the network layout, and finally, aligning lines on a grid.Note that each individual step here has been categorized as a challenging problem [FSSS15, WNT * 20, LvDW16].To guarantee the visual quality of the generated maps, the guide shape should be recognizable in the final layout, while the remaining part of the layout should still fulfill the classical octolinear design criteria [NW11].Our contributions in the paper are summarized: • A general definition and solution for the mixed metro map problem beyond the state-to-the-art.• An algorithmic approach to perform shape matching, shape approximation, and metro line alignment as a whole.• Quantitative and qualitative evaluation to test shape recognizability and the corresponding influence on route planning tasks.
The paper is structured as follows: In Section 2, we summarize the state-of-the-art literature relevant to our approach.We then begin with a definition of the proposed problem, followed by an explanation of the design criteria and a high-level description of our algorithm (Section 3).The method used to solve the proposed problem is detailed in Sections 4-6.We collect several results (Section 7), examine the approach performance and quality (Section 8), and conclude this paper and propose open topics in Section 9.

Related Work
Metro maps are designed to help passengers navigate transit lines when taking trains in a rail system.Since train routes are fixed and passengers mainly need to know at which station to get on or off a train, some sort of distortions are allowed in metro maps for improving readability.Since exact geographic information is no longer needed, cartographers usually enlarge downtown areas to label station names and prevent visual clutters [Ove08,Sch14].The stations on metro lines are re-positioned to fulfill several criteria, such as even spacing of stations [Deg13,Llo17], minimum direction changes in routes [Rob14a], and the relative positions of stations [RGL17].Generally, the layout of a metro map can be curvilinear, multilinear [RGL17], k-linear (including octolinear, hexalinear, and tetralinear) [NN20], and even based on concentric circles [RNC16,NRW19].In addition to the network map, text or image labels are placed around stations for passengers to connect the map and the real world [Ove15].The labels are expected to be overlap-free, close to their corresponding stations, and have consistent orientations if they represent neighboring stations.Schematic Layout Approaches.So far the most commonly used metro map layout is octolinear, which was introduced by Henry Beck for the London Underground in 1933.It is known that computing an optimal octolinear layout is NP-hard [Nöl05].Several categories of methods were then introduced to pursue highquality metro map layouts within a reasonable computation time.The first category is line simplification, which attempts to find a set of linked line segments to represent each path on the map [Ney99, MG06, DHM08, CdBvK05, LD10].During the simplification process, the deviation between each station and the closest line segment is bounded, and the number of line segments is minimized.The second is local optimization.Methods in this category iteratively move stations to nearby positions to align edges in octolinear directions [AM00,Ave07].Several strategies, such as simulated annealing [MWTAT06], ant colony optimization [WR13], magnetic force field [CR14], and least-squares optimization [vDL18] were applied to prevent the algorithm from falling into local minimums.The third category is to formulate a metro map layout problem into a mixed-integer linear program [NW11, WPT * 15], which distinguishes hard constraints that must be fulfilled and soft constraints that are globally optimized.Typically, the octolinear layout is mandatory since edge orientation is formulated using a set of binary variables in the model, whereas other aesthetic requirements can be relaxed if they conflict with others.Finally a recent result computes shortest paths between candidate positions of stations on a predefined grid [BBS20,BBS21].This was formulated as an ILP, but heuristical solutions through repeated applications of shortest path algorithms can be obtained very quickly.In addition to methods belonging to the above-mentioned categories, the works of [WC11] and [WP16] applied a two-step deformation technique to achieve the goal.Their methods first compute curvilinear layouts of metro maps and then rotate each edge to the closest octolinear direction.Each step solves a least-squares optimization problem.Compared to previous works, our approach allows embedding a guide shape with arbitrary edge directions into a schematic metro map, which is challenging to integrate with their frameworks.
Station Names Labeling.Station names are essential in metro maps, yet the labeling problem itself is also NP-hard [GIM * 01, NH18].Several previous methods solve the layout and the labeling problems in two steps to reduce the computation cost [WC11,WTLY11].Niedermann and Haunert in particular present a general framework for labeling network maps [NH18].Since occlusions could be inevitable when the layout does not provide enough space for labeling, the methods of [NH18, YMK * 18, TMK * 19] systematically scale certain edges on the map to solve the problem.There are also methods considering both layout and labeling problems simultaneously when computing metro maps [SR05, SR-MOW11,NW11].Please refer to [WNT * 20] for details as our work does not focus on station names labeling problem.

Overview
Our approach was developed by firstly investigating several realworld examples [ZER21,Mos19,Cer16] and existing design criteria [Rob14b, WNT * 20], and then summarizing common design principles for our mixed metro map layout.Secondly, we transform these design principles to aesthetic constraints.Finally, these aesthetic constraints are formulated into equations for a mathematical model that can be solved systematically.We will demonstrate these design principles, followed by an introduction of our approach pipeline achieving these goals.

The Mixed Metro Map Problem
We define the mixed metro map problem in a more general fashion by relaxing the user-specified shape constraints introduced by Wu et al. [WTLY12, WPT * 15].Note that to retain consistency, in this paper, we follow the terminology and symbols used in the recent transit map survey [WNT * 20].A transit network is defined as N = (S,C), where S = {v 1 , v 2 , ..., vn} represents a vertex set of stations and C = {e 1 , e 2 , . . ., em} is an edge set describing station connectivity.In addition to classical networks, a path cover T of N is used to describe a set of paths, in N, indicating the different service lines in the transportation system.Note that each connection e ∈ C belongs to one or more paths in T .Moreover, a guide shape P, which can consist of one or more open or closed polylines P = {p 1 , p 2 , ..., p k }, is introduced to express the user's design goal.

Design Principles
Based on criteria collected for layout approaches [WNT * 20] and open criteria raised by the design studio [ZER21,Cer16], we summarize the design principles for our mixed metro maps as follows: D1 Constrained Layouts: To increase legibility [WNT * 20, Rob14b] line configurations are often simplified to an octolinear design [NW11].In such a layout, the preservation of the input topology is often assumed a natural constraint [WNT * 20].

D2 Topographic Accuracy and Relative Positions of Stations:
The topographic accuracy has been discussed as an important factor in a schematic representation [Rob14b] to preserve users' mental map of a city.Relative positions between pairs of stations should be maintained.D3 Spatially-separated Stations: To avoid overlaps between stations, a minimum distance between stations is commonly incorporated.This distance is preferably uniform [Gar94,NW11].D4 Simplification of Trajectories: Line orientations are expected as continuous as possible [Gar94,NW11].
The aforementioned design rules have been defined previously [WNT * 20] and are applied to real-world metro maps in general.In this paper, we further propose design criteria, which allow us to achieve the desired affect when embedding the guide shape in the final layout.

D5 Translation and Scale Invariant Shape Embedding:
The shape can be translated and scaled when embedding it, while we exclude rotation to avoid adding another layer of recognition complexity [TP89].D6 Shape Representation: The edges in the transit network should be appropriately selected to approximate the shapes.Perceptually, the embedded shape in the layout should be recognizable.D7 Hybrid Edge Orientation: Edges that are used to approximate the guide shape should follow the shape structure, while the remaining edges follow the aforementioned classical design.

Mixed Metro Map Pipeline
Figure 3 gives a conceptual overview of the proposed algorithmic pipeline.Initially, the user needs to select a transit network and provide a target shape as input to our approach.Figure 3(a) shows an example, where the transit network is drawn with colored lines and a user-specified shape (heart) is marked in gray.In the second step, as shown in Figure 3(b), we scale and translate the guide shape in order to find an appropriate sub-network to approximate this shape (Section 4).Once the guide shape is uniformly scaled and translated, we adapt a two-step deformation procedure inspired by Wang et al. [WC11,WP16] in order to create a relatively well-representative network embedding.Here, we first generate a smooth layout (Figure 3(c)) to balance mutual distance between stations and straighten lines with degree 2 stations, followed by synthesizing a nearly octolinear layout (Figure 3(d)).This optimization process is detailed in Section 5.In the last step, to guarantee that the metro lines are fully aligned on a grid (Figure 3(e)), we introduce a grid alignment approach while retaining the mixed layout structure (see Section 6).

Route Matching and Shape
We compute a metro map layout that exhibits the given guide shape.
Limited by the metro network's route structure, determining the optimal size and position of the guide shape is essential.In addition to size and position, however, we do not rotate either the guide shape or the metro map when computing the map layout because their orientations are restricted.For example, the upright direction of a "heart" shape is meaningful to humans; and the relative positions of stations help passengers navigate themselves in an urban area.An up-side-down metro map would conflict with users' mental map and decrease the map's usability.To determine the position of a guide shape, we first determine a path W consisting of metro connections e ∈ C.Then, we scale and translate the guide shape P to align with the path W .Note that the guide shape's size and position will not be updated during the deformation process.
We focus on an automatic approach for aligning guide shapes and metro maps, which determines a path inside the transit network visually similar to the guide shape P.However, as outlined in Section 1, there are use cases (artistic or advertising purposes), where specific lines must lie on iconic shapes.We optionally let designers define W manually.

Automatic Route Matching
We search for a path W = (e 1 , e 2 , ..., e k ) on the transport network that is visually similar to the user-defined guide shape.Since the guide shape P can be arbitrary and the path W similar to P may not exist, we insert dummy edges to the network for enhancing visual quality.Specifically, if the geographic distance between two stations v i and v j ∈ S is smaller than a predefined threshold and no edge connecting v i and v j exists, we insert a dummy edge to connect the two stations (Figure 4).We adapt the shape-preserving Dijkstra algorithm [FS11] to find a path W that can approximate P. The cost of a path in the shapepreserving Dijkstra algorithm, in contrast to the normal shortest path algorithm, is given by similarity between the path and P. Specifically, we quantify the difference between the path W and the P using the direction-based integral Fréchet distance [dBC11] between W and P, which we write as δ(W, P).We also use the concept of the partial similarity [dBC11] δ partial (W, P), which is defined by a subpath P of P, which minimizes δ(W, P ) (see Figure 4).
The cost of a connection is given by the difference between the slope of the metro connections and the slope of the corresponding section of the guide shape.So in case the difference between those slopes is small, the additional cost of the connection for the path is small, too.Rather than considering the Euclidean distance between points in the original shape-preserving Dijkstra algorithm [FS11], the direction-based integral Fréchet distance is beneficial for our use case because it is scale and translation invariant (i.e., P is given with an arbitrary size and position).It provides a robust mapping between P and W , and small variations between two lines are not disproportionately penalized.Experiments can be found in Appendix A.
In our implementation, we grow the path W from a station on the metro map until none of the inserted stations can reduce the Fréchet distance.Let W 0 be the initial path and W k be the path composed of k + 1 stations.Namely, the growing process can be expressed as W 0 → W 1 → W 2 → ... → W .At each step k, we examine all neighboring stations of W k and insert the station v into a queue if it can reduce the direction-based integral Fréchet distance.In other words, δ(W k + v, P) < δ(W k , P).Then, for each station u in the queue, we compute the partial matching δ partial (W k + u, P) to obtain a subsection of the guide shape P that is the most similar to W k + u.The station u that has the shortest distance δ partial will be inserted to extend the path from W k to W k+1 .Note that we only consider subsections of the guide shape P with the intent, that W k+1 approximates P better than W k in each iteration.The algorithm repeats until the queue is empty.
Using paths with a few dummy edges to represent the guide shape is preferable.To achieve this goal, we give dummy edges a high cost and real metro edges a small one.Since the starting vertex of path W is unknown, we run the Dijkstra method from each potential starting station and select the path W that has the least cost δ(W, P).If the guide shape consists of multiple polylines, for example the eye-formed shape shown in Figure 11, we perform the route matching only for the the polyline containing the top left vertex, and all other polylines are placed at the correct scaling and offset to the matched one.
Once the path W is obtained, we transform the metro network to align W with the guide shape P. As mentioned previously, we assume that the guide shape and the metro map are in the right orientation, and thus the transformation contains only translation  and scaling.For simplicity, the alignment is achieved based on the bounding boxes of P and W .

Deformation
After aligning the guide shape P with the metro network, we deform the metro network to fulfill the design principles outlined in Section 3.2.This process is inspired by the two-step approach of Wang et al. [WC11].First, we create a smooth layout (Figure 3.c) that aims to space stations evenly, avoid sharp bends, and maximize angular resolution.Additionally, the guide shape P is approximated by aligning metro stations with segments of P (Figure 6).The smooth, as well as the mixed layout, are created using the least squares optimization by minimizing constraints iteratively.
In the following sections, we denote the geographic position of a station by v i ∈ S, the transformed position in the smooth optimization stage by v i ∈ S , and in the mixed stage by ṽi ∈ S. We assume that the input metro network is planar.Otherwise, we planarize the network by inserting dummy stations if two connections intersect.
To approximate the guide shape, a subset of stations v i ∈ S shape are pushed toward the guide shape segments that are located closest to them.As a result, the edges e i ∈ C shape connecting those stations can represent the guide shape P. Figure 6 illustrates the connections and stations that should and should not approximate the guide shape.It deserves noting that we use W only to align the guide Figure 6: The station v j , rather than v i , is used to approximate the guide shape.This guarantees that no other metro line is closer to the guide shape.Therefore, v j is added to S shape , but not v i .
shape with the network, rather than to define C shape .The reason is that the automatically computed path W represents only the overall shape of the guide shape and may miss details.Therefore, we update S shape at each step of the smooth deformation.This is done as follows: let v * i be a reflection of v i over the closest point p i on the guide shape.We assign v i to S shape if the line segment between v i and v * i does not intersect any of the edges in C , as illustrated in Figure 6.Otherwise, such an intersection implies that another station and metro line must be closer to the guide shape.

Smooth Layout
We optimize four constraints to compute the smooth layout, Specifically, Ωc forces the layout to approximate the guide shape.Ω l causes uniform edge lengths, Ωa maximizes angular resolutions, and Ωp minimizes the distance of the position of a metro station v i ∈ S to its geographical location.The corresponding weight to balance the potentially contrary constraints is denoted by w.Let D(v i ) be the degree of v i .The constraint Ωc penalizes the distance of smooth stations and the polyline and is given as To implement the Design principles D1 to D4 (outline in Section 3.2), three energy terms are applied to all stations v i ∈ C. The constraint Ω l forces stations to be evenly spaced.This eliminates the information about the geographic distance between stations, but creates a more uniform and balanced layout.Ω l is given by where L denotes the target length of the edges.This length is equal for all edges where stations are not dummy nodes, and equals the average length of the metro connections in the initial layout.In case v i or v j of {i, j} ∈ C is a dummy node and not a regular station, the target length for {i, j} ∈ C is L/2.Besides, θ describes the unknown angle of a connection {i, j} ∈ C and R is a rotation matrix, ensuring that the rotation of the connection is not penalized.
The constraint Ωa aims to maximize the angle between connections sharing a station.This separates the different metro lines in case of station with a degree > 2 (e.g. an interchange), making it easier for the user to distinguish two metro lines.In case of a station with degree = 2, the metro lines are straightened naturally.Ωa is formulated as where c i j = 1 2 (v k − v j ).θ i depends on the number of outgoing connections of v i , namely, To preserve the overall geographic structure of the metro system, we add the energy term Ωp.This term can avoid large deformations of the network and avoid a conflict with the mental map of users.For example, to avoid a layout where stations located in the north of a city are moved to the south.Ωp is given as: (5)

Mixed Layout
Following the smooth optimization stage, we create a mixed layout.Similar to the previous step, we differentiate between connections ẽ j ∈ Cshape that aim to approximate the guide shape and octolinear connections ẽi ∈ Cocto that do not contribute to the recognisability of the shape.Octolinear edges should have an octolinear slope (e.g. a multiple of π 4 ), whereas shape connections approximate P and should align to a section of the guide shape P. The differentiation between octolinear and shape connections is based on the assignment used for the smooth stage.Therefore, if a connection was in C shape in the smooth layout, then this edge is treated as a shape edge ẽi ∈ Cshape .Otherwise, the edge is an octolinear one.
To determine the mixed layout, each connection ẽi ∈ Cocto is assigned to its closest octolinear slope.In case of a conflict, the Hungarian algorithm is applied to reassign the octolinear slope of each edge by minimizing the sum of rotations.We minimize the term to rotate octolinear edges ẽi ∈ Cocto, where θ i j denotes the angle of the connection after the smooth optimization, ∆θ i j is the difference between θ i j and the target angle, and θi j is the current slope of the connection {i, j} ∈ Cocto.Further we apply the constraints Ωp and Ωc equally as for the smooth layout.The mixed layout is than computed by minimizing During the smooth and the mixed deformation stages, the planarity is checked after each optimization step.In case of an intersection the corresponding stations are moved back to the position at the previous iteration.An energy term is applied to avoid the same intersection in the following optimization step.If the distance between a station and a connection is below a pre-defined threshold, we apply an energy term to move them apart.A parameter testing is shown in Appendix B.

Grid Alignment
While the previous mixed layout step tries to align the shape edges with the shape and the remaining edges with an octolinear direction, the resulting layout may still contain some edges that are not fully octolinear yet.Our goal is to compute a final layout, which is as similar to the mixed layout as possible, while all edges of Cocto are exactly aligned with one of the octolinear directions and all edges of C shape are tracing the guide shape.This issue can not easily be resolved by simply snapping every edge to the closest octolinear direction.However we can adapt an existing layout algorithm developed by Bast et al. [BBS20], which computes octolinear layouts of metro maps given as geographical inputs on predefined grids, and renders edges as piece-wise octolinear curves.
We will proceed by giving a description of the original approach first and then we will describe all adaptions we made to accommodate for our setting.

The Octi framework
In their Octi framework for metro map layout, Bast et al.Note that every port node has as many ports as its original degree.Finally for every sink node, edges are introduced to create the complete graph on its port nodes.Every edge between two ports of different sink nodes has weight ccop, every connection of a port to its own sink node has a (sufficiently large) weight c sink and every connection {a b , ac} in the complete graph between port nodes of a node a have one of four possible values, inversely proportional to the angle bac.
Let x(s) and y(s) be the x and y coordinates of a station s in N. Now the candidate set V c (s) of a station s is defined as all sink nodes of G, which have a distance of r or smaller to (x(s), y(s)).
By iterating over all edges of N in a computed order Σ, the edges are routed as paths through the grid.For the first edge {s,t}, this is done -conceptually -by temporarily adding virtual vertices as and at to G and adding the edges (ax, k) for k ∈ V c (x) and x ∈ {s,t}.Every such edge is relative to the distance of x and k.Now a shortest path Πs,t between as and at is computed, as and at are removed from G, the positions for s and t are fixed to the first and last sink node of Πs,t and the piece-wise octolinear path between s and t is obtained by concatenating all sink nodes of Πs,t or the sink nodes of port nodes in Πs,t .This is now done for all edges of Σ.Should an endpoint of an edge already be fixed to a grid node, no virtual vertex is added and the shortest path is instead computed to or from the already fixed position.
Two main factors require adaption of this process, namely the additional design principle D7, i.e., the presence of the guide shape and that we do not use an input map with geographical station positions, but the mixed layout, which lets us assume that our input is already reasonably close to the final layout we want to compute.

Adaptions
We reduce the size of the map by removing stations and reinserting them afterwards, similar to Section 5.2.While the original algorithm [BBS20] uses a similar approach and retains any vertex with degree three or higher, we also retain every vertex of Socto of degree two, if its two adjacent edges are not assigned to the same (or opposing) octolinear angles, since the mixed layout already aims -in accordance with design principle D4 -to simplify line trajectories.Moreover, the mixed layout also, by design principle D6, approximates P and we therefore also keep all stations in S shape .
Next, all computed paths are paths in G. Recall that P is given as a polygonal shape.To ensure that the distances along the shape are comparable to the average distances in the grid, P is subsampled, however, no vertices are removed towards this goal to ensure that no essential features of P are lost.We need a suitable representation of P in G.This is done by overlaying P onto G, removing all edges of G, which cross an edge of P and all vertices, which are closer than a small threshold value d min to a vertex of P. Then we reconnect a node p i ∈ P with a node a ∈ G if their distance d is d low ≤ d ≤ dup, where d low < d < dup.We choose d low and dup, s.t. the connecting edges are roughly the same size as the cell size of the grid.Since the nodes on the guide shape are not perfectly aligned with nodes in G the connecting edges are not necessarily octolinear.We could approximate the shape using nodes of G, however we emphasize design principle D6 over D7 and allow some edges to deviate from the octolinear or shape aligned directions.
The newly introduced edges also need to be assigned weights.Port-to-sink connections for shape nodes are weighted the same as for normal nodes of G. Edges between port nodes of different sinks are weighted with c hop /2 or c hop /20 if one or both sinks belong to P respectively.These cost reductions are intended to encourage the routing of edges in N using edges of P. Connections between port nodes of the same sink node are again weighted inversely proportional to the angle of their connected edges, however, since the shape is not necessarily octolinear, we need to be able to derive these weights based on any arbitrary angle θ and we therefore use 2π − θ.Since θ ≤ π, we retain the desired property that no path of length two between two ports of the same sink is ever cheaper than their direct connecting edge.
Since the mixed layout already assigns and aligns stations and edges with the guide shape, we first and foremost want to ensure that these edges are still routed along edges of P. Therefore we ensure that all edges of C shape appear in Σ before any edge of Cocto.
When computing V c (s) for a station s ∈ S shape , we drastically reduce its size.In particular, we only keep the two nodes of G based on our experiments, which are closest to s.After routing all edges, all previously removed stations are reinserted and finally all maximal sequences of stations of degree two are equally distributed.

Experimental Results
The route matching and the computation of the smooth and mixed layout was performed on a a MacBook Pro (2017) with a 2.9 GHz Quad-Core Intel processor.The grid alignement was implemented in Python 3.8 using the NetworkX 2.6.3 module for shortest path and the bentley-ottman module 7.2.0 for segment crossing computation.It was computed on a standard laptop running Ubuntu 21.20 Our test cases can be grouped into two scenarios/potential usecases for our approach.In the first cases the path W was computed automatically as outlined in Section 4.1.Figure 1 shows the metro system of Taipei with a heart shape, and Figure 7 shows the one of Montreal with a cloverleaf shape, taken from the city's logo.Figures 10 and 11 use more complex guide shapes embedded in larger metro networks, demonstrating the capabilities and limitations of our approach.
For the second type of test case, we provide a manually defined path W .In Figure 9 a layout of the Berlin metro and train network is created where the ring line is emphasized in an stadium shape.The provided path W is highlighted.For the Moscow system (Fig-ure 13) a similar concept is applied.For the Lisbon metro network (Figure 12) a schematic representation of the coastline guide the train connection reaching from top right to bottom left.Table 1 lists all the presented test-cases, the number of stations of the networks, the guide shape, and if W was provided or automatically computed.

Evaluation and Discussion
In this section, we examine the performance of our approach, and the visual quality of the maps generated using our system.

Performance Evaluation
The measured computation times for the figures of the paper are summarized in Table 1.We observe that the running time increases based on the network sizes and route sizes.As the grid alignment is built based on the shortest path algorithm with complexity N(|V | 2 ), the runtimes are not yet competitive for real-time applications (a

Network
Lisbon (60) Figure 12 Montreal (68) Figure 7 Taipei (96) Figure 1 Moscow (204) Figure 13 Berlin (272) Figure 9 Berlin (272) Figure 10 Paris  1: Test instances and guide shapes with number of vertices (after planarization and before subsampling, respectively) in parenthesis with their corresponding runtimes for the route matching and deformation processes.All times are given in seconds.Shapes marked with were manually defined, and therefore have no route matching time.

Visual Quality Evaluation
To examine the visual quality of our layouts, we conducted an online user study.As previously summarized in Section 3.2, one goal of our approach is to make the embedded shapes recognizable on maps (D6) so that they become helpful for general route-finding tasks that can be done on the maps.Therefore, we are interested in two research questions, including (1) Are shapes in maps significant enough to be identified?and (2) Are embedded shapes helpful or harmful for route planning tasks in comparison to classical design?For the shape recognizability (E1), we asked the participants to mark a shape if they saw one using a polyline drawing tool via mouse clicking.To evaluate the map usability (E2), we explicitly asked participants to trace and count the number of stations between a start station and a destination station.The tasks are done on classical octolinear maps and our mixed metro maps.To analyze the result of (E1), we overlay the polyline coordinates with the map and annotate each result manually.As for (E2), we analyze task accuracy and time performance on both map styles.The study begins with example training, followed by formal questions on small (approx.100 stations), medium (approx.200 stations), and large (approx.300 stations) networks.
We received in total 65 results, while we removed one incomplete answer and one which did not pass our training exercises.We analyzed 63 results from the participants (16 females, 40 males, and 7 not disclosed) with ages ranging from 20 to 59. Five are professional transit map users (e.g., cartographers, designers, transport company employees, etc).15 are everyday users, 25 are frequent users, and 15 are occasional users.One participant rarely uses a transit map and two participants never used it.Figure 14 (a) gives an example of a route marking result from a participant, and Figure 14 (b) shows a summary of the route finding task accuracy.For (E1), we prepared maps from cities in several countries and with different guide shapes, including Montreal (flower), Singapore (heart), Paris (circle), Berlin (bear), and Paris (eye).More than 95% of the participants marked the shapes correctly in the the Montreal (flower), Singapore (heart), and Paris (circle) maps.The eye in the Paris (eye) map was recognized by 89% of the participants.The coarse shape of the bear was recognized by 60% of the participants, while none of them identified the teeth of the bear.We assume this could be because the teeth are a small portion of the entire shape and the stations are not sufficient enough to represent it.Except for the Berlin (bear) map (58%), more than 97% participants considered the shapes in the study significant.We also asked participants if the symbolic shapes helped them recognize the maps.This is done trough a 5 Point Likert Scale Analysis (yes, partially yes, neutral, partially no, and no).When the shapes are simple (flower (3.75), heart (3.51), and circle (3.71)), the answers lean toward positive, while if the shapes are complicated (bear (2.85) and eye (3.31)), the preference is close to neutral or negative.
For (E2), we compare task performance on a classical octolinear layout and a layout with embedded shapes on Montreal (flower), Singapore (circle), and Berlin (stadium).With simple shapes (e.g., circle, stadium, etc.), we see a slight improvement in task accuracy on Singapore and Berlin mixed maps (Figure 14(b)), and the time used to accomplish the route planning tasks is reduced in general (Figure 14(c)).The Berlin (stadium) has better accuracy because the stadium is a nice shape for representing a circular route of this network.We also received some explicit feedback from the participants.Ten participants mentioned in the feedback form that they found the shape design interesting and potentially helpful, especially when the shapes are simple, while two participants disliked embedding artificial shapes due to the inaccuracy introduced in comparison to more topographically correct maps.Two participants mentioned that corners on the shapes were important features that were expected to be mapped to stations in the final result.It is an interesting observation, while we did not come up with an intuitive extension to achieve this.One participant suggested that embedding a shape covering a larger area would increase the map's memorability.Another two participants mentioned that the embedded shapes might influence their planning decisions since they introduced additional bends in the map.

Limitations and Discussion
Although the route matching generally found a good alignment between the guide shape and the metro network in our test cases, we cannot guarantee their global optimality.In addition, formalizing and predicting the recognizability of shapes is a hard task, especially on shapes with multiple polylines.Likely in such a scenario not all features and subsections of a shape contribute equally to the recognizability.Our approach does not differentiate sub-regions of the guide shape and treats the entire guide shape equally.
Our deformation process creates the layout by minimizing sets of local constraints, which may cause unexpected results.For example, when deforming the transit network, the guide shape can prevent areas with a higher station density to expand, like in the Moscow map (Figure 13), where a larger circular route would be beneficial.Note that we also do not claim that any shape will be appropriate for a transit map.However, we see other potentials in the marketing, such as logo (Figure 2) and poster design [ZER21].Another limitation is inherited from the octolinear transit map design, where we do not accept a station degree that is larger than eight.In our implementation, we split high-degree stations into multiple stations with degrees less than eight in a pre-processing step.
The grid alignment requires that the vertices of P are connected with a suitable set of vertices of the grid, which results in non-octolinear edges at the interface between the grid and P. The iterative computation might not always find a routing for all edges, although even for large networks, we found layouts where only few number of edges (< 5) fail.An example is the layout of Tokyo, shown in Figure 15.The running time bottleneck of the grid alignment is the grid size and the shortest path algorithm.However, the underlying method of using repeated shortest path computations has been shown to be highly efficient on both octolinear [BBS20] and flexible grids [BBS21] and has recently been made openly available as part of a toolchain for transit map generation [Bro22].Finally, our current approach applies a post-processing labeling technique [NH18], which can potentially produce rather small text labels.The implementation is avail-Figure 15: Tokyo metro map with a heart shaped guide guide.Five edges could not be routed.The grid alignment was computed based on the smooth layout and only the dense center of the map is shown.

Conclusion and Future Work
In this paper, we introduced a new layout approach for synthesizing more engaging, mixed-style metro maps.This is achieved by embedding recognizable shapes into a classical metro map.The presented algorithm handles automatic and interactive route matching, shape-aware deformation, and finally, grid alignment sub-problems.With our results and evaluation, we show that the synthesized maps are of good quality and that the embedded shapes are intuitively recognizable.As a primary future research direction, we aim to investigate embedding more complex shapes, but also in combination with non-octolinear grids.One initial idea here is to decompose the network together with the shape hierarchically.We also plan to investigate more scalable methods to enable a realtime workflow for larger networks with proper labeling as well as to develop systematic quality metrics on such representations that are heavily linked to human shape recognition.Finally, we aim to conduct a usability test that covers the aforementioned spectrum to examine the function of shapes in a layout design.For the test-cases 4 to 7, the smooth layout is computed with the default parameters, and for the test case 4, we adapted wo and wc to 5.0.For the test-case 6, we use wo = 10.0 and for the test-case 7, we applied wc = 2.The results of the effects are further summarized in the following paragraphs.
Smooth Layout Variables (Test-cases 1-3) In the smooth results of Taipei with the default parameters (Figure 17(a)), one can see that the metro lines are straightened and stations are evenly spaced apart.Test-case 2 depicts the effect of wa clearly (Figure 17(c) and 19(c)).By decreasing the wa, the system prioritizes the other objective functions and metro lines are less straight, resulting in a less clear layout after the mixed stage.By increasing wa (Test-case 3, Figure 17(d) and 19(d)) metro lines are even more straightened at the cost of the other objective functions.This results in a layout that does not preserve the geographic shape of the metro network.For a more complex network like Moscow, the effects of the different parameters are even more significant.This indicates that the potential conflicts between the different objective functions and that the system is not able to find a reasonable solution.For example, if wa is decreased, the approach does not produce appealing results.
Mixed Layout Variables (Test-cases 4-7) For the Taipei test data, the variation of the weights wo and wc in the mixed stage have relatively little effect on the results of the final layout, as one can see in Figure 18.This implies that the process is relatively stable and the system can find a good solution for the objective function.For the Moscow test cases, the system fails to rotate a large amount of edges to octolinear direction, independently from the parameters, especially in the dense center of the map.Therefore, when the weight wc is decreased (e.g., Test-case 5 shown in Figure 20(e)), the system prioritizes the octolinear edge constraint and pushes stations away from the guide that should be located close to the guide shape.
When comparing different results of the smaller and less complex metro systems to the larger and more complex Moscow system, we can see that in the complex systems, the weights have to be balanced carefully, while in simple networks the system produces good potential results for a variety of parameters and finds a reasonable solution that satisfies different objective terms.

Figure 1 :
Figure 1: An example of Taipei metro maps, including (a) the input transit network and the guide shape (gray), and the output (b) without and (c) with the shape.
(a) Schematic Mapping Workshop logo (b) Embedded heart

Figure 2 :
Figure 2: Examples of shape-embedded layouts, including (a) the logo of Schematic Mapping Workshop 2019 (courtesy of Dr. Maxwell J. Roberts), and (b) an example illustration from One Metro World [Cer16] (courtesy of Mr. Jug Cerović).

Figure 3 :
Figure 3: Algorithmic pipeline of our layout approach.(a) The input metro network and a user-specified shape.(b) Shape and route matching, shown in blue.(c) Shape fitting using a smooth layout.(d) Shape fitting using an octolinear layout.(e) Final layout after aligning stations and lines on a modified grid, which includes the shape.

Figure 4 :
Figure 4: Dummy edges are shown with dotted lines.W is shown with a light blue stroke and W with a dark blue.The complete guide shape P is shown in black and a subsection of the guide shape is drawn with an orange stroke.

Figure 5 :
Figure5: Shape stations v i ∈ S shape and the corresponding edges that approximate a circular guide shape are visualized in blue.Stations and connections that do not approximate the guide shape are shown in red.
[BBS20, BBS21] consider a geographic network N as input.Let x min , y min , xmax and ymax be the minimal maximal x and y coordinate over all stations in N respectively.A grid graph G = (V G , E G ) (with cell diagonals) is created, with a cell size d equal to the average distance between two stations in N multiplied by a factor f d with (xmax − x min )/d columns and (ymax − y min )/d rows.The dimensions are chosen, s.t., N can be placed on top of G and the axisaligned bounding box of N is completely contained in that of G. Now every edge {a, b} of the grid is replaced with a path a, a b , ba, b of length three.The two nodes a b and ba are called the port of a in the direction of b and the port of b in the direction of a, respectively, while a and b are called the sink nodes of their respective ports.

Figure 7 :
Figure 7: Montreal metro map created with a cloverleaf-shaped guide inspired by the city's logo.(a) Geographically accurate layout with the automatically computed path P highlighted.The input guide shape is shown on the bottom left.(b) The smooth layout, (c) the mixed layout and (d) the final grid-aligned layout.
Figure 8: (a) P is overlayed on G. (b) P is subsampled to ensure similar distances on P as on G. (c) Edges of G, which intersect P and vertices of G, which are too close to a vertex of P are removed.(d) Vertices of P are reconnected with vertices of G, which are within a certain distance range.

Figure 9 :
Figure 9: Berlin metro and S-Bahn map, consisting of 272 stations.The layout is created with a stadium-shaped guide and a path W for the stadium is provided.(a) Geographically accurate layout with the path W highlighted.The input guide shape is shown on the bottom left.(b) The smooth layout, (c) the mixed layout and (d) the final grid-aligned layout.

Figure 10 :
Figure 10: Berlin metro and S-Bahn map created with a bearshaped guide, shown in the bottom right.The guide shape is inspired by the logo of Berlin.

Figure 11 :
Figure 11: Paris metro map created with an eye-shaped guide consists of multiple polylines, shown in the bottom left.

Figure 12 :
Figure12: Lisbon metro and train map.Created with an curved guide shape, aiming to schematize the right and bottom train line that follows the coast.The guide shape is shown at the top left.

Figure 13 :
Figure 13: Moscow metro map.Created with a circular guide.

Figure 14 :
Figure 14: (a) An example of the shape recognition task, and (b) accuracy and (c) time of the route finding task.The time is recorded in seconds and the error bars represent the standard errors.

Figure 16 :
Figure 16: Results of the translation and scale invariant test.For each test-case, we show the input guide shape (gray) in the input image and the resulting path (highlighted with a bold line) in the output image.

Figure 17 :
Figure 17: Taipei metro system computed with different weights for the smooth optimization process.The mixed stage was computed with the parameters wo = 2, wp = 0.1 and wc = 10.Left: smooth layout, center: mixed layout and right: grid aligned layout.

Figure 18 :
Figure 18: Taipei metro system computed with different weights for the mixed optimization process.The smooth stage was computed with the parameters wc = 10, w l = 1, wa = 2 and wp = 0.16.Left: smooth layout, center: mixed layout and right: grid aligned layout.

Figure 19 :
Figure 19: Moscow metro system computed with different weights for the smooth optimization process.The mixed stage was computed with the parameters wo = 2, wp = 0.1 and wc = 10.Left: smooth layout, center: mixed layout and right: grid aligned layout.

Figure 20 :
Figure 20: Moscow metro system computed with different weights for the mixed optimization process.The smooth stage was computed with the parameters wc = 10, w l = 1, wa = 2 and wp = 0.16.Left: smooth layout, center: mixed layout and right: grid aligned layout.Note that grid alignment layouts can have up to 5 edges, which could not be routed.