def _remove_cycles(self):
"""
Really hacky way to remove cycles in hierarchies (wtf).
"""
G = self.make_graph()
cycles = list(networkx.simple_cycles(G))
if not cycles:
return False
else:
cycles[0][0].looped = True
cycles[0][0].sources[:] = [ ]
return True
评论列表
文章目录