-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hypergraph Heat Kernel Lift (Hypergraph to Simplicial) #58
base: main
Are you sure you want to change the base?
Conversation
Hello @peekxc! Thank you for your submission. As we near the end of the challenge, I am collecting participant info for the purpose of selecting and announcing winners. Please email me (or have one member of your team email me) at [email protected] so I can share access to the voting form. In your email, please include:
Before July 12, make sure that your submission respects all Submission Requirements laid out on the challenge page. Any submission that fails to meet this criteria will be automatically disqualified. |
Hi @peekxc! While checking your submission I found out that you did not provide a tutorial notebook (in the corresponding folder there is only a Did you forget to generate it? |
@gbg141 Ahh yes, sorry, I tend to prefer developing using the percent format (or Jupyter cells in VSCode); I can generate a .ipynb file with one click. Would you like me to convert it? |
This PR implements the hypergraph-to-simplicial topological conversion described in the paper below (1), which is aimed at encoding the higher-order information of a hypergraph into a weighted simplicial complex without loss of information. One notable application of this approach is to bring the power of the heat kernel to the realm of hypergraphs.
Note this is not a 'lift' in the sense that we are going from a higher order structure to a (theoretically) lower order one, though the submission requirements mention this is allowed.
Application example
To illustrate this lift, consider the set of all hypergraphs whose simplicial closures are given by the maximal simplices$S = \{(0,1,2), (1,2,3) \}$ . As there are 9 non-maximal faces in the closure, there are $2^9$ distinct hypergraphs with identical closures; for any conversion to be useful, we would like a lift capable of distinguishing between hypergraphs in this set.
Of course, a natural weight map is the identity map$f : S_H \to \{0,1\}$ given by $S(\sigma) = 1$ if $\sigma \in H$ and $0$ otherwise; however, for various reasons, this assignment is not very useful.
Instead, below are 5 hypergraphs and their simplicial lifts weighted using the lift implemented here, along with two featurizations on the right; the first of these shows the amount of heat diffused at each vertex across time starting with a unit amount of heat at the red vertex, the second shows the heat kernel signature, a natural featurization one could associate with this lift. Keeping in line with simplicial weights representing thermal conductivity in the Laplacian sense, the 'width' of each edge is inversely proportional to its weight deduced by the input hypergraph.
To illustrate the diffusion curves, consider the 3rd row: the red vertex (0) starts with a unit amount of heat, which it diffuses through the weighted edges (0,1) and (0,2) via the heat kernel. The blue vertex heats up faster than the green due to having higher conductivity, and the orange vertex (3) heats up the slowest due to being not adjacent to the heat source (0).
Observe from above that not only is the HKS able to distinguish between different hypergraphs, but also symmetrically related graphs are handled naturally. To demonstrate this, below is a plot of the MDS embedding computed from the Euclidean distance matrix over the HKS-features, for a heuristic choice of time points$t_1, t_2, \dots, t_k$ .
$2^9$ distinct hypergraphs are indeed distinguished by the HKS.
Though not exhibiting perfect symmetry, many of the distances are quite intuitive, and each of the
Overview
The high-level algorithmic pipeline of this lift is as follows:
Properties of the weights
There are many ways to map higher-order interactions to simplicial weights; to define a notion of 'topological weight', (1) define a weighting scheme that satisfies:
This lifting implements the weighting scheme defined by Eq. 3 & Eqs. (63-65) from (1), which not only satisfies all these properties, but can also be computed quickly for the$d$ -skeleton $S_d \subseteq S$ .
For hypergraphs, the affinity weight is deduced by the number of times$c$ a face $\sigma \in S$ appears in a hyperedge $h \in H$ of order $n$ , while the topological weight depends only the dimensions of the faces that contain the given simplex. For an example of the weighting scheme, see the picture below:
The primary use-case for this simplex-weight mapping is to make a valid inner product on the cochain space that captures higher-order interactions using only simplicial structure. In particular, multiscale invariants such as those deriving from the heat kernel were shown in [1] to yield more information gain than in the unweighted settings.
Implementation details
This lift implementation includes:
The lifting code itself requires the$d$ -skeleton. This was added as a dependency to the
hirola
package to efficiently compute thepyproject.toml
.References
Weighted simplicial complexes and their representation power of higher-order network data and topology." Physical Review E 106.3 (2022): 034319, by Baccini, Federica, Filippo Geraci, and Ginestra Bianconi.
Sun, Jian, Maks Ovsjanikov, and Leonidas Guibas. "A concise and provably informative multi‐scale signature based on heat diffusion." Computer graphics forum. Vol. 28. No. 5. Oxford, UK: Blackwell Publishing Ltd, 2009.