HNX Data Structures
Fig. 9 Code structure for HNX.
The HNX library centers around the idea of a hypergraph. There are many definitions of a hypergraph. In HNX a hypergraph is a tuple of three sets, \(H = (V, E, \mathcal{I})\).
\(V\), a set of nodes (aka hypernodes, vertices), distinguished by unique identifiers
\(E\) a set of edges (aka hyperedges), distinguished by unique identifiers
\(\mathcal{I}\), a set of incidences, which form a subset of \(E \times V\), distinguished by the pairing of unique identifiers of edges in \(E\) and nodes in \(V\)
The incidences \(\mathcal{I}\) can be described by a Boolean function, \(\mathcal{I}_B : E \times V \rightarrow \{0, 1\}\), indicating whether or not a pair is included in the hypergraph.
In HNX we instantiate \(H = (V, E, \mathcal{I})\) using three hypergraph views. We can visualize this through a high level diagram of our current code structure shown in Fig. 1. Here we begin with data (e.g., data frame, dictionary, list of lists, etc.) that is digested via the appropriate factory method to construct property stores for nodes, edges, and incidences as well as an incidence store that captures the hypergraph structure. These four objects are then used to create three hypergraph views that the hypergraph object uses to access and analyze the hypergraph structure and attributes.