コード例 #1
0
 def test_min_vertex_cover(self):
     print("---minVertexCover--")
     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.minDegree_decomp(G)
         S = tdlib.min_vertex_cover_with_treedecomposition(G, T, True, True)
コード例 #2
0
ファイル: test_apps.py プロジェクト: jamesjer/tdlib
 def test_min_vertex_cover_with_treedecomposition_0d(self):
     V, E = cornercases[3]
     G = Graph(V, E)
     T, w = tdlib.PP_FI_TM(G)
     s, S = tdlib.min_vertex_cover_with_treedecomposition(G, T)
     self.assertEqual(len(S), 4)
     self.assertEqual(len(S), s)
コード例 #3
0
ファイル: test_apps.py プロジェクト: zbhuang/tdlib
 def test_min_vertex_cover_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_vertex_cover_with_treedecomposition(G, T)
コード例 #4
0
 def test_min_vertex_cover(self):
     print("---minVertexCover--")
     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.minDegree_decomp(G)
         S = tdlib.min_vertex_cover_with_treedecomposition(G, T, True, True)
コード例 #5
0
ファイル: test_apps.py プロジェクト: jamesjer/tdlib
 def test_min_vertex_cover_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_FI_TM(G)
             s, S = tdlib.min_vertex_cover_with_treedecomposition(G, T)
             self.assertEqual(len(S), s)
             self.assertEqual(len(S), s)
コード例 #6
0
ファイル: test_Zoo.py プロジェクト: llarisch/VC
    def test_min_vertex_cover(self):
        print("---vertex_cover---")
        for i in range(0, COUNT + 1):
            if base.skip(PREFIX, i, lambda x, y: y > 2000):
                print("skip.. ")
                base.print_graph_name(PREFIX, i)
                continue

            base.print_graph_name(PREFIX, i)
            G = Graph(eval(PREFIX + ".V_" + str(i)),
                      eval(PREFIX + ".E_" + str(i)))
            T, w = tdlib.minDegree_decomp(G)
            if w > 17:
                print("...tw > 17, skipping...")
                continue

            S = tdlib.min_vertex_cover_with_treedecomposition(G, T)
コード例 #7
0
ファイル: test_long_apps_Zoo.py プロジェクト: freetdi/tdlib
    def test_min_vertex_cover(self):
        print("---vertex_cover---")
        for i in range(0, COUNT+1):
            if i == 91:
                 continue

            if base.skip(PREFIX, i, lambda x,y: y > 10000):
                continue

            base.print_graph_name(PREFIX, i)
            G = Graph(eval(PREFIX+".V_"+str(i)), eval(PREFIX+".E_"+str(i)))
            T, w = tdlib.minDegree_decomp(G)
            if w > 25:
                print("...tw > 25, skipping...")
                continue

            S = tdlib.min_vertex_cover_with_treedecomposition(G, T)
            print(str(S))
コード例 #8
0
ファイル: test_apps.py プロジェクト: jamesjer/tdlib
 def test_min_vertex_cover_with_treedecomposition_7(self):
     G = Graph(V_Grid_5_5, E_Grid_5_5)
     T, w = tdlib.PP_FI_TM(G)
     s, S = tdlib.min_vertex_cover_with_treedecomposition(G, T)
     self.assertEqual(len(S), 12)
     self.assertEqual(len(S), s)
コード例 #9
0
ファイル: test_apps.py プロジェクト: jamesjer/tdlib
 def test_min_vertex_cover_with_treedecomposition_6(self):
     G = Graph(V_Pappus, E_Pappus)
     T, w = tdlib.PP_FI_TM(G)
     s, S = tdlib.min_vertex_cover_with_treedecomposition(G, T)
     self.assertEqual(len(S), 9)
     self.assertEqual(len(S), s)
コード例 #10
0
ファイル: test_apps.py プロジェクト: jamesjer/tdlib
 def test_min_vertex_cover_with_treedecomposition_5(self):
     G = Graph(V_Wagner, E_Wagner)
     T, w = tdlib.PP_FI_TM(G)
     s, S = tdlib.min_vertex_cover_with_treedecomposition(G, T)
     self.assertEqual(len(S), 5)
     self.assertEqual(len(S), s)
コード例 #11
0
ファイル: test_apps.py プロジェクト: jamesjer/tdlib
 def test_min_vertex_cover_with_treedecomposition_4(self):
     G = Graph(V_Petersen_double, E_Petersen_double)
     T, w = tdlib.PP_FI_TM(G)
     s, S = tdlib.min_vertex_cover_with_treedecomposition(G, T)
     self.assertEqual(len(S), 12)
     self.assertEqual(len(S), s)
コード例 #12
0
ファイル: test_apps.py プロジェクト: zbhuang/tdlib
 def test_min_vertex_cover_with_treedecomposition_3(self):
     G = Graph(V_Petersen, E_Petersen)
     T, w = tdlib.PP_MD(G)
     S = tdlib.min_vertex_cover_with_treedecomposition(G, T)
     self.assertEqual(len(S), 6)
コード例 #13
0
ファイル: test_apps.py プロジェクト: zbhuang/tdlib
 def test_min_vertex_cover_with_treedecomposition_2(self):
     G = Graph(V_K5, E_K5)
     T, w = tdlib.PP_MD(G)
     S = tdlib.min_vertex_cover_with_treedecomposition(G, T)
     self.assertEqual(len(S), 4)
コード例 #14
0
ファイル: test_apps.py プロジェクト: zbhuang/tdlib
 def test_min_vertex_cover_with_treedecomposition_0c(self):
     V, E = cornercases[2]
     G = Graph(V, E)
     T, w = tdlib.PP_MD(G)
     S = tdlib.min_vertex_cover_with_treedecomposition(G, T)
     self.assertEqual(len(S), 0)