Gurobi taking too long (?) to set up problem with enormous matrix
AnsweredI'm a beginner Gurobi user, so apologies if there is a trivial solution that I'm not aware of.
I have a giant real constant matrix B, with dimensions on the order of 10^11 by 10^11 but which is very sparse. I am trying to minimize f(x) = Bx + c_1, where c is a constant vector and x is a realvalued vector. Here is how I currently have this problem set up (in Gurobipy):
Define realvalued vector x with no constraints
Define realvalued vector N with constraints
(c + B @ x) * (c + B @ x) <= N * N
0 <= N
Minimize the objective function ones @ N, where ones is a vector of 1's (i.e. minimize the sum of the components of N).
When I try to run my Python script, it seems that it never makes it past the setup step. I added print statements after key lines of code, and they show that the variable x is set up correctly. However, due to the computing cluster that I'm running it on, it's unclear to me whether it gets stuck trying to set up N and the constraints, or whether the problem is somewhere else. The file for the giant matrix B is about 7 GB, but it seems to load fine into the program.
Anyone have any ideas what the problem could be?

Hi Ming,
Your code doesn't seem consistent with the definition of  . _1.
I think the fastest way of creating the model you want is to first define this "auxiliary model":
min 0
s.t.
Bx = cA feasible solution to this model would be one where Bx + c_1 = 0, and in general won't exist. But if you then use the feasRelaxS method, with
relaxobjtype=0
minrelax=False
vrelax=False
crelax=Truethen the resulting model will be equivalent to min Bx + c_1.
 Riley
0
Please sign in to leave a comment.
Comments
1 comment