예제 #1
0
 def test_PP_MD(self):
     print("---PP_MD---")
     for i in range(0, COUNT+1):
         G = Graph(eval(PREFIX+".V_"+str(i)), eval(PREFIX+".E_"+str(i)))
         base.print_graph_name(PREFIX, i)
         T, w = tdlib.PP_MD(G)
         self.assertEqual(tdlib.is_valid_treedecomposition(G, T), True)
예제 #2
0
파일: test_apps.py 프로젝트: zbhuang/tdlib
 def test_max_clique_with_treedecomposition_8(self):
     for n in range(0, 13):
         for i in range(0, 10):
             V, E = randomGNP(n, 0.2)
             G = Graph(V, E)
             T, w = tdlib.PP_MD(G)
             S = tdlib.max_clique_with_treedecomposition(G, T)
예제 #3
0
파일: test_apps.py 프로젝트: jamesjer/tdlib
 def test_min_dominating_set_with_treedecomposition_0c(self):
     V, E = cornercases[2]
     G = Graph(V, E)
     T, w = tdlib.PP_MD(G)
     s, S = tdlib.min_dominating_set_with_treedecomposition(G, T)
     self.assertEqual(len(S), 5)
     self.assertEqual(len(S), s)
예제 #4
0
파일: test_apps.py 프로젝트: jamesjer/tdlib
 def test_min_coloring_with_treedecomposition_0d(self):
     V, E = cornercases[3]
     G = Graph(V, E)
     T, w = tdlib.PP_MD(G)
     s, S = tdlib.min_coloring_with_treedecomposition(G, T)
     self.assertEqual(len(S), 5)
     self.assertEqual(len(S), s)
예제 #5
0
 def test_PP_MD_8(self):
     for n in range(0, 13):
         for i in range(0, 10):
             V, E = randomGNP(n, 0.2)
             G = Graph(V, E)
             T, w = tdlib.PP_MD(G)
             self.assertEqual(tdlib.is_valid_treedecomposition(G, T), True)
예제 #6
0
파일: test_apps.py 프로젝트: zbhuang/tdlib
 def test_min_dominating_set_with_treedecomposition_8(self):
     for n in range(0, 13):
         for i in range(0, 10):
             V, E = randomGNP(n, 0.2)
             G = Graph(V, E)
             T, w = tdlib.PP_MD(G)
             S = tdlib.min_dominating_set_with_treedecomposition(G, T)
예제 #7
0
파일: test_misc.py 프로젝트: zbhuang/tdlib
 def test_conversion_0(self):
     for V, E in cornercases:
         G = Graph(V, E)
         T, w = tdlib.PP_MD(G)
         O = tdlib.treedec_to_ordering(T)
         T, w = tdlib.ordering_to_treedec(G, O)
         self.assertEqual(tdlib.is_valid_treedecomposition(G, T), True)
예제 #8
0
파일: test_apps.py 프로젝트: jamesjer/tdlib
 def test_min_coloring_with_treedecomposition_8(self):
     for n in range(0, 13):
         for i in range(0, 10):
             V, E = randomGNP(n, 0.2)
             G = Graph(V, E)
             T, w = tdlib.PP_MD(G)
             s, S = tdlib.min_coloring_with_treedecomposition(G, T)
             self.assertEqual(len(S), s)
예제 #9
0
파일: test_misc.py 프로젝트: zbhuang/tdlib
 def test_conversion_8(self):
     for i in range(0, 10):
         V, E = randomGNP(20, 0.2)
         G = Graph(V, E)
         T, w = tdlib.PP_MD(G)
         self.assertTrue(tdlib.is_valid_treedecomposition(G, T))
         O = tdlib.treedec_to_ordering(T)
         T, w = tdlib.ordering_to_treedec(G, O)
         self.assertEqual(tdlib.is_valid_treedecomposition(G, T), True)
예제 #10
0
파일: test_apps.py 프로젝트: jamesjer/tdlib
 def test_min_dominating_set_with_treedecomposition_3(self):
     G = Graph(V_Petersen, E_Petersen)
     T, w = tdlib.PP_MD(G)
     s, S = tdlib.min_dominating_set_with_treedecomposition(G, T)
     self.assertEqual(len(S), 3)
     self.assertEqual(len(S), s)
예제 #11
0
파일: test_apps.py 프로젝트: jamesjer/tdlib
 def test_min_dominating_set_with_treedecomposition_2(self):
     G = Graph(V_K5, E_K5)
     T, w = tdlib.PP_MD(G)
     s, S = tdlib.min_dominating_set_with_treedecomposition(G, T)
     self.assertEqual(len(S), 1)
     self.assertEqual(len(S), s)
예제 #12
0
파일: test_apps.py 프로젝트: zbhuang/tdlib
 def test_min_dominating_set_with_treedecomposition_4(self):
     G = Graph(V_Petersen_double, E_Petersen_double)
     T, w = tdlib.PP_MD(G)
     S = tdlib.min_dominating_set_with_treedecomposition(G, T)
     self.assertEqual(len(S), 6)
예제 #13
0
파일: test_apps.py 프로젝트: jamesjer/tdlib
 def test_max_independent_set_with_treedecomposition_4(self):
     G = Graph(V_Petersen_double, E_Petersen_double)
     T, w = tdlib.PP_MD(G)
     s, S = tdlib.max_independent_set_with_treedecomposition(G, T)
     self.assertEqual(s, 8)
     self.assertEqual(len(S), s)
예제 #14
0
파일: test_apps.py 프로젝트: zbhuang/tdlib
 def test_max_clique_with_treedecomposition_0d(self):
     V, E = cornercases[3]
     G = Graph(V, E)
     T, w = tdlib.PP_MD(G)
     S = tdlib.max_clique_with_treedecomposition(G, T)
     self.assertEqual(len(S), 5)
예제 #15
0
파일: test_apps.py 프로젝트: jamesjer/tdlib
 def test_min_coloring_with_treedecomposition_7(self):
     G = Graph(V_Grid_5_5, E_Grid_5_5)
     T, w = tdlib.PP_MD(G)
     s, S = tdlib.min_coloring_with_treedecomposition(G, T)
     self.assertEqual(len(S), 2)
     self.assertEqual(len(S), s)
예제 #16
0
파일: test_apps.py 프로젝트: jamesjer/tdlib
 def test_min_coloring_with_treedecomposition_5(self):
     G = Graph(V_Wagner, E_Wagner)
     T, w = tdlib.PP_MD(G)
     s, S = tdlib.min_coloring_with_treedecomposition(G, T)
     self.assertEqual(len(S), 3)
     self.assertEqual(len(S), s)
예제 #17
0
파일: test_apps.py 프로젝트: zbhuang/tdlib
 def test_min_dominating_set_with_treedecomposition_6(self):
     G = Graph(V_Pappus, E_Pappus)
     T, w = tdlib.PP_MD(G)
     S = tdlib.min_dominating_set_with_treedecomposition(G, T)
     self.assertEqual(len(S), 5)
예제 #18
0
파일: test_apps.py 프로젝트: zbhuang/tdlib
 def test_max_clique_with_treedecomposition_5(self):
     G = Graph(V_Wagner, E_Wagner)
     T, w = tdlib.PP_MD(G)
     S = tdlib.max_clique_with_treedecomposition(G, T)
     self.assertEqual(len(S), 2)
예제 #19
0
파일: test_apps.py 프로젝트: zbhuang/tdlib
 def test_max_clique_with_treedecomposition_6(self):
     G = Graph(V_Pappus, E_Pappus)
     T, w = tdlib.PP_MD(G)
     S = tdlib.max_clique_with_treedecomposition(G, T)
     self.assertEqual(len(S), 2)
예제 #20
0
파일: test_apps.py 프로젝트: zbhuang/tdlib
 def test_max_clique_with_treedecomposition_4(self):
     G = Graph(V_Petersen_double, E_Petersen_double)
     T, w = tdlib.PP_MD(G)
     S = tdlib.max_clique_with_treedecomposition(G, T)
     self.assertEqual(len(S), 2)
예제 #21
0
파일: test_apps.py 프로젝트: zbhuang/tdlib
 def test_min_coloring_with_treedecomposition_3(self):
     G = Graph(V_Petersen, E_Petersen)
     T, w = tdlib.PP_MD(G)
     S = tdlib.min_coloring_with_treedecomposition(G, T)
     self.assertEqual(len(S), 3)
예제 #22
0
파일: test_apps.py 프로젝트: zbhuang/tdlib
 def test_min_coloring_with_treedecomposition_2(self):
     G = Graph(V_K5, E_K5)
     T, w = tdlib.PP_MD(G)
     S = tdlib.min_coloring_with_treedecomposition(G, T)
     self.assertEqual(len(S), 5)
예제 #23
0
파일: test_apps.py 프로젝트: zbhuang/tdlib
 def test_min_vertex_cover_with_treedecomposition_7(self):
     G = Graph(V_Grid_5_5, E_Grid_5_5)
     T, w = tdlib.PP_MD(G)
     S = tdlib.min_vertex_cover_with_treedecomposition(G, T)
     self.assertEqual(len(S), 12)
예제 #24
0
파일: test_apps.py 프로젝트: zbhuang/tdlib
 def test_max_independent_set_with_treedecomposition_0c(self):
     V, E = cornercases[2]
     G = Graph(V, E)
     T, w = tdlib.PP_MD(G)
     S = tdlib.max_independent_set_with_treedecomposition(G, T)
     self.assertEqual(len(S), 5)
예제 #25
0
파일: test_apps.py 프로젝트: jamesjer/tdlib
 def test_min_coloring_with_treedecomposition_4(self):
     G = Graph(V_Petersen_double, E_Petersen_double)
     T, w = tdlib.PP_MD(G)
     s, S = tdlib.min_coloring_with_treedecomposition(G, T)
     self.assertEqual(len(S), 3)
     self.assertEqual(len(S), s)
예제 #26
0
파일: test_apps.py 프로젝트: zbhuang/tdlib
 def test_min_dominating_set_with_treedecomposition_5(self):
     G = Graph(V_Wagner, E_Wagner)
     T, w = tdlib.PP_MD(G)
     S = tdlib.min_dominating_set_with_treedecomposition(G, T)
     self.assertEqual(len(S), 3)
예제 #27
0
파일: test_apps.py 프로젝트: jamesjer/tdlib
 def test_min_coloring_with_treedecomposition_6(self):
     G = Graph(V_Pappus, E_Pappus)
     T, w = tdlib.PP_MD(G)
     s, S = tdlib.min_coloring_with_treedecomposition(G, T)
     self.assertEqual(len(S), 2)
     self.assertEqual(len(S), s)
예제 #28
0
파일: test_apps.py 프로젝트: jamesjer/tdlib
 def test_max_independent_set_with_treedecomposition_2(self):
     G = Graph(V_K5, E_K5)
     T, w = tdlib.PP_MD(G)
     s, S = tdlib.max_independent_set_with_treedecomposition(G, T)
     self.assertEqual(s, 1)
     self.assertEqual(len(S), s)
예제 #29
0
파일: test_apps.py 프로젝트: zbhuang/tdlib
 def test_max_clique_with_treedecomposition_7(self):
     G = Graph(V_Grid_5_5, E_Grid_5_5)
     T, w = tdlib.PP_MD(G)
     S = tdlib.max_clique_with_treedecomposition(G, T)
     self.assertEqual(len(S), 2)
예제 #30
0
파일: test_apps.py 프로젝트: zbhuang/tdlib
 def test_min_dominating_set_with_treedecomposition_7(self):
     G = Graph(V_Grid_5_5, E_Grid_5_5)
     T, w = tdlib.PP_MD(G)
     S = tdlib.min_dominating_set_with_treedecomposition(G, T)
     self.assertEqual(len(S), 7)