Search arXivSearch

arXiv · 2609.16088

netseg: a Python Package for Measuring Structural Polarization and Segregation in Social Networks

Abstract

The study of structural polarization and segregation in social networks is an established line of research, and the quantification of both phenomena proceeds through a set of widely cited network indices. The code implementing those indices, however, is seldom released and almost never tested. We present netseg, a comprehensively documented Python package implementing these indices, most of them generalized to more than two groups and to directed as well as undirected input. It ports the R package of the same name and adds measures the R version lacks, among them Random Walk Controversy, Boundary Connectivity, Dipole Moment, and Moran's I. The package operates on igraph objects and performs the underlying graph operations (e.g., neighborhood queries and random-walk simulation) through igraph's Python interface, so that they execute in compiled code rather than in interpreted Python. For several of the indices this yields runtimes orders of magnitude below those of the available open-source implementations, which the documentation reports in benchmarks. Most of these indices are defined as a divergence from a null model, and published implementations fix that null model to a uniform random graph of matching density. netseg accepts an ensemble of graphs as a sample from an arbitrary null model, and distinguishes indices that already incorporate a baseline from those that do not, adjusting the comparison accordingly to avoid double subtraction. The documentation provides, for each index, a worked empirical example, its behaviour at the degenerate cases where it is undefined, a benchmark, and the procedure for substituting a custom null model. We report the behaviour of every index over a parameter sweep of a generative opinion model, and apply them to a county-level railroad network built from nineteenth-century operator records joined to full-count census data.

Explore related subjects

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

Onur Tuncay Bal, Michał Bojanowski. 2026-09-14. netseg: a Python Package for Measuring Structural Polarization and Segregation in Social Networks. https://arxiv.org/abs/2609.16088

Cite the original work for its findings. Save a collection to share your selection of sources.

KEEP EXPLORING

Related papers

The Benefit of Collective Intelligence in Community-Based Content Moderation is Limited by Overt Political Signalling

Social media platforms face increasing scrutiny over the rapid spread of misinformation. In response, many have adopted community-based content moderation systems, including Community Notes (formerly Birdwatch) on X (formerly Twitter), Community Notes on Meta, and Footnotes on TikTok. However, research shows that the current design of these systems can allow political biases to influence both the development of notes and the rating processes, reducing their overall effectiveness. We hypothesise that enabling users to collaborate on writing notes, rather than relying solely on individually authored notes, can enhance the overall quality of their notes. To test this idea, we conducted an online experiment in which participants jointly authored notes on politically misleading posts. We find that collaboration improves the helpfulness of notes, although the average effect depends on the interactional context. In particular, the benefits of collaboration decline when participants are made aware of one another's political affiliations. We also find that politically diverse teams improve note quality when evaluating Republican posts, while team composition does not meaningfully affect note quality for Democrat posts. These findings underscore the complexity of community-based content moderation and highlight the importance of understanding group dynamics and political diversity when designing more effective moderation systems.

cs.SI

The Same Ledger, Different Verdicts: How Measurement Specification Determines On-Chain Concentration

Whether a public blockchain is "decentralized" is routinely settled by citing a concentration statistic. On two ERC-20 ledgers, Chainlink (LINK) and Uniswap (UNI) over a 90-day window, we show that verdict depends on measurement specification rather than the ledger itself. Four discretionary choices (holder population, address type, temporal aggregation, and entity resolution) move the balance HHI for UNI from 109 to 2,336 (a factor of 21), with every specification defensible. Over the same range, the Gini coefficient moves by less than 0.003 and does not change under entity resolution, demonstrating that Gini and HHI answer different questions and cannot substitute for one another. We further document an implementation choice - summing versus overwriting repeated transfers - that discards roughly 85% of volume and overturns a finding on wealth and structural position. Substantively, both ledgers are extraordinarily unequal in ownership (balance Gini = 0.990 and 0.998) yet unconcentrated in routing (weekly flow HHI = 421 and 386), with the two dimensions close to statistically independent across addresses. A parameterized criterion for hidden brokers identifies 30 and 18 zero-balance intermediaries, 12 shared across ledgers; a matched control confirms that degree thresholding, rather than learned embeddings, drives the discovery. Finally, on the governance ledger, proposal-eligible addresses and routing intermediaries are almost disjoint, so routing contestability is held at the pleasure of a rule layer with a Nakamoto coefficient of two. We conclude that on-chain concentration should be reported as a specified range rather than a point estimate.

cs.SI

Optimal and heuristic strategies for evaluating the influence of coordinated behavior in information cascades and retweet networks

Coordinated Inauthentic Behavior (CIB) has become a major concern in online social platforms, yet its actual impact on information diffusion remains poorly understood. Existing research has primarily focused on detecting coordinated activity, while comparatively little attention has been devoted to quantifying its influence once detected. In this work, we introduce two complementary frameworks for the post-hoc evaluation of coordinated accounts. First, we formulate the problem on information cascades as a constrained influence maximization problem over directed trees and develop a polynomial-time dynamic programming algorithm that computes the optimal placement of coordinated nodes, providing an upper bound on their achievable influence. Second, motivated by the limited availability of diffusion cascades in real-world platforms, we propose a network-based framework that estimates influence directly from retweet networks using the independent cascade model and compares the observed placement of coordinated accounts against established heuristic baselines. We evaluate both approaches on Twitter/X data from the 2019 UK General Election and on a collection of verified state-backed information operation campaigns spanning multiple countries. While coordinated accounts exhibit limited influence in the UK cascades, the network-based analysis reveals substantial differences across campaigns, with several operations achieving influence comparable to or exceeding that of structurally central seed sets. Finally, by reconstructing cascades from the retweet networks, we show that the two frameworks produce consistent results, suggesting that the observed effects reflect intrinsic structural properties of coordinated activity rather than artifacts of the underlying methodology.

cs.SI