cvxgrp/cvxportfolio

Feature request: Add constraint priority with automatic resolution into soft-constraints

Opened this issue · 1 comments

Rationale
Only primal infeasibility benefits from managing the problem formulation. Dual infeasibility (unboundedness) is typically due to bugs in the user syntax. Primal infeasibility instead should have an automatic exception handling procedure.

Idea is simple; use the order of constraints provided by the user as priority, and add an option to SPO/MPO to automatically try to turn each constraint into soft-constraint, starting from the lowest priority one, in case of infeasibility. Option could be the soft-constraint multiplier, by default plus infinity (meaning don't use this procedure).

All pieces should be there, I think the way I factored the compile_to_cvxpy code separate from initialize_estimator should make this really easy and self-contained, as well as how I designed the constraint base classes. It needs a deep look into all pieces to make sure there is no implicit assumption that the method execution order is the default one, but it probably is all fine.

Edit: one complication actually. In MPO, constraints are duplicated for all forward planning steps (in the simplest case), or specified differently for each step. It's not clear how to make constraint priority easily specified in the latter case. The latter case should probably not be supported by this procedure. (I only included it because it was the original 2016 formulation.) Better bookkeeping should be defined in the MPO class for mapping the user syntax into compiled program.