This solution will iteratively try the optimization problem with the user-specified n_pairs, and check whether the solution is valid. If no solution, n_pairs is reduced by one and the problem is attempted again. Repeat until convergence.
We assume that Gurobi and GLPK can quickly determine if a problem is infeasible. If not, this solution could add a lot of run-time, but this is still better than leaving the user with no solution and no warning.
In an ideal world, the warning would specify which exact match cohort we are working in, but will leave that for future update.
Fixes #11
This solution will iteratively try the optimization problem with the user-specified
n_pairs
, and check whether the solution is valid. If no solution,n_pairs
is reduced by one and the problem is attempted again. Repeat until convergence.The solution is untested with the Gurobi solver, since my license has lapsed, but the documentation at https://www.gurobi.com/documentation/current/refman/r_grb.html indicates when the solution is found. Tests are added for this case regardless.
We assume that Gurobi and GLPK can quickly determine if a problem is infeasible. If not, this solution could add a lot of run-time, but this is still better than leaving the user with no solution and no warning.
In an ideal world, the warning would specify which exact match cohort we are working in, but will leave that for future update.