def test_optimal_solution(self): sol = partition.solve_partition_greedy([1, 2, 3, 6]) p1, p2 = sol self.assertNotEqual(p1, p2) expected_partitioning = [{0, 1, 2}, {3}] assert set(p1) in expected_partitioning assert set(p2) in expected_partitioning
def test_suboptimal_solution(self): sol = partition.solve_partition_greedy([4, 5, 6, 7, 8]) p1, p2 = sol self.assertNotEqual(p1, p2) expected_partitioning = [{0, 1, 4}, {2, 3}] assert set(p1) in expected_partitioning assert set(p2) in expected_partitioning