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
0
votes
0 answers

CVXPY violates constraints when it solves SDP

Let's say that I want to solve the following problem. minimize Tr(CY) s.t. Y = xxT x is 0 or 1. where xxT indicates an outer product of n-1 dimension vector x. C is a n-1 by n-1 square matrix. To convert this problem to a problem with a single…
StandTall
  • 13
  • 1
  • 4
0
votes
0 answers

Convex Optimization: cvxpy solver issue

I'm solving a simple convex optimisation problem as follows: import numpy as np import cvxpy as cp from cvxopt import solvers #Problem: A diet problem where we minimize the cost of meal while keeping in mind the calories and vitamin constraints. #…
Pranav
  • 3
  • 4
0
votes
0 answers

How to use decision variable in the exponential term while using CVXPY?

The objective function of my optimization problem involves the exponential function of the decision variables. My code is import cvxpy as cp import numpy as np import math A = np.array([0.805156521,0.464522,0.00452762,0.00047562]) Zmax = 200 Zmin =…
0
votes
1 answer

SolverError: The solver CVXOPT is not installed. But cp.installed_solvers() show it is installed

Describe the bug Linear mixed-integer solver problem is failing with CVXOPT (or other solvers, same problems). Execute "print(cp.installed_solvers())" show these solvers installed. ['CVXOPT', 'ECOS', 'ECOS_BB', 'GLPK', 'GLPK_MI', 'GUROBI', 'OSQP',…
0
votes
0 answers

how can get rid of "ValueError: all the input array dimensions except for the concatenation axis must match exactly" error when use cvxopt function?

first i define some matrix and vector in proper shape . initialization I=np.eye(24) Z=np.zeros((24,24)) a=0.012 b=1.1 gamma1=0.9/80 gamma2=1.1/80 MM=np.eye(24) for i in range (22): MM[i+1,i]=-1 MM[0,23]=-1 M=random.randint(200,300,…
0
votes
1 answer

cvxpy -> OSQP or cvxpy -> CVXOPT how does it work under the hood?

I have the following simple program: import numpy as np import cvxpy as cp np.random.seed(0) n = 100 i = 20 y = np.random.rand(n) A = np.random.rand(i, n).T x = cp.Variable(n) lmbd = cp.Variable(i) objective = cp.Minimize(cp.sum_squares(x -…
silgon
  • 6,890
  • 7
  • 46
  • 67
0
votes
1 answer

Why can't I use Solver qpsolver anymore?

I just coded a quadratic programming and it has worked very well but after the someday it works not at all. Does anyone have any idea what the problem is? My code is: import time import numpy as np from numpy import array, dot from qpsolvers…
0
votes
1 answer

how can I use a solve cvxopt in Julia?

Hi I'm trying to use a solver cvxopt in Julia. So I made a code like this: @time begin using PyCall using Pkg ENV["PYTHON"]="" Pkg.add("CVXOPT") Pkg.test("CVXOPT") using Compat.SparseArrays using…
0
votes
0 answers

Dot used with entries in integer programming with cvxopt.glpk

from cvxopt import matrix from cvxopt.glpk import ilp c = [1, 1, 1, 1, 1, 1, 1] A_ineq = [[-1., 0., 0., -1., -1., -1., -1.], [-1., -1., 0., 0., -1., -1., -1.], [-1., -1., -1., 0., 0., -1., -1.], [-1., -1., -1., -1., 0., 0., -1.], [-1., -1., -1.,…
Emad
  • 155
  • 1
  • 7
0
votes
1 answer

How can I disable the log output from GLPK solver in cvxopt?

Here's an example linear programming problem using cvxopt. from cvxopt import matrix, solvers import numpy as np c = matrix(np.array([0] * m + [-1]).astype(float)) G = matrix(np.array(G_np).astype(float)) h = matrix(np.array([0] *…
Jared Nielsen
  • 3,669
  • 9
  • 25
  • 36
0
votes
1 answer

cvxpy integer variable - exclude certain integer values from the solution

I have the following problem and I can't figure out if cvxpy can do what I need. Context: I optimize portfolios. When buying bonds and optimizing the quantity of each bond to buy, it's only possible to buy each bond only in multiples of 1,000…
Angelo
  • 1,594
  • 5
  • 17
  • 50
0
votes
1 answer

max_iters doesn't seem to work with GLPK_MI solver in Python

I'm debugging my code right now and since it's running with some datas and not with other ones, I wanted to set the 'max_iters' option to 1 to see if it works in only 1 iteration or if it needs more. I realised it doesn't seem to even use it. I…
Simon F.-Smith
  • 781
  • 3
  • 8
0
votes
2 answers

How to install CVXOPT in VS code

Trying to install CVXOPT in VS code it fails every time ,so far I have tried installing using wheel file, tar file, just pip install, pip install --user and others, but fails every time with the same error that I don't have an idea of. (env) PS…
Katya Pas
  • 33
  • 6
0
votes
1 answer

Simple Symbolic LP problem to Matrix form

I solved a linear programming problem and here is my symbolic form code. import cvxpy as cp import numpy as np x11 = cp.Variable(nonneg=True) x12 = cp.Variable(nonneg=True) x21 = cp.Variable(nonneg=True) x22 = cp.Variable(nonneg=True) x31 =…
hoan
  • 13
  • 5
0
votes
1 answer

How to plot the non-linear decision boundary using the parameters obtained from the cvxopt.solvers?

I attempting to understand the SVM from here. While understanding the kernels I came across the following plot. (plotted by me as per the data given in here) By using this data and cvxopt.solvers I obtained the parameter w and b. using the…
Anil Sarode
  • 175
  • 13