Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python Library to create and visualize HyperGraph

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.

like image 824
Ashik Vetrivelu Avatar asked Oct 08 '17 19:10

Ashik Vetrivelu


People also ask

What is a hypergraph database?

A hypergraph is a graph data model in which a relationship (called a hyperedge) can connect any number of given nodes. While a property graph permits a relationship to have only one start node and one end node, the hypergraph model allows any number of nodes at either end of a relationship.


2 Answers

  • 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.

like image 137
Ebrahim Byagowi Avatar answered Oct 27 '22 00:10

Ebrahim Byagowi


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.
like image 43
ngmir Avatar answered Oct 26 '22 22:10

ngmir