def test_that_relaxed_solution_with_some_variables_fixed_is_correctly_calculated(
         self):
     bnb = BranchAndBound(self.input_data_4)
     fixed_vars = [1, 0, np.nan, np.nan]
     solution = bnb.relaxed_solution(fixed_variables=np.array(fixed_vars))
     expected_solution = [1, 0, 7 / 8, 0]
     self.assertEqual(expected_solution, list(solution))
 def test_that_infeasible_solution_returns_empty_array(self):
     bnb = BranchAndBound(self.input_data_4)
     fixed_vars = [1, 1, 0, 1]
     solution = bnb.relaxed_solution(fixed_variables=np.array(fixed_vars))
     self.assertListEqual([], list(solution))
 def test_that_relaxed_solution_with_all_variables_fixed_is_correctly_calculated(
         self):
     bnb = BranchAndBound(self.input_data_4)
     fixed_vars = [1, 1, 0, 0]
     solution = bnb.relaxed_solution(fixed_variables=np.array(fixed_vars))
     self.assertListEqual(fixed_vars, list(solution))