save_lpΒΆ
- save_lp(model: Model, filename: str | os.PathLike, allow_constant: bool = True) NoneΒΆ
Save a model to an LP file.
- Parameters:
model (Model) β Model to write.
filename (str | os.PathLike) β Output file path.
allow_constant (bool) β Whether to allow a constant term in the objective function. Defaults to
True.
- Raises:
RuntimeError β If the model is invalid for the LP format (e.g., contains degree 3 or higher, or has invalid variable names / constraint labels).