Reduce n_pairs
in brsmatch()
when too many are specified
#18
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.