Vehicle Routing Algorithm solutions are not based on cost matrix issue
Data :- we have 2 fleets and 1 order (Shipment)
Details :-
Order :- Shipment
[id=87][name=-87][pickupLocation=[id=0][index=-1][coordinate=null]][deliveryLocation=[id=1][index=-1][coordinate=null]][capacity=[noDimensions=2][[dimIndex=0][dimValue=300]][[dimIndex=1][dimValue=0]]][pickupServiceTime=3.0][deliveryServiceTime=5.0][pickupTimeWindows=[timeWindow=[start=1080.0][end=1230.0]]][deliveryTimeWindows=[timeWindow=[start=1260.0][end=1350.0]]]
Pick lat long :- 43.6631316 -79.4029299
Delivery lat long :- 43.6385261 -79.4751539
Fleet
1. Vehicle
[id=2][type=[typeId=2][capacity=[noDimensions=2][[dimIndex=0][dimValue=5000]][[dimIndex=1][dimValue=5000]]][costs=[fixed=1.0][perTime=1.0][perDistance=1.0][perWaitingTimeUnit=1.0]]][startLocation=[id=-2][index=-1][coordinate=null]][endLocation=[id=-2][index=-1][coordinate=null]][isReturnToDepot=true][skills=[, 2_vehicle]]
lat long :- 43.7572088788494,-79.5109858621854
Distance and time from vehicle current location to pickup location = 18.8 km /40 mins
2. Vehicle
[id=1][type=[typeId=1][capacity=[noDimensions=2][[dimIndex=0][dimValue=5000]][[dimIndex=1][dimValue=5000]]][costs=[fixed=1.0][perTime=1.0][perDistance=1.0][perWaitingTimeUnit=1.0]]][startLocation=[id=-1][index=-1][coordinate=null]][endLocation=[id=-1][index=-1][coordinate=null]][isReturnToDepot=true][skills=[, 1_vehicle]]
lat long :- 43.729521,-79.4322585440268
Distance and time from vehicle current location to pickup location = 8.4 km /23 mins
Vehicle Configuration is same but the latitude and longitude is different and lat long is already mentioned in the detail .
Scenario 1 :-
If vehicle sequence in VehicleRoutingAlgorithm object is like this
1 vehicle and then 2 vehicle the cost will be :- 33626.26666666666
Scenario 2:-
If vehicle sequence in VehicleRoutingAlgorithm object is like this
2 vehicle and then 1 vehicle the cost will be :- 24958.05
Code :-
Jsprit.Builder vrpBuilder = Jsprit.Builder.newInstance(vrp)
.setProperty(Jsprit.Parameter.THREADS, jspritThreadCount.toString())
.setProperty(Jsprit.Parameter.FIXED_COST_PARAM, "2.0");
VariationCoefficientTermination prematureTermination; VehicleRoutingAlgorithm vra = vrpBuilder.buildAlgorithm();
Collection<VehicleRoutingProblemSolution> solutions = vra.searchSolutions();
any idea ??