Hypergraph Analysis and Visualization in PythonThe hatvis toolbox

Preface

This book is about the analysis and visualization of relations that join more than two things at once: a production step that needs an operator, a robot, and a fixture together; a customer requirement that is met only by a combination of engineering solutions; a news article that mentions five themes in the same breath; a set of items bought in one basket. A graph can store such a relation only by breaking it into pairs, and the pairs forget which of them belonged together. A hypergraph keeps the group as a whole. The price is that almost every familiar tool of network analysis, from the adjacency matrix to the shortest path, the centrality index, the community, and the drawing, has to be defined again, and usually in more than one way.

The chapters develop these definitions in one notation and, for each of them, show how to compute it with the hatvis Python package, what it reveals in a concrete data set, and what it would have missed had the data been reduced to a graph. The emphasis is on methods that a practitioner can apply and interpret: representations and their losses, matrix and node-link views, similarity-based layouts, walks and centralities, communities and partitions, frequent patterns, motifs and null models, combinatorial problems such as covering and acyclicity, quality function deployment, dynamical processes and semi-supervised learning, and the comparison of hypergraphs over time.

Who the book is for. It is written for engineers, data scientists, and graduate students who know basic graph theory and linear algebra and want to work with group interactions without first reading the physics, database, and data-mining literatures separately. The proofs are referenced rather than reproduced; the mathematics needed is that of an undergraduate course in linear algebra and discrete mathematics, together with a little probability for the null models. Every method is stated as an algorithm, summarized in a box at the end of its theory section, and illustrated by a script that the reader can run.

The toolbox and its predecessors. hatvis grew out of two visualization tools of the authors’ group at the University of Pannonia. HAT-VIS [1], written in MATLAB, introduced the similarity-based drawing of hypergraphs: vertices are placed by multidimensional scaling of a weighted Jaccard similarity, the hyperedges are drawn as minimal spanning trees, and the incidence matrix is reordered by seriation. HyperGodot [2], built on the Godot game engine, added interactive force-directed and circular layouts, convex-hull hyperedges with adjustable padding, and the comparison of several versions of a system by groups and line styles. Two applications of the group shaped the analysis part of the package: the hypergraph and network-flow formulation of quality function deployment [3] and the hypergraph-based analysis and design of collaborative manufacturing spaces with s-walk centralities [4]. hatvis reimplements all four in Python, places them next to the methods of the wider literature, adds new visualizations (a membership-aware layout, layout quality measures, the s-profile, linked primal–dual views, an interactive HTML viewer), and exchanges data with HyperNetX, XGI, and Hypergraphx through the Hypergraph Interchange Format.

How to run the examples. The package is installed with pip install hatvis. The scripts that produce the figures are in the examples/ directory of the repository, grouped into folders by chapter, and are listed in chapter C. The sphinx-gallery extension renders them as the online gallery of the documentation and converts them into Jupyter notebooks that run in Google Colab without installation. Every number quoted in the text was printed by one of these scripts; when a later version of a dependency changes the last digit, the script, not the book, is authoritative.

Data. The examples use five data sets shipped with the package. Two are taken from the published papers: the electric-vehicle house of quality of [3] and the production example of [2]. The wire-harness manufacturing space of [4] is confidential in its original form; hatvis contains a reconstruction with the same resources, the same number of activities, and the same incidences wherever the paper reports them, so that the analysis of chapter 6 can be repeated, but its numbers are not those of the factory. The collection of news articles in chapters 8 and 12 is synthetic: it is generated with planted narratives so that the methods can be checked against a known truth. The fifth set is the small three-hyperedge hypergraph used throughout HAT-VIS.

Acknowledgments. This work was supported by the National Research, Development and Innovation Office of Hungary (NKFIH) through the OTKA K 143482 project Monitoring complex systems by goal-oriented clustering algorithms. The authors are grateful to Viktor Sebestyén, co-author of HyperGodot, and to László Nagy, Tamás Ruppert, and Andreas Löcklin, co-authors of the manufacturing-space study, whose ideas run through several chapters. The interchange format and the converters would not exist without the open work of the HyperNetX, XGI, and Hypergraphx teams; the package rests on NumPy, SciPy, pandas, NetworkX, scikit-learn, and Matplotlib [5, 6, 7, 8, 9, 10].

Veszprém, November 2026 János Abonyi, Tímea Czvetkó, and Attila Ficsor