Python Library to create and visualize HyperGraph

4.6k views Asked by At

Is there any libraries similar to igraph where I can create a hypergraph. I am working with hypergraph now and wanted to use some HyperGraph libraries to work on.

2

There are 2 answers

0
Ebrahim Byagowi On BEST ANSWER
  • MGtoolkit and its paper
  • pygraph
  • halp
  • PyMETIS
  • SageMath's implementation, 1, 2. SageMath is not a python library but more like a python distribution (ships python 2.7 currently) which lots of interesting libraries are pre-installed.

I hope we see NetworkX and igraph support also soon.

1
ngmir On

There's also HyperNetX which is able to represent and visualise hypergraphs.

enter image description here

It seems very accessible. They have a number of nice tutorials on their GitHub page.

However, when working with it I identified some issues:

  • Performance: The library struggles with graphs that have several thousand nodes. I recommend igraph instead, although it does not have explicit support for hypergraphs. It does offer functionality for bipartite graphs, though. I believe if no hyperedge is fully contained in another, you can work with a bipartite graph that is isomorphic to your given hypergraph?
  • I encountered an issue in which the ordering of nodes would not be deterministic, i.e. if you constructed the same graph several times and iterated over the nodes, they would be given to you in different orders. This can probably be worked around.