Hypergraph Analysis and Visualization in PythonThe hatvis toolbox

Chapter 13
What the hypergraph view buys

The previous chapters introduced one method at a time. This chapter steps back and collects what the examples have shown about the value of representing group interactions as hypergraphs: where the hypergraph changed a conclusion, where it made a pattern visible, and where it was not needed. It ends with a guide from questions to methods, a workflow for a new data set, and the limits of the toolbox.

13.1 The evidence of the examples

Every chapter contains at least one comparison between a hypergraph method and its pairwise or projected counterpart. Taken together, they support five claims.

The incidence matrix stores what the projections lose. Two hypergraphs that differ only in whether three vertices act together or in pairs have identical clique expansions (section 2.5); every statistic of the expansion is therefore blind to the difference. The conformality test of section 2.2.4 says when the loss is harmless, and the simpliciality measures of section 9.2.4 say how far a data set is from a simplicial complex: for the news data, representing the articles as a simplicial complex would have added about 95% non-existent faces, and representing them as a graph would have destroyed every three-theme combination.

Overlap strength changes the ranking of elements. In the wire-harness space, the crimping competence C7 ranks eleventh by s-betweenness when any shared activity counts (s = 1) and second when only strong overlaps count (s = 2) (section 6.4). A pairwise analysis has only the first view; the s-family shows that C7 is the element through which the strongly overlapping crimping activities hang together, which is exactly what a redesign of the cells has to respect. The s-component profile showed in the same way that the activities are 1-connected with diameter 2 but split into seventeen components at s = 3: the system is a set of tight cells connected by weak links.

Group-aware objectives find group-defined structure. When communities are defined by whole hyperedges being internal, the strict hypergraph modularity recovers them under more noise than modularity on the clique expansion (an adjusted Rand index of 0.956 against 0.872 at pin = 0.45, section 7.4), and on the manufacturing space it finds a partition of higher hypergraph modularity (0.419 against 0.394). The null models of section 9.4 confirm that this modularity, and the two-node clustering of 0.183, are about twice what the degree and size sequences alone produce.

Patterns are hyperedges, and hyperedges can be tested. Frequent itemsets, association rules, and validated groups are all hyperedges of derived hypergraphs. Treating them as such allowed the same drawings, clusterings, and statistics to be applied to them: ARHP clustering of the itemset hypergraph recovered the six planted narratives exactly, including one that the maximal itemsets captured only partially (section 8.4), and the statistical validation of section 8.2.4 singled out exactly the four planted groups among 300 random ones, ranking a repeated quadruple as far more surprising than a repeated pair although both occurred six times. The h-motif profile showed that the activities of the manufacturing space overlap in a nested way, with loose chains of activities strongly under-represented (section 9.4).

Group effects change the dynamics. When a group transmits only if all its other members are infected, the stationary prevalence depends on the initial seed: at the same transmission probability the infection died out from 5% and persisted at 42% from 40% (section 11.4). Nonlinear group consensus changed the time course of agreement on the same hypergraph and from the same start. In a directed hypergraph the cost of an assembly distinguished total effort (22 time units) from makespan (19) because an AND-dependency waits for all its inputs (section 10.4); no path in a graph expresses this.

Where the hypergraph was not needed. The examples also show the limits. On a uniform hypergraph PageRank of the Zhou walk is essentially the degree (Spearman correlation 0.99, section 6.4), and linear diffusion and label spreading are processes on a weighted clique expansion (section 11.2.1). When a question is answered by a pairwise statistic, the projection is the efficient choice; the point of the hypergraph is that the projection is then a deliberate decision with a known loss, not the only option the software offers.

13.2 From questions to methods

Table 13.1 maps typical questions to the representation, the method, and the function of hatvis that answers them.

Table 13.1: From questions to methods: the representation, the method, and the hatvis function for typical questions about group interactions.

Question

Representation

Method

Function (chapter)

Can the data be stored without loss and exchanged?

incidence matrix, HIF

interchange, converters

io. write_hif (2)

Does a projection lose information?

clique expansion

conformality, simpliciality

problems. is_conformal, simpliciality (2, 9)

Which vertices and hyperedges belong together in the matrix?

incidence matrix

seriation, co-clustering

seriate, seriation. bicluster_blocks (3)

How can the groups be drawn legibly?

layout + hyperedge style

force, similarity, membership-aware layouts; hulls, isocontours

draw_hypergraph, layout_membership (4, 5)

Which requirements or resources are similar?

weighted incidence profiles

Jaccard, transitive closure, MDS

vertex_similarity, draw_hatvis (5)

How strongly connected is the system, and which elements are critical?

s-line graphs

s-components, s-betweenness, averages over s

s_component_profile, s_centrality_table (6)

Which vertices matter if a group needs all its members?

adjacency tensor, incidence

ZEC, HEC, node–edge centralities, hyper-cores

z_eigenvector, node_edge_eigenvector, hypercoreness (6)

Which communities or cells exist?

hypergraph, projections

strict modularity, Louvain, spectral, co-clustering

hypergraph_louvain, spectral_coclustering (7)

How to split with little cut?

hypergraph

FM bisection, normalized cut

partition. fm_bisection (7)

Which combinations recur, and which predict others?

transactions

Eclat, closed itemsets, rules, ARHP

frequent_itemsets, association_rules (8)

Is a recurring group significant?

hyperedges per size

iterated hypergeometric test

patterns. validated_hyperedges (8)

Is a structure more than chance?

null ensembles

configuration model, motif z-scores

models. configuration_model, motifs. motif_zscores (9)

What must be monitored or covered?

hypergraph, dual

hitting set, set cover, transversals

problems. hitting_set (10)

Can tables be joined efficiently?

schema hypergraph

GYO reduction, join tree

problems. join_tree (10)

What can be produced, at what cost?

directed hypergraph

B-reachability, hyperpaths

problems. shortest_hyperpaths (10)

Which specifications to develop?

house of quality

MILP, min-cost flow, centrality

qfd. qfd_select (10)

How do group processes behave?

Laplacians, hyperedges

diffusion, group consensus, threshold contagion

dynamics.* (11)

How to classify from few labels or predict groups?

propagation operator

label spreading, simplified HGNN, scores

learning.* (11)

How does the system change?

snapshots, difference

turnover, persistence, distances

temporal.* (12)

13.3 A workflow for a new data set

Figure 13.1 summarizes the order in which the methods of the book are usually applied to a new data set. The first steps decide whether the hypergraph is the right representation at all (are there genuine groups, are they nested or downward closed, are there duplicates and equivalent vertices). The middle steps describe the structure and test it against null models before interpreting it. The last steps answer the substantive question and communicate the result.

Figure 13.1

Figure 13.1. A workflow for the hypergraph analysis of a new data set. The dashed branch is a legitimate outcome: if the groups turn out to be pairs or downward-closed families, a graph or a simplicial complex is the better representation.

13.4 Limits and outlook

hatvis is designed for hypergraphs that can be inspected: up to a few thousand vertices and hyperedges for the drawings, and up to tens of thousands of incidences for the analyses, most of which work with sparse matrices. Several methods are exponential in the worst case (minimal transversals, Property B, simplicial closure) or cubic in the number of vertices (the transitive closure of similarities, classical MDS), and the tensor centralities are restricted to uniform hypergraphs. For much larger data the converters and the HIF interchange of section 2.3 hand the data to packages built for scale, and the results come back by label.

Three directions of current research will shape the next versions. Visualization of large hypergraphs relies increasingly on simplification that preserves topological structure [69, 70, 71], which fits the separation of layout and hyperedge style used here. Statistical inference on hypergraphs, from generative community models [98, 104] to the validation of groups [118] and information-theoretic comparison [84], is moving from heuristics to principled models. Learning on hypergraphs [150, 151] is turning the propagation operators of section 11.2.4 into trainable architectures. The interchange format [26] is what makes it possible to combine these developments across packages, and hatvis will follow it.