Lazy Constraints Violated

55 views
Skip to first unread message

Andres Collart

unread,
Nov 19, 2015, 8:30:28 PM11/19/15
to Gurobi Optimization
Hi,

I'm new to using lazy constraints and am trying out this simple one with a multi-resource constrained scheduling problem. However, when I run the code to compute violations after getting the "optimal" solution, I find that more violations are still found. Any ideas why this could be? The code I'm using to compute violations both during the lazy constraint and after the solution are exactly the same.


def resource_constr(m,where):
    if where == GRB.callback.MIPSOL or where== GRB.Callback.MIPNODE:
        print "LAZY"
 
        #Do some stuff to compute violations....  

        #Basically this set you found is not possible. S[a,t] is binary.
        if len(violations)>0:
            m.cbLazy(quicksum(S[a,t] for (a,t) in selected)<=len(selected)-1)


Thoughts on what could be breaking this? I really appreciate the help.

Thanks,
Andres

Sonja Mars

unread,
Nov 20, 2015, 4:31:44 AM11/20/15
to gur...@googlegroups.com
Hi,

Please take a lot at this post:
https://groups.google.com/forum/#!searchin/gurobi/adding$20multiple$20lazy$20constraints/gurobi/6PqcldtKEcw/CBIJxxK6AAAJ

Thanks and best regards,
Sonja

-----------------------------------------------------------------
Dr. Sonja Mars
Gurobi Optimization


Andres Collart

unread,
Nov 20, 2015, 6:43:35 PM11/20/15
to Gurobi Optimization
Hi,

Thank you Sonja, that fixed it. I wasn't eliminating every infeasibility on each callback.
Reply all
Reply to author
Forward
0 new messages