In my instance a lot of vehicles are defined with some different configuration.
I would like to limit the number of vehicles into my solution in order to obtain a subset of my initial fleet.
I’ve found this topic which seems to fit my problem, but the links are out of date
I have to solve a VRPTW problem with the constraint that the solution must have a fixed number of vehicles.
I have tried to search inside the library on how to implement this constraint. Through the SolomonReader I tried to insert manually a certain nr of vehicles but this helped only in defining the max number of possible vehicles (but still it was showing solutions with a lower nr of vehicles).
How can I implement a fixed fleet size constraint?
Is there currently a mechanism to fit my need ?
If you want to limit your fleet, what prevents you from specifying your limited fleet and setting your fleetsize to finite?
The needs is to obtain a subset of my entire fleet.
For example :
4 Vehicles starting from Location A
4 Vehicles starting from Location B
I want at most 6 vehicles used, letting the solve chose which subset is the most fittest
By my side, I’ve reach this goal by avoiding the insertion a new route in the solution at the Insertion level.
this seems practically useful (for example, there are 10 vehicles but only 5 drivers, etc.) and thus I have implemented the constraint in the following commit - I guess you have probably implemented something similar
. Hopefully I have done it right.