xgi-org / xgi

CompleX Group Interactions (XGI) is a Python package for higher-order networks.
https://xgi.readthedocs.io
Other
181 stars 29 forks source link

implement hyperedge adjacency matrices #395

Open maximelucas opened 1 year ago

maximelucas commented 1 year ago

A collaborator would be interested if we had hyperedge adjacency matrices (see definition in page 10 of this preprint).

Basically, two k-edges are :

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.

leotrs commented 1 year ago

Sounds compute intensive at first sight. Perhaps there are some optimizations possible using maximal edges.

maximelucas commented 1 year ago

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?

leotrs commented 1 year ago

You would need perhaps to subtract a higher order (co?)boundary matrix...

Marconurisso commented 1 year ago

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 $Uk = (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.