Viewing Hypergraphs in SageMath

124 Views Asked by At

I am trying to visualise the hyperedges of the complete 3-uniform hypergraph on 13 vertices, so then I can colour them. I am aware that it will be busy and incomprehensible, but that is the point I am trying to show.

I have tried manually creating the hypergraph using Tikz in LaTex, but there are too many edges and I wondered if there was a way in SageMath.

1

There are 1 best solutions below

0
On

As you observe, drawing hypergraphs is tricky in general if you are looking for tidy intuitive and clean drawings. I think (but please correct me if I am wrong) that, since you are expecting the picture to be too noisy, part of your question is about automating it because your hypergraph has 286 hyperedges.

Mathematica has a function CommunityGraphPlot which I have seen used to make pretty nice hypergraph drawings. As far as I can tell Sagemath does not have a direct equivalent, but you might be able to use some of the code used to make a Venn diagram in Sagemath.

There has been some discussion and work to add hypergraph visualization to the Graphviz Graph Visualization Tools. SageMath has an interface to Graphviz. Alternatively there is a python graphviz library (confusingly given the same name as the non-python software it is interfacing to) to interface with Graphviz and it could be imported and used in SageMath.

Alessandro Angioi has some good discussion of ways to visualize hypergraphs with python

P.J. Rogers has a site dedicated to thinking about ways to automate drawing Venn diagrams

R also has a package eulerr which can be used to visualize set systems. It can be utilized from within Sagemath.