Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Graph plotting not working properly

Consider the following code:

def Sier(g):
h = Graph()
for i in range(1, g.order() + 1):
    perm = {u: (i, u) for u in g}
    gg = g.relabel(perm=perm, inplace=False)
    h.add_edges(gg.edges())
return h
f=Sier(graphs.CompleteGraph(4))
v=f.vertices()
n1=[((a,b),(b,a)) for (a,b) in v]
n2=[(a,a),(a,a)) for (a,b) in v]
x=set(n1)-set(n2)
z=f.add_edges(x)
z.plot()

The plot function does not give the graph I desire. The size() function gives the size correctly. But the diagram is incorrect. Why is this? Any workarounds to make it precise? Thanks beforehand.

Graph plotting not working properly

Consider the following code:

def Sier(g):
 h = Graph()
 for i in range(1, g.order() + 1):
     perm = {u: (i, u) for u in g}
     gg = g.relabel(perm=perm, inplace=False)
     h.add_edges(gg.edges())
 return h
f=Sier(graphs.CompleteGraph(4))
v=f.vertices()
n1=[((a,b),(b,a)) 
f = Sier(graphs.CompleteGraph(4))
v = f.vertices()
n1 = [((a, b), (b, a)) for (a,b) a, b in v]
n2=[(a,a),(a,a)) n2 = [(a, a), (a, a)) for (a,b) a, b in v]
x=set(n1)-set(n2)
z=f.add_edges(x)
x = set(n1) - set(n2)
z = f.add_edges(x)
z.plot()

The plot function does not give the graph I desire. desire. The size() function gives the size correctly. correctly. But the diagram is incorrect. Why is this? this? Any workarounds to make it precise? Thanks beforehand.precise?