History of rome_roads
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 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/rome_roads/__init__.py b/entries/rome_roads/__init__.py
index 5fa0425..9d261f4 100644
--- a/entries/rome_roads/__init__.py
+++ b/entries/rome_roads/__init__.py
@@ -20,7 +20,7 @@
from .. import *
title = "Rome road network (1999)"
-description = """Directed road network covering a large part of the city of Rome, Italy, as of 1999. Nodes are road intersections, and a directed edge $(i,j)$ is a road or road segment along which one can drive from intersection $i$ to intersection $j$ (two-way roads appear as a pair of opposite edges); edges are weighted by their physical length. The network was contributed by G. Storchi, P. Dell'Olmo (University of Rome "La Sapienza") and M. Gentili (University of Salerno), and was distributed by the 9th DIMACS Implementation Challenge on shortest paths (2006) as one of its benchmark instances, in the challenge's graph format. The network contains a few parallel edges, which are kept as in the source file.
+description = """Directed road network covering a large part of the city of Rome, Italy, as of 1999. Nodes are road intersections, and a directed edge $(i,j)$ is a road or road segment along which one can drive from intersection $i$ to intersection $j$ (two-way roads appear as a pair of opposite edges); edges are weighted by their physical length. The network was contributed by G. Storchi, P. Dell'Olmo (University of Rome "La Sapienza") and M. Gentili (University of Salerno), and was used by the 9th DIMACS Implementation Challenge on shortest paths (2006) as one of its benchmark instances. The network contains a few parallel edges, which are kept.
The edges have the property `distance`, the length of the road segment, in meters.[^icon]
[entries] Lay out the spatial networks with hfd_layout() instead of cfd_layout() cc3bcb0
Changed: none
diff --git a/entries/rome_roads/__init__.py b/entries/rome_roads/__init__.py
index e9aa72e..5fa0425 100644
--- a/entries/rome_roads/__init__.py
+++ b/entries/rome_roads/__init__.py
@@ -64,6 +64,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 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/rome_roads/__init__.py b/entries/rome_roads/__init__.py
index 82cba80..e9aa72e 100644
--- a/entries/rome_roads/__init__.py
+++ b/entries/rome_roads/__init__.py
@@ -28,7 +28,7 @@ The edges have the property `distance`, the length of the road segment, in meter
tags = ['Transportation', 'Roads', 'Weighted', 'Spatial']
url = 'https://web.archive.org/web/2019/http://www.dis.uniroma1.it/challenge9/download.shtml'
citation = [('"9th DIMACS Implementation Challenge - Shortest Paths" (2006)', 'https://web.archive.org/web/2019/http://www.dis.uniroma1.it/challenge9/download.shtml')]
-icon_hash = '5724ea9f461efe0c7a675e7c'
+date_added = '2026-10-25'
upstream_license = None
# The challenge's site (www.dis.uniroma1.it/challenge9) is no longer
# reachable; the file is obtained from the Internet Archive.
[entries] Remove unneeded code from the entries 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/rome_roads/__init__.py b/entries/rome_roads/__init__.py
index af4dc1f..82cba80 100644
--- a/entries/rome_roads/__init__.py
+++ b/entries/rome_roads/__init__.py
@@ -43,7 +43,6 @@ def fetch_upstream(force=False):
@coerce_props()
@annotate()
def parse(alts=None):
- global files
name = __name__.split(".")[-1]
for fname, 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 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/rome_roads/__init__.py b/entries/rome_roads/__init__.py
index 65b0489..af4dc1f 100644
--- a/entries/rome_roads/__init__.py
+++ b/entries/rome_roads/__init__.py
@@ -62,3 +62,9 @@ def parse(alts=None):
g.ep.distance = g.new_ep("int")
g.add_edge_list(edges, eprops=[g.ep.distance])
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: rome_roads 8638301
diff --git a/entries/rome_roads/__init__.py b/entries/rome_roads/__init__.py
new file mode 100644
index 0000000..65b0489
--- /dev/null
+++ b/entries/rome_roads/__init__.py
@@ -0,0 +1,64 @@
+#! /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 = "Rome road network (1999)"
+description = """Directed road network covering a large part of the city of Rome, Italy, as of 1999. Nodes are road intersections, and a directed edge $(i,j)$ is a road or road segment along which one can drive from intersection $i$ to intersection $j$ (two-way roads appear as a pair of opposite edges); edges are weighted by their physical length. The network was contributed by G. Storchi, P. Dell'Olmo (University of Rome "La Sapienza") and M. Gentili (University of Salerno), and was distributed by the 9th DIMACS Implementation Challenge on shortest paths (2006) as one of its benchmark instances, in the challenge's graph format. The network contains a few parallel edges, which are kept as in the source file.
+
+The edges have the property `distance`, the length of the road segment, in meters.[^icon]
+
+[^icon]: Description obtained in part from the [ICON](https://icon.colorado.edu) project."""
+tags = ['Transportation', 'Roads', 'Weighted', 'Spatial']
+url = 'https://web.archive.org/web/2019/http://www.dis.uniroma1.it/challenge9/download.shtml'
+citation = [('"9th DIMACS Implementation Challenge - Shortest Paths" (2006)', 'https://web.archive.org/web/2019/http://www.dis.uniroma1.it/challenge9/download.shtml')]
+icon_hash = '5724ea9f461efe0c7a675e7c'
+upstream_license = None
+# The challenge's site (www.dis.uniroma1.it/challenge9) is no longer
+# reachable; the file is obtained from the Internet Archive.
+upstream_prefix = 'https://web.archive.org/web/20181229035133id_/http://www.dis.uniroma1.it:80/challenge9/data/rome'
+files = [('rome99.gr', None, None)]
+
+def fetch_upstream(force=False):
+ return retry_download(fetch_upstream_files, __name__.split(".")[-1],
+ upstream_prefix, files, force)
+
+@cache_network()
+@coerce_props()
+@annotate()
+def parse(alts=None):
+ global files
+ name = __name__.split(".")[-1]
+ for fname, alt, fmt in files:
+ if alts is not None and alt not in alts:
+ continue
+ with open_upstream_file(name, fname, "r") as f:
+ N = None
+ edges = []
+ for line in f:
+ if line.startswith("p "):
+ N = int(line.split()[2])
+ elif line.startswith("a "):
+ u, v, w = line.split()[1:4]
+ edges.append((int(u) - 1, int(v) - 1, int(w)))
+ g = Graph(directed=True)
+ g.add_vertex(N)
+ g.ep.distance = g.new_ep("int")
+ g.add_edge_list(edges, eprops=[g.ep.distance])
+ yield alt, g