I am trying to Minimize the following function using the Python API of Gurobi 9.0.0
min ||A*x||_1 - ||B*x||_1
for x in [-1,1]^n
This cost function is not convex and thererfore not as easy to compute as in https://support.gurobi.com/hc/en-us/community/posts/360056614871-L1-norm-in-objective-function
Depending on the values of the two matrices, the minimal value of the loss may be 0 (with x=0) or negative. I previosly tried to solve the optimization problem in Matlab using the Yalmip wrapper and a nonconvex solver (bmibnb), which works as expected. Now i have problems solving it in Python.
Since the 1-Norm is not supported in the API, I try to model it as a sum of absolute values. My idea was to introduce new variables (MLinVar) with the following constraints
yA = A*x
yB = B*x
zA = abs(yA)
zB = abs(yB)
But unfortunately, the absolute value does not work for the MVar nor for the individual elements of it (zA = abs(yA).
Is there another way how to optimize this function?
Please sign in to leave a comment.