I am running an optimization in Gurobi which crashes whenever I add a quadratic constraint to the problem that I generate thru the following lines of code:
expression = gurobipy.QuadExpr()
for course_key in hostings:
for kitchen_key in hostings[course_key]:
if not hostings[course_key][kitchen_key].large_gathering:
expression.add(x[kitchen_key,course_key,team_key1]*x[kitchen_key,course_key,team_key2])
mod.addQConstr(expression,gurobipy.GRB.LESS_EQUAL,1,"1MeetingPerPair_"+team_key1+"_"+team_key2)
The optimization always crashes after three iterations:
with the following error message:
Unhandled exception at 0x00007FFC596CE6FC (ntdll.dll) in python.exe:
0xC0000374: A heap has been corrupted (parameters: 0x00007FF8FF82C6E0).
Does anyone have any clue as to how this problem could be solved? I am rather clueless as to what the error message even wants to tell me. I tried constructing the constraint in different ways (e. g. using .add instead of .addTerms) but that didn't change anything. Appreciate any help!
User contributions licensed under CC BY-SA 3.0