# Graph polynomial construction

I wish to construct the graph polynomial (as given here) of any given graph. To do so, I wrote the following code. But, the output was null. What needs to be modified in the following code to get the appropriate graph polynomial (the product of binomials corresponding each edge):

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

Thanks beforehand.