help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-glpk] Remove constraint


From: Kasper Tordrup
Subject: [Help-glpk] Remove constraint
Date: Wed, 2 Nov 2011 14:46:57 +0100

Hi Guys
I came across a weird bug or maybe it was just me that was doing something stupid.
I had this constraint:
s.t. overlap1{r in R, j in fr[r]..1}: sum{s in S, i in max(1,j-hs[s]+1)..j} x[s,r,i] <= 1;
but GLPK kept violating it. I tried making the sum in the end of my .mod file (after solve;) and I could see that there was a clear violation.
I could see in my shell that it was generating the constraint, but when I checked the output file there was no values for overlap1 like it has just ignored the constraint?
I then played a little with the constraint and changed it to:
s.t. overlap1{r in R, j in 1..fr[r]}: sum{s in S, i in max(1,j-hs[s]+1)..j} x[s,r,i] <= 1;
only changed "fr[r]..1" to "1..fr[r]" and now it works perfectly. Is there some logical explanation that I'm missing?

Best regards,
Kasper

reply via email to

[Prev in Thread] Current Thread [Next in Thread]