for i in xrange(N):
var = [A[i,k] for k in xrange(p)]
m.addConstr(quicksum(var[k]*w[k] for k in xrange(p))<=b[i])
I have found using LinExpr to be faster.
for i in xrange(N):
var = [A[i,k] for k in xrange(p)]
m.addConstr(LinExpr([(w[k], var[k]) for k in xrange(p)])<=b[i])
> We are basically just adding linear inequality constraints of the form Ax<=b, where A is ~100K \times 100K, non-sparse...If A really isn't sparse, it is going to take significant time to add a coefficient matrix with 1e10 nonzeros.
--
---
You received this message because you are subscribed to the Google Groups "Gurobi Optimization" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gurobi+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
...can I use parallel for loop to add the constraints?