save_lp

save_lp(model: Model, filename: str | PathLike, allow_constant: bool = True) → None

Save a model to an LP file.

パラメータ:
  • model (Model) -- Model to write.

  • filename (str | PathLike) -- Output file path.

  • allow_constant (bool) -- Whether to allow a constant term in the objective function. Defaults to True.

例外:

RuntimeError -- If the model is invalid for the LP format (e.g., contains degree 3 or higher, or has invalid variable names / constraint labels).