Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solver failed error for bilinear terms #15

Open
smehdia opened this issue Nov 23, 2019 · 0 comments
Open

Solver failed error for bilinear terms #15

smehdia opened this issue Nov 23, 2019 · 0 comments

Comments

@smehdia
Copy link

smehdia commented Nov 23, 2019

When a bilinear product is used in your example, CVXOPT solver fails:

from numpy.random import randn
import cvxpy as cvx
from qcqp import *
n, m = 10, 15
A = randn(m, n)
b = randn(m, 1)
x = cvx.Variable(n)
obj = cvx.sum_squares(A*x - b)
cons = [cvx.square(x) == 1]
cons.extend([x[0]*x[1] == 1])
prob = cvx.Problem(cvx.Minimize(obj), cons)
qcqp = QCQP(prob)
qcqp.suggest(SDR)
print("SDR lower bound: %.3f" % qcqp.sdr_bound)
f_cd, v_cd = qcqp.improve(COORD_DESCENT)
print("Coordinate descent: objective %.3f, violation %.3f" % (f_cd, v_cd))
print(x.value)

Output:

`  File "/usr/local/lib/python3.6/dist-packages/qcqp/qcqp.py", line 391, in suggest
    self.sdr_sol, self.sdr_bound = solve_sdr(self.qcqp_form, *args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/qcqp/qcqp.py", line 92, in solve_sdr
    rel_prob.solve(*args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/cvxpy/problems/problem.py", line 209, in solve
    return self._solve(*args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/cvxpy/problems/problem.py", line 335, in _solve
    self._update_problem_state(results_dict, sym_data, solver)
  File "/usr/local/lib/python3.6/dist-packages/cvxpy/problems/problem.py", line 447, in _update_problem_state
    "Solver '%s' failed. Try another solver." % solver.name())
cvxpy.error.SolverError: Solver 'CVXOPT' failed. Try another solver.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant