Пример #1
0
 def test_triangulation_all_heuristics(self):
     i = 2
     while True:
         graph = UndirectedGraph([(0, 1), (0, 3), (0, 8), (1, 2), (1, 4), (1, 8),
                                     (2, 4), (2, 6), (2, 7), (3, 8), (3, 9), (4, 7),
                                     (4, 8), (5, 8), (5, 9), (5, 10), (6, 7), (7, 10),
                                     (8, 10)])
         #graph.read_simple_format("test_graphs/graph")
         #print(i)
         ret = graph.jt_techniques(i, False, True)
         if not ret:
             break
         self.assertTrue(graph.is_triangulated())
         i += 1
Пример #2
0
 def test_jt_from_chordal_graph(self):
     #small triangulated graph
     graph = UndirectedGraph([(0, 1), (1, 2), (2, 0), (3, 4),
                                 (4, 5), (5, 3), (0, 3)])
     ret = graph.jt_techniques(0, True, True)
     self.assertTrue(ret.is_triangulated())