I am trying to get my head around using hypergraphs in pygraph, the following is a simple example I inserted:
hgr = hypergraph()
hgr.add_nodes(["A1", "B1", "C1", "D1"])
hgr.add_nodes(["A2", "B2", "C2", "D2"])
hgr.add_nodes(["A3", "B3", "C3", "D3"])
hgr.add_nodes(["A4", "B4", "C4", "D4"])
hgr.add_hyperedge(("A1", "A2", "A3", "A4"))
hgr.add_hyperedge(("B1", "B2", "B3", "B4"))
hgr.add_hyperedge(("C1", "C2", "C3", "C4"))
hgr.add_hyperedge(("D1", "D2", "D3", "D4"))
h_dot = write(hgr)
h_gvv = gv.readstring(h_dot)
gv.layout(h_gvv,'dot')
gv.render(h_gvv, 'png', 'hypergraph.png')
The image I am getting is (click to see full size version):
Please verify that this is the correct way to create hypergraphs using pygraph.
Much appreciated!