Backend for problem reformulation classes.
- class picos.reforms.reformulation.Reformulation(theObject)¶
Base class for problem reformulations.
Abstract base class for a reformulation from one (possibly already reformulated) problem form to another.
- abstract backward(solution)¶
Translate back a solution from reformulated to original problem.
Reformulate the problem and obtain a solution from the result.
For this to work there needs to be a solver instance at the end of the reformulation pipeline, which would implement its own version of this method that actually solves the problem and produces the first solution.
- abstract forward()¶
Perform the initial problem reformulation.
Implementations are supposed to do the necessary bookkeeping so that
backwardcan transform a solution to the new problem back to a solution of the original problem.
- abstract classmethod predict(footprint)¶
Predict the reformulation’s effect on a problem footprint.
Given a problem footprint, returns another problem footprint that a problem with the former one would be reformulated to.
This is used to predict the effects of a reformulation when planning a solution strategy without the cost of actually transforming a problem.
Reset the pipeline from this reformulation onward.
This is done whenever a reformulation does not implement
updateso that succeeding reformulations do not attempt to update a problem which was completely rewritten as this may be inefficient.
- abstract classmethod supports(footprint)¶
Whether the reformulation affects problems with the given footprint.
The reformulation must support every problem with such a footprint and the resulting problem should have a changed footprint.
- abstract update()¶
Update a previous problem reformulation.
NotImplementedError – If performing an update is not feasible for the reformulation.
- property input¶
The input problem.
The output problem.
The next reformulation in the pipeline.
- property verbosity¶
Verbosity level of the reformulation; same as for input problem.