| 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)
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.