Learn R Programming

CVXR (version 1.9.1)

Problem: Create an Optimization Problem

Description

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

Usage

Problem(objective, constraints = list())

Value

A Problem object.

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).

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

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

Run the code above in your browser using DataLab