Skip to content
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

Support DiHypergraph in from_bipartite_graph #625

Open
colltoaction opened this issue Nov 22, 2024 · 2 comments
Open

Support DiHypergraph in from_bipartite_graph #625

colltoaction opened this issue Nov 22, 2024 · 2 comments

Comments

@colltoaction
Copy link

Hi, do you think it's possible to support DiHypergraphs in this API?

def from_bipartite_graph(G, create_using=None, dual=False):

I can try to implement it but I wonder what the API would look like. Likely something compatible with HIF.

@nwlandry
Copy link
Collaborator

@colltoaction --- this is a great idea! Do you want to take the lead on this? If not, happy to give it a try.

@colltoaction
Copy link
Author

Definitely! I'm thinking I can use the nx.Graph attributes like the HIF top-level metadata:

xgi/xgi/readwrite/hif.py

Lines 138 to 146 in 0726fe1

if "network-type" in data:
network_type = data["network-type"]
else:
network_type = "undirected"
if network_type in {"asc", "undirected"}:
G = Hypergraph()
elif network_type == "directed":
G = DiHypergraph()

I would like to implement DiHypergraphs for from_bipartite at the moment, but there is more work to do for feature parity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants