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)
评论列表
文章目录