Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def build(G, T):
- for x in T:
- if not T.has(x):
- continue
- for y in G:
- if T.has(y):
- continue
- if G[(x, y)] == 'Y':
- T.add((x, y, 'Y'));
- checkResult = CheckLoop(T)
- if(checkResult.hasXEdge):
- if(xCount < T.xCount):
- T.remove(checkResult.getXEdge())
- return
- else
- T.remove((x, y, 'Y'))
- return
- def buildSpanningTree(G, xCount):
- T = MakeSpanningForest(G)
- for i in range(0, G.size):
- rebuild(G, T)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement