All pastes #506414 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-05-23 23:28 UTC
rendered paste body
#Python type psuedocode for finding all 

N = subgraphsize
V = list
subGraph = []
def findSubGraph(v, n):
    subGraph.append(v)
    if n == N:
        doSomethingWithSubgraph()
    for w in V[v+1:]:
        if w is connected to v:
            findSubGraph(w, n+1)
    subGraph.pop()

for v in V:
    findSubGraph(v,1)