s_c_c.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:breaking_cycles_in_noisy_hierarchies 作者: zhenv5 项目源码 文件源码
def get_big_sccs(g):
    self_loop_edges = g.selfloop_edges()
    g.remove_edges_from(g.selfloop_edges())
    num_big_sccs = 0
    edges_to_be_removed = []
    big_sccs = []
    for sub in nx.strongly_connected_component_subgraphs(g):
        number_of_nodes = sub.number_of_nodes()
        if number_of_nodes >= 2:
            # strongly connected components
            num_big_sccs += 1
            big_sccs.append(sub)
    #print(" # big sccs: %d" % (num_big_sccs))
    return big_sccs
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号