예제 #1
0
    def test_bs_ensure_result_is_tree(self):
        params = pkl.load(
            open(make_path('test/data/quota_test_cases/params.pkl')))[0]

        root = params['roots'][0]
        preprune_secs = params['preprune_secs']
        mg = IU.get_topic_meta_graph_from_synthetic(
            make_path('test/data/quota_test_cases/interactions.json'),
            preprune_secs)
        dag = IU.get_rooted_subgraph_within_timespan(mg, root, preprune_secs)
        t = charikar_algo(dag, root, dag.nodes(), k=20, level=2)
        assert_true(nx.is_arborescence(t))
예제 #2
0
    def test_bs_ensure_result_is_tree(self):
        params = pkl.load(
            open(make_path('test/data/quota_test_cases/params.pkl'))
        )[0]

        root = params['roots'][0]
        preprune_secs = params['preprune_secs']
        mg = IU.get_topic_meta_graph_from_synthetic(
            make_path('test/data/quota_test_cases/interactions.json'),
            preprune_secs            
        )
        dag = IU.get_rooted_subgraph_within_timespan(
            mg, root, preprune_secs
        )
        t = charikar_algo(dag, root, dag.nodes(),
                          k=20, level=2)
        assert_true(nx.is_arborescence(t))