-
Notifications
You must be signed in to change notification settings - Fork 66
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
How to transform a igraph or networkx object into hypergraph? #29
Comments
Hi, you can extract the edge list and the number of vertices from G of networkx. Then, you can construct a DHG's Graph with the default construction function https://deephypergraph.readthedocs.io/en/0.9.3/api/dhg.html#dhg.Graph . |
Thank you for your timely reply. Could you kindly suggest how to set node attribute? |
If you don't have the node attribute, you can try the following ways:
|
Thanks. If I want to set a numeric vector (degree) as node attribute. How to assign the numbers to nodes? |
You can try to transform the degree to a one-hot vector. Refer to this https://github.com/weihua916/powerful-gnns/blob/master/util.py#L118 |
Hi @yifanfeng97 I wonder what encoding of Hypergraphs you would use in NetworkX transformations. I'm implementing such encoding and was hoping to use this one: What do you think? Thanks! |
Hi again! I would like to invite you to join the HIF effort, allowing hypergraphs to be shared across many libraries. This can complement the pickle strategy that is currently implemented with cross library and language compatibility. I hope you would like to take a look at our repository where we provide the specification of a JSON format. It is an incidence-based encoding that looks to be compatible with the structure of your library. This format has been implemented in HypergraphX, HyperNetX and XGI. https://github.com/pszufe/HIF-standard Let me know what you think and any way I can help make this happen! Cheers and happy new year. |
How to transform a igraph or networkx object into hypergraph object used in DHG?
The text was updated successfully, but these errors were encountered: