def test_compare1(self): # input = [[34, 36, 37], [48, 51, 52], [31, 32, 34], [31, 32, 38, 39], [21, 48, 49, 52], [28, 29, 30, 31, 32], [9, 26, 27, 28, 29, 30, 53, 54], [26, 27, 28, 29, 30, 36, 37, 38, 39], [28, 29, 30, 36, 37, 38, 39, 40, 43], [26, 27, 28, 29, 30, 40, 41, 43, 44, 45]] m = GreedyMaxCover() result1 = m.solve(input) #print MaxCover.length_of_total_elements(result) #print result # 15 #self.assertTrue(MaxCover.length_of_total_elements(result) == 34) m = BrutalForceMaxCover() result2 = m.solve_list_input(input) #print MaxCover.length_of_total_elements(result) #print result2 #self.assertTrue(MaxCover.length_of_total_elements(result) == 34) self.assertEqual(result1, result2)
def test_greedy_maxcover_from_world2(self): m = GreedyMaxCover() result = m.solve(world2) print MaxCover.length_of_total_elements(result)
def test_greedy_maxcover_from_world1(self): m = GreedyMaxCover() result = m.solve(world1) self.assertTrue(MaxCover.length_of_total_elements(result) == 34)
def test_compare2(self): m = GreedyMaxCover() result1 = m.solve(data1) print MaxCover.length_of_total_elements(data1) print MaxCover.length_of_total_elements(result1)