hatvis: hypergraph analysis and visualization in Python ======================================================= .. image:: _static/banner.png :alt: hatvis :class: hv-banner **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. It is the Python successor of two tools of the Abonyi group at the University of Pannonia, the MATLAB-based **HAT-VIS** (similarity-based hypergraph visualization) and the interactive **HyperGodot** viewer, and it integrates the hypergraph methods of the group's work on quality function deployment and on collaborative manufacturing spaces with the most useful methods of the wider literature. Data move to and from HyperNetX, XGI and Hypergraphx through converters and the Hypergraph Interchange Format (HIF). .. grid:: 1 2 2 3 :gutter: 3 .. grid-item-card:: Representations :link: api/representations :link-type: doc Incidence matrices, weighted, fuzzy, directed and temporal hypergraphs; clique and star expansions, s-line graphs, Laplacians, tensors. .. grid-item-card:: Interchange :link: api/io :link-type: doc HIF, HyperGodot and SPMF files, CSV and Excel; converters to HyperNetX, XGI and Hypergraphx. .. grid-item-card:: Visualization :link: api/plotting :link-type: doc Seriated incidence matrices, PAOH and UpSet views, hulls, isocontours, ellipses, stars and trees; HAT-VIS, HyperGodot and membership-aware layouts; an interactive HTML viewer. .. grid-item-card:: Structure and centrality :link: api/centrality :link-type: doc s-walks and s-components, s-betweenness and s-closeness, tensor and nonlinear node-edge eigenvector centralities, PageRank, hyper-cores. .. grid-item-card:: Clustering and patterns :link: api/community :link-type: doc Hypergraph modularity and Louvain, spectral and co-clustering, FM partitioning; frequent itemsets, rules, validated hyperedges. .. grid-item-card:: Problems, dynamics, learning :link: api/problems :link-type: doc Covering and transversals, acyclicity and join trees, directed hyperpaths, QFD; contagion and consensus; label spreading and HGNN. Quick start ----------- .. code-block:: bash pip install hatvis .. code-block:: 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 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 Where to go next ---------------- * :doc:`installation`: requirements and optional extras. * :doc:`auto_examples/index`: the **example gallery**, one runnable script per method; every example prints the numbers quoted in the book and can be opened as a Jupyter notebook. * :doc:`book`: the **book** *Hypergraph Analysis and Visualization in Python*: theory in one notation, algorithm boxes, and the same examples. * :doc:`api/index`: the API reference. * :doc:`migration`: coming from HAT-VIS, HyperGodot or another package. .. toctree:: :hidden: :maxdepth: 2 installation auto_examples/index book api/index migration citing changelog