def hasConnectedBoundaries(code, loops_graph, Exts):
if len(loops_graph.edges()) <= 1:
return False
for ext1 in loops_graph.nodes():
for ext2 in loops_graph.nodes():
if ext1 in Exts and ext2 in Exts and ext1 != ext2:
if nx.has_path(loops_graph,ext1,ext2):
path = nx.shortest_path(loops_graph, ext1, ext2)
for node in path:
if node not in Exts:
return True
return False
评论列表
文章目录