xgi-org / xgi

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

Function to convert from hypergraph to a simplicial complex #305

Closed nwlandry closed 1 year ago

nwlandry commented 1 year ago

The function would input a hypergraph, extract the maximal faces, and initialize a SimplicialComplex with these maximal faces.

leotrs commented 1 year ago

Do we have one that goes the other way?

maximelucas commented 1 year ago

We have one that takes an SC as input, and outputs a HG containing the maximal simplices from the SC.

maximelucas commented 1 year ago

But Nich, can you no just do S = xgi.SimplicialComplex(H) to do this?

nwlandry commented 1 year ago

When I try this, I get XGIError: Input data has unsupported type.

maximelucas commented 1 year ago

What about S = xgi.SimplicialComplex(H._edge)

nwlandry commented 1 year ago

I get XGIError: Cannot generate SimplicialComplex from simplex dictionary 😢

nwlandry commented 1 year ago

The only thing that works right now for me is SC = xgi.SimplicialComplex(H.edges.members())

maximelucas commented 1 year ago

The only thing that works right now for me is SC = xgi.SimplicialComplex(H.edges.members())

Ah good. Is that what you wanted?

I getXGIError: Cannot generate SimplicialComplex from simplex dictionary 😢

Ah yes true, we didn't implement that input format for SC. I don't remember if there was a reason or if we just didn't get round to it?

nwlandry commented 1 year ago

It's worth noting that H = xgi.Hypergraph(SC) works so it would be great to implement something similar

maximelucas commented 1 year ago

@nwlandry if I'm not mistaken we have a solution to the original issue but mentioned another idea about implementing more input types for the SC constructor, right? If so, I'd close this issue and open a new one about that.

nwlandry commented 1 year ago

Good point. I'll do that.