Beispiel #1
0
 def test_minimalChordal_8(self):
     for i in range(0, 10):
         V, E = randomGNP(20, 0.2)
         G = Graph(V, E)
         T, w = tdlib.trivial_decomposition(G)
         T, w = tdlib.minimalChordal_decomp(G, T)
         self.assertEqual(tdlib.is_valid_treedecomposition(G, T), True)
Beispiel #2
0
 def test_minimalChordal_8(self):
     for i in range(0, 10):
         V, E = randomGNP(20, 0.2)
         G = Graph(V, E)
         T, w = tdlib.trivial_decomposition(G)
         T, w = tdlib.minimalChordal_decomp(G, T)
         self.assertEqual(tdlib.is_valid_treedecomposition(G, T), True)
Beispiel #3
0
 def test_minimalChordal_trivial(self):
     print("---minimalChordal_trivial---")
     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)
         T1, w1 = tdlib.trivial_decomposition(G)
         T2, w2 = tdlib.minimalChordal_decomp(G, T1)
         self.assertEqual(tdlib.is_valid_treedecomposition(G, T2), True)
 def test_minimalChordal_trivial(self):
     print("---minimalChordal (trivial)---")
     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)))
         T1, w1 = tdlib.trivial_decomposition(G)
         T2, w2 = tdlib.minimalChordal_decomp(G, T1)
         self.assertEqual(tdlib.is_valid_treedecomposition(G, T2), True)
Beispiel #5
0
 def test_minimalChordal_4(self):
     G = Graph(V_Petersen_double, E_Petersen_double)
     T, w = tdlib.trivial_decomposition(G)
     T, w = tdlib.minimalChordal_decomp(G, T)
     self.assertEqual(tdlib.is_valid_treedecomposition(G, T), True)
     self.assertEqual(w, 4)
Beispiel #6
0
 def test_minimalChordal_2(self):
     G = Graph(V_K5, E_K5)
     T, w = tdlib.trivial_decomposition(G)
     T, w = tdlib.minimalChordal_decomp(G, T)
     self.assertEqual(tdlib.is_valid_treedecomposition(G, T), True)
     self.assertEqual(w, 4)
Beispiel #7
0
 def test_minimalChordal_0(self):
     for V, E in cornercases:
         G = Graph(V, E)
         T, w = tdlib.trivial_decomposition(G)
         T, w = tdlib.minimalChordal_decomp(G, T)
         self.assertEqual(tdlib.is_valid_treedecomposition(G, T), True)
Beispiel #8
0
 def test_minimalChordal_4(self):
     G = Graph(V_Petersen_double, E_Petersen_double)
     T, w = tdlib.trivial_decomposition(G)
     T, w = tdlib.minimalChordal_decomp(G, T)
     self.assertEqual(tdlib.is_valid_treedecomposition(G, T), True)
     self.assertEqual(w, 4)
Beispiel #9
0
 def test_minimalChordal_2(self):
     G = Graph(V_K5, E_K5)
     T, w = tdlib.trivial_decomposition(G)
     T, w = tdlib.minimalChordal_decomp(G, T)
     self.assertEqual(tdlib.is_valid_treedecomposition(G, T), True)
     self.assertEqual(w, 4)
Beispiel #10
0
 def test_minimalChordal_0(self):
     for V, E in cornercases:
         G = Graph(V, E)
         T, w = tdlib.trivial_decomposition(G)
         T, w = tdlib.minimalChordal_decomp(G, T)
         self.assertEqual(tdlib.is_valid_treedecomposition(G, T), True)