Closed Kuifje02 closed 4 years ago
@Kuifje02 Just seen this. I'll have a look through the new stuff and see
I think I fixed it? Couldn't come up with an actual solution. Was mostly trying to get the resource functions working Please check the time windows resources are correct.
Yes looks good to me for now! Still need to perform more thorough checks.
I thought of an alternative solution. Would it work if we always worked with all the resources (monotone,stops, capacity, time, time_windows, ...) and changed res_max according to the constraints that are activated ? When solving the big instances we will run into negative cycles and will have to add another resource to enforce path elementarity.
An obvious down side is that if you only have one constraint, for example, capacity, you have to handle all the other "dummy" resources in the algorithm. I assume this affects the computational complexity of the bidirectional algorithm (exponentially ?) ?
Yeh that's a much neater solution. The number of resources should not really affect the algorithms performance.
Partially implemented. Partially because two tests fail and I cannot figure out why for the moment. Still looking. For some reason the maximum number of stops resource fails.
It turned out pretty neat! Fixed on error, got a new one. It seems pretty tricky to get the REFs right, not easy to debug either...
Not sure, seems to work without the REFs. The total resource consumption is not correct. So I think it might be a problem with cspy not dealing with custom REFs very well.
New commit in cspy fixes all errors except time windows. I'll have another look into it tomorrow.
Works with the the version in cspy-master!!
Nice I'll take a look !
When considering the following constraints :
maximum number of stops
load constraints
duration constraints
resources extension functions are additive, so it is not necessary to define a custom REF.
But when considering time windows, a custom REF is necessary with the cspy.REF_custom method :
How can we handle the fact that the cumulative_res object has a variable length, as it depends on which constraints are activated (load, duration, etc.) ?
For example, we know that the monotone resource is alway first (
new_res[0}+=1
), but not sure how to handle the other ones.