A way to force the algorithm to utilize a fixed number of vehicles
nkaragiannis opened this issue · 0 comments
Hi everyone!
In this issue related on how to force the algorithm to utilize a fixed number of vehicles : #239,
PGWelch wrote:
"It may be more reliable to actually modify the insertion and ruin heuristics a bit. Assuming you want n vehicles, for the initial solution construction, randomly choose n jobs, assigning one per vehicle and then apply cheapest or regret based construction to assign all other jobs and finish building the first solution. For subsequent ruin-and-recreate iterations, use a modified ruin which leaves at least a single job in place on each route (where the job is randomly chosen each time).
This kind of strategy would force the algorithm to always use n vehicles, but still allow it to optimise them."
Can someone please help me to code the above strategy?
Thanks