xgi
xgi copied to clipboard
implement hyperedge adjacency matrices
A collaborator would be interested if we had hyperedge adjacency matrices (see definition in page 10 of this preprint).
Basically, two k-edges are :
- lower adjacent if they share a (k-1)-edge
- upper adjacent if they are part of a common (k+1)-edge
- adjacent if lower adjacent and not upper adjacent
The entries of the matrices are 1 for pairs of edges that are * adjacent, and 0 otherwise.
It feels similar to the intersection profile we currently have, but that one only counts the number nodes shared between two edges.
Sounds compute intensive at first sight. Perhaps there are some optimizations possible using maximal edges.
I agree. Or with boundary matrices $B_k$, just like incidence matrices $I$, but giving the relationships between k and k-1 edges. The intersection profile is $P = I^T I$. Would this not be something like $A_k = B_k^T B_k$? @Marconurisso any thoughts?
You would need perhaps to subtract a higher order (co?)boundary matrix...
You can get the lower adjacency matrix of order k simply by taking the nonzero elements of the down Laplacian $L_k = (B_k^\top B_k \neq 0)$ and, vice versa, you get the upper adjacency matrix from the nonzero elements of the up Laplacian $U_k = (B_{k+1}B_{k+1}^\top \neq 0)$. The adjacency would then be something like $A_k = L_k \odot (1 - U_k)$ i think.