Skip to contents

Constructs a convex optimization problem from an objective and a list of constraints. Use psolve to solve the problem.

Usage

Problem(objective, constraints = list())

Arguments

objective

A Minimize or Maximize object.

constraints

A list of Constraint objects (e.g., created by ==, <=, >= operators on expressions). Defaults to an empty list (unconstrained).

Value

A Problem object.

Known limitations

  • Problems must contain at least one Variable. Zero-variable problems (e.g., minimizing a constant) will cause an internal error in the reduction pipeline.

Examples

x <- Variable(2)
prob <- Problem(Minimize(sum_entries(x)), list(x >= 1))