I'm getting really frustrated using the pygraph library for building hypergraphs with Python.
I'm trying to link two different nodes (75, 69) to a hyperedge (31), and then link that hyperedge to other two different nodes (71, 70).
i.e: (75,69) ---> (31) ---> (71,70)
So:
h = hypergraph()
h.add_nodes(['75','69','71','70'])
h.add_hyperedges(['31'])
h.link('71', '31')
h.link('70', '31')
That linked the hyperedge to nodes 70 and 71. But I don't know how to link the first two nodes to the hyperedge since link()
only accepts node
and hyperedge
as parameters in this order, and that only lets me link the hyperedge to a node and not vice versa (node to hyperedge).