Originally posted by: SystemAdmin
[JR said:]
Hi.
Depending of the problem, a better formulation may exist. You have an upper bound of the number of passage in the depot: you have a load event at depot passage. For each visit (unload) you make an alternative of interval, each term of alternative being associated with a depot passage. For each depot passage, you span the corresponding alternative of visit.
int nbOfDepotPassage=...;
int nbOfVisit=...;
int quantity[1..nbOfVisit]=...;
dvar interval depotspan[i..nbOfDepot] optional sizein min..max; // compute min and max
//tupleset distances : compute the distance matrix between visit
dvar interval visits[1..nbOfVisit] size 0;
dvar interval unloads[1..nbOfVisits*nbOfDepots] optional size 1;
constraints {
//the chain of load
forall(i in 2..nbOfDepots) {
endBeforeStart(depotspan[i-1], depotspan[i));
presenceOf(depotspan[i] <= depotspan[i-1]);<br /> }
forall(j in 1..nbOfVisit)
alternative(visit[i], all(j in 1..nbOfDepots) unload[nbOfDepots*(i-1) + j]));
forall(i in 1..nbOfDepots) {
span(depotspan[i], all(i in 1..nbOfVisit) unload[nbOfDepots*(i-1) + j]));
sum(i in 1..nbOfVisit) presenceOf(unload[nbOfDepots*(i-1) + j])*quantity[i] <= maxLoad;<br />}
This model is much more efficient than the one with reservoir for solving as it is driven by the bin-packing structure of the problem: this is true for propagation and solving.
Note the usage of reservoir does not achieve hinting the solver for that structural aspect. Second the sum are all local to a span and deal with positive term while the reservoir is dealing with each possible time point, with positive and negative number and must manage an equality to zero constraint (alwaysIn(f, l, 0, 0): That is computotionnally hard to manage
Of course the number of depot passage must remain small compare with the number of
Of course this multiply the number of intervals and is tractable in memory only if the number of depot is small compare with the number of visits.
Of course the condition
#DecisionOptimization#OPLusingCPOptimizer