logo Netzschleuder network catalog, repository, and centrifuge

History of resistance_game

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] 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/resistance_game/__init__.py b/entries/resistance_game/__init__.py
index 344f6c0..2a570ff 100644
--- a/entries/resistance_game/__init__.py
+++ b/entries/resistance_game/__init__.py
@@ -41,7 +41,7 @@ tags = ['Social', 'Offline', 'Weighted', 'Temporal', 'Multigraph']
 url = ['https://snap.stanford.edu/data/comm-f2f-Resistance.html']
 citation = [('S. Kumar, C. Bai, V. S. Subrahmanian, and J. Leskovec, "Deception Detection in Group Video Conversations using Dynamic Interaction Networks." Proceedings of the International AAAI Conference on Web and Social Media (ICWSM) 15, 339-350 (2021).', 'https://doi.org/10.1609/icwsm.v15i1.18065'),
             ('C. Bai, S. Kumar, J. Leskovec, M. Metzger, J. F. Nunamaker, and V. S. Subrahmanian, "Predicting the Visual Focus of Attention in Multi-Person Discussion Videos." Proceedings of the 28th International Joint Conference on Artificial Intelligence (IJCAI), 4504-4510 (2019).', 'https://doi.org/10.24963/ijcai.2019/626')]
-icon_hash = None
+date_added = '2026-10-27'
 upstream_license = None
 upstream_prefix = 'https://snap.stanford.edu/data'
 _arch = 'comm-f2f-Resistance-network.tar.gz:comm-f2f-Resistance'
[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/resistance_game/__init__.py b/entries/resistance_game/__init__.py
index ba04f0c..344f6c0 100644
--- a/entries/resistance_game/__init__.py
+++ b/entries/resistance_game/__init__.py
@@ -33,9 +33,10 @@ The data do not identify the games (they are numbered 0 to 61, as given) nor the
 
 The networks have the following properties:
 
-- `name`: the label of the participant within the game ("P1", "P2", ...).
-- `network<ID>`, edge `time` and `duration`: the start of the interval, in seconds since the beginning of the recording, and its length, in seconds (multiples of 1/3 s).
-- `network<ID>_weighted`, edge `time`: the time step, in seconds since the beginning of the recording; `weight`, the probability that the source participant looked at the target participant (or at their laptop, for a self-loop) at that time."""
+- (Node) `name`: the label of the participant within the game ("P1", "P2", ...).
+- (Edge) `time`, `duration` (`network<ID>`): the start of the interval, in seconds since the beginning of the recording, and its length, in seconds (multiples of 1/3 s).
+- (Edge) `time` (`network<ID>_weighted`): the time step, in seconds since the beginning of the recording.
+- (Edge) `weight` (`network<ID>_weighted`): the probability that the source participant looked at the target participant (or at their laptop, for a self-loop) at that time."""
 tags = ['Social', 'Offline', 'Weighted', 'Temporal', 'Multigraph']
 url = ['https://snap.stanford.edu/data/comm-f2f-Resistance.html']
 citation = [('S. Kumar, C. Bai, V. S. Subrahmanian, and J. Leskovec, "Deception Detection in Group Video Conversations using Dynamic Interaction Networks." Proceedings of the International AAAI Conference on Web and Social Media (ICWSM) 15, 339-350 (2021).', 'https://doi.org/10.1609/icwsm.v15i1.18065'),
[entries] New entry: resistance_game by Tiago de Paula Peixoto 077a34d
diff --git a/entries/resistance_game/__init__.py b/entries/resistance_game/__init__.py
new file mode 100644
index 0000000..ba04f0c
--- /dev/null
+++ b/entries/resistance_game/__init__.py
@@ -0,0 +1,105 @@
+#! /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 *
+
+import csv
+
+title = "Gaze networks in games of The Resistance (2019)"
+description = r"""Dynamic face-to-face interaction networks of groups of 5 to 8 people playing The Resistance, a party game of social deception in which some players secretly work against the group, recorded on video by C. Bai, S. Kumar and collaborators in sessions held at several universities. There are 62 games, each lasting 45 to 60 minutes, with 451 participants in total. Each participant had a laptop in front of them. From the videos, the authors estimated, every 1/3 second, where each participant was looking (the visual focus of attention): at another participant or at their own laptop, using their ICAF algorithm.
+
+Each game gives two directed temporal networks, whose nodes are its participants:
+
+- `network<ID>`: the most likely focus of attention. An edge from participant $u$ to participant $v$ is an uninterrupted interval of time during which $u$ looked at $v$, according to the binary networks of the data (consecutive time steps with the same focus are merged into one edge; each participant has exactly one focus at each time step). A self-loop is an interval during which the participant looked at their laptop.
+- `network<ID>_weighted`: the estimated probabilities of the focus of attention. For every time step and every participant $u$, there is one edge from $u$ to each participant $v$ (or to $u$ itself, for the laptop) with a nonzero probability that $u$ looked at $v$ at that time; the probabilities of a participant at one time step sum to approximately 1 (they are given with three decimals).
+
+The data do not identify the games (they are numbered 0 to 61, as given) nor the participants (numbered within each game), and do not include the roles of the players (whether they were deceivers) or the outcomes of the games, which were used in the study of deception detection.
+
+The networks have the following properties:
+
+- `name`: the label of the participant within the game ("P1", "P2", ...).
+- `network<ID>`, edge `time` and `duration`: the start of the interval, in seconds since the beginning of the recording, and its length, in seconds (multiples of 1/3 s).
+- `network<ID>_weighted`, edge `time`: the time step, in seconds since the beginning of the recording; `weight`, the probability that the source participant looked at the target participant (or at their laptop, for a self-loop) at that time."""
+tags = ['Social', 'Offline', 'Weighted', 'Temporal', 'Multigraph']
+url = ['https://snap.stanford.edu/data/comm-f2f-Resistance.html']
+citation = [('S. Kumar, C. Bai, V. S. Subrahmanian, and J. Leskovec, "Deception Detection in Group Video Conversations using Dynamic Interaction Networks." Proceedings of the International AAAI Conference on Web and Social Media (ICWSM) 15, 339-350 (2021).', 'https://doi.org/10.1609/icwsm.v15i1.18065'),
+            ('C. Bai, S. Kumar, J. Leskovec, M. Metzger, J. F. Nunamaker, and V. S. Subrahmanian, "Predicting the Visual Focus of Attention in Multi-Person Discussion Videos." Proceedings of the 28th International Joint Conference on Artificial Intelligence (IJCAI), 4504-4510 (2019).', 'https://doi.org/10.24963/ijcai.2019/626')]
+icon_hash = None
+upstream_license = None
+upstream_prefix = 'https://snap.stanford.edu/data'
+_arch = 'comm-f2f-Resistance-network.tar.gz:comm-f2f-Resistance'
+files = []
+for _i in range(62):
+    files += [((f'{_arch}/network/network{_i}.csv', f'{_arch}/network_list.csv'),
+               f'network{_i}', None),
+              ((f'{_arch}/network/network{_i}_weighted.csv', f'{_arch}/network_list.csv'),
+               f'network{_i}_weighted', None)]
+
+def fetch_upstream(force=False):
+    return fetch_upstream_files(__name__.split(".")[-1], upstream_prefix, files,
+                                force)
+
+@cache_network()
+@coerce_props()
+@annotate()
+def parse(alts=None):
+    name = __name__.split(".")[-1]
+    nparts = None
+    for (fname, flist), alt, fmt in files:
+        if alts is not None and alt not in alts:
+            continue
+        if nparts is None:
+            with open_upstream_file(name, flist, "r") as f:
+                nparts = {f"network{r['NETWORK']}": int(r["NUMBER_OF_PARTICIPANTS"])
+                          for r in csv.DictReader(f)}
+        weighted = alt.endswith("_weighted")
+        n = nparts[alt.removesuffix("_weighted")]
+        with open_upstream_file(name, fname, "rb") as f:
+            X = numpy.loadtxt(f, delimiter=",", skiprows=1)
+        T = len(X)
+        assert X.shape[1] == 1 + n * (n + 1)
+        assert (X[:, 0] == numpy.arange(T)).all()
+        # columns of participant u: laptop, then participants 1..n
+        X = X[:, 1:].reshape(T, n, n + 1)
+        # target index: the laptop becomes the participant itself
+        tgt = numpy.array([[u if j == 0 else j - 1 for j in range(n + 1)]
+                           for u in range(n)])
+        g = Graph(directed=True)
+        g.add_vertex(n)
+        g.vp.name = g.new_vp("string", vals=[f"P{u + 1}" for u in range(n)])
+        g.ep.time = g.new_ep("double")
+        if weighted:
+            g.ep.weight = g.new_ep("double")
+            t, u, j = numpy.nonzero(X)
+            E = numpy.column_stack([u, tgt[u, j], t / 3, X[t, u, j]])
+            g.add_edge_list(E, eprops=[g.ep.time, g.ep.weight])
+        else:
+            assert (X.sum(axis=2) == 1).all()
+            g.ep.duration = g.new_ep("double")
+            focus = X.argmax(axis=2)        # T x n
+            E = []
+            for u in range(n):
+                s = 0
+                for t in range(1, T + 1):
+                    if t == T or focus[t, u] != focus[s, u]:
+                        E.append((u, tgt[u, focus[s, u]], s / 3, (t - s) / 3))
+                        s = t
+            E.sort(key=lambda e: (e[2], e[0]))
+            g.add_edge_list(E, eprops=[g.ep.time, g.ep.duration])
+        yield alt, g