[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-glpk] Remove constraint
From: |
Nilo Cesar Teixeira |
Subject: |
Re: [Help-glpk] Remove constraint |
Date: |
Wed, 2 Nov 2011 14:20:33 -0200 |
Try 'fr[r]..1 by -1'
The by makes it count in reverse order.
(page 16 of manual, Arithmetic set).
2011/11/2 Kasper Tordrup
<address@hidden>
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
_______________________________________________
Help-glpk mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/help-glpk
--
Nilo Cesar Teixeira
address@hidden
(55) (11) 8571-5314