# Remove the obsolete nodes
if result:
# Magic removal process
- print result
- print group
-
+ res_nodes = [r[0] for r in result]
+ remove = []
+ for n in group[0]:
+ if n not in res_nodes:
+ remove.append(n)
+
+ indices = []
+ for i, k in enumerate(self.subgraphs['none'][0]):
+ if k[0] in remove:
+ indices.insert(0, i)
+ for i in indices:
+ del(self.subgraphs['none'][0][i])
+ indices = []
+ for i, c in enumerate(self.subgraphs['none'][1]):
+ if c[0] in remove or c[1] in remove:
+ indices.insert(0, i)
+ for i in indices:
+ del(self.subgraphs['none'][1][i])
def process_multipath(self, path):
"""Looks for possible merge candidates
# Magic
pass
-
def walk(self, current, conn, currents=[], strings=[], vis=set()):
"""Walk the graph and keep track of vis conn