コード例 #1
0
 def test_that_infeasible_solution_is_identified(self):
     bnb = BranchAndBound(self.input_data_4)
     infeasible_solution = [1, 1, 1, 0]
     result = bnb.feasible(np.array(infeasible_solution))
     self.assertEqual(result, False)
コード例 #2
0
 def test_that_feasible_solution_is_returned(self):
     bnb = BranchAndBound(self.input_data_4)
     feasible_solution = [1, 0, 0, 1]
     result = bnb.feasible(np.array(feasible_solution))
     self.assertEqual(result, True)