cvxpy: Unable to link cvxpy to SCIP
Describe the bug I need to solve a non-linear MIP problem, so I installed pyscipopt. Though, after importing the package, cvxpy still cannot find the SCIP solver.
To Reproduce
import pyscipopt
import numpy as np
import cvxpy as cp
x = np.arange(100)
y = 5 * x**2 - 3 * x + 4
v = cp.Variable(integer=True)
problem = cp.Problem(cp.Minimize(cp.sum_squares(y - v)))
problem.solve(solver=cp.SCIP)
Expected behavior The problem should be solved by SCIP.
Output
SolverError:
CVXPY needs additional software (a `mixed-integer solver`) to handle this model. The web documentation https://www.cvxpy.org/tutorial/advanced/index.html#mixed-integer-programs reviews open-source and commercial options for mixed-integer solvers. Quick fix: if you install the python package CVXOPT (pip install cvxopt), then CVXPY can use the open-source mixed-integer solver `GLPK`.
Version
- OS: Windows 10 64-bits
- CVXPY Version: 1.1.3
About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 26
The practical problem with large numbers is that computers work in finite-precision arithmetic. This introduces rounding errors into operations as innocuous as addition, multiplication, division, and subtraction. Such rounding errors can cause very reliable algorithms to fail if a problem is badly scaled.
There is also a fun fact about convex optimization theory on this topic: the runtime of provably-correct algorithms for convex optimization – even linear programming – depend on the number of bits required to represent a problem. So if you have a problem that requires accurate representation of numbers spanning huge orders of magnitude then even the best algorithms would be sensitive to problem scale. (This isn’t relevant in practice since practically all numerical solvers are designed to use IEEE double precision arithmetic.)