Metadata-Version: 2.5
Name: hatvis
Version: 1.0
Summary: Hypergraph analysis and visualization toolbox: representations, interchange (HIF), similarity-based (HAT-VIS) and force-directed (HyperGodot) layouts, matrix and set views, s-walk centralities, clustering, frequent patterns, motifs, null models, combinatorial problems, dynamics and learning on hypergraphs.
Project-URL: Homepage, https://github.com/ComplexSystemsIntelligence/hatvis
Project-URL: Documentation, https://complexsystemsintelligence.github.io/hatvis
Project-URL: Repository, https://github.com/ComplexSystemsIntelligence/hatvis
Project-URL: Issues, https://github.com/ComplexSystemsIntelligence/hatvis/issues
Project-URL: Changelog, https://github.com/ComplexSystemsIntelligence/hatvis/blob/main/CHANGELOG.md
Project-URL: Book (PDF), https://complexsystemsintelligence.github.io/hatvis/hatvis-book.pdf
Author: Tímea Czvetkó, Attila Ficsor
Author-email: János Abonyi <janos@abonyilab.com>
License-Expression: MIT
License-File: LICENSE
Keywords: HAT-VIS,HIF,HyperGodot,frequent itemsets,higher-order networks,hypergraph,hypergraph clustering,hypergraph visualization,s-walks,set visualization
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Classifier: Topic :: Scientific/Engineering :: Mathematics
Classifier: Topic :: Scientific/Engineering :: Visualization
Requires-Python: >=3.10
Requires-Dist: matplotlib>=3.7
Requires-Dist: networkx>=3.0
Requires-Dist: numpy>=1.24
Requires-Dist: pandas>=2.0
Requires-Dist: scikit-learn>=1.3
Requires-Dist: scipy>=1.11
Provides-Extra: dev
Requires-Dist: build; extra == 'dev'
Requires-Dist: hypergraphx>=1.7; extra == 'dev'
Requires-Dist: hypernetx>=2.3; extra == 'dev'
Requires-Dist: myst-parser; extra == 'dev'
Requires-Dist: numpydoc; extra == 'dev'
Requires-Dist: openpyxl>=3.1; extra == 'dev'
Requires-Dist: pydata-sphinx-theme; extra == 'dev'
Requires-Dist: pytest-cov; extra == 'dev'
Requires-Dist: pytest>=7; extra == 'dev'
Requires-Dist: ruff; extra == 'dev'
Requires-Dist: sphinx-copybutton; extra == 'dev'
Requires-Dist: sphinx-design; extra == 'dev'
Requires-Dist: sphinx-gallery>=0.15; extra == 'dev'
Requires-Dist: sphinx>=7; extra == 'dev'
Requires-Dist: twine; extra == 'dev'
Requires-Dist: xgi>=0.8; extra == 'dev'
Provides-Extra: docs
Requires-Dist: myst-parser; extra == 'docs'
Requires-Dist: numpydoc; extra == 'docs'
Requires-Dist: openpyxl>=3.1; extra == 'docs'
Requires-Dist: pydata-sphinx-theme; extra == 'docs'
Requires-Dist: sphinx-copybutton; extra == 'docs'
Requires-Dist: sphinx-design; extra == 'docs'
Requires-Dist: sphinx-gallery>=0.15; extra == 'docs'
Requires-Dist: sphinx>=7; extra == 'docs'
Provides-Extra: interop
Requires-Dist: hypergraphx>=1.7; extra == 'interop'
Requires-Dist: hypernetx>=2.3; extra == 'interop'
Requires-Dist: openpyxl>=3.1; extra == 'interop'
Requires-Dist: xgi>=0.8; extra == 'interop'
Provides-Extra: test
Requires-Dist: openpyxl>=3.1; extra == 'test'
Requires-Dist: pytest-cov; extra == 'test'
Requires-Dist: pytest>=7; extra == 'test'
Description-Content-Type: text/markdown

<p align="center"><img src="https://raw.githubusercontent.com/ComplexSystemsIntelligence/hatvis/main/docs/_static/banner.png" alt="hatvis: hypergraph analysis and visualization in Python"></p>

# hatvis: hypergraph analysis and visualization in Python

[![tests](https://github.com/ComplexSystemsIntelligence/hatvis/actions/workflows/ci.yml/badge.svg)](https://github.com/ComplexSystemsIntelligence/hatvis/actions/workflows/ci.yml)
[![docs](https://img.shields.io/badge/docs-gallery%20%2B%20API-285780)](https://complexsystemsintelligence.github.io/hatvis)
[![book](https://img.shields.io/badge/book-PDF%20%7C%20EPUB%20%7C%20web-285780)](https://complexsystemsintelligence.github.io/hatvis/book.html)
[![PyPI](https://img.shields.io/pypi/v/hatvis.svg)](https://pypi.org/project/hatvis/)
[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/ComplexSystemsIntelligence/hatvis/blob/main/LICENSE)

**hatvis** is a Python toolbox for the analysis and visualization of
hypergraphs, the natural model of interactions that join more than two
entities at once: a manufacturing task that needs an operator, a robot and a
fixture together, a news article that combines several topics, a customer
requirement served by several engineering solutions. It is the Python
successor of two tools of the Abonyi group at the University of Pannonia,
the MATLAB-based [HAT-VIS](https://github.com/abonyilab/HAT-VIS_MATLAB)
(Czvetkó and Abonyi, *SoftwareX* 2024) and the interactive HyperGodot viewer
(Ficsor et al., *SoftwareX* 2025). It contains the hypergraph methods of the
group's work on quality function deployment (*Heliyon* 2022) and on
collaborative manufacturing spaces (*J. Manuf. Syst.* 2022), and the most
useful methods of the wider literature, from s-walk centralities and
hypergraph modularity to h-motifs, validated hyperedges and hypergraph neural
networks. Data move to and from HyperNetX, XGI and Hypergraphx through
converters and the Hypergraph Interchange Format (HIF).

| Module | Contents |
|---|---|
| `hatvis.core` | `Hypergraph` (sparse incidence matrix, weights, fuzzy memberships, α-cuts, attributes, dual, restriction), `DirectedHypergraph`, `TemporalHypergraph` |
| `hatvis.representations` | clique and star expansions, line and s-line graphs, intersection and co-occurrence matrices, Laplacians (normalized, random-walk, Bolla, clique), adjacency, degree and Laplacian tensors, simplicial closure |
| `hatvis.io` | HIF, HyperGodot and SPMF files, incidence CSV and Excel; converters to and from HyperNetX, XGI, Hypergraphx and NetworkX bipartite graphs |
| `hatvis.seriation` | barycentric (HAT-VIS), correspondence-analysis and hierarchical (optimal leaf ordering) ordering of incidence matrices, quality measures, bicluster blocks |
| `hatvis.layout`, `hatvis.similarity` | HAT-VIS similarity with max-product transitive closure, classical MDS and Sammon mapping, HyperGodot force-directed layout, a membership-aware layout, circular, radial, spectral and bipartite layouts, layout quality (stress, intrusions), hypergraph distances |
| `hatvis.plotting`, `hatvis.interactive` | seven hyperedge styles (hull, padded concentric hull, smooth curve, isocontour, minimum-volume ellipse, star, spanning tree), seriated incidence matrices, PAOH and UpSet views, house of quality, primal-dual views, s-walk and motif profiles, interactive HTML viewer |
| `hatvis.metrics`, `hatvis.centrality`, `hatvis.spectral` | s-components, s-distances and s-profiles; s-betweenness and s-closeness, clique, Z-, H- and nonlinear node-edge eigenvector centralities, PageRank, hyper-cores; random walks and spectral embedding; clustering, assortativity, nestedness, simpliciality |
| `hatvis.community`, `hatvis.partition` | strict and all-or-nothing hypergraph modularity, hypergraph Louvain, label propagation, spectral clustering and co-clustering, Fiduccia-Mattheyses bisection, cut and connectivity metrics |
| `hatvis.patterns` | itemset hypergraphs, frequent, closed and maximal itemsets, association-rule hyperarcs, ARHP clustering weights, statistically validated hyperedges, inclusion lattices and formal concepts |
| `hatvis.motifs`, `hatvis.models` | the 26 h-motifs and node motifs with z-scores; uniform, random, Chung-Lu, configuration and planted-partition models |
| `hatvis.problems`, `hatvis.qfd` | set cover and hitting set (exact ILP and greedy), minimal transversals, matching, coloring and 2-colorability, GYO reduction and join trees, conformality, Helly property, B-reachability and shortest hyperpaths; hypergraph and network-flow based quality function deployment |
| `hatvis.dynamics`, `hatvis.learning`, `hatvis.temporal` | diffusion, nonlinear group consensus, threshold contagion; label spreading, HGNN features and classifier, hyperedge prediction; turnover, persistence, differences and temporal centrality |
| `hatvis.datasets` | the HAT-VIS and HyperGodot examples, the collaborative manufacturing cyber-physical system, the electric-car QFD, a wire-harness assembly network and a synthetic news-topic generator |

## Installation

```bash
pip install hatvis
pip install "hatvis[interop]"    # HyperNetX, XGI, Hypergraphx converters and Excel input
```

Python ≥ 3.10; depends on numpy, scipy, pandas, networkx, scikit-learn and matplotlib.

## Quick start

```python
import hatvis as hv
from hatvis.plotting import draw_hypergraph, plot_incidence

H = hv.Hypergraph({"e1": ["v1", "v2", "v3"], "e2": ["v1", "v2", "v4"], "e3": ["v3", "v4", "v5"]})
H.degrees()                                  # pandas Series indexed by the vertices
S = hv.vertex_similarity(H, transitive=True) # HAT-VIS similarity
hv.s_betweenness(H, s=2)                     # s-walk centrality of the hyperedges

draw_hypergraph(H, layout="membership", style="smooth")
plot_incidence(H, order="barycentric")
hv.to_html(H, "my_hypergraph.html")          # interactive viewer in the browser

cps = hv.datasets.load_manufacturing_cps()   # collaborative manufacturing space
hv.community.hypergraph_louvain(cps, random_state=0)
```

## Documentation and book

* **Documentation**: <https://complexsystemsintelligence.github.io/hatvis>,
  with an example gallery of 39 scripts (each can be opened as a Jupyter
  notebook or in Google Colab) and the API reference.
* **Book**: *Hypergraph Analysis and Visualization in Python: The hatvis
  toolbox* by János Abonyi, Tímea Czvetkó and Attila Ficsor, 13 chapters and 3 appendices:
  [read online](https://complexsystemsintelligence.github.io/hatvis/book/index.html),
  [PDF](https://complexsystemsintelligence.github.io/hatvis/hatvis-book.pdf),
  [EPUB](https://complexsystemsintelligence.github.io/hatvis/hatvis-book.epub).
  The book develops every method in one notation and uses the gallery scripts
  as its examples, so the book, the documentation and the code show the same
  numbers.

## Development

```bash
git clone https://github.com/ComplexSystemsIntelligence/hatvis.git
cd hatvis
pip install -e ".[dev]"
pytest                                        # unit tests and doctests
python docs/build_api_pages.py && sphinx-build -b html docs docs/_build/html
book/build.sh                                 # book PDF (TeX Live, latexmk, biber)
```

`DESIGN.md` fixes the notation and the API conventions shared by the code,
the documentation and the book.

## Citing

If you use hatvis, please cite it (see `CITATION.cff`) together with the
original publications of the methods you use; the docstrings and the book
list them. The predecessors of the toolbox are

* T. Czvetkó, J. Abonyi, Version [1.0]- HAT-VIS — A MATLAB-based hypergraph visualization tool, *SoftwareX* 28 (2024) 101963, [doi:10.1016/j.softx.2024.101963](https://doi.org/10.1016/j.softx.2024.101963)
* A. Ficsor, T. Czvetkó, V. Sebestyén, J. Abonyi, HyperGodot: Interactive hypergraph visualization tool, *SoftwareX* 31 (2025) 102315, [doi:10.1016/j.softx.2025.102315](https://doi.org/10.1016/j.softx.2025.102315)
* J. Abonyi, T. Czvetkó, Hypergraph and network flow-based quality function deployment, *Heliyon* 8 (2022) e12263, [doi:10.1016/j.heliyon.2022.e12263](https://doi.org/10.1016/j.heliyon.2022.e12263)
* L. Nagy, T. Ruppert, A. Löcklin, J. Abonyi, Hypergraph-based analysis and design of intelligent collaborative manufacturing space, *J. Manuf. Syst.* 65 (2022) 88–103, [doi:10.1016/j.jmsy.2022.08.001](https://doi.org/10.1016/j.jmsy.2022.08.001)

## License and acknowledgment

Code: MIT License. Book (`book/` directory): CC BY 4.0.

The development 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*.
