Questions tagged [cvxopt]

A Python package for convex optimization, including solvers for linear programming, quadratic programming, semidefinite programming and more.

There is an official web site of the CVXOPT package. The official description of the package is given there as follows:

CVXOPT is a free software package for convex optimization based on the Python programming language. It can be used with the interactive Python interpreter, on the command line by executing Python scripts, or integrated in other software via Python extension modules. Its main purpose is to make the development of software for convex optimization applications straightforward by building on Python’s extensive standard library and on the strengths of Python as a high-level programming language.

227 questions
14
votes
1 answer

CVXOPT with only equality constraints

I am trying the following as learning exercise in CVXOPT. I have made minor modifications to the example code here by removing the inequality constraints and adding few more equality constraints. from cvxopt import solvers, blas, matrix, spmatrix,…
Zanam
  • 4,607
  • 13
  • 67
  • 143
14
votes
4 answers

CVXOPT QP Solver: TypeError: 'A' must be a 'd' matrix with 1000 columns

I'm trying to use the CVXOPT qp solver to compute the Lagrange Multipliers for a Support Vector Machine def svm(X, Y, c): m = len(X) P = matrix(np.dot(Y, Y.T) * np.dot(X, X.T)) q = matrix(np.ones(m) * -1) g1 =…
Utumbu
  • 432
  • 3
  • 7
  • 18
14
votes
2 answers

How to silent cvxopt solver [Python]?

Whenever I run Python cvsopt solver in terminal, it will print: pcost dcost gap pres dres 0: -8.0742e+00 -7.3715e+00 3e+03 5e+01 4e-15 1: -6.6241e-01 -7.2834e+00 7e+01 1e+00 3e-15 ...... Optimal solution found. Can I…
user2558887
12
votes
0 answers

Warm-start linear programming in Python?

I'm working on an mid-sized linear program (70k x 10k sparse constraint matrix) and need to run a large number of scenarios, requiring ~2,000 CPU-hours at my current solve time. Because the changes are relatively minor (changing at most ~10% of the…
emunsing
  • 9,536
  • 3
  • 23
  • 29
12
votes
1 answer

From CVX to CVXPY or CVXOPT

I've been trying to pass some code from Matlab to Python. I have the same convex optimization problem working on Matlab but I'm having problems passing it to either CVXPY or CVXOPT. n = 1000; i = 20; y = rand(n,1); A = rand(n,i); cvx_begin variable…
silgon
  • 6,890
  • 7
  • 46
  • 67
11
votes
4 answers

Maximum volume inscribed ellipsoid in a polytope/set of points

Later Edit: I uploaded here a sample of my original data. It's actually a segmentation image in the DICOM format. The volume of this structure as it is it's ~ 16 mL, so I assume the inner ellipsoid volume should be smaller than that. to extract the…
RMS
  • 1,350
  • 5
  • 18
  • 35
9
votes
2 answers

How to install cvxopt on on windows 10 on python 3.6

How do I install cvxopt on windows 10 on python 3.6? When running conda install cvxopt Fetching package metadata ........... Solving package specifications: . UnsatisfiableError: The following specifications were found to be in conflict: -…
Trexion Kameha
  • 3,362
  • 10
  • 34
  • 60
8
votes
2 answers

how Python cvxopt solvers qp basically works

I want to use cvxopt solvers qp and compute Lagrange multiplier but I wonder how it works "exactly". I was trying to find more information but there is not much information about cvxopt out there. I was looking at this example problem and I am not…
harumomo503
  • 371
  • 1
  • 7
  • 16
7
votes
1 answer

What are the specific reasons for CVXPY to throw `SolverError` exception?

I am using CVXPY (version 1.0) to solve a quadratic program (QP) and I often get this exception: SolverError: Solver 'xxx' failed. Try another solver. which makes my program really fragile. I have tried different solvers, including CVXOPT, OSQP,…
7
votes
1 answer

Stochastic Optimization in Python

I am trying to combine cvxopt (an optimization solver) and PyMC (a sampler) to solve convex stochastic optimization problems. For reference, installing both packages with pip is straightforward: pip install cvxopt pip install pymc Both packages…
Amelio Vazquez-Reina
  • 91,494
  • 132
  • 359
  • 564
6
votes
3 answers

How to use GLPK with cvxopt in Windows 10?

I use 64 bit Windows 10. I downloaded glpk-4.64 for Windows. I unzipped the file to my documents. I added the w64 path in this folder to Windows' environment variables. I check if the glpk works in command line by executing…
alwbtc
  • 28,057
  • 62
  • 134
  • 188
6
votes
0 answers

python least squares regression modification to objective function

Least squares regression is defined as the minimization of the sum of squared residuals e.g. Minimize(sum_squares(X * beta - y)) However, I'd like to propose a slight modification such that we are still minimizing the…
Michael
  • 7,087
  • 21
  • 52
  • 81
6
votes
3 answers

sum of absolute values constraint in semi definite programming

I want to further my real world semi definite programming optimization problem with a constraint on sum of absolute values. For example: abs(x1) + abs(x2) + abs(x3) <= 10. I have searched internet and documentation but could not find a way to…
user2593973
6
votes
3 answers

scipy sparse matrix to cvxopt spmatrix?

I need to convert a scipy sparse matrix to cvxopt's sparse matrix format, spmatrix, and haven't come across anything yet (the matrix is too big to be converted to dense, of course). Any ideas how to do this?
5
votes
1 answer

How to invert a matrix of variables in cvxpy?

How do I invert a matrix of variables in cvxpy? I have a matrix of problem variables defined as follows: import cvxpy as cp A = cp.Variable(2,2) and I want to solve a program with an objective function involving the inverse of this matrix. I have…
DLim
  • 93
  • 5
1
2 3
15 16