logo Netzschleuder network catalog, repository, and centrifuge

History of erdos_collaboration

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/erdos_collaboration/__init__.py b/entries/erdos_collaboration/__init__.py
index 8a2048b..fd7a12e 100644
--- a/entries/erdos_collaboration/__init__.py
+++ b/entries/erdos_collaboration/__init__.py
@@ -22,14 +22,14 @@ from .. import *
 
 
 title = "Erdős collaboration graph (1997-2002)"
-description = """Networks of the mathematicians with Erdős number 1 or 2, i.e. the co-authors of Paul Erdős, and the co-authors of these, from the data of the Erdős Number Project of J. W. Grossman, as converted to Pajek networks by V. Batagelj and A. Mrvar, in four versions of the data: `erdos97`, `erdos98`, `erdos99` (from 1997, 1998 and 1999) and `erdos02` (from 2002). Each node is a mathematician, and an undirected edge connects two of them if they wrote a paper together. The data list the co-authors of the people with Erdős number 1 only, so that the edges join people with Erdős number 1, or people with Erdős numbers 1 and 2; there are no edges between people with Erdős number 2. Paul Erdős himself (and his edges to his co-authors) is included only in `erdos02`.
+description = """Networks of the mathematicians with Erdős number 1 or 2, i.e. the co-authors of Paul Erdős, and the co-authors of these, from the data of the Erdős Number Project of J. W. Grossman, as converted into networks by V. Batagelj and A. Mrvar, in four versions of the data: `erdos97`, `erdos98`, `erdos99` (from 1997, 1998 and 1999) and `erdos02` (from 2002). Each node is a mathematician, and an undirected edge connects two of them if they wrote a paper together. The data list the co-authors of the people with Erdős number 1 only, so that the edges join people with Erdős number 1, or people with Erdős numbers 1 and 2; there are no edges between people with Erdős number 2. Paul Erdős himself (and his edges to his co-authors) is included only in `erdos02`.
 
-Batagelj and Mrvar also distribute the networks of the people with Erdős number 1 for 1997 to 1999 (e.g. `ERDOS971.NET`); they are not included as separate networks, since they are the subgraphs of the full networks induced by these people.
+The networks of the people with Erdős number 1 for 1997 to 1999, also prepared by Batagelj and Mrvar, are not included as separate networks, since they are the subgraphs of the full networks induced by these people.
 
 The networks have the following properties:
 
 - (Node) `name`: the name of the mathematician (in upper case, except in `erdos97` and for a few names of `erdos02`).
-- (Node) `erdos_number`: the Erdős number of the mathematician (0 for Paul Erdős, 1 or 2 otherwise). For `erdos97` to `erdos99` they are given by the partitions distributed with the networks; for `erdos02` they follow from the network."""
+- (Node) `erdos_number`: the Erdős number of the mathematician (0 for Paul Erdős, 1 or 2 otherwise). For `erdos97` to `erdos99` they are given by the partitions of Batagelj and Mrvar; for `erdos02` they follow from the network."""
 tags = ['Social', 'Collaboration', 'Unweighted', 'Metadata']
 url = ['https://web.archive.org/web/20041128004146/http://vlado.fmf.uni-lj.si/pub/networks/data/default.htm',
        'https://oakland.edu/enp/']
[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/erdos_collaboration/__init__.py b/entries/erdos_collaboration/__init__.py
index b145509..8a2048b 100644
--- a/entries/erdos_collaboration/__init__.py
+++ b/entries/erdos_collaboration/__init__.py
@@ -35,7 +35,7 @@ url = ['https://web.archive.org/web/20041128004146/http://vlado.fmf.uni-lj.si/pu
        'https://oakland.edu/enp/']
 citation = [('V. Batagelj, A. Mrvar, "Some analyses of Erdős collaboration graph." Social Networks 22(2), 173-186 (2000)', 'https://doi.org/10.1016/S0378-8733(00)00023-X'),
             ('J. W. Grossman, P. D. F. Ion, "On a portion of the well-known collaboration graph." Congressus Numerantium 108, 129-131 (1995)', 'https://oakland.edu/enp/')]
-icon_hash = None
+date_added = '2026-10-27'
 upstream_license = None
 upstream_prefix = None
 
[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/erdos_collaboration/__init__.py b/entries/erdos_collaboration/__init__.py
index 5440f2a..b145509 100644
--- a/entries/erdos_collaboration/__init__.py
+++ b/entries/erdos_collaboration/__init__.py
@@ -28,8 +28,8 @@ Batagelj and Mrvar also distribute the networks of the people with Erdős number
 
 The networks have the following properties:
 
-- `name`: the name of the mathematician (in upper case, except in `erdos97` and for a few names of `erdos02`).
-- `erdos_number`: the Erdős number of the mathematician (0 for Paul Erdős, 1 or 2 otherwise). For `erdos97` to `erdos99` they are given by the partitions distributed with the networks; for `erdos02` they follow from the network."""
+- (Node) `name`: the name of the mathematician (in upper case, except in `erdos97` and for a few names of `erdos02`).
+- (Node) `erdos_number`: the Erdős number of the mathematician (0 for Paul Erdős, 1 or 2 otherwise). For `erdos97` to `erdos99` they are given by the partitions distributed with the networks; for `erdos02` they follow from the network."""
 tags = ['Social', 'Collaboration', 'Unweighted', 'Metadata']
 url = ['https://web.archive.org/web/20041128004146/http://vlado.fmf.uni-lj.si/pub/networks/data/default.htm',
        'https://oakland.edu/enp/']
[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/erdos_collaboration/__init__.py b/entries/erdos_collaboration/__init__.py
index e44868a..5440f2a 100644
--- a/entries/erdos_collaboration/__init__.py
+++ b/entries/erdos_collaboration/__init__.py
@@ -54,7 +54,6 @@ def fetch_upstream(force=False):
 @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] New entry: erdos_collaboration by Tiago de Paula Peixoto bcc4626
diff --git a/entries/erdos_collaboration/__init__.py b/entries/erdos_collaboration/__init__.py
new file mode 100644
index 0000000..e44868a
--- /dev/null
+++ b/entries/erdos_collaboration/__init__.py
@@ -0,0 +1,84 @@
+#! /usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 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 = "Erdős collaboration graph (1997-2002)"
+description = """Networks of the mathematicians with Erdős number 1 or 2, i.e. the co-authors of Paul Erdős, and the co-authors of these, from the data of the Erdős Number Project of J. W. Grossman, as converted to Pajek networks by V. Batagelj and A. Mrvar, in four versions of the data: `erdos97`, `erdos98`, `erdos99` (from 1997, 1998 and 1999) and `erdos02` (from 2002). Each node is a mathematician, and an undirected edge connects two of them if they wrote a paper together. The data list the co-authors of the people with Erdős number 1 only, so that the edges join people with Erdős number 1, or people with Erdős numbers 1 and 2; there are no edges between people with Erdős number 2. Paul Erdős himself (and his edges to his co-authors) is included only in `erdos02`.
+
+Batagelj and Mrvar also distribute the networks of the people with Erdős number 1 for 1997 to 1999 (e.g. `ERDOS971.NET`); they are not included as separate networks, since they are the subgraphs of the full networks induced by these people.
+
+The networks have the following properties:
+
+- `name`: the name of the mathematician (in upper case, except in `erdos97` and for a few names of `erdos02`).
+- `erdos_number`: the Erdős number of the mathematician (0 for Paul Erdős, 1 or 2 otherwise). For `erdos97` to `erdos99` they are given by the partitions distributed with the networks; for `erdos02` they follow from the network."""
+tags = ['Social', 'Collaboration', 'Unweighted', 'Metadata']
+url = ['https://web.archive.org/web/20041128004146/http://vlado.fmf.uni-lj.si/pub/networks/data/default.htm',
+       'https://oakland.edu/enp/']
+citation = [('V. Batagelj, A. Mrvar, "Some analyses of Erdős collaboration graph." Social Networks 22(2), 173-186 (2000)', 'https://doi.org/10.1016/S0378-8733(00)00023-X'),
+            ('J. W. Grossman, P. D. F. Ion, "On a portion of the well-known collaboration graph." Congressus Numerantium 108, 129-131 (1995)', 'https://oakland.edu/enp/')]
+icon_hash = None
+upstream_license = None
+upstream_prefix = None
+
+archived_files = {
+    'ERDOSdat.ZIP': 'https://web.archive.org/web/20041222053355id_/http://vlado.fmf.uni-lj.si:80/pub/networks/data/erdos/ERDOSdat.ZIP',
+    'Erdos02.net': 'https://web.archive.org/web/20041220213354id_/http://vlado.fmf.uni-lj.si:80/pub/networks/data/Erdos/Erdos02.net'}
+files = [((f'ERDOSdat.ZIP:zip:ERDOS{y}2.NET', f'ERDOSdat.ZIP:zip:ERDOS{y}.CLU'),
+          f'erdos{y}', None) for y in ['97', '98', '99']]
+files += [(('Erdos02.net',), 'erdos02', None)]
+
+def fetch_upstream(force=False):
+    return fetch_archived_files(__name__.split(".")[-1], archived_files, force,
+                                tries=3)
+
+@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
+        net = get_pajek_item(load_pajek(name, fnames[0]), "network")
+        g = pajek_graph(net)
+        g.vp.erdos_number = g.new_vp("int")
+        if len(fnames) > 1:
+            # "*Vertices N" and then one value per vertex: 1 for Erdős
+            # number 1, 0 for Erdős number 2
+            with open_upstream_file(name, fnames[1], "r", encoding="cp1252") as f:
+                vals = f.read().split()
+            assert vals[0].lower() == "*vertices" and int(vals[1]) == g.num_vertices()
+            clu = numpy.array([int(x) for x in vals[2:]])
+            # the partition of 1998 has an extra (last) value, 0
+            if len(clu) == g.num_vertices() + 1 and clu[-1] == 0:
+                clu = clu[:-1]
+            assert len(clu) == g.num_vertices() and set(clu) <= {0, 1}
+            g.vp.erdos_number.a = 2 - clu
+        else:
+            erdos = [v for v in g.vertices() if g.vp.name[v].upper() == "ERDOS PAUL"]
+            assert len(erdos) == 1
+            g.vp.erdos_number.a = 2
+            g.vp.erdos_number[erdos[0]] = 0
+            for u in erdos[0].all_neighbors():
+                g.vp.erdos_number[u] = 1
+        yield alt, g