Hello,
I'm trying to solve an LP, and with certain inputs I get the message, "Warning for adding constraints: zero or small (< 1e-13) coefficients, ignored." Here's the code where I'm adding the problematic constraints. This is a snippet from inside a larger function. self.m is the model, var is a Gurobi variable, and then I'm printing weight and on_virt_link.
logger.info(DASHES*3)
self.m.addConstr(var == weight * on_virt_link, name=cname)
self.m.update()
logger.info("just added constraint %s with weight %s and on_virt_link = %s"
% (cname, weight, on_virt_link))
logger.info("max coefficient: %s" % self.m.maxcoeff)
logger.info("min coefficient: %s" % self.m.mincoeff)
logger.info("max bound: %s" % self.m.maxbound)
logger.info("min bound: %s" % self.m.minbound)
logger.info(DASHES*3)
Here's the log file for the first constraint that produces a warning:
---------------------------------------------------------------------
Warning for adding constraints: zero or small (< 1e-13) coefficients, ignored
just added constraint 818_path_weight_521(5,16,1,3,21) with weight 1.0 and
on_virt_link = gurobi.LinExpr: Z_818521(5,16,1,3,21) + Z_818521(5,16,10,3,21) + Z_818521(5,16,1,7,21) + Z_818521(5,16,10,17,7,21)
max coefficient: 5000.0
min coefficient: 0.0262601362977
max bound: 0.0
min bound: 0.0
---------------------------------------------------------------------
I don't see how this constraint has zero or small coefficients? The only coefficient is weight, and its value is 1.0. I'd greatly appreciate any help.
Jennifer Gossels