pyoptexplain: A Python Library for Post-Optimality Analysis and Explanation of Optimization Models
Abstract
Optimization models are built in a variety of modeling languages and solved by a variety of solvers, but once a solution exists, the information needed to understand it is fragmented: each solver exposes a partial, differently named set of native diagnostics, and the modeling language has already canonicalized the formulation the user wrote.
We present pyoptexplain, a practitioner-first Python library for post-optimality analysis of optimization models that sits above this layer.
It adapts a model authored in any of five modeling front ends, namely cvxpy, Pyomo, gurobipy, docplex, and OR-Tools, into a normalized internal representation, solves it through a choice of backends, and answers the why and what-if questions of an optimization decision through one uniform interface.
The design rests on two observations.
First, a post-optimality quantity requested from different backends for the same problem can come back as an exception, a structurally meaningless zero or a basis-dependent value that disagrees across solvers, so reporting whatever one solver returns is unreliable. pyoptexplain reports a quantity only when both the representation and the chosen backend can justify it, and does not approximate unavailable information.
Second, repeated scenario analysis can amortize its cost by extracting the model once and reusing a warm solver session across a batch of scenarios. pyoptexplain builds a single scalable what-if interface, uniform across its modeling languages and backends and returning a certified report for every scenario, at a cost within a small constant factor of the bare solver.
A reproducible computational study substantiates both claims.
Source code is available at this https URL and installation can be done through the Python Package Index this https URL.
이 뉴스, 어떠셨어요?
탭 한 번으로 반응 · 로그인 불필요