-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
documentationgood first issuehelp wantedWe would appreciate contributions for this issue! A CVXPY member will provide guidance.We would appreciate contributions for this issue! A CVXPY member will provide guidance.
Description
Is your feature request related to a problem? Please describe.
The documentation suggests:
Warm start can also be used to provide an initial guess the first time a problem is solved. The initial guess is constructed from the
valuefield of the problem variables.
It seems to be incorrect, as per #1355, e.g. (modified from here):
import cvxpy as cvx
# Examples: linear programming
# Create two scalar optimization variables.
x = cvx.Variable(value=0.5)
y = cvx.Variable(value=0.5)
# Create 4 constraints.
constraints = [x >= 0, y >= 0, x + y >= 1, 2 * x + y >= 1]
# Form objective.
obj = cvx.Minimize(x + y)
# Form and solve problem.
prob = cvx.Problem(obj, constraints)
prob.solve(warm_start=True) # Returns the optimal value.
print("status:", prob.status)
print("optimal value", prob.value)
print("optimal var", x.value, y.value)
# status: optimal
# optimal value 1.0000000021945776
# optimal var 0.4971185775945734 0.5028814246000043
Expected to obtain a solution (0.5, 0.5) with smaller objective value (1.0) if (x.value, y.value) is used as an initial guess.
So, the documentation seems to be misleading and needs to be updated.
Describe the solution you'd like
I believe the documentation should explicitly mention that warm_start=True cannot be used to provide the initial guess by the user, up until this support is implemented.
Metadata
Metadata
Assignees
Labels
documentationgood first issuehelp wantedWe would appreciate contributions for this issue! A CVXPY member will provide guidance.We would appreciate contributions for this issue! A CVXPY member will provide guidance.