remove_cycle_edges_by_hierarchy.py 文件源码

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

项目:breaking_cycles_in_noisy_hierarchies 作者: zhenv5 项目源码 文件源码
def remove_cycle_edges_strategies(graph_file,nodes_score_dict,score_name = "socialagony"):


    g = nx.read_edgelist(graph_file,create_using = nx.DiGraph(),nodetype = int)
    # greedy
    e1 = scc_based_to_remove_cycle_edges_iterately(g,nodes_score_dict)
    g = nx.read_edgelist(graph_file,create_using = nx.DiGraph(),nodetype = int)
    # forward
    e2 = remove_cycle_edges_BF_iterately(g,nodes_score_dict,is_Forward = True,score_name = score_name)
    # backward
    g = nx.read_edgelist(graph_file,create_using = nx.DiGraph(),nodetype = int)
    e3 = remove_cycle_edges_BF_iterately(g,nodes_score_dict,is_Forward = False,score_name = score_name)
    return e1,e2,e3
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号