Optimization ModelsΒΆ
PyEPO trains predict-then-optimize models with a linear objective and unknown cost coefficients: only the cost is predicted, while the constraints are fixed.
optModel is the interface that PyEPO trains against. It wraps an optimization solver or algorithm behind a setObj / solve contract. There are two ways to create one. For linear and integer programs supported by the DSL, define the problem with pyepo.dsl and compile it to a backend (DSL Models). For a custom algorithm or constraint generation, write an optModel subclass directly (Custom Models).
PyEPO also ships built-in models for shortest path, knapsack, traveling salesperson, capacitated vehicle routing, and portfolio problems, ready to pair with generated data (Built-in Models).
For a runnable walkthrough, see the 01 Optimization Model notebook.