Human mobility critically depends on the existing infrastructure underlying it1,2. The transition to more sustainable mobility in particular requires a sufficiently developed infrastructure to promote, for example, cycling over motorized mobility for short and medium-distance intra-urban trips3,4. During the COVID-19 pandemic, a number of cities such as Paris, New York and Bogotá pushed to open more street space to cyclists, expanded the size of side-walks, or blocked car traffic to enable social distancing5. Similarly, many cities have vouched to invest into cycling infrastructure6,7 and are gaining increasing support among the population for these investments.

In general, designing suitable and efficient infrastructure networks constitutes an intricate problem as the networks are subject to multiple, often opposing technical, economic and social constraints8,9,10. Examples for efficient network structures can be found in various biological11,12 and social networks13,14, balancing resource and energy costs with efficient physical or information transport and robustness to failures. For mobility and infrastructure networks, examples of efficient topologies include the core–periphery structure of air travel networks, balancing the cost of direct flights with the inconvenience of transfers11,15,16,17, and the emergent backbone structure in street networks of cities18,19.

For the design of bike path networks, three major constraints include: (1) budget constraints, which limit the total length of bike paths due to, for example, construction or maintenance cost15,20; (2) bike path networks have to support the mobility demand and enable fast travel between frequented locations without large detours15,16,18; (3) bike path networks should also enable safe travel of cyclists along highly frequented routes21. Different implementations of bike path infrastructure weigh these constraints differently. For example, colored bike lanes on the street do not cost much but only slightly protect cyclists, whereas physically separated bike lanes greatly improve cyclists’ safety but require more space and investment22,23. From a network structure perspective, each of these aspects is simple to understand individually. For example, a connected bike path network in a city that minimizes the required budget is simply given by the minimum spanning tree of the underlying street network17,19. More sophisticated approaches to find connected network structures have recently been proposed. Such approaches, based on percolation processes24,25,26, optimize the connectivity of the bike path network; however, connectivity alone is not sufficient to support demand, as routes along streets equipped with bike paths would likely be indirect and require large detours. Shortest path trees would optimally support the demand only from and to a single location. By contrast, direct routes between other locations would require cycling along streets without dedicated bike infrastructure and would not be as safe27,28. Finally, the safest and most convenient network for cyclists—in which a bike path exists along every street—would naturally exceed any reasonable budget constraints20,29. However, efficient bike path networks have to simultaneously adhere to all three constraints to enable both convenient and safe travel with feasible investment30,31.

In this article we propose a framework for constructing a family of efficient bike path networks, all adapted to the given street network and demand distribution. The algorithm realizes inverted network growth: based on a simplified cyclist routing model and starting from a network fully equipped with bike paths, the algorithm generates a sequence of bike path networks by successively removing bike paths from the street segments with the least impact given the usage patterns in the current network. We observe that both convenience and safety of cycling in the network remain high, even if only a small part of the street network remains equipped with bike paths. Application of the algorithm to synthetic, homogeneous demand conditions enables us to quantify the importance of the cycling demand for the structure of the resulting bike path networks. The proposed framework is extendable to include different routing models and its applicability to different street networks and demand distributions may support planning of bike path networks that promote a desired cycling demand.


Cyclist route choice model

The benefit of bike paths fundamentally depends on their usage and in turn on the routes of cyclists. We map cyclists’ route choices to a shortest-path problem on a preference graph G = (V, E) with N = V number of nodes (intersections) and M = E number of edges (street segments). We derive the preference graph G from the physical street network Gstreet. Both graphs share the same set of nodes V. Each edge eijE in the cyclist preference graph represents a street segment that connects intersections i, jV and is assigned a perceived distance


Here, \({l}_{ij}^{{{{\rm{street}}}}}\) denotes the physical length of the corresponding street segment \({e}_{ij}^{{{{\rm{street}}}}}\) in the street network and \({p}_{ij}\in \{{p}_{ij}^{B},{p}_{ij}^{0}\}\) is a penalty factor summarizing cyclists preferences against riding along the street segment eij. The set of street segments equipped with bike paths EBE contains street segments eijEB without distance penalty \({p}_{ij}^{B}=1\). Street segments that are not in this set eijEB have penalty factors \({p}_{ij}^{0} > 1\). The value of these penalty factors \({p}_{ij}^{0}\) may depend on different characteristics of the individual street segments, representing the perceived safety or convenience for cycling.

Adopting this perspective of a cyclist preference graph, we take cyclists to choose their route based on the shortest path \({{{\Pi }}}_{i\to j}^{* }={{{\rm{argmin}}}}\left[{L}_{i\to j}({{{\Pi }}}_{i\to j})\right]\) between their origin i and destination j, minimizing the perceived trip distance

$${L}_{i\to j}({{{\Pi }}}_{i\to j})=\mathop{\sum}\limits_{e\in {{{\Pi }}}_{i\to j}}{l}_{e}$$

over their potential paths Πij. Effectively, cyclists choose the most direct path to keep the physical distance of their trip as short as possible but accept detours to avoid busy streets and use bike paths or low-traffic residential streets as alternative routes (Fig. 1).

Fig. 1: Cyclists’ route choices balance speed and safety.
figure 1

a, If all major streets (thick edges) are outfitted with dedicated bike paths (thick blue lines), cyclists choose the most direct route (1, solid black arrow) from their origin (pin) to a destination (flag) over alternative paths (dashed arrows). b, If only some major streets are equipped with a bike path, cyclists avoid busy roads without a bike path (thick gray lines) and may prefer a short detour (2, solid black arrow). c, If none of the streets have dedicated bike infrastructure, cyclists balance the distance and safety of their route choices and may prefer long detours (3, solid black arrow) via low-traffic residential streets (thin gray lines) to more direct routes with high car traffic.

This simplified route choice model enables efficient calculation of route choice decisions, particularly compared with more complex stochastic models32,33. To illustrate the concept, we focus here on the effect of the street type and take the penalties \({p}_{ij}^{0}\) of a street segment to depend on the volume of car traffic on the respective segment, where higher penalties correspond with larger car traffic volumes (that is, a lower perceived safety or convenience; see Methods for details). In principle, the approach can be extended to include additional factors (see Supplementary Note 1 for a brief discussion) such as slopes, (left) turns or crossings by appropriately modifying the cyclist preference graph (for example, adding more edges with a penalty for left turns) as well as more complex route choice models or heterogeneous preferences among cyclists27,28.

Network generation

We describe the bike path network of a city as a subgraph GB = (V, EB) Gstreet of the city’s street network, in which each street segment eijE may (eijEB) or may not (eijEB) be equpped with a bike path. Even in this simple binary model, the number of possible bike path networks GB scales exponentially with the number M of edges in the street network, as each street segment may or may not be equipped with a bike path (there are thus 2M possible subgraphs). Testing all of these networks is impossible for real-world cities in reasonable time (see Supplementary Note 2 for a more detailed description of the underlying optimization problem). Recent approaches utilize forward network percolation models to construct bike path networks24,26 or apply percolation models to a fixed cyclist flow25 to find efficient networks.

Here we employ a complementary approach that follows the idea of pruning links from a network—as previously employed in network community-detection algorithms34 and to study the structure of aviation networks16. Specifically, we create a sequence \({\{{G}_{B}(M^{\prime} )\}}_{M^{\prime} }\) of bike path networks where \(M^{\prime} \in \{0,1,\ldots ,M\}\) street segments are outfitted with a bike path (see Fig. 2): we start from an optimal bike path network in which every street segment is equipped with a bike path (EB(M) = E) such that there is no penalty for any street segment (\({p}_{ij}={p}_{ij}^{B}=1\) for all edges). We then compute the route choice decisions of the cyclists in their preference graph G (as described above) on the basis of their demand distribution nij, which denotes the number of cyclists traveling from nodes i to j. To construct the family of bike path networks, one by one we remove the least important bike path \({e}_{ij}^{* }(M^{\prime} )\) from the network, \({E}_{B}(M^{\prime} -1)={E}_{B}(M^{\prime} )\setminus \{{e}_{ij}^{* }(M^{\prime} )\}\), adjusting the penalty of that street segment from \({p}_{ij}={p}_{ij}^{B}=1\) to \({p}_{ij}={p}_{ij}^{0} > 1\) in the cyclist preference graph G. We quantify the importance of a bike path \({e}_{ij}\in {E}_{B}(M^{\prime} )\) in the current state of the bike path network (with \(M^{\prime}\) remaining bike paths) as the product \({p}_{ij}^{0}\,{n}_{ij}(M^{\prime} )\) of the penalty \({p}_{ij}^{0}\) (if the street had no bike path) and the number of cyclists that using that street segment \({n}_{ij}(M^{\prime} )\). The product represents the graph-theoretical weighted betweenness centrality of the edge in the cyclist preference graph. This approach minimizes the negative impact of each removed bike path on the perceived distance of the cyclists in the current bike path network. After each change to the cyclist preference graph G, we update the route choice decisions of the cyclists, ensuring that the algorithm continually adapts to the cycling demand given the currently available set of bike paths \({E}_{B}(M^{\prime} )\). The process terminates with an empty bike path network \({G}_{B}(0)=(V,{{\emptyset}})\) once all of the bike paths have been removed.

Fig. 2: Constructing a sequence of efficient bike path networks.
figure 2

a, Block diagram of the algorithm. b, Illustration of bike path networks \({G}_{B}(M^{\prime} )\) with different numbers \(M^{\prime}\) of street segments equipped with bike paths. Edges represent major busy streets (thick lines) or minor residential streets (thin lines), and whether the street is equipped with a bike path (blue) or not (gray). The black dotted lines indicate cyclists' route choices. (i) We start from a full bike path network GB(M) = G, in which all M street segments of the network G are equipped with a bike path (\(M^{\prime} =M\)). (ii) We first remove all of the bike paths that are not used by any cyclists, nij = 0, leaving us with the smallest subgraph GB(M0) that still optimally serves the given demand. (iii, iv) We then remove the least important edges one by one, defined by the smallest product \({p}_{ij}^{0}\,{n}_{ij}\) of the penalty factor and the number of cyclists using the bike path, updating the cyclists' route choice and recording one network \({G}_{B}(M^{\prime} )\) for each number \(M^{\prime}\) of bike paths. (v) The algorithm terminates with an empty bike path network GB(0) once all of the bike paths have been removed.

See Supplementary Note 3 for a discussion on the computational runtime of the network generation.

In contrast to iteratively adding bike paths to an initially empty graph and building on the suboptimal cycling routes in networks with few bike paths, this procedure creates bike path networks adjusted to ideal cycling conditions; for example, it keeps bike paths that may not be important in the perfect network if the cyclists start to use them more heavily as the other bike paths are removed (see Supplementary Note 4 for details).

Inputs to our algorithm are: (1) the street network Gstreet, (2) the penalty factors \({p}_{ij}^{0}\) for each street segment not equipped with a bike path, (3) the demand distribution nij and (4) the cyclists’ route choice model. These parameters may either be as-is empirical values, or planned/desired ideal values (for example, describing the desired or predicted demand for cycling in a city). The latter application might be particularly relevant for planning bike path network extensions if urban quarters develop or are repurposed.


We test the proposed algorithm using data from two German cities: Dresden and Hamburg (see Fig. 3). We take the street networks of both cities from OpenStreetMap (OSM)35—using the street classification as a proxy for their expected traffic load—as input data; we also take data from local bike-sharing services to model the cycling demand. We fix the penalty factors against those of physically protected bike path infrastructure based on the street type classification decoded in OSM (see the Methods for a detailed description of the data).

Fig. 3: Street networks and bike-sharing demand in Dresden and Hamburg.
figure 3

a, Street network (gray lines), bike-sharing-station locations and station activity (colored circles) in Dresden between November 2017 and March 202044. b, Distribution of station usage, measuring the combined number of in- and outgoing trips per station in Dresden. Bike-sharing usage is strongly heterogeneous and is dominated by two heavily used stations (pink) along the north–south axis between the central train station (center) and university campus (south). Station density reflects this usage pattern and is highest in the central city (north/center) and near the university campus (south). c, Street network, bike-sharing-station locations and station activity in Hamburg between January 2014 and May 201745. d, Distribution of station usage, measuring the combined number of in- and outgoing trips per station in Hamburg. The station activity distribution is homogeneous across a broad spectrum of total number of trips. This homogeneous usage is also reflected in a more homogeneous distribution of bike-sharing stations, which is slightly denser only in the inner city (south).

Source data

The two cities are representatives of two archetypes of local demand constellations: spatially homogeneous all-to-all demand and confined few-to-few demand. Bike-sharing usage patterns in Hamburg indicate a local demand structure that refers to the first archetype (see Fig. 3c,d), whereas corresponding data for Dresden hint at the latter archetype, which is reflected by the dominance of trips between the university and main train station (see Fig. 3a,b).

Algorithmic generation of bike path networks

We generate families of bike path networks \({\{{G}_{B}(M^{\prime} )\}}_{M^{\prime} }\) for both cities. We chose a network in which all primary and secondary (P + S) street segments (as per their classification in OSM) are equipped with bike paths and compare this network to our generated network with the same total length \({{\Lambda }}(M^{\prime} )={\sum }_{e\in {E}_{B}(M^{\prime} )}{l}_{e}^{{{{\rm{street}}}}}\) of bike paths such that \({{\Lambda }}(M^{\prime} )={{{\Lambda }}}_{{{{\rm{P+S}}}}}\). Taking the installation and maintenance cost of the bike path network proportional to its length, we thus compare networks with the same budget. Due to some antiparallel one-way streets, our algorithm may place slightly more bike paths along other streets than effectively exist in the P + S network. As we assume bidirectional paths, our algorithm may equip only one of the antiparallel streets with a bike path, instead of both as in the P + S network.

Figure 4 illustrates both types of networks for Dresden and Hamburg. The network generated by our algorithm largely coincides with the primary and secondary roads due to the high penalty if bike paths are removed; however, we observe strong differences in the density of the bike path coverage. Especially in Dresden, the resulting bike path network is much denser along the central north–south axis of high station density and bike-sharing usage, indicating that our algorithm correctly adapts the network to the input demand conditions (Fig. 4c). The differences for Hamburg are smaller due to the comparatively homogeneous demand across the city, although our algorithm introduces bike path shortcuts through residential areas in cases of high demand or to connect stations to the bike path network.

Fig. 4: Demand-efficient bike path networks.
figure 4

af, Networks for Dresden (ac) and Hamburg (df) with bike-sharing-station locations (purple, compare with Fig. 3). a,d, Bike path networks generated by the algorithm (blue) with the same total length as all of the primary and secondary streets, \({{\Lambda }}(M^{\prime} )={{{\Lambda }}}_{{{{\rm{P+S}}}}}\). b,e,Networks for the scenario in which only the primary and secondary streets (as per their OSM classification) are equipped with bike paths (black). c,f, Comparisons between both networks. The networks generated by the proposed algorithm largely coincide with the primary–secondary networks (orange edges in c and f) but more accurately reflect the input demand structure by also keeping highly used tertiary or residential streets equipped with bike paths and exhibiting a higher density of bike paths in high-demand areas.

Source data

To quantitatively compare the bike path families for both cities, we normalize the length of bike paths \(\lambda ={{\Lambda }}(M^{\prime} )/{{\Lambda }}({M}_{0})\) with respect to the length Λ(M0) after removing all of the unused bike paths (see Fig. 2b). We define the total perceived distance of all trips in the cyclist preference graph as

$${{{\mathcal{L}}}}(\lambda )=\mathop{\sum}\limits_{i,j\in V}{n}_{i\to j}\,{L}_{i\to j}({{{\Pi }}}_{i\to j}^{* }(\lambda ),\lambda )$$

where Lij(Π, λ) = ∑eΠle(λ) (compare with equation (2)). Here, le(λ) denotes the effective length of the street segment e in the cyclist preference graph G, given a set of bike paths \({E}_{B}(M^{\prime} )\) with normalized length λ (that is, including penalties only for those streets from which we have removed the bike path); \({{{\Pi }}}_{i\to j}^{* }(\lambda )\) denotes the shortest path in this cyclist preference graph and thus the route chosen by cyclists going from i to j. To compare the total perceived distance across both cities, we measure the overall performance b(λ) of the resulting network as the bikeability

$$b(\lambda )=\frac{{{{\mathcal{L}}}}(0)-{{{\mathcal{L}}}}(\lambda )}{{{{\mathcal{L}}}}(0)-{{{\mathcal{L}}}}(1)},$$

where we again normalize the absolute values to the best- (λ = 1) and worst-case (λ = 0) scenarios; b(0) = 0 describes the network with no bike paths, whereas b(1) = 1 is the optimal network with bike paths along all of the shortest paths. We remark that our definition of bikeability differs from past measures36 in that it quantifies the efficiency of the bike path network with respect to a specific demand distribution. The total difference between the physical trip length of cyclists and the direct shortest paths is only on the order of 10%, consistent with the empirical observations of cyclists’ route choice behavior27,28.

Figure 5 illustrates the bikeability across the generated sequence of bike path networks. Interestingly, a small fraction of bike paths with a small relative length of λ > 0.1 is sufficient to achieve more than 50% of the maximal bikeability in both cities. The larger area under the bikeability curve for Dresden compared with Hamburg is consistent with the differences in the demand structure between the two cities: we achieve a faster improvement in Dresden due to the more concentrated demand distribution, whereas we have to cover most of the city of Hamburg due to the more homogeneous demand. See Supplementary Fig. 3 for a brief overview of the bikeability of a further twelve cities.

Fig. 5: Demand-driven design of bike path networks improves bikeability.
figure 5

a,c, The resulting bikeability b(λ) (blue, equation (4)) and relative cost of the network (gray) for Dresden (a) and Hamburg (c) as a function of the normalized length of the bike path network λ. b,d, Corresponding fraction of total distance traveled on streets with and without bike paths, in networks with bike paths with the same relative length λP+S, and the primary–secondary (P + S) comparison network. Adapting the network to the demand structure achieves over 89% of the distance traveled on bike paths (blue), also reducing the distance traveled on residential streets (light gray). For our algorithm, a negligible fraction of the total distance is cycled on tertiary (dark gray) and secondary (black) roads without a bike path (not visible in the bar chart).

Source data

A comparison with the bikeability of the primary–secondary bike path network with the same relative length λP+S of bike paths highlights the better adaptation to the demand structure in our algorithm. The bikeability is already high when all large roads are equipped with bike paths (about 0.87 for Dresden and 0.82 for Hamburg). Yet our algorithm manages to further increase this value to about 0.97 for Dresden and 0.95 for Hamburg (capturing more than 70% of the remaining potential of an optimal network b(1) = 1). Moreover, by adjusting the network to the route choice behavior, cyclists keep to streets equipped with bike paths for more than 89% of their total trip distance, compared with only about 60% in the primary–secondary network (see Fig. 5b,d). A negligible but non-zero fraction of the distance is cycled on tertiary and secondary streets without a bike path. See Supplementary Notes 5 and 4 for a comparison with static and dynamic forwards percolation approaches, respectively.

Impact of demand structure

We attribute the difference between the two cities in the above analysis to the structure of the bike-sharing demand distributions. To quantify the impact of the demand structure on our bike path network families and their bikeability curves, we compare the above results to synthetic bike path networks with homogenized demand. We create these homogeneous demand settings by first distributing demand equally between all stations and then distributing the stations as equidistantly as possible in the street network (see Fig. 6a and Methods).

Fig. 6: Bikeability differences quantify the importance of demand structures.
figure 6

a, Illustration of the demand homogenization for Hamburg. Starting from the empirical demand (i), we create uniform demand between all stations (ii) and then distribute the stations approximately equidistantly across the city (iii). b,c, Comparison of the bikeability b(λ) (equation (4)) from the empirical (compare with Fig. 5) and homogenized demand data for Dresden (b) and Hamburg (c). The comparatively smaller area between the curves (shaded gray, equation (5)) for Hamburg suggests a more homogenous empirical demand, in line with our observations in Fig. 4.

Source data

Comparing the bikeability curves b(λ) and bhom(λ) in the empirical and the homogeneous demand settings, respectively, we find a comparatively large difference for Dresden and a much smaller difference for Hamburg (Fig. 6b,c). We quantify these differences by the area

$${\beta }_{\hom }=\int\nolimits_{0}^{1}\left[b(\lambda )\,-{b}_{\hom }(\lambda )\right]\,{{{\rm{d}}}}\lambda ,$$

between the two bikeability curves, which describes the impact of the patterns—as well as the structure of the station and demand distribution—on the bikeability (βhom ≈ 0.015 for Dresden, βhom ≈ 0.007 for Hamburg; compare with Fig. 6). This confirms our above analysis that the heterogeneous, centralized demand and station distribution in Dresden enhances the bikeability as fewer streets have to be equipped with bike paths to cover a large fraction of the total demand, whereas there is a much smaller effect in Hamburg. A similar approach may be used to quantitatively compare the impact that different street networks, or different types of cycling or desired demand distributions may have on the resulting bike path networks.


Promoting cycling as a way to improve the sustainability of urban mobility is a complex problem. The attractiveness of cycling depends on the available infrastructure and safety of the trips, alternative mobility options, other mode choice decisions that influence the amount of car traffic, as well as aspects such as topography and weather21.

Existing approaches to study bike path networks rely on various types of input data and focus on different properties; for example, improving connectivity of existing bike paths24, purely structural network growth models26 or standard forward percolation models based on static route choice data25. Compared with these more abstract percolation models, our adaptive inverse percolation framework trades computational speed for the explicit inclusion of cyclist demand. Compared with more detailed infrastructure models, we trade accuracy of the route choice model for the ability to adaptively adjust route choices as the network evolves.

Similar network pruning or inverse percolation techniques—as used in cascading failure models37,38—have previously been applied to understand the structure of transportation networks and their robustness16,18. The approach may therefore also find applications in designing and analyzing infrastructure and transportation networks beyond cycling. Combining the suggested approach with additional optimization steps, for example, by using successive addition and removal of individual bike paths or simulated annealing techniques15 to explore the vicinity of networks constructed by our greedy approach, may further improve the quality of the resulting networks.

The proposed framework relies on several types of input, all with potential limitations in terms of data quality, modelling accuracy and interpretability of the results; however, the framework is highly adaptive and can easily be extended to overcome these challenges provided more detailed input data are available.

First, the quality and type of input data is critical for the resulting networks and their interpretation. Available street network data are mostly of high quality (see Methods) and even existing bicycle infrastructure may be included in the framework by preventing the removal of bike paths from specific street segments in the network; however, the resulting bike path networks have to be interpreted in the context of the demand input (compare our results for Dresden). For example, the empirical bike-sharing demand used to illustrate the framework may be strongly influenced by the currently (non-)existing infrastructure and the type of users of the service, thus skewing the generated networks to further improve already efficient parts of the network. At the same time, the framework is not limited to empirical demand data. Constructing efficient networks for desired and predicted demand may help guide extensions of bicycle infrastructure networks by suggesting efficient network structures4,25. Combining full mobility demand with a suitable mode choice model may even enable us to capture effects of induced additional demand when sufficient infrastructure is provided.

Second, the framework relies on a simplified route choice model to enable fast computation by mapping the route choice of cyclists to an effective shortest-path problem. We illustrated the framework with an effective network capturing only the effect of car traffic volume on cyclists route choice. A more detailed definition of the penalties, including additional deterrents such as slopes and (left) turns, may improve the accuracy of the route choice model. Furthermore, explicit safety considerations such as accident risk may be included in the penalties as proposed in ref. 39, enabling more accurate quantification of the actual safety in addition to the perceived safety. A more accurate representation of cyclist route choice behavior and heterogeneous preferences among cyclists, as assumed in common probabilistic route choice models, may be indirectly possible by considering multiple types of cyclists and creating a cyclist preference graph with appropriate penalties for each user type.

All of these potential extensions naturally require more details in the input data, such as information on traffic signals, street quality or expected driving behavior for car traffic across the street network. Recent contributions to the data-driven analysis and planning of cycling infrastructure and route choice as well as data collection methods are essential to establish a foundation of input data and ensure reliable results and predictions24,25,26. Although, eventually, first-hand on-site experience and detailed case-by-case modelling must determine the sensibility and feasibility of the suggested networks, with sufficiently accurate input data our framework may provide scenarios for efficient bicycle infrastructure networks, helping to guide planned extensions of existing infrastructure networks4,25. Our framework may thus complement current urban planning approaches22 by helping to develop a more detailed understanding of the theoretical properties of efficient bike network structures across cities and offering a baseline of an efficient network to develop a more detailed long-term strategy to expand bicycle infrastructure.

Overall, the framework presented in this article may enable quantitative analysis of bike path networks with a large range of tools from network science by providing a way to quickly generate and compare families of efficient bike path networks in different settings and under different conditions.


Street networks

We download physical street networks for Hamburg and Dresden from OSM35,40. Although OSM data are crowdsourced, it is of high quality in developed countries, especially in Western Europe41. For other regions of the world, OSM is sometimes the only feasible source of data42.

For both cities, we restrict ourselves to the area covered by the local bike-sharing schemes. We exclude city peripheries that are either sparsely populated with a low density of bike-sharing stations or a long distance from the city center. This results in a reasonably bikeable area of approximately 65 km2 (Dresden) and 49 km2 for Hamburg (Fig. 3).

We simplify these raw street networks by merging nodes within a radius of less than 35 m (for example, simplifying the detailed structure of intersections) and placing the resulting aggregated node at the centroid of their former positions40. Finally, we discard bike-inaccessible roads based on the OSM street classification hierarchy43, in particular, edges labeled as: motorway, motorway_link, trunk, or trunk_link, which describe highways or high-speed motorways where cycling is not possible.

Based on the remaining nodes and edges (see Fig. 3), we create the physical street network Gstreet by assigning each street segment a length \({l}_{ij}^{{{{\rm{street}}}}}\) corresponding to its physical length in the OSM data.

Penalty factors

To fix the penalty factors in these networks without detailed information on traffic volume, we rely on the street type classification decoded in OSM as a proxy for the traffic load. Within the OSM category of car-accessible streets, we use OSM’s classification hierarchy of: primary, secondary, tertiary or residential streets, replacing link street types with their corresponding normal street types, for example, primary_link with primary. Street segments not labeled with one of the four aforementioned classifications are assigned the residential status, as most other OSM classifications are reserved for small streets, for example, living_street. In case of ambiguity on the street segment length or street type, we always choose the first value in the list of the OSM data.

We assume that the expected traffic load and thus the corresponding penalty factor \({p}_{ij}^{0}\) monotonically increases from residential to primary roads. Based on this input, we construct the cyclist preference graph G with the perceived edge lengths \({l}_{ij}={p}_{ij}\,{l}_{ij}^{{{{\rm{street}}}}}\) (equation (1)).

The penalty factors \({p}_{ij}^{0}\) quantify the trade-off between the distance a cyclist is willing to ride along a street with a bike path to avoid a specific street segment a without bike path. To illustrate our framework, we take penalty values representing the perceived distance compared with physically protected bike paths as they are the safest option for cyclists; however, the penalties can be adapted to represent other types of bike path implementations. We employ penalty factors as estimated in ref. 28; the authors associated different penalties with different properties of the route and street segment by contrasting actually chosen bike routes with possible alternatives in a logit route choice model. We take the penalty factors representing accepted detours for streets with more than 30,000 vehicles per day, 20,000 to 30,000 vehicles per day, and 10,000 to 20,000 vehicles per day. Due to lack of detailed information on traffic volume, we directly match these penalties to the OSM street types: primary street segments are assigned a penalty \({p}_{ij}^{0}=7.0\), secondary \({p}_{ij}^{0}=2.4\), and tertiary \({p}_{ij}^{0}=1.4\). We add a smaller penalty factor \({p}_{ij}^{0}=1.1\) for residential street segments. These values serve as illustrative examples of the influence of car traffic and may vary depending on the location, trip purpose, bicycle infrastructure or for individual cyclists.

Bike-sharing demand data

We take demand data from local bike-sharing services in Dresden and Hamburg as demand input for the algorithm (Fig. 3). For both cities, we map the bike-sharing stations to their respective nearest node in the street network and obtain the origin–destination-resolved demand statistics by counting the overall number of trips nij made throughout the entire observation period per pair (i, j) of stations. To quantify the total usage of each station, we compute the sum of bike rentals and returns at the station (see Fig. 3b,d). The two datasets represent two archetypes of local demand constellations: confined few-to-few demand in Dresden (Fig. 3a,b) and spatially homogeneous all-to-all demand in Hamburg (Fig. 3c,d).


Dresden’s local bike-sharing scheme operated on a combined station-based and free-floating mode during the observation period. Although bikes could be rented or returned on an as-needed basis within a pre-defined area in the inner city center, they needed to be rented from, and returned to, one of 159 stations outside of the free-floating zone44.

To estimate the local bike demand, we use a proprietary dataset of approximately 440,000 bike-sharing trip records conducted by students of the local universities between November 2017 and March 2020 (except February and September 2018), which accounts for about 80% of all trips of the service44. The dataset contains, among other things, information on the trip origin and destination if the trip started or ended at a station, as well as the pickup and drop-off timestamps. The dataset does not contain positional information on trips conducted in free-floating mode.

To be able to fix the demand distribution to nodes in the street network, we exclude trips for which no origin or destination information is available (for example, trips starting or ending in the free-floating zones). Furthermore, we exclude nine stations that are distant from the city center and are thus not included in the core polygon illustrated in Fig. 3a, leaving approximately 163,000 trip records for the demand analysis. The remaining 150 stations are mapped to 142 nodes of the street network G (eight stations are mapped to the same node as another station, for example, two stations on two sides of a large street crossing).


In 2017, Hamburg’s station-based bike-sharing scheme operated 206 stations, of which 129 were distributed in the core city (see Fig. 3b). Between January 2014 and May 2017 the service facilitated approximately 8.6 million rides for which detailed trip information is publicly available45. The data contains, among others, information on trip origin and destination station, pickup and drop-off timestamps, as well as user or bike-related information.

We again exclude trips where no origin or destination information is available as well as trips which start and end at the same station, leaving about 6.4 million trips in our region of interest (approximately 74% of all trips). After mapping the 129 stations to the street network G, we keep 127 unique locations (two stations are mapped to the same node as another station).

Homogenized demand

To quantify the impact of the demand distribution on the bikeability, we compare our results for the empirical demand distribution with results for homogenized demand distributions. We generate these randomized comparisons in three steps: (1) create approximately homogeneous demand and station distribution; (2) generate bike path ensembles for ten realizations of the demand and station distribution; (3) average the bikeability results from the different realizations.

We create these homogeneous demand settings by first distributing demand equally between all stations, setting \({n}_{i\to j}^{(\hom )}=1\) for all bike-sharing-station pairs i and j, where i ≠ j. Second, we distribute the stations as equidistantly as possible in the street network. To achieve this station distribution, we create a triangular lattice in the polygon of the physical street network with a slightly higher total number of lattice points. We then map each lattice point to the closest node in the underlying street network G and delete excess points starting with those lattice points whose position in the triangular lattice is furthest from its corresponding node in G until we are left with the same number of nodes as station in our original data (Fig. 6a).

We create bike path networks as described above, compute the resulting bikeability and other measures, and average them over ten realizations of random homogeneous station distributions.