HGX-Team/hypergraphx
HGX is a multi-purpose, open-source Python library for higher-order network analysis
What it solves
Most network analysis tools only handle pairwise connections, but many real-world systems involve groups of three or more entities acting together — e.g., collaboration teams, brain networks, face-to-face contacts. Hypergraphs capture these group, or higher-order, interactions directly, using hyperedges that can connect any number of nodes. Hypergraphx is a Python library that brings a complete toolkit for building, visualizing, and analyzing these hypergraphs, filling a gap in open-source software for higher-order network science.
How it works
Hypergraphx provides a Hypergraph class that lets you create a hypergraph from a simple edge list — each edge can contain any number of nodes. You can add weights, node metadata, edge metadata, and even time stamps using the TemporalHypergraph class. The library supports conversions between hypergraphs and other representations like line graphs, bipartite networks, clique expansions, and duals. It includes tools for computing measures (degrees, correlations, motifs), centrality (spectral, betweenness), community detection (hard and overlapping), filtering statistically validated hypergraphs, generating synthetic hypergraphs (Erdos-Renyi, scale-free, configuration, etc.), and simulating dynamics such as synchronization, contagion, and random walks. It also provides linear algebra utilities, like incidence and adjacency matrices and Laplacian matrices, to support spectral analysis.
Who it’s for
Hypergraphx is aimed at researchers and analysts in network science, computational biology, social science, and any field dealing with group interactions. It is designed to be user-friendly and accessible, with introductory tutorials and a collection of real-world datasets to get started quickly. The project is open source and welcomes contributions.
Highlights
- Supports weighted, directed, temporal, multiplex, and signed hypergraphs
- Rich set of measures and statistics: degrees, correlations, assortativity, motifs, mesoscale structure
- Centrality algorithms: spectral, shortest paths, betweenness flows, motif sampling
- Community detection: hard and overlapping, with assortative/disassortative options
- Filtering: statistically validated hypergraphs and significant interacting groups
- Generative models: Erdos-Renyi, scale-free, configuration, community-based, temporal activity-driven
- Dynamics: synchronization, social contagion, random walks, diffusion
- Easy installation via pip and extensive documentation and tutorials
Related
- Project
- Project
- Project
- Project