Open hakank opened 3 years ago
Sorry that is a small error on my side. Good catch. A fix is on its way. Unfortunately my solver has quite some troubles solving it at the moment.Not sure why yet but I see that I need more testing with reified constraints for objective functions.
Thanks again for the issue and the testing of my solver. It's a long way to go to make it really usable as it's a massive project but I enjoy the journey.
The optimal solution is limit = 3
, right? I'm a bit confused why it takes so long when optimizing. When setting limit to <= 2
it's immediately infeasible for obvious reasons but the bound computed is always 1.0 when optimizing. I'll check this out in the next days but most likely not today.
I found out why this is very slow in general:
start_times
and end_times
. I'm working on activity based branch (see #181) but that also seems to fail here as the activity for the binary variables is much higher. I think it would be valuable to have a strategy which counts the activity as how many values can be removed by this change instead.Nevertheless in general a scheduling constraint needs to be implemented :smile:
Thanks for looking into this, Ole.
And I agree that there should be a dedicated scheduling constraint. :-)
However, I don't understand your comment: "It's not immediately obvious that the sum over the b for each task needs to be the duration, so I would add that constraint.". Would you mind explain a little more what you mean?
(The approach for this implementation is to - for each time step - check that the the total number of active resources cannot exceed limit
. "active" is here the complete duration of a task, from start to start + duration -1. )
For clarification:
The b
basically encodes whether it's active in the given time.
We want that every task is completed until our maximum end time. This means that when we have a vector of b
for each task the sum of it over t
has to equal the duration.
This is given by your definition but it's not as easy for my solver to see. I would therefore add that constraint as a user.
@Wikunia Yes, you have a good point and I will test this as well. (My formulation is one of the most used decompositions in the CP folk lore.)
Unfortunately because of the other problems I have identified this will still take a minute to solve. Even with #222 because of the branching strategy. I'll do more research on that.
Here is a model that works without
@objective
but adding an@objective
throwsMethodError: no method matching iterate(::Nothing)
. I don't know is this is a bug in my model or somewhere else. (It use a decomposition ofcumulative
and that might very well be the culprit.)And sorry about the largish model. I haven't had any similar problems with
@objective
before this.