Thanks to visit codestin.com
Credit goes to github.com

Skip to content

DOC: providing initial guess is not supported #2912

@ischurov

Description

@ischurov

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 value field 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

No one assigned

    Labels

    documentationgood first issuehelp wantedWe would appreciate contributions for this issue! A CVXPY member will provide guidance.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions