# Builds all k-edge subgraphs of G, up to isomorphism
def SUBGRAPHS(G,k):
E = Set(G.edges())
SUB = []
for s in Subsets(E,k):
H = Graph()
H.add_edges(s)
Hcan = H.canonical_label()
if Hcan not in SUB:
SUB.append(Hcan)
return SUB
# Returns 1 if there is a k-edge subgraph of G which is H-free and 0 otherwise
# Note that ex(G,H)