示例#1
0
    def test_FI(self):
	print("---FI---")
        for i in range(0, COUNT+1):
            base.print_graph_name(PREFIX, i)
            G = Graph(eval(PREFIX+".V_"+str(i)), eval(PREFIX+".E_"+str(i)))
            T, w = tdlib.fillIn_decomp(G)
            self.assertEqual(tdlib.is_valid_treedecomposition(G, T), True)
示例#2
0
 def test_FI(self):
     print("---FI---")
     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.fillIn_decomp(G)
         self.assertEqual(tdlib.is_valid_treedecomposition(G, T), True)
示例#3
0
 def test_fillIn_decomp_8(self):
     for i in range(0, 10):
         V, E = randomGNP(20, 0.2)
         G = Graph(V, E)
         T, w = tdlib.fillIn_decomp(G)
         self.assertEqual(tdlib.is_valid_treedecomposition(G, T), True)
示例#4
0
 def test_fillIn_decomp_7(self):
     G = Graph(V_Grid_5_5, E_Grid_5_5)
     T, w = tdlib.fillIn_decomp(G)
     self.assertEqual(tdlib.is_valid_treedecomposition(G, T), True)
     self.assertEqual(w, 5)
示例#5
0
 def test_fillIn_decomp_6(self):
     G = Graph(V_Pappus, E_Pappus)
     T, w = tdlib.fillIn_decomp(G)
     self.assertEqual(tdlib.is_valid_treedecomposition(G, T), True)
     self.assertEqual(w, 6)
示例#6
0
 def test_fillIn_decomp_5(self):
     G = Graph(V_Wagner, E_Wagner)
     T, w = tdlib.fillIn_decomp(G)
     self.assertEqual(tdlib.is_valid_treedecomposition(G, T), True)
     self.assertEqual(w, 4)
示例#7
0
 def test_fillIn_decomp_4(self):
     G = Graph(V_Petersen_double, E_Petersen_double)
     T, w = tdlib.fillIn_decomp(G)
     self.assertEqual(tdlib.is_valid_treedecomposition(G, T), True)
     self.assertEqual(w, 4)
示例#8
0
 def test_fillIn_decomp_0(self):
     for V, E in cornercases:
         G = Graph(V, E)
         T, w = tdlib.fillIn_decomp(G)
         self.assertEqual(tdlib.is_valid_treedecomposition(G, T), True)