hatvis 1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- hatvis-1.0/.gitignore +47 -0
- hatvis-1.0/CHANGELOG.md +50 -0
- hatvis-1.0/CITATION.cff +87 -0
- hatvis-1.0/LICENSE +21 -0
- hatvis-1.0/PKG-INFO +188 -0
- hatvis-1.0/README.md +116 -0
- hatvis-1.0/book/README.md +66 -0
- hatvis-1.0/examples/01_representations/README.rst +4 -0
- hatvis-1.0/examples/01_representations/plot_01_quickstart.py +37 -0
- hatvis-1.0/examples/01_representations/plot_02_projection_loss.py +35 -0
- hatvis-1.0/examples/01_representations/plot_03_expansions_and_spectra.py +41 -0
- hatvis-1.0/examples/01_representations/plot_04_interchange.py +45 -0
- hatvis-1.0/examples/02_matrix_views/README.rst +4 -0
- hatvis-1.0/examples/02_matrix_views/plot_05_seriation.py +35 -0
- hatvis-1.0/examples/02_matrix_views/plot_06_biclusters.py +30 -0
- hatvis-1.0/examples/02_matrix_views/plot_07_paoh.py +23 -0
- hatvis-1.0/examples/02_matrix_views/plot_08_upset.py +20 -0
- hatvis-1.0/examples/03_node_link/README.rst +4 -0
- hatvis-1.0/examples/03_node_link/plot_09_layouts.py +33 -0
- hatvis-1.0/examples/03_node_link/plot_10_hyperedge_styles.py +28 -0
- hatvis-1.0/examples/03_node_link/plot_11_groups.py +24 -0
- hatvis-1.0/examples/03_node_link/plot_12_primal_dual.py +23 -0
- hatvis-1.0/examples/03_node_link/plot_13_circular_and_interactive.py +31 -0
- hatvis-1.0/examples/04_similarity/README.rst +4 -0
- hatvis-1.0/examples/04_similarity/plot_14_hatvis_pipeline.py +44 -0
- hatvis-1.0/examples/04_similarity/plot_15_electric_car.py +38 -0
- hatvis-1.0/examples/04_similarity/plot_16_membership_layout.py +46 -0
- hatvis-1.0/examples/05_structure/README.rst +4 -0
- hatvis-1.0/examples/05_structure/plot_17_s_walks.py +33 -0
- hatvis-1.0/examples/05_structure/plot_18_wire_harness_centrality.py +35 -0
- hatvis-1.0/examples/05_structure/plot_19_centrality_family.py +44 -0
- hatvis-1.0/examples/05_structure/plot_20_hypercores.py +40 -0
- hatvis-1.0/examples/06_clustering/README.rst +4 -0
- hatvis-1.0/examples/06_clustering/plot_21_planted_communities.py +45 -0
- hatvis-1.0/examples/06_clustering/plot_22_cell_formation.py +45 -0
- hatvis-1.0/examples/06_clustering/plot_23_partitioning.py +39 -0
- hatvis-1.0/examples/06_clustering/plot_24_coclustering.py +34 -0
- hatvis-1.0/examples/07_patterns/README.rst +4 -0
- hatvis-1.0/examples/07_patterns/plot_25_itemset_hypergraph.py +41 -0
- hatvis-1.0/examples/07_patterns/plot_26_association_rules.py +37 -0
- hatvis-1.0/examples/07_patterns/plot_27_validated_hyperedges.py +36 -0
- hatvis-1.0/examples/08_higher_order/README.rst +4 -0
- hatvis-1.0/examples/08_higher_order/plot_28_h_motifs.py +30 -0
- hatvis-1.0/examples/08_higher_order/plot_29_simpliciality.py +40 -0
- hatvis-1.0/examples/08_higher_order/plot_30_null_models.py +53 -0
- hatvis-1.0/examples/09_problems/README.rst +4 -0
- hatvis-1.0/examples/09_problems/plot_31_sensor_placement.py +44 -0
- hatvis-1.0/examples/09_problems/plot_32_acyclicity.py +43 -0
- hatvis-1.0/examples/09_problems/plot_33_directed_assembly.py +42 -0
- hatvis-1.0/examples/09_problems/plot_34_qfd_optimization.py +50 -0
- hatvis-1.0/examples/10_dynamics_learning/README.rst +4 -0
- hatvis-1.0/examples/10_dynamics_learning/plot_35_diffusion_consensus.py +40 -0
- hatvis-1.0/examples/10_dynamics_learning/plot_36_contagion.py +41 -0
- hatvis-1.0/examples/10_dynamics_learning/plot_37_learning.py +51 -0
- hatvis-1.0/examples/11_temporal/README.rst +4 -0
- hatvis-1.0/examples/11_temporal/plot_38_evolving_narratives.py +32 -0
- hatvis-1.0/examples/11_temporal/plot_39_comparing_systems.py +37 -0
- hatvis-1.0/examples/README.rst +6 -0
- hatvis-1.0/pyproject.toml +84 -0
- hatvis-1.0/src/hatvis/__init__.py +117 -0
- hatvis-1.0/src/hatvis/centrality.py +324 -0
- hatvis-1.0/src/hatvis/community.py +318 -0
- hatvis-1.0/src/hatvis/core.py +700 -0
- hatvis-1.0/src/hatvis/datasets.py +276 -0
- hatvis-1.0/src/hatvis/dynamics.py +139 -0
- hatvis-1.0/src/hatvis/interactive.py +174 -0
- hatvis-1.0/src/hatvis/io.py +381 -0
- hatvis-1.0/src/hatvis/layout.py +371 -0
- hatvis-1.0/src/hatvis/learning.py +172 -0
- hatvis-1.0/src/hatvis/metrics.py +243 -0
- hatvis-1.0/src/hatvis/models.py +131 -0
- hatvis-1.0/src/hatvis/motifs.py +190 -0
- hatvis-1.0/src/hatvis/partition.py +175 -0
- hatvis-1.0/src/hatvis/patterns.py +345 -0
- hatvis-1.0/src/hatvis/plotting/__init__.py +49 -0
- hatvis-1.0/src/hatvis/plotting/_style.py +46 -0
- hatvis-1.0/src/hatvis/plotting/analysis.py +190 -0
- hatvis-1.0/src/hatvis/plotting/geometry.py +202 -0
- hatvis-1.0/src/hatvis/plotting/matrix.py +301 -0
- hatvis-1.0/src/hatvis/plotting/nodelink.py +493 -0
- hatvis-1.0/src/hatvis/problems.py +383 -0
- hatvis-1.0/src/hatvis/qfd.py +194 -0
- hatvis-1.0/src/hatvis/representations.py +299 -0
- hatvis-1.0/src/hatvis/seriation.py +170 -0
- hatvis-1.0/src/hatvis/similarity.py +195 -0
- hatvis-1.0/src/hatvis/spectral.py +139 -0
- hatvis-1.0/src/hatvis/temporal.py +100 -0
- hatvis-1.0/tests/conftest.py +3 -0
- hatvis-1.0/tests/test_analysis.py +356 -0
- hatvis-1.0/tests/test_core.py +83 -0
- hatvis-1.0/tests/test_io.py +71 -0
- hatvis-1.0/tests/test_viz.py +112 -0
hatvis-1.0/.gitignore
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
__pycache__/
|
|
2
|
+
*.pyc
|
|
3
|
+
*.egg-info/
|
|
4
|
+
dist/
|
|
5
|
+
build/
|
|
6
|
+
.pytest_cache/
|
|
7
|
+
.ruff_cache/
|
|
8
|
+
docs/_build/
|
|
9
|
+
docs/auto_examples/
|
|
10
|
+
docs/gen_modules/
|
|
11
|
+
docs/sg_execution_times.rst
|
|
12
|
+
book/figures/
|
|
13
|
+
book/*.aux
|
|
14
|
+
book/*.log
|
|
15
|
+
book/*.out
|
|
16
|
+
book/*.toc
|
|
17
|
+
book/*.bbl
|
|
18
|
+
book/*.bcf
|
|
19
|
+
book/*.blg
|
|
20
|
+
book/*.run.xml
|
|
21
|
+
book/*.idx
|
|
22
|
+
book/*.ilg
|
|
23
|
+
book/*.ind
|
|
24
|
+
book/*.fls
|
|
25
|
+
book/*.fdb_latexmk
|
|
26
|
+
book/*.synctex.gz
|
|
27
|
+
book/main.pdf
|
|
28
|
+
*.ipynb_checkpoints
|
|
29
|
+
book/_check_tmp/
|
|
30
|
+
book/_check.tex
|
|
31
|
+
docs/_build/
|
|
32
|
+
docs/api/generated/
|
|
33
|
+
docs/_build_log.txt
|
|
34
|
+
book/_build/
|
|
35
|
+
.coverage
|
|
36
|
+
book/_build_new/
|
|
37
|
+
book/_check_*.tex
|
|
38
|
+
book/cover/*.aux
|
|
39
|
+
book/cover/*.log
|
|
40
|
+
book/cover/*.fls
|
|
41
|
+
book/cover/*.fdb_latexmk
|
|
42
|
+
book/cover/*.pdf
|
|
43
|
+
book/cover/*.png
|
|
44
|
+
book/cover/logo.svg
|
|
45
|
+
*.blg
|
|
46
|
+
book/_build_epub/
|
|
47
|
+
book/_build_web/
|
hatvis-1.0/CHANGELOG.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 1.0 (2026-11-29)
|
|
4
|
+
|
|
5
|
+
First release.
|
|
6
|
+
|
|
7
|
+
* **Data model**: `Hypergraph` on a sparse incidence matrix with hyperedge
|
|
8
|
+
weights, fuzzy memberships and α-cuts, vertex and hyperedge attributes, dual,
|
|
9
|
+
restriction and collapsing; `DirectedHypergraph` (hyperarcs with tail and head sets)
|
|
10
|
+
and `TemporalHypergraph`.
|
|
11
|
+
* **Representations**: clique and star expansions, line and s-line graphs,
|
|
12
|
+
intersection and co-occurrence matrices, four hypergraph Laplacians,
|
|
13
|
+
adjacency, degree and Laplacian tensors, simplicial closure.
|
|
14
|
+
* **Interchange**: HIF (read and write), HyperGodot text
|
|
15
|
+
files, SPMF itemsets and rules, incidence CSV and Excel; converters to and
|
|
16
|
+
from HyperNetX, XGI, Hypergraphx and NetworkX bipartite graphs.
|
|
17
|
+
* **Visualization**: barycentric, correspondence and hierarchical seriation
|
|
18
|
+
with quality measures and bicluster blocks; HAT-VIS similarity layout with
|
|
19
|
+
max-product transitive closure, classical MDS and Sammon mapping;
|
|
20
|
+
HyperGodot force-directed layout; a membership-aware layout that keeps
|
|
21
|
+
non-members out of hyperedge regions; circular, radial, spectral and
|
|
22
|
+
bipartite layouts; layout quality (stress, intrusions); seven hyperedge
|
|
23
|
+
styles; PAOH and UpSet views; house of quality; primal-dual views;
|
|
24
|
+
interactive HTML viewer.
|
|
25
|
+
* **Analysis**: s-components, s-distances and s-profiles; s-betweenness,
|
|
26
|
+
s-closeness and averages over s; clique, Z-, H- and nonlinear node-edge
|
|
27
|
+
eigenvector centralities; PageRank; hyper-cores; clustering coefficients,
|
|
28
|
+
assortativity, nestedness, simpliciality, entropies.
|
|
29
|
+
* **Clustering and partitioning**: strict and all-or-nothing hypergraph
|
|
30
|
+
modularity, hypergraph Louvain, label propagation, spectral clustering and
|
|
31
|
+
co-clustering, Fiduccia-Mattheyses and recursive bisection, cut metrics.
|
|
32
|
+
* **Patterns**: itemset hypergraphs, frequent, closed and maximal itemsets,
|
|
33
|
+
association-rule hyperarcs, ARHP weights, statistically validated
|
|
34
|
+
hyperedges, inclusion lattices and formal concepts.
|
|
35
|
+
* **Higher-order structure**: h-motifs and node motifs with z-scores against
|
|
36
|
+
uniform, random, Chung-Lu and configuration null models; planted-partition
|
|
37
|
+
generator.
|
|
38
|
+
* **Problem solving**: set cover and hitting set (exact and greedy), minimal
|
|
39
|
+
transversals, matching, coloring and 2-colorability, GYO reduction and join
|
|
40
|
+
trees, conformality and the Helly property, B-reachability and shortest
|
|
41
|
+
hyperpaths, hypergraph and network-flow based QFD.
|
|
42
|
+
* **Dynamics and learning**: diffusion, nonlinear group consensus, threshold
|
|
43
|
+
contagion, label spreading (with class mass normalization), HGNN features
|
|
44
|
+
and classifier, hyperedge prediction; temporal turnover, persistence,
|
|
45
|
+
differences and centrality.
|
|
46
|
+
* **Datasets**: HAT-VIS and HyperGodot examples, collaborative manufacturing
|
|
47
|
+
CPS, electric-car QFD, wire-harness assembly network, synthetic news
|
|
48
|
+
transactions.
|
|
49
|
+
* 39 gallery examples, Sphinx documentation and the companion book
|
|
50
|
+
*Hypergraph Analysis and Visualization in Python* (PDF, EPUB, web edition).
|
hatvis-1.0/CITATION.cff
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
cff-version: 1.2.0
|
|
2
|
+
message: "If you use hatvis, please cite it as below, together with the original publications of the methods you use."
|
|
3
|
+
type: software
|
|
4
|
+
title: "hatvis: hypergraph analysis and visualization toolbox for Python"
|
|
5
|
+
version: "1.0"
|
|
6
|
+
date-released: 2026-11-29
|
|
7
|
+
license: MIT
|
|
8
|
+
repository-code: "https://github.com/ComplexSystemsIntelligence/hatvis"
|
|
9
|
+
url: "https://complexsystemsintelligence.github.io/hatvis"
|
|
10
|
+
authors:
|
|
11
|
+
- family-names: Abonyi
|
|
12
|
+
given-names: János
|
|
13
|
+
affiliation: "University of Pannonia, Veszprém, Hungary"
|
|
14
|
+
orcid: "https://orcid.org/0000-0001-8593-1493"
|
|
15
|
+
- family-names: Czvetkó
|
|
16
|
+
given-names: Tímea
|
|
17
|
+
affiliation: "University of Pannonia, Veszprém, Hungary"
|
|
18
|
+
- family-names: Ficsor
|
|
19
|
+
given-names: Attila
|
|
20
|
+
affiliation: "University of Pannonia, Veszprém, Hungary"
|
|
21
|
+
keywords:
|
|
22
|
+
- hypergraph
|
|
23
|
+
- higher-order networks
|
|
24
|
+
- hypergraph visualization
|
|
25
|
+
- s-walks
|
|
26
|
+
- hypergraph clustering
|
|
27
|
+
- frequent itemsets
|
|
28
|
+
- quality function deployment
|
|
29
|
+
references:
|
|
30
|
+
- type: article
|
|
31
|
+
title: "Version [1.0]- HAT-VIS — A MATLAB-based hypergraph visualization tool"
|
|
32
|
+
authors:
|
|
33
|
+
- family-names: Czvetkó
|
|
34
|
+
given-names: Tímea
|
|
35
|
+
- family-names: Abonyi
|
|
36
|
+
given-names: János
|
|
37
|
+
journal: SoftwareX
|
|
38
|
+
volume: 28
|
|
39
|
+
start: 101963
|
|
40
|
+
year: 2024
|
|
41
|
+
doi: 10.1016/j.softx.2024.101963
|
|
42
|
+
- type: article
|
|
43
|
+
title: "HyperGodot: Interactive hypergraph visualization tool"
|
|
44
|
+
authors:
|
|
45
|
+
- family-names: Ficsor
|
|
46
|
+
given-names: Attila
|
|
47
|
+
- family-names: Czvetkó
|
|
48
|
+
given-names: Tímea
|
|
49
|
+
- family-names: Sebestyén
|
|
50
|
+
given-names: Viktor
|
|
51
|
+
- family-names: Abonyi
|
|
52
|
+
given-names: János
|
|
53
|
+
journal: SoftwareX
|
|
54
|
+
volume: 31
|
|
55
|
+
start: 102315
|
|
56
|
+
year: 2025
|
|
57
|
+
doi: 10.1016/j.softx.2025.102315
|
|
58
|
+
- type: article
|
|
59
|
+
title: "Hypergraph and network flow-based quality function deployment"
|
|
60
|
+
authors:
|
|
61
|
+
- family-names: Abonyi
|
|
62
|
+
given-names: János
|
|
63
|
+
- family-names: Czvetkó
|
|
64
|
+
given-names: Tímea
|
|
65
|
+
journal: Heliyon
|
|
66
|
+
volume: 8
|
|
67
|
+
issue: 12
|
|
68
|
+
start: e12263
|
|
69
|
+
year: 2022
|
|
70
|
+
doi: 10.1016/j.heliyon.2022.e12263
|
|
71
|
+
- type: article
|
|
72
|
+
title: "Hypergraph-based analysis and design of intelligent collaborative manufacturing space"
|
|
73
|
+
authors:
|
|
74
|
+
- family-names: Nagy
|
|
75
|
+
given-names: László
|
|
76
|
+
- family-names: Ruppert
|
|
77
|
+
given-names: Tamás
|
|
78
|
+
- family-names: Löcklin
|
|
79
|
+
given-names: Andreas
|
|
80
|
+
- family-names: Abonyi
|
|
81
|
+
given-names: János
|
|
82
|
+
journal: Journal of Manufacturing Systems
|
|
83
|
+
volume: 65
|
|
84
|
+
start: 88
|
|
85
|
+
end: 103
|
|
86
|
+
year: 2022
|
|
87
|
+
doi: 10.1016/j.jmsy.2022.08.001
|
hatvis-1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 János Abonyi, Tímea Czvetkó, Attila Ficsor
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
hatvis-1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: hatvis
|
|
3
|
+
Version: 1.0
|
|
4
|
+
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.
|
|
5
|
+
Project-URL: Homepage, https://github.com/ComplexSystemsIntelligence/hatvis
|
|
6
|
+
Project-URL: Documentation, https://complexsystemsintelligence.github.io/hatvis
|
|
7
|
+
Project-URL: Repository, https://github.com/ComplexSystemsIntelligence/hatvis
|
|
8
|
+
Project-URL: Issues, https://github.com/ComplexSystemsIntelligence/hatvis/issues
|
|
9
|
+
Project-URL: Changelog, https://github.com/ComplexSystemsIntelligence/hatvis/blob/main/CHANGELOG.md
|
|
10
|
+
Project-URL: Book (PDF), https://complexsystemsintelligence.github.io/hatvis/hatvis-book.pdf
|
|
11
|
+
Author: Tímea Czvetkó, Attila Ficsor
|
|
12
|
+
Author-email: János Abonyi <janos@abonyilab.com>
|
|
13
|
+
License-Expression: MIT
|
|
14
|
+
License-File: LICENSE
|
|
15
|
+
Keywords: HAT-VIS,HIF,HyperGodot,frequent itemsets,higher-order networks,hypergraph,hypergraph clustering,hypergraph visualization,s-walks,set visualization
|
|
16
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
17
|
+
Classifier: Intended Audience :: Science/Research
|
|
18
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
19
|
+
Classifier: Operating System :: OS Independent
|
|
20
|
+
Classifier: Programming Language :: Python :: 3
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
25
|
+
Classifier: Topic :: Scientific/Engineering
|
|
26
|
+
Classifier: Topic :: Scientific/Engineering :: Information Analysis
|
|
27
|
+
Classifier: Topic :: Scientific/Engineering :: Mathematics
|
|
28
|
+
Classifier: Topic :: Scientific/Engineering :: Visualization
|
|
29
|
+
Requires-Python: >=3.10
|
|
30
|
+
Requires-Dist: matplotlib>=3.7
|
|
31
|
+
Requires-Dist: networkx>=3.0
|
|
32
|
+
Requires-Dist: numpy>=1.24
|
|
33
|
+
Requires-Dist: pandas>=2.0
|
|
34
|
+
Requires-Dist: scikit-learn>=1.3
|
|
35
|
+
Requires-Dist: scipy>=1.11
|
|
36
|
+
Provides-Extra: dev
|
|
37
|
+
Requires-Dist: build; extra == 'dev'
|
|
38
|
+
Requires-Dist: hypergraphx>=1.7; extra == 'dev'
|
|
39
|
+
Requires-Dist: hypernetx>=2.3; extra == 'dev'
|
|
40
|
+
Requires-Dist: myst-parser; extra == 'dev'
|
|
41
|
+
Requires-Dist: numpydoc; extra == 'dev'
|
|
42
|
+
Requires-Dist: openpyxl>=3.1; extra == 'dev'
|
|
43
|
+
Requires-Dist: pydata-sphinx-theme; extra == 'dev'
|
|
44
|
+
Requires-Dist: pytest-cov; extra == 'dev'
|
|
45
|
+
Requires-Dist: pytest>=7; extra == 'dev'
|
|
46
|
+
Requires-Dist: ruff; extra == 'dev'
|
|
47
|
+
Requires-Dist: sphinx-copybutton; extra == 'dev'
|
|
48
|
+
Requires-Dist: sphinx-design; extra == 'dev'
|
|
49
|
+
Requires-Dist: sphinx-gallery>=0.15; extra == 'dev'
|
|
50
|
+
Requires-Dist: sphinx>=7; extra == 'dev'
|
|
51
|
+
Requires-Dist: twine; extra == 'dev'
|
|
52
|
+
Requires-Dist: xgi>=0.8; extra == 'dev'
|
|
53
|
+
Provides-Extra: docs
|
|
54
|
+
Requires-Dist: myst-parser; extra == 'docs'
|
|
55
|
+
Requires-Dist: numpydoc; extra == 'docs'
|
|
56
|
+
Requires-Dist: openpyxl>=3.1; extra == 'docs'
|
|
57
|
+
Requires-Dist: pydata-sphinx-theme; extra == 'docs'
|
|
58
|
+
Requires-Dist: sphinx-copybutton; extra == 'docs'
|
|
59
|
+
Requires-Dist: sphinx-design; extra == 'docs'
|
|
60
|
+
Requires-Dist: sphinx-gallery>=0.15; extra == 'docs'
|
|
61
|
+
Requires-Dist: sphinx>=7; extra == 'docs'
|
|
62
|
+
Provides-Extra: interop
|
|
63
|
+
Requires-Dist: hypergraphx>=1.7; extra == 'interop'
|
|
64
|
+
Requires-Dist: hypernetx>=2.3; extra == 'interop'
|
|
65
|
+
Requires-Dist: openpyxl>=3.1; extra == 'interop'
|
|
66
|
+
Requires-Dist: xgi>=0.8; extra == 'interop'
|
|
67
|
+
Provides-Extra: test
|
|
68
|
+
Requires-Dist: openpyxl>=3.1; extra == 'test'
|
|
69
|
+
Requires-Dist: pytest-cov; extra == 'test'
|
|
70
|
+
Requires-Dist: pytest>=7; extra == 'test'
|
|
71
|
+
Description-Content-Type: text/markdown
|
|
72
|
+
|
|
73
|
+
<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>
|
|
74
|
+
|
|
75
|
+
# hatvis: hypergraph analysis and visualization in Python
|
|
76
|
+
|
|
77
|
+
[](https://github.com/ComplexSystemsIntelligence/hatvis/actions/workflows/ci.yml)
|
|
78
|
+
[](https://complexsystemsintelligence.github.io/hatvis)
|
|
79
|
+
[](https://complexsystemsintelligence.github.io/hatvis/book.html)
|
|
80
|
+
[](https://pypi.org/project/hatvis/)
|
|
81
|
+
[](https://github.com/ComplexSystemsIntelligence/hatvis/blob/main/LICENSE)
|
|
82
|
+
|
|
83
|
+
**hatvis** is a Python toolbox for the analysis and visualization of
|
|
84
|
+
hypergraphs, the natural model of interactions that join more than two
|
|
85
|
+
entities at once: a manufacturing task that needs an operator, a robot and a
|
|
86
|
+
fixture together, a news article that combines several topics, a customer
|
|
87
|
+
requirement served by several engineering solutions. It is the Python
|
|
88
|
+
successor of two tools of the Abonyi group at the University of Pannonia,
|
|
89
|
+
the MATLAB-based [HAT-VIS](https://github.com/abonyilab/HAT-VIS_MATLAB)
|
|
90
|
+
(Czvetkó and Abonyi, *SoftwareX* 2024) and the interactive HyperGodot viewer
|
|
91
|
+
(Ficsor et al., *SoftwareX* 2025). It contains the hypergraph methods of the
|
|
92
|
+
group's work on quality function deployment (*Heliyon* 2022) and on
|
|
93
|
+
collaborative manufacturing spaces (*J. Manuf. Syst.* 2022), and the most
|
|
94
|
+
useful methods of the wider literature, from s-walk centralities and
|
|
95
|
+
hypergraph modularity to h-motifs, validated hyperedges and hypergraph neural
|
|
96
|
+
networks. Data move to and from HyperNetX, XGI and Hypergraphx through
|
|
97
|
+
converters and the Hypergraph Interchange Format (HIF).
|
|
98
|
+
|
|
99
|
+
| Module | Contents |
|
|
100
|
+
|---|---|
|
|
101
|
+
| `hatvis.core` | `Hypergraph` (sparse incidence matrix, weights, fuzzy memberships, α-cuts, attributes, dual, restriction), `DirectedHypergraph`, `TemporalHypergraph` |
|
|
102
|
+
| `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 |
|
|
103
|
+
| `hatvis.io` | HIF, HyperGodot and SPMF files, incidence CSV and Excel; converters to and from HyperNetX, XGI, Hypergraphx and NetworkX bipartite graphs |
|
|
104
|
+
| `hatvis.seriation` | barycentric (HAT-VIS), correspondence-analysis and hierarchical (optimal leaf ordering) ordering of incidence matrices, quality measures, bicluster blocks |
|
|
105
|
+
| `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 |
|
|
106
|
+
| `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 |
|
|
107
|
+
| `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 |
|
|
108
|
+
| `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 |
|
|
109
|
+
| `hatvis.patterns` | itemset hypergraphs, frequent, closed and maximal itemsets, association-rule hyperarcs, ARHP clustering weights, statistically validated hyperedges, inclusion lattices and formal concepts |
|
|
110
|
+
| `hatvis.motifs`, `hatvis.models` | the 26 h-motifs and node motifs with z-scores; uniform, random, Chung-Lu, configuration and planted-partition models |
|
|
111
|
+
| `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 |
|
|
112
|
+
| `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 |
|
|
113
|
+
| `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 |
|
|
114
|
+
|
|
115
|
+
## Installation
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
pip install hatvis
|
|
119
|
+
pip install "hatvis[interop]" # HyperNetX, XGI, Hypergraphx converters and Excel input
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Python ≥ 3.10; depends on numpy, scipy, pandas, networkx, scikit-learn and matplotlib.
|
|
123
|
+
|
|
124
|
+
## Quick start
|
|
125
|
+
|
|
126
|
+
```python
|
|
127
|
+
import hatvis as hv
|
|
128
|
+
from hatvis.plotting import draw_hypergraph, plot_incidence
|
|
129
|
+
|
|
130
|
+
H = hv.Hypergraph({"e1": ["v1", "v2", "v3"], "e2": ["v1", "v2", "v4"], "e3": ["v3", "v4", "v5"]})
|
|
131
|
+
H.degrees() # pandas Series indexed by the vertices
|
|
132
|
+
S = hv.vertex_similarity(H, transitive=True) # HAT-VIS similarity
|
|
133
|
+
hv.s_betweenness(H, s=2) # s-walk centrality of the hyperedges
|
|
134
|
+
|
|
135
|
+
draw_hypergraph(H, layout="membership", style="smooth")
|
|
136
|
+
plot_incidence(H, order="barycentric")
|
|
137
|
+
hv.to_html(H, "my_hypergraph.html") # interactive viewer in the browser
|
|
138
|
+
|
|
139
|
+
cps = hv.datasets.load_manufacturing_cps() # collaborative manufacturing space
|
|
140
|
+
hv.community.hypergraph_louvain(cps, random_state=0)
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## Documentation and book
|
|
144
|
+
|
|
145
|
+
* **Documentation**: <https://complexsystemsintelligence.github.io/hatvis>,
|
|
146
|
+
with an example gallery of 39 scripts (each can be opened as a Jupyter
|
|
147
|
+
notebook or in Google Colab) and the API reference.
|
|
148
|
+
* **Book**: *Hypergraph Analysis and Visualization in Python: The hatvis
|
|
149
|
+
toolbox* by János Abonyi, Tímea Czvetkó and Attila Ficsor, 13 chapters and 3 appendices:
|
|
150
|
+
[read online](https://complexsystemsintelligence.github.io/hatvis/book/index.html),
|
|
151
|
+
[PDF](https://complexsystemsintelligence.github.io/hatvis/hatvis-book.pdf),
|
|
152
|
+
[EPUB](https://complexsystemsintelligence.github.io/hatvis/hatvis-book.epub).
|
|
153
|
+
The book develops every method in one notation and uses the gallery scripts
|
|
154
|
+
as its examples, so the book, the documentation and the code show the same
|
|
155
|
+
numbers.
|
|
156
|
+
|
|
157
|
+
## Development
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
git clone https://github.com/ComplexSystemsIntelligence/hatvis.git
|
|
161
|
+
cd hatvis
|
|
162
|
+
pip install -e ".[dev]"
|
|
163
|
+
pytest # unit tests and doctests
|
|
164
|
+
python docs/build_api_pages.py && sphinx-build -b html docs docs/_build/html
|
|
165
|
+
book/build.sh # book PDF (TeX Live, latexmk, biber)
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
`DESIGN.md` fixes the notation and the API conventions shared by the code,
|
|
169
|
+
the documentation and the book.
|
|
170
|
+
|
|
171
|
+
## Citing
|
|
172
|
+
|
|
173
|
+
If you use hatvis, please cite it (see `CITATION.cff`) together with the
|
|
174
|
+
original publications of the methods you use; the docstrings and the book
|
|
175
|
+
list them. The predecessors of the toolbox are
|
|
176
|
+
|
|
177
|
+
* 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)
|
|
178
|
+
* 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)
|
|
179
|
+
* 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)
|
|
180
|
+
* 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)
|
|
181
|
+
|
|
182
|
+
## License and acknowledgment
|
|
183
|
+
|
|
184
|
+
Code: MIT License. Book (`book/` directory): CC BY 4.0.
|
|
185
|
+
|
|
186
|
+
The development was supported by the National Research, Development and
|
|
187
|
+
Innovation Office of Hungary (NKFIH) through the OTKA K 143482 project
|
|
188
|
+
*Monitoring complex systems by goal-oriented clustering algorithms*.
|
hatvis-1.0/README.md
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
<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>
|
|
2
|
+
|
|
3
|
+
# hatvis: hypergraph analysis and visualization in Python
|
|
4
|
+
|
|
5
|
+
[](https://github.com/ComplexSystemsIntelligence/hatvis/actions/workflows/ci.yml)
|
|
6
|
+
[](https://complexsystemsintelligence.github.io/hatvis)
|
|
7
|
+
[](https://complexsystemsintelligence.github.io/hatvis/book.html)
|
|
8
|
+
[](https://pypi.org/project/hatvis/)
|
|
9
|
+
[](https://github.com/ComplexSystemsIntelligence/hatvis/blob/main/LICENSE)
|
|
10
|
+
|
|
11
|
+
**hatvis** is a Python toolbox for the analysis and visualization of
|
|
12
|
+
hypergraphs, the natural model of interactions that join more than two
|
|
13
|
+
entities at once: a manufacturing task that needs an operator, a robot and a
|
|
14
|
+
fixture together, a news article that combines several topics, a customer
|
|
15
|
+
requirement served by several engineering solutions. It is the Python
|
|
16
|
+
successor of two tools of the Abonyi group at the University of Pannonia,
|
|
17
|
+
the MATLAB-based [HAT-VIS](https://github.com/abonyilab/HAT-VIS_MATLAB)
|
|
18
|
+
(Czvetkó and Abonyi, *SoftwareX* 2024) and the interactive HyperGodot viewer
|
|
19
|
+
(Ficsor et al., *SoftwareX* 2025). It contains the hypergraph methods of the
|
|
20
|
+
group's work on quality function deployment (*Heliyon* 2022) and on
|
|
21
|
+
collaborative manufacturing spaces (*J. Manuf. Syst.* 2022), and the most
|
|
22
|
+
useful methods of the wider literature, from s-walk centralities and
|
|
23
|
+
hypergraph modularity to h-motifs, validated hyperedges and hypergraph neural
|
|
24
|
+
networks. Data move to and from HyperNetX, XGI and Hypergraphx through
|
|
25
|
+
converters and the Hypergraph Interchange Format (HIF).
|
|
26
|
+
|
|
27
|
+
| Module | Contents |
|
|
28
|
+
|---|---|
|
|
29
|
+
| `hatvis.core` | `Hypergraph` (sparse incidence matrix, weights, fuzzy memberships, α-cuts, attributes, dual, restriction), `DirectedHypergraph`, `TemporalHypergraph` |
|
|
30
|
+
| `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 |
|
|
31
|
+
| `hatvis.io` | HIF, HyperGodot and SPMF files, incidence CSV and Excel; converters to and from HyperNetX, XGI, Hypergraphx and NetworkX bipartite graphs |
|
|
32
|
+
| `hatvis.seriation` | barycentric (HAT-VIS), correspondence-analysis and hierarchical (optimal leaf ordering) ordering of incidence matrices, quality measures, bicluster blocks |
|
|
33
|
+
| `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 |
|
|
34
|
+
| `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 |
|
|
35
|
+
| `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 |
|
|
36
|
+
| `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 |
|
|
37
|
+
| `hatvis.patterns` | itemset hypergraphs, frequent, closed and maximal itemsets, association-rule hyperarcs, ARHP clustering weights, statistically validated hyperedges, inclusion lattices and formal concepts |
|
|
38
|
+
| `hatvis.motifs`, `hatvis.models` | the 26 h-motifs and node motifs with z-scores; uniform, random, Chung-Lu, configuration and planted-partition models |
|
|
39
|
+
| `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 |
|
|
40
|
+
| `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 |
|
|
41
|
+
| `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 |
|
|
42
|
+
|
|
43
|
+
## Installation
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
pip install hatvis
|
|
47
|
+
pip install "hatvis[interop]" # HyperNetX, XGI, Hypergraphx converters and Excel input
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Python ≥ 3.10; depends on numpy, scipy, pandas, networkx, scikit-learn and matplotlib.
|
|
51
|
+
|
|
52
|
+
## Quick start
|
|
53
|
+
|
|
54
|
+
```python
|
|
55
|
+
import hatvis as hv
|
|
56
|
+
from hatvis.plotting import draw_hypergraph, plot_incidence
|
|
57
|
+
|
|
58
|
+
H = hv.Hypergraph({"e1": ["v1", "v2", "v3"], "e2": ["v1", "v2", "v4"], "e3": ["v3", "v4", "v5"]})
|
|
59
|
+
H.degrees() # pandas Series indexed by the vertices
|
|
60
|
+
S = hv.vertex_similarity(H, transitive=True) # HAT-VIS similarity
|
|
61
|
+
hv.s_betweenness(H, s=2) # s-walk centrality of the hyperedges
|
|
62
|
+
|
|
63
|
+
draw_hypergraph(H, layout="membership", style="smooth")
|
|
64
|
+
plot_incidence(H, order="barycentric")
|
|
65
|
+
hv.to_html(H, "my_hypergraph.html") # interactive viewer in the browser
|
|
66
|
+
|
|
67
|
+
cps = hv.datasets.load_manufacturing_cps() # collaborative manufacturing space
|
|
68
|
+
hv.community.hypergraph_louvain(cps, random_state=0)
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Documentation and book
|
|
72
|
+
|
|
73
|
+
* **Documentation**: <https://complexsystemsintelligence.github.io/hatvis>,
|
|
74
|
+
with an example gallery of 39 scripts (each can be opened as a Jupyter
|
|
75
|
+
notebook or in Google Colab) and the API reference.
|
|
76
|
+
* **Book**: *Hypergraph Analysis and Visualization in Python: The hatvis
|
|
77
|
+
toolbox* by János Abonyi, Tímea Czvetkó and Attila Ficsor, 13 chapters and 3 appendices:
|
|
78
|
+
[read online](https://complexsystemsintelligence.github.io/hatvis/book/index.html),
|
|
79
|
+
[PDF](https://complexsystemsintelligence.github.io/hatvis/hatvis-book.pdf),
|
|
80
|
+
[EPUB](https://complexsystemsintelligence.github.io/hatvis/hatvis-book.epub).
|
|
81
|
+
The book develops every method in one notation and uses the gallery scripts
|
|
82
|
+
as its examples, so the book, the documentation and the code show the same
|
|
83
|
+
numbers.
|
|
84
|
+
|
|
85
|
+
## Development
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
git clone https://github.com/ComplexSystemsIntelligence/hatvis.git
|
|
89
|
+
cd hatvis
|
|
90
|
+
pip install -e ".[dev]"
|
|
91
|
+
pytest # unit tests and doctests
|
|
92
|
+
python docs/build_api_pages.py && sphinx-build -b html docs docs/_build/html
|
|
93
|
+
book/build.sh # book PDF (TeX Live, latexmk, biber)
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
`DESIGN.md` fixes the notation and the API conventions shared by the code,
|
|
97
|
+
the documentation and the book.
|
|
98
|
+
|
|
99
|
+
## Citing
|
|
100
|
+
|
|
101
|
+
If you use hatvis, please cite it (see `CITATION.cff`) together with the
|
|
102
|
+
original publications of the methods you use; the docstrings and the book
|
|
103
|
+
list them. The predecessors of the toolbox are
|
|
104
|
+
|
|
105
|
+
* 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)
|
|
106
|
+
* 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)
|
|
107
|
+
* 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)
|
|
108
|
+
* 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)
|
|
109
|
+
|
|
110
|
+
## License and acknowledgment
|
|
111
|
+
|
|
112
|
+
Code: MIT License. Book (`book/` directory): CC BY 4.0.
|
|
113
|
+
|
|
114
|
+
The development was supported by the National Research, Development and
|
|
115
|
+
Innovation Office of Hungary (NKFIH) through the OTKA K 143482 project
|
|
116
|
+
*Monitoring complex systems by goal-oriented clustering algorithms*.
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# The hatvis book — authoring conventions
|
|
2
|
+
|
|
3
|
+
`main.tex` includes `preamble.tex` and one file per chapter from `chapters/`.
|
|
4
|
+
Build: `book/build.sh` (cover artwork, figures, generated appendices, PDF in `book/_build/`).
|
|
5
|
+
EPUB edition: `python book/epub/make_epub.py` after `book/build.sh` (needs tex4ebook, biber and dvisvgm;
|
|
6
|
+
output in `book/_build_epub/`). It is generated from the same chapters with an e-book preamble.
|
|
7
|
+
Web edition: `python book/web/make_web.py` (same requirements plus beautifulsoup4; output in
|
|
8
|
+
`book/_build_web/site/`, published as `book/` on the documentation site).
|
|
9
|
+
|
|
10
|
+
## Chapter template (follow exactly)
|
|
11
|
+
|
|
12
|
+
```latex
|
|
13
|
+
\chapter{Title}\label{ch:slug}
|
|
14
|
+
\begin{roadmap}
|
|
15
|
+
What this chapter covers, why it matters, how it connects to the previous one (3–5 sentences).
|
|
16
|
+
\end{roadmap}
|
|
17
|
+
|
|
18
|
+
\section{Problem and idea} % motivation in plain words, one TikZ concept figure
|
|
19
|
+
\section{Theory} % unified notation of DESIGN.md (preamble macros: \Bm \Wm \Dv \De \Sm \Ls ...)
|
|
20
|
+
...
|
|
21
|
+
\begin{algobox}{Name of the algorithm}{slug}
|
|
22
|
+
\begin{algorithm}[H] ... \end{algorithm} % or an enumerated list for short procedures
|
|
23
|
+
\end{algobox}
|
|
24
|
+
\begin{summarybox}{Name}
|
|
25
|
+
3–6 bullets: what it does, what it assumes, when to use it, main parameters.
|
|
26
|
+
\end{summarybox}
|
|
27
|
+
\section{Using it in hatvis} % \begin{apibox}{hatvis.module.function} parameters \end{apibox}
|
|
28
|
+
% + code snippets via \pysnippet{examples/<sec>/plot_xx.py}{tag}
|
|
29
|
+
\section{Examples} % one subsection per example script; figures via \exfig; discuss parameter effects
|
|
30
|
+
\section{Further reading} % 3–8 references with \cite{} (BibTeX keys in references.bib)
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Rules
|
|
34
|
+
* Theory and experiments are kept apart (Theory vs. Examples sections).
|
|
35
|
+
* Index $i,j$ = vertices, $e,f,g$ = hyperedges; $\mathbf{B}$ is the $n\times m$ incidence matrix (`H.incidence`). The book says *vertex*, the code says `node`.
|
|
36
|
+
* Every algorithm gets exactly one `algobox` and one `summarybox`.
|
|
37
|
+
* Every example script of the chapter is referenced at least once with `\exfig`; captions are descriptive sentences ("The membership-aware layout keeps non-members out of the hyperedge regions"), not labels. A caption of several sentences gets a short form for the list of figures: `\exfig[width]{section/script_n}[First sentence.]{Full caption.}{label}` (manual figures and tables: `\caption[short]{long}`).
|
|
38
|
+
* Every `algobox` is followed by `\index{}` entries for the algorithm name, its abbreviation and its class (`hypergraph_louvain@\code{hypergraph\_louvain}`); add them when a new algorithm box is written.
|
|
39
|
+
* Spelling is American (-ize, color, center, neighbor, modeling); code identifiers, file names, labels and BibTeX keys are never changed .
|
|
40
|
+
* Concept figures (TikZ) are drawn at natural font size inside the 360 pt text width: no `\resizebox`; stack panels vertically or use `scale=` on the coordinates instead; `\code{}` breaks lines after underscores, so long identifiers may be used in running text.
|
|
41
|
+
* Snippet tags: in the example scripts wrap the lines to quote between `# [snippet:tag]` and `# [/snippet:tag]`.
|
|
42
|
+
* Figures: `book/build_figures.py` writes `figures/<section>/<script>_<n>.pdf`; `n` is the 1-based figure number inside the script.
|
|
43
|
+
* Citations: add BibTeX entries to `references.bib` (key style `author:year` or `author:year:topic`); only cite works you have actually seen (the uploaded papers, standard textbooks, the original method papers).
|
|
44
|
+
* No MATLAB or GDScript code; the HAT-VIS and HyperGodot originals are described in words and mapped to hatvis in the migration appendix.
|
|
45
|
+
|
|
46
|
+
## Design
|
|
47
|
+
|
|
48
|
+
The visual identity is defined once, in `cover/brand.tex`, and shared by the
|
|
49
|
+
book, the cover, the documentation (`docs/_static/custom.css`, logo, banner)
|
|
50
|
+
and the README:
|
|
51
|
+
|
|
52
|
+
* colors: Pannon blue `#285780` for headings, rules and links; navy `#14304A`
|
|
53
|
+
for dark backgrounds; the Okabe–Ito triple blue/vermilion/green of the logo,
|
|
54
|
+
which is also the palette of every data figure (`hatvis.plotting.PALETTE`);
|
|
55
|
+
* type: Libertinus Serif and Libertinus Math for text and formulas, Raleway for
|
|
56
|
+
headings and display, IBM Plex Mono for code;
|
|
57
|
+
* boxes: one geometry (colored rule on the left, light tint, title in Raleway);
|
|
58
|
+
only the color tells the kind (algorithm, summary, hint, API, roadmap);
|
|
59
|
+
* the cover artwork (`cover/make_cover_art.py`) is a planted-partition
|
|
60
|
+
hypergraph drawn by the membership-aware layout of the package, hyperedges as
|
|
61
|
+
smooth regions in the community colors. The same script draws the banner of
|
|
62
|
+
the README and the docs.
|
|
63
|
+
|
|
64
|
+
Page layout rules: algorithm boxes are floats; headings and listings carry a
|
|
65
|
+
`\needspace`, so they never end a page; widows and orphans are forbidden. Do
|
|
66
|
+
not add `\clearpage` or `\vspace` in the chapters.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
r"""
|
|
2
|
+
A first hypergraph: incidence matrix, dual and degrees
|
|
3
|
+
======================================================
|
|
4
|
+
|
|
5
|
+
A hypergraph :math:`H=(V,E)` consists of vertices and hyperedges, where every
|
|
6
|
+
hyperedge is an arbitrary subset of the vertices. This script builds the
|
|
7
|
+
five-vertex example of the HAT-VIS paper, prints its incidence matrix
|
|
8
|
+
:math:`\mathbf{B}`, the dual hypergraph :math:`H^*` (incidence
|
|
9
|
+
:math:`\mathbf{B}^\mathsf{T}`) and the basic statistics, and draws the two
|
|
10
|
+
views side by side.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
# %%
|
|
14
|
+
import matplotlib.pyplot as plt
|
|
15
|
+
|
|
16
|
+
import hatvis as hv
|
|
17
|
+
from hatvis.plotting import draw_hypergraph, plot_incidence
|
|
18
|
+
|
|
19
|
+
# [snippet:build]
|
|
20
|
+
H = hv.Hypergraph({"e1": ["v1", "v2", "v3"], "e2": ["v1", "v2", "v4"], "e3": ["v3", "v4", "v5"]})
|
|
21
|
+
print(H.to_dataframe().astype(int))
|
|
22
|
+
print(H.degrees().to_dict(), H.edge_sizes().to_dict())
|
|
23
|
+
D = H.dual()
|
|
24
|
+
print(D.edge_dict())
|
|
25
|
+
# [/snippet:build]
|
|
26
|
+
print(H.summary())
|
|
27
|
+
|
|
28
|
+
# %%
|
|
29
|
+
# The incidence matrix (left) is a complete description; the node-link view
|
|
30
|
+
# (middle) draws every hyperedge as a padded convex hull around its members,
|
|
31
|
+
# here with the force-directed layout of HyperGodot; the dual (right) swaps
|
|
32
|
+
# the roles: the hyperedges become the vertices.
|
|
33
|
+
fig, axes = plt.subplots(1, 3, figsize=(13, 3.8), gridspec_kw={"width_ratios": [1, 1.3, 1.3]})
|
|
34
|
+
plot_incidence(H, order=None, ax=axes[0], title="incidence matrix")
|
|
35
|
+
draw_hypergraph(H, layout="force", ax=axes[1], title="H", legend=False, edge_labels=True, style="smooth")
|
|
36
|
+
draw_hypergraph(D, layout="force", ax=axes[2], title="dual H*", legend=False, edge_labels=True, style="smooth")
|
|
37
|
+
plt.tight_layout()
|