-
Notifications
You must be signed in to change notification settings - Fork 0
Improving Hinting (Documentation) #2
Description
This issue is intended to document some recent work on the nodeprices branch in this fork of the package.
Summary
The most recent batch of commits, concluding with this attempts move the needle on improving functionality around providing hints. Specifically, they contain some updates to how feasibility is tracked and returned to users. These updates, as they stand, should be seen as experimental and a work in progress for reasons detailed below. These updates are primarily targeted at this issue on the main repo.
I should note that these changes do not explicitly address the linked issue, but upon resolving the issues of these updates, a fix to subproblemSuccess() should become trivial. As of now, the current version of the nodeprices branch also passes existing tests.
Major features of these updates
This round of updates offers the following set of features
- Explicit tracking of subproblem feasibility. That is, there is always a subproblems table and it always returns TRUE or FALSE regarding feasibility. This subproblems table should be reliable, even in the code's current form. One other selling point here is that feasibility is now set only within
fmatch.Rand not higher up the stack anywhere. fullmatch()andpairmatch()always return and MCFSolutions attribute with reliable information about subproblem feasibility.
Issues with these updates
Prior code had a multi-pronged approach for dealing with feasibility. Specified subproblems could be either 1) feasible 2) infeasible and never handed to the solver or 3) infeasible but passed to the solver. If a subproblem fell into (1) or (3), an MCFSolutions object was passed back to the end user. If it fell into (2), there was not. As such, checking feasibility using just this metadata required checking the existence of an MCFSolutions object, as well as explicitly checking the subproblems table if it did exist.
I opted to try implementing a UI where an MCFSolutions object is always returned with a result and where feasibility is always explicitly listed in the subproblems table. The logic here was to streamline the internal logic about feasibility and the UI -- no broader wisdom at work here.
It turns out that explicitly returning an MCFSolutions raises some questions and problems that I've only hastily papered over here. A (likely incomplete) list of some things to be dealt with:
-
It's unclear if there should be any difference between subproblems that are determined to be infeasible prior to being passed to the solver and infeasible problems that are determined to be so by the solver. For one, subproblems in the former camp might be ill-specified to the point of not being able to create a sensible MCFSolutions object. As an example, what should be done if a subproblem with no viable treatment or control units is passed? More generally, should nodes/arc/bookkeeping always be returned when the subproblem is infeasible?
-
It's possible that existing constructors/class definitions will need to be updated to deal with the implications of (1). For instance, in certain cases, I've opted to set both
flowandcapacityto 0 when the subproblem is infeasible in order to please the class-checking standards. Another example: MCFSolutions objects that only contain a filled out subproblems table seem to break at the concatenation stage. For now, I've used workarounds to please the existing class definitions/constructors, but some of these choices might not make substantive sense. For instance, Including nonsensical arcs from end and sink nodes to themselves in the "bookkeeping" table when subproblems are empty. While the subproblems table can be trusted, the other slots currently cannot be (unless the problem is feasible).
Instances of where 1 and 2 are relevant should be documented with comments in the code, primarily in fmatch.R, solve_reg_fm_prob.R and fullmatch.R
In short, we need to think through what to return -- either as an MCFSolutions object or something similar -- when problems are infeasible.