Hypergraph Analysis and Visualization in PythonThe hatvis toolbox

Appendix B
Migrating from HAT-VIS, HyperGodot, and other packages

This appendix is for readers who know the MATLAB scripts of HAT-VIS, the HyperGodot viewer, or one of the Python packages HyperNetX, XGI, and Hypergraphx. It maps their functions and settings to hatvis and lists the chapter where each method is explained.

B.1 HAT-VIS

The HAT-VIS distribution [1] consists of MATLAB scripts that build a Hypergraph object of HAT [18] from an incidence matrix, reorder the matrix, compute the similarity of the vertices, embed it with cmdscale, and draw the hyperedges. Table B.1 gives the hatvis counterpart of every step. Two details matter when results are compared. The electric-car script embeds the dissimilarity of the transitive similarity (D=1-simOT), which is the default of layout_similarity; the mini example embeds the plain similarity (D=1-simO), which corresponds to transitive=False. The hyperedge trees of both scripts are minimum spanning trees on the dissimilarities 1 −sij of the plain similarity, as in draw_hatvis.

Table B.1. HAT-VIS script steps and their hatvis counterparts.

HAT-VIS (MATLAB)

hatvis

Chapter

Hypergraph(’IM’, IM)

Hypergraph.from_incidence(IM)

2

HAT.uniformErdosRenyi(v, e, k)

models.uniform_random(n, m, k)

9

adjTensor, degreeTensor, laplacianTensor

adjacency_tensor, degree_tensor, laplacian_tensor

2

cliqueGraph, starGraph

clique_expansion, star_expansion

2

barycentric sorting loops, spy(IM(x,y))

seriate(H, "barycentric"), plot_incidence(H)

3

simO (weighted Jaccard loop)

vertex_similarity(H)

5

simOT (max-product loop)

transitive_closure(S, "max-product"), vertex_similarity(H, transitive=True)

5

cmdscale(D, 2)

layout.classical_mds(D), layout_similarity(H)

5

MST of the members per hyperedge

draw_hatvis(H, mode="mst")

5

bounding ellipses, convex hulls

draw_hypergraph(H, style="ellipse"|"hull")

4

xlsread of the house of quality; A.*w

io.read_incidence_excel, qfd.qfd_hypergraph(R, importance), datasets.load_electric_car_qfd()

5

B.2 HyperGodot

HyperGodot [2] is an interactive application; its settings correspond to arguments of the hatvis layout and drawing functions (table B.2). The input files are read and written unchanged, and to_html provides an interactive view in the browser with dragging, zooming, the vertex filter, group toggles, layout switching, adjustable padding and smoothness, and SVG export.

Table B.2. HyperGodot features and their hatvis counterparts.

HyperGodot

hatvis

Chapter

input file with #WEIGHT and #GROUP tags

io.read_hypergodot, io.write_hypergodot

2

force-directed layout (iterations, repulsion, spring length)

layout_force(H, iterations=500, repulsion=250, spring_length=30)

4

circular and radial layouts

layout_circular, layout_radial

4

convex-hull hyperedges with padding

draw_hypergraph(H, style="hull", pad, pad_step)

4

groups shown by line styles

draw_hypergraph(H, group="group")

4

line widths by weight

draw_hypergraph(H, width_by="weight")

4

vertex filter

draw_hypergraph(H, highlight=v)

4

interactive window, image export

to_html(H, path); Matplotlib savefig

4

comparison of system variants

temporal.difference, temporal.group_statistics

12

B.3 HyperNetX, XGI, and Hypergraphx

The three Python packages are reached through converters and through the Hypergraph Interchange Format (section 2.3). Table B.3 lists the conversions and the hatvis functions that correspond to frequently used concepts of these packages; the names of the functions in the other packages change between versions, so the table refers to the concepts and the chapters rather than to their exact spelling.

Table B.3. Interoperation with HyperNetX, XGI, and Hypergraphx.

Concept or object

hatvis

Chapter

HyperNetX hypergraph

io.to_hypernetx(H), io.from_hypernetx(h)

2

XGI hypergraph

io.to_xgi(H), io.from_xgi(h)

2

Hypergraphx hypergraph

io.to_hypergraphx(H), io.from_hypergraphx(h)

2

HIF file (all three)

io.write_hif, io.read_hif

2

s-line graphs, s-components, s-distance

s_line_graph, s_connected_components, s_distance

6

s-betweenness, s-closeness

s_betweenness, s_closeness, s_harmonic_closeness

6

clustering coefficients

metrics.two_node_clustering, metrics.clique_clustering

9

CEC, ZEC, HEC, node–edge centralities

clique_eigenvector, z_eigenvector, h_eigenvector, node_edge_eigenvector

6

motifs

motifs.h_motifs, motifs.node_motifs, motifs.motif_zscores

9

statistically validated hyperedges

patterns.validated_hyperedges

8

configuration model

models.configuration_model

9

simpliciality

simpliciality

9

drawing

draw_hypergraph, draw_hatvis, to_html

4