Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The code required the following modifications after which it worked smoothly:

def grappoly(G):
   R=PolynomialRing(ZZ,['x_'+str(k) for k in G.vertices()])
   R.inject_variables()
   P=1
   for i,j in G.edges(labels=false):
       P=(R('x_'+str(i))-R('x_'+str(j)))*P 
   return P           
X=graphs.CompleteBipartiteGraph(5,5)
grappoly(X)