logo Netzschleuder network catalog, repository, and centrifuge

History of tntp

The changes to the source code of this entry in the repository, newest first, each with the differences it made to the entry's files. They are also listed on GitLab.

[entries] Remove superfluous details of the upstream distribution from the descriptions by Tiago de Paula Peixoto dc07aa0
The descriptions mentioned incidental details of how the upstream data
are made available: the file formats (CSV, JSON, XML, GEXF, SBML, HIF,
Pajek, UCINET, ...), file names, where the files were published or
obtained from (Zenodo, figshare, Kaggle, the Pajek datasets page, the
Internet Archive), and that some networks are only available in the gt
format. These are left out; caveats about the data themselves are kept,
referring to "the data" instead of "the file". The description of
sp_baboons now lists its properties instead of the upstream columns,
and says that events without a recipient are left out.
diff --git a/entries/tntp/__init__.py b/entries/tntp/__init__.py
index b036182..edd35fb 100644
--- a/entries/tntp/__init__.py
+++ b/entries/tntp/__init__.py
@@ -19,7 +19,7 @@
 from .. import *
 
 title = "Transportation Networks for Research road networks (1975-2016)"
-description = """Road networks used as test problems for the traffic assignment problem, from the Transportation Networks for Research repository maintained by B. Stabler, H. Bar-Gera and E. Sall, which continues H. Bar-Gera's earlier "Transportation Network Test Problems" (TNTP) collection. Each network represents the road system of a region as prepared for (static) traffic assignment: nodes are intersections, points along roads, or zone centroids (artificial nodes representing traffic analysis zones, where trips start and end), and directed edges are road links, including the artificial "centroid connector" links that join zones to the road network. Most networks were produced by regional planning agencies or researchers, and many are simplified or aggregated representations of the real road system; the years of the underlying data are often unknown. The origin-destination demand tables that accompany the networks in the repository are not included.
+description = """Road networks used as test problems for the traffic assignment problem, from the Transportation Networks for Research repository maintained by B. Stabler, H. Bar-Gera and E. Sall, which continues H. Bar-Gera's earlier "Transportation Network Test Problems" (TNTP) collection. Each network represents the road system of a region as prepared for (static) traffic assignment: nodes are intersections, points along roads, or zone centroids (artificial nodes representing traffic analysis zones, where trips start and end), and directed edges are road links, including the artificial "centroid connector" links that join zones to the road network. Most networks were produced by regional planning agencies or researchers, and many are simplified or aggregated representations of the real road system; the years of the underlying data are often unknown. The origin-destination demand tables of the networks are not included.
 
 The networks are:
 
@@ -33,7 +33,7 @@ The networks are:
 - `chicago_sketch`: an aggregated ("sketch planning") representation of the Chicago region, by CATS. Time in minutes, length in miles, toll in cents; node positions are Illinois State Plane coordinates, in feet.
 - `eastern_massachusetts`: the highway subnetwork of the Eastern Massachusetts network, for the PM period of April 2012, from Zhang et al. (2016). Time in hours, length in miles; every node is a zone.
 - `gold_coast`: Gold Coast, Australia, from Veitch Lister Consultancy (provided by M. Bliemer; revised in January 2016). Capacity is per lane, length in km, time in minutes, speeds in km/h; node positions are longitude and latitude.
-- `hessen_asymmetric`, `terrassa_asymmetric`, `winnipeg_asymmetric`: networks of Hessen (Germany), Terrassa (Spain) and Winnipeg (Canada) with asymmetric cost functions at junctions (provided by E. Codina Sancho); the asymmetric cost structure itself is not included in the network files.
+- `hessen_asymmetric`, `terrassa_asymmetric`, `winnipeg_asymmetric`: networks of Hessen (Germany), Terrassa (Spain) and Winnipeg (Canada) with asymmetric cost functions at junctions (provided by E. Codina Sancho); the asymmetric cost structure itself is not included.
 - `philadelphia`: the Delaware Valley Region (Philadelphia, USA), by the Delaware Valley Regional Planning Commission. Capacity in vehicles per 24 hours, length in miles, time in minutes, toll in cents; the `speed` values have unknown meaning; node positions are in units of 0.01 miles. Link types: 1 freeway, 2 parkway, 3 principal arterial, 4 secondary arterial, 6 collector/local, 7 approach link (including centroid connectors), 8 ramp, 9 dummy link.
 - `sioux_falls`: the classic, unrealistic, Sioux Falls (USA) network of LeBlanc et al. (1975). Free flow times are in units of 0.01 hours, lengths are set equal to them, and node positions were generated artificially to reproduce the diagram of the paper.
 - `sydney`: Sydney, Australia, from Veitch Lister Consultancy (provided by M. Bliemer). Length in km, time in minutes, speeds in km/h; node positions are longitude and latitude.
@@ -42,7 +42,7 @@ The networks are:
 
 The networks have the following properties (missing values are NaN):
 
-- (Node) `is_zone`: whether the node is a zone (zones are numbered first in the source files; in some networks zone nodes cannot be traversed by through traffic, see the graph property `first_thru_node`).
+- (Node) `is_zone`: whether the node is a zone (zones are numbered first in the data; in some networks zone nodes cannot be traversed by through traffic, see the graph property `first_thru_node`).
 - (Node) `pos`: the position of the node, in the units given above (only for some networks).
 - (Node) `original_id`: the node number in the original data (Berlin networks only).
 - (Edge) `capacity`: the link capacity (usually in vehicles per hour).
[entries] Lay out the spatial networks with hfd_layout() instead of cfd_layout() by Tiago de Paula Peixoto cc3bcb0
Changed: none
diff --git a/entries/tntp/__init__.py b/entries/tntp/__init__.py
index f7ac737..b036182 100644
--- a/entries/tntp/__init__.py
+++ b/entries/tntp/__init__.py
@@ -305,6 +305,6 @@ def parse(alts=None):
 
 
 def get_pos(g, sbm_fit):
-    # Spatial network: laid out with the default parameters of cfd_layout(),
+    # Spatial network: laid out with the default parameters of hfd_layout(),
     # without the partition of the SBM fit
-    return cfd_layout(g)
+    return hfd_layout(g)
[entries] Add the date when each entry was added, and remove icon_hash by Tiago de Paula Peixoto beff7c9
The dates are those of the commits that first added the entries' files
(2020-08-11 for the entries of the initial commit); renamed entries keep
the date of their first name.

Changed: none
diff --git a/entries/tntp/__init__.py b/entries/tntp/__init__.py
index d8c04c8..f7ac737 100644
--- a/entries/tntp/__init__.py
+++ b/entries/tntp/__init__.py
@@ -64,14 +64,7 @@ citation = [('Transportation Networks for Research Core Team, "Transportation Ne
             ('L. J. LeBlanc, E. K. Morlok, W. P. Pierskalla, "An efficient approach to solving the road network equilibrium traffic assignment problem." Transportation Research 9(5), 309-318 (1975)', 'https://doi.org/10.1016/0041-1647(75)90030-1'),
             ('J. Zhang, S. Pourazarm, C. G. Cassandras, I. Ch. Paschalidis, "The price of anarchy in transportation networks by estimating user cost functions from actual traffic data." 2016 IEEE 55th Conference on Decision and Control (CDC), 789-794 (2016)', 'https://doi.org/10.1109/CDC.2016.7798364'),
             ('A. M. Farid, "Symmetrica: test case for transportation electrification research." Infrastructure Complexity 2, 9 (2015)', 'https://doi.org/10.1186/s40551-015-0012-9')]
-icon_hash = ['5944a4144ed8f1bb6022a493', '594b42004ed8f1bb6022ae48',
-             '594b427a4ed8f1bb6022ae49', '594b42c44ed8f1bb6022ae4a',
-             '594b43484ed8f1bb6022ae4e', '594b436a4ed8f1bb6022ae4f',
-             '594b43c54ed8f1bb6022ae50', '594b43e14ed8f1bb6022ae51',
-             '594b444f4ed8f1bb6022ae52', '594b44724ed8f1bb6022ae53',
-             '594b44b54ed8f1bb6022ae54', '594b44d34ed8f1bb6022ae55',
-             '594b457e4ed8f1bb6022ae56', '594b459e4ed8f1bb6022ae57',
-             '594b45bd4ed8f1bb6022ae58', '594b46634ed8f1bb6022ae5b']
+date_added = '2026-10-25'
 upstream_license = ("For academic research purposes only", "https://github.com/bstabler/TransportationNetworks#license")
 # Repository at a fixed commit
 upstream_prefix = 'https://raw.githubusercontent.com/bstabler/TransportationNetworks/d1639b4ef218c17928ba573e806ddf8ba5e7ae6d'
[entries] Prefix the properties in the descriptions with (Node), (Edge) or (Graph) by Tiago de Paula Peixoto bc3dbbd
The lists of properties at the end of the descriptions marked edge
properties with "Edge" but left node properties unmarked, or grouped
them in "Nodes: `a`, ...; `b`, ..." items, so the kind of a property
was often unclear. Every item now starts with (Node), (Edge) or (Graph),
followed by the property names, a colon and the explanation, one item
per property or group of properties; qualifications (kinds of nodes,
networks) follow the names in parentheses. Properties that were only
named got a short explanation, and a few items that named the wrong
kind of property were corrected.
diff --git a/entries/tntp/__init__.py b/entries/tntp/__init__.py
index 949fd16..d8c04c8 100644
--- a/entries/tntp/__init__.py
+++ b/entries/tntp/__init__.py
@@ -42,9 +42,21 @@ The networks are:
 
 The networks have the following properties (missing values are NaN):
 
-- Nodes: `is_zone`, whether the node is a zone (zones are numbered first in the source files; in some networks zone nodes cannot be traversed by through traffic, see the graph property `first_thru_node`); `pos`, the position of the node, in the units given above (only for some networks); `original_id`, the node number in the original data (Berlin networks only).
-- Edges: `capacity`, the link capacity (usually in vehicles per hour); `length`; `free_flow_time`, the travel time at zero flow; `b` and `power`, the parameters of the link travel time function, travel time = free_flow_time * (1 + b * (flow / capacity)^power); `speed`, the speed limit or free flow speed (its meaning is not consistent across networks); `toll`; `link_type`, a network-specific link classification; `critical_speed` and `lanes` (`gold_coast` and `sydney` only); `flow` and `flow_cost`, the best known user-equilibrium link flow and the corresponding link travel cost (`anaheim`, `barcelona`, `chicago_regional`, `chicago_sketch`, `sioux_falls`, `winnipeg` only).
-- `symmetrica`: nodes have `node_type` (`StationC`, conventional station; `HomeE` and `WorkE`, home and work locations with charging) and `pos`; edges have `is_electric` (whether the link can charge vehicles), `capacity` (vehicles), `speed` (km/min) and `length` (km). All links of the same kind have identical parameters in the source data."""
+- (Node) `is_zone`: whether the node is a zone (zones are numbered first in the source files; in some networks zone nodes cannot be traversed by through traffic, see the graph property `first_thru_node`).
+- (Node) `pos`: the position of the node, in the units given above (only for some networks).
+- (Node) `original_id`: the node number in the original data (Berlin networks only).
+- (Edge) `capacity`: the link capacity (usually in vehicles per hour).
+- (Edge) `length`.
+- (Edge) `free_flow_time`: the travel time at zero flow.
+- (Edge) `b` and `power`: the parameters of the link travel time function, travel time = free_flow_time * (1 + b * (flow / capacity)^power).
+- (Edge) `speed`: the speed limit or free flow speed (its meaning is not consistent across networks).
+- (Edge) `toll`.
+- (Edge) `link_type`: a network-specific link classification.
+- (Edge) `critical_speed` and `lanes` (`gold_coast` and `sydney` only).
+- (Edge) `flow` and `flow_cost`: the best known user-equilibrium link flow and the corresponding link travel cost (`anaheim`, `barcelona`, `chicago_regional`, `chicago_sketch`, `sioux_falls`, `winnipeg` only).
+- (Node) `node_type` (`symmetrica`): `StationC`, conventional station; `HomeE` and `WorkE`, home and work locations with charging (the nodes of `symmetrica` also have `pos`).
+- (Edge) `is_electric` (`symmetrica`): whether the link can charge vehicles.
+- (Edge) `capacity`, `speed`, `length` (`symmetrica`): the capacity (vehicles), the speed (km/min) and the length (km) of the link. All links of the same kind have identical parameters in the source data."""
 tags = ['Transportation', 'Roads', 'Weighted', 'Metadata', 'Spatial']
 url = 'https://github.com/bstabler/TransportationNetworks'
 citation = [('Transportation Networks for Research Core Team, "Transportation Networks for Research."', 'https://github.com/bstabler/TransportationNetworks'),
[entries] Remove unneeded code from the entries by Tiago de Paula Peixoto 2c69f19
Unneeded "global files" statements, unused imports and variables,
f-strings without placeholders, duplicate keys in foodweb_little_rock
(keeping the order and the values used), and the second definition of
get_lines() in twitter_higgs. Nothing changes in the networks or
descriptions.

Changed: none
diff --git a/entries/tntp/__init__.py b/entries/tntp/__init__.py
index f065ffa..949fd16 100644
--- a/entries/tntp/__init__.py
+++ b/entries/tntp/__init__.py
@@ -288,7 +288,6 @@ def parse_symmetrica(name, fnames):
 @coerce_props()
 @annotate()
 def parse(alts=None):
-    global files
     name = __name__.split(".")[-1]
     for fnames, alt, fmt in files:
         if alts is not None and alt not in alts:
[entries] Lay out spatial networks with cfd_layout() without the SBM partition by Tiago de Paula Peixoto 9db8d77
Road, power grid, public transport, water and river networks and physical
meshes override get_pos() with the default parameters of cfd_layout(),
without grouping by the partition of the SBM fit.
diff --git a/entries/tntp/__init__.py b/entries/tntp/__init__.py
index 08ffd84..f065ffa 100644
--- a/entries/tntp/__init__.py
+++ b/entries/tntp/__init__.py
@@ -298,3 +298,9 @@ def parse(alts=None):
         else:
             g = parse_symmetrica(name, fnames)
         yield alt, g
+
+
+def get_pos(g, sbm_fit):
+    # Spatial network: laid out with the default parameters of cfd_layout(),
+    # without the partition of the SBM fit
+    return cfd_layout(g)
[entries] New entry: tntp by Tiago de Paula Peixoto 16c5e4f
diff --git a/entries/tntp/__init__.py b/entries/tntp/__init__.py
new file mode 100644
index 0000000..08ffd84
--- /dev/null
+++ b/entries/tntp/__init__.py
@@ -0,0 +1,300 @@
+#! /usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2020-2026 Tiago de Paula Peixoto <tiago@skewed.de>
+#
+# This program is free software: you can redistribute it and/or modify it under
+# the terms of the GNU Affero General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your option) any
+# later version.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
+# details.
+#
+# You should have received a copy of the GNU Affero General Public License along
+# with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+from .. import *
+
+title = "Transportation Networks for Research road networks (1975-2016)"
+description = """Road networks used as test problems for the traffic assignment problem, from the Transportation Networks for Research repository maintained by B. Stabler, H. Bar-Gera and E. Sall, which continues H. Bar-Gera's earlier "Transportation Network Test Problems" (TNTP) collection. Each network represents the road system of a region as prepared for (static) traffic assignment: nodes are intersections, points along roads, or zone centroids (artificial nodes representing traffic analysis zones, where trips start and end), and directed edges are road links, including the artificial "centroid connector" links that join zones to the road network. Most networks were produced by regional planning agencies or researchers, and many are simplified or aggregated representations of the real road system; the years of the underlying data are often unknown. The origin-destination demand tables that accompany the networks in the repository are not included.
+
+The networks are:
+
+- `anaheim`: Anaheim, California, USA, for 1992 (provided by J. Ban and R. Jayakrishnan). Time in minutes, length in feet, speed in feet per minute; node positions are longitude and latitude.
+- `austin`: Austin, Texas, USA, AM peak hour of 2005 (provided by C. Xie). Every node is a zone. The network contains five duplicated links with different parameters (see the repository notes).
+- `barcelona`: Barcelona, Spain.
+- `berlin_center`, `berlin_friedrichshain`, `berlin_mitte_center`, `berlin_mitte_prenzlauerberg_friedrichshain`, `berlin_prenzlauerberg_center`, `berlin_tiergarten`: areas of Berlin, Germany, provided by R. Möhring, A. Schulz and N. Stier-Moses, and used by Jahn et al. (2005). Node positions are in arbitrary planar units. `berlin_center` contains six duplicated links with different parameters.
+- `birmingham`: the Birmingham City Region, England, a modified version of the PRISM transport model (provided by T. van Vuren and K. Noekel). Node positions are planar coordinates (apparently British National Grid eastings and northings, in meters).
+- `braess`: the four-node network of the Braess paradox (prepared by A. Koh).
+- `chicago_regional`: a detailed representation of the Chicago region, USA, by the Chicago Area Transportation Study (CATS). Time in minutes, length in miles, toll in cents; node positions are planar coordinates.
+- `chicago_sketch`: an aggregated ("sketch planning") representation of the Chicago region, by CATS. Time in minutes, length in miles, toll in cents; node positions are Illinois State Plane coordinates, in feet.
+- `eastern_massachusetts`: the highway subnetwork of the Eastern Massachusetts network, for the PM period of April 2012, from Zhang et al. (2016). Time in hours, length in miles; every node is a zone.
+- `gold_coast`: Gold Coast, Australia, from Veitch Lister Consultancy (provided by M. Bliemer; revised in January 2016). Capacity is per lane, length in km, time in minutes, speeds in km/h; node positions are longitude and latitude.
+- `hessen_asymmetric`, `terrassa_asymmetric`, `winnipeg_asymmetric`: networks of Hessen (Germany), Terrassa (Spain) and Winnipeg (Canada) with asymmetric cost functions at junctions (provided by E. Codina Sancho); the asymmetric cost structure itself is not included in the network files.
+- `philadelphia`: the Delaware Valley Region (Philadelphia, USA), by the Delaware Valley Regional Planning Commission. Capacity in vehicles per 24 hours, length in miles, time in minutes, toll in cents; the `speed` values have unknown meaning; node positions are in units of 0.01 miles. Link types: 1 freeway, 2 parkway, 3 principal arterial, 4 secondary arterial, 6 collector/local, 7 approach link (including centroid connectors), 8 ramp, 9 dummy link.
+- `sioux_falls`: the classic, unrealistic, Sioux Falls (USA) network of LeBlanc et al. (1975). Free flow times are in units of 0.01 hours, lengths are set equal to them, and node positions were generated artificially to reproduce the diagram of the paper.
+- `sydney`: Sydney, Australia, from Veitch Lister Consultancy (provided by M. Bliemer). Length in km, time in minutes, speeds in km/h; node positions are longitude and latitude.
+- `winnipeg`: Winnipeg, Canada (one of several versions of this network; here the capacity is set to 1, and `b` is in fact B/capacity^power).
+- `symmetrica`: the Symmetrica test case for transportation electrification research of Farid (2015), a synthetic grid-like road network with conventional links and electrified links that can charge vehicles while driving, and nodes that are conventional stations or home and work locations with charging facilities. Node positions are grid coordinates.
+
+The networks have the following properties (missing values are NaN):
+
+- Nodes: `is_zone`, whether the node is a zone (zones are numbered first in the source files; in some networks zone nodes cannot be traversed by through traffic, see the graph property `first_thru_node`); `pos`, the position of the node, in the units given above (only for some networks); `original_id`, the node number in the original data (Berlin networks only).
+- Edges: `capacity`, the link capacity (usually in vehicles per hour); `length`; `free_flow_time`, the travel time at zero flow; `b` and `power`, the parameters of the link travel time function, travel time = free_flow_time * (1 + b * (flow / capacity)^power); `speed`, the speed limit or free flow speed (its meaning is not consistent across networks); `toll`; `link_type`, a network-specific link classification; `critical_speed` and `lanes` (`gold_coast` and `sydney` only); `flow` and `flow_cost`, the best known user-equilibrium link flow and the corresponding link travel cost (`anaheim`, `barcelona`, `chicago_regional`, `chicago_sketch`, `sioux_falls`, `winnipeg` only).
+- `symmetrica`: nodes have `node_type` (`StationC`, conventional station; `HomeE` and `WorkE`, home and work locations with charging) and `pos`; edges have `is_electric` (whether the link can charge vehicles), `capacity` (vehicles), `speed` (km/min) and `length` (km). All links of the same kind have identical parameters in the source data."""
+tags = ['Transportation', 'Roads', 'Weighted', 'Metadata', 'Spatial']
+url = 'https://github.com/bstabler/TransportationNetworks'
+citation = [('Transportation Networks for Research Core Team, "Transportation Networks for Research."', 'https://github.com/bstabler/TransportationNetworks'),
+            ('O. Jahn, R. H. Möhring, A. S. Schulz, N. E. Stier-Moses, "System-Optimal Routing of Traffic Flows with User Constraints in Networks with Congestion." Operations Research 53(4), 600-616 (2005)', 'https://doi.org/10.1287/opre.1040.0197'),
+            ('L. J. LeBlanc, E. K. Morlok, W. P. Pierskalla, "An efficient approach to solving the road network equilibrium traffic assignment problem." Transportation Research 9(5), 309-318 (1975)', 'https://doi.org/10.1016/0041-1647(75)90030-1'),
+            ('J. Zhang, S. Pourazarm, C. G. Cassandras, I. Ch. Paschalidis, "The price of anarchy in transportation networks by estimating user cost functions from actual traffic data." 2016 IEEE 55th Conference on Decision and Control (CDC), 789-794 (2016)', 'https://doi.org/10.1109/CDC.2016.7798364'),
+            ('A. M. Farid, "Symmetrica: test case for transportation electrification research." Infrastructure Complexity 2, 9 (2015)', 'https://doi.org/10.1186/s40551-015-0012-9')]
+icon_hash = ['5944a4144ed8f1bb6022a493', '594b42004ed8f1bb6022ae48',
+             '594b427a4ed8f1bb6022ae49', '594b42c44ed8f1bb6022ae4a',
+             '594b43484ed8f1bb6022ae4e', '594b436a4ed8f1bb6022ae4f',
+             '594b43c54ed8f1bb6022ae50', '594b43e14ed8f1bb6022ae51',
+             '594b444f4ed8f1bb6022ae52', '594b44724ed8f1bb6022ae53',
+             '594b44b54ed8f1bb6022ae54', '594b44d34ed8f1bb6022ae55',
+             '594b457e4ed8f1bb6022ae56', '594b459e4ed8f1bb6022ae57',
+             '594b45bd4ed8f1bb6022ae58', '594b46634ed8f1bb6022ae5b']
+upstream_license = ("For academic research purposes only", "https://github.com/bstabler/TransportationNetworks#license")
+# Repository at a fixed commit
+upstream_prefix = 'https://raw.githubusercontent.com/bstabler/TransportationNetworks/d1639b4ef218c17928ba573e806ddf8ba5e7ae6d'
+
+# alt: (network, node coordinates, flow solution, node number conversion)
+nets = {
+    "anaheim": ("Anaheim/Anaheim_net.tntp", "Anaheim/anaheim_nodes.geojson",
+                "Anaheim/Anaheim_flow.tntp", None),
+    "austin": ("Austin/Austin_net.tntp", None, None, None),
+    "barcelona": ("Barcelona/Barcelona_net.tntp", None,
+                  "Barcelona/Barcelona_flow.tntp", None),
+    "berlin_center": ("Berlin-Center/berlin-center_net.tntp",
+                      "Berlin-Center/berlin-center_node.tntp", None,
+                      "Berlin-Center/berlin-center_Node-Conversion.txt"),
+    "berlin_friedrichshain": ("Berlin-Friedrichshain/friedrichshain-center_net.tntp",
+                              "Berlin-Friedrichshain/friedrichshain-center_node.tntp", None,
+                              "Berlin-Friedrichshain/friedrichshain-center_Node-Conversion.txt"),
+    "berlin_mitte_center": ("Berlin-Mitte-Center/berlin-mitte-center_net.tntp",
+                            "Berlin-Mitte-Center/berlin-mitte-center_node.tntp", None,
+                            "Berlin-Mitte-Center/berlin-mitte-center_Node-Conversion.txt"),
+    "berlin_mitte_prenzlauerberg_friedrichshain":
+    ("Berlin-Mitte-Prenzlauerberg-Friedrichshain-Center/berlin-mitte-prenzlauerberg-friedrichshain-center_net.tntp",
+     "Berlin-Mitte-Prenzlauerberg-Friedrichshain-Center/berlin-mitte-prenzlauerberg-friedrichshain-center_node.tntp", None,
+     "Berlin-Mitte-Prenzlauerberg-Friedrichshain-Center/berlin-mitte-prenzlauerberg-friedrichshain-center_Node-Conversion.txt"),
+    "berlin_prenzlauerberg_center": ("Berlin-Prenzlauerberg-Center/berlin-prenzlauerberg-center_net.tntp",
+                                     "Berlin-Prenzlauerberg-Center/berlin-prenzlauerberg-center_node.tntp", None,
+                                     "Berlin-Prenzlauerberg-Center/berlin-prenzlauerberg-center_Node-Conversion.txt"),
+    "berlin_tiergarten": ("Berlin-Tiergarten/berlin-tiergarten_net.tntp",
+                          "Berlin-Tiergarten/berlin-tiergarten_node.tntp", None,
+                          "Berlin-Tiergarten/berlin-tiergarten_Node-Conversion.txt"),
+    "birmingham": ("Birmingham-England/Birmingham_Net.tntp",
+                   "Birmingham-England/Birmingham_Nodes.tntp", None, None),
+    "braess": ("Braess-Example/Braess_net.tntp", None, None, None),
+    "chicago_regional": ("chicago-regional/ChicagoRegional_net.tntp",
+                         "chicago-regional/ChicagoRegional_node.tntp",
+                         "chicago-regional/ChicagoRegional_flow.tntp", None),
+    "chicago_sketch": ("Chicago-Sketch/ChicagoSketch_net.tntp",
+                       "Chicago-Sketch/ChicagoSketch_node.tntp",
+                       "Chicago-Sketch/ChicagoSketch_flow.tntp", None),
+    "eastern_massachusetts": ("Eastern-Massachusetts/EMA_net.tntp", None, None, None),
+    "gold_coast": ("GoldCoast/Goldcoast_network_2016_01.tntp",
+                   "GoldCoast/Goldcoast_nodes_2016_01.tntp", None, None),
+    "hessen_asymmetric": ("Hessen-Asymmetric/Hessen-Asym_net.tntp", None, None, None),
+    "philadelphia": ("Philadelphia/Philadelphia_net.tntp",
+                     "Philadelphia/Philadelphia_node.tntp", None, None),
+    "sioux_falls": ("SiouxFalls/SiouxFalls_net.tntp",
+                    "SiouxFalls/SiouxFalls_node.tntp",
+                    "SiouxFalls/SiouxFalls_flow.tntp", None),
+    "sydney": ("Sydney/Sydney_net.tntp", "Sydney/Sydney_node.tntp", None, None),
+    "terrassa_asymmetric": ("Terrassa-Asymmetric/Terrassa-Asym_net.tntp", None, None, None),
+    "winnipeg": ("Winnipeg/Winnipeg_net.tntp", None, "Winnipeg/Winnipeg_flow.tntp", None),
+    "winnipeg_asymmetric": ("Winnipeg-Asymmetric/Winnipeg-Asym_net.tntp", None, None, None),
+}
+
+files = [(tuple(f for f in fs if f is not None), alt, "tntp")
+         for alt, fs in nets.items()]
+files.append((("SymmetricaTestCase/TransportationLinksConventional.csv",
+               "SymmetricaTestCase/TransportationLinksElectric.csv",
+               "SymmetricaTestCase/TransportationStationsConventional.csv",
+               "SymmetricaTestCase/TransportationStationsElectric.csv"),
+              "symmetrica", "symmetrica"))
+
+def fetch_upstream(force=False):
+    return fetch_upstream_files(__name__.split(".")[-1], upstream_prefix, files,
+                                force)
+
+def split_tntp(line):
+    """Split a TNTP record into its fields (tab-separated, possibly padded
+    with spaces, and terminated by a semicolon). Empty fields are kept."""
+    line = line.strip()
+    if line.endswith(";"):
+        line = line[:-1]
+    vals = [x.strip() for x in line.split("\t")]
+    while vals and vals[-1] == "":
+        vals.pop()
+    while vals and vals[0] == "":
+        vals.pop(0)
+    return vals
+
+def read_tntp_net(f):
+    meta = {}
+    cols = None
+    rows = []
+    for line in f:
+        s = line.strip()
+        if s.startswith("<"):
+            if s.startswith("<END OF METADATA>"):
+                continue
+            key, val = s[1:].split(">", 1)
+            meta[key] = val.strip()
+            continue
+        if s.startswith("~"):
+            cols = split_tntp(s[1:])
+            continue
+        vals = split_tntp(s)
+        if len(vals) < 2:
+            continue
+        rows.append(vals)
+    return meta, cols, rows
+
+def tofloat(x):
+    try:
+        return float(x)
+    except ValueError:
+        return numpy.nan
+
+def read_coords(f, fname):
+    "Return a dictionary of node number -> (x, y)."
+    pos = {}
+    if fname.endswith(".geojson"):
+        d = json.load(f)
+        for feat in d["features"]:
+            pos[int(feat["properties"]["id"])] = \
+                [float(x) for x in feat["geometry"]["coordinates"][:2]]
+        return pos
+    for line in f:
+        vals = line.replace(";", " ").split()
+        if len(vals) < 3 or not vals[0].isdigit():
+            continue
+        pos[int(vals[0])] = [float(vals[1]), float(vals[2])]
+    return pos
+
+def parse_tntp(name, fnames):
+    net, node, flow, conv = fnames
+    with open_upstream_file(name, net, "r") as f:
+        meta, cols, rows = read_tntp_net(f)
+    n_zones = int(meta["NUMBER OF ZONES"])
+    n_nodes = int(meta["NUMBER OF NODES"])
+    first_thru = int(meta.get("FIRST THRU NODE", 1))
+    ncol = max(len(r) for r in rows)
+    if len(cols) < ncol:
+        cols = cols + ["link_type"] * (ncol - len(cols))
+    cols = cols[:ncol]
+
+    g = Graph(directed=True)
+    ids = sorted(set(int(r[0]) for r in rows) | set(int(r[1]) for r in rows))
+    assert max(ids) <= n_nodes and min(ids) >= 1
+    g.add_vertex(n_nodes)
+    g.vp.is_zone = g.new_vp("bool")
+    g.vp.is_zone.a[:n_zones] = True
+    g.gp.first_thru_node = g.new_gp("int", val=first_thru)
+
+    eprops = []
+    for c in cols[2:]:
+        vt = "int" if c in ("link_type", "lanes") else "double"
+        g.ep[c] = g.new_ep(vt)
+        eprops.append(g.ep[c])
+    elist = []
+    for r in rows:
+        r = r + [""] * (ncol - len(r))
+        e = [int(r[0]) - 1, int(r[1]) - 1]
+        for c, x in zip(cols[2:], r[2:]):
+            if c in ("link_type", "lanes"):
+                e.append(int(float(x)) if x != "" else -1)
+            else:
+                e.append(tofloat(x))
+        elist.append(e)
+    g.add_edge_list(elist, eprops=eprops)
+    assert g.num_edges() == int(meta["NUMBER OF LINKS"])
+
+    if node is not None:
+        with open_upstream_file(name, node, "r") as f:
+            pos = read_coords(f, node)
+        g.vp.pos = g.new_vp("vector<double>")
+        for i, xy in pos.items():
+            if 1 <= i <= n_nodes:
+                g.vp.pos[i - 1] = xy
+
+    if conv is not None:
+        g.vp.original_id = g.new_vp("int")
+        with open_upstream_file(name, conv, "r") as f:
+            for line in f:
+                vals = line.split()
+                if len(vals) == 2 and vals[0].isdigit():
+                    g.vp.original_id[int(vals[0]) - 1] = int(vals[1])
+
+    if flow is not None:
+        with open_upstream_file(name, flow, "r") as f:
+            frows = []
+            for line in f:
+                vals = line.replace(";", " ").split()
+                if len(vals) >= 4 and vals[0].isdigit():
+                    frows.append(vals)
+        # the flow solutions list the links in the same order as the network
+        assert len(frows) == g.num_edges()
+        g.ep.flow = g.new_ep("double")
+        g.ep.flow_cost = g.new_ep("double")
+        for e, r in zip(g.edges(), frows):
+            assert (int(e.source()) + 1, int(e.target()) + 1) == (int(r[0]), int(r[1]))
+            g.ep.flow[e] = float(r[2])
+            g.ep.flow_cost[e] = float(r[3])
+    return g
+
+def parse_symmetrica(name, fnames):
+    rows = []
+    for fn in fnames:
+        with open_upstream_file(name, fn, "r") as f:
+            rs = list(csv.DictReader(f))[1:]   # second line has the units
+            rows.append(rs)
+    links_c, links_e, nodes_c, nodes_e = rows
+    nodes = [(int(r["nodeNum"]), r["nodeType"], float(r["gpsX"]), float(r["gpsY"]))
+             for r in nodes_c + nodes_e]
+    N = max(n[0] for n in nodes)
+    g = Graph(directed=True)
+    g.add_vertex(N)
+    g.vp.node_type = g.new_vp("string")
+    g.vp.pos = g.new_vp("vector<double>")
+    for i, t, x, y in nodes:
+        g.vp.node_type[i - 1] = t
+        g.vp.pos[i - 1] = [x, y]
+    g.ep.is_electric = g.new_ep("bool")
+    g.ep.capacity = g.new_ep("double")
+    g.ep.speed = g.new_ep("double")
+    g.ep.length = g.new_ep("double")
+    elist = []
+    for rs, el in [(links_c, False), (links_e, True)]:
+        for r in rs:
+            elist.append((int(r["origin"]) - 1, int(r["dest"]) - 1, el,
+                          float(r["vehicleCCap"]), float(r["freeSpeed"]),
+                          float(r["distance"])))
+    g.add_edge_list(elist, eprops=[g.ep.is_electric, g.ep.capacity,
+                                   g.ep.speed, g.ep.length])
+    return g
+
+@cache_network()
+@coerce_props()
+@annotate()
+def parse(alts=None):
+    global files
+    name = __name__.split(".")[-1]
+    for fnames, alt, fmt in files:
+        if alts is not None and alt not in alts:
+            continue
+        if fmt == "tntp":
+            g = parse_tntp(name, nets[alt])
+        else:
+            g = parse_symmetrica(name, fnames)
+        yield alt, g