def test_generate_paths_generates_whole_path(self):
     g = self._createBaseGraph([(1,2),(2,3),(3,4)])
     all_paths = list(graph_utils.generate_paths(g, 1,4))
     self.assertEqual(len(all_paths), 1)
     self.assertEqual([1,2,3,4], list(graph_utils.generate_paths(g, 1,4))[0])
示例#2
0
 def __init__(self, problem_description, tester):
     super(BruteForceGCGTSolver, self).__init__(problem_description, tester)
     self.path_generator = graph_utils.generate_paths(
         self.graph, self.source, self.sink)
示例#3
0
 def test_generate_paths_generates_whole_path(self):
     g = self._createBaseGraph([(1, 2), (2, 3), (3, 4)])
     all_paths = list(graph_utils.generate_paths(g, 1, 4))
     self.assertEqual(len(all_paths), 1)
     self.assertEqual([1, 2, 3, 4],
                      list(graph_utils.generate_paths(g, 1, 4))[0])
 def __init__(self, problem_description, tester):
     super(BruteForceGCGTSolver, self).__init__(problem_description, tester)
     self.path_generator = graph_utils.generate_paths(self.graph, self.source, self.sink)