test_bubbles.py 文件源码

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

项目:phasm 作者: AbeelLab 项目源码 文件源码
def test_graph_to_dag(test_graph):
    logger = logging.getLogger('graph_to_dag')
    g = test_graph

    for partition, acyclic in partition_graph(g):
        if acyclic:
            continue

        dag, dfs_tree = graph_to_dag(partition)

        logger.debug("%s", dag.nodes())
        logger.debug("%s", dag.edges())
        logger.debug("DFS nodes: %s", dfs_tree.nodes())
        logger.debug("DFS edges: %s", dfs_tree.edges())

        assert networkx.is_directed_acyclic_graph(dag)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号