Python Library to create and visualize HyperGraph

  • MGtoolkit and its paper
  • pygraph
  • halp
  • 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.

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.