pygraph

Using hypergraphs in pygraph, need verification that example is correct

坚强是说给别人听的谎言 提交于 2019-12-06 14:56:09
问题 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

Using hypergraphs in pygraph, need verification that example is correct

旧街凉风 提交于 2019-12-04 21:56:19
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

How to get the coordinates from layout from graphviz?

回眸只為那壹抹淺笑 提交于 2019-12-04 03:31:19
问题 I have been working with pygraph on some project. I completed this example, it works fine. Now, the problem is the following: the graph is drawn in a picture format (gif). What I need is to get the actual coordinates for each node for the graph layout shown on the gif image. How do I do this? I've been trying and trying, but couldn't find solution to this problem. I thought the the problem's solution would be somehow with manipulating one of the two following lines: gv.layout(gvv,'dot') gv