Research Article

An Adaptive Data-Driven Approach to Solve Real-World Vehicle Routing Problems in Logistics

Pseudocode 1

Steps of the proposed algorithm.
/∗ Prestep (3.1.1) ∗/
ConnectingToTheDatabase (connection);
DataInitialization (customersList, vehiclesList, depot, sdvrpConstraints);
PreparationOfTheInputData (customersList, vehiclesList, depot, sdvrpConstraints);
TimeWindowsTranspformations (customersList);
RoutesInitialization (customersList, routes);
/∗ First step (3.1.2) and (3.1.3) ∗/
//initial solution becomes optimal routes
ClarkeWrightSavingsAlgorihm (routes, vehiclesList);
AssigningVehiclesToRoutes (routes, vehiclesList);
/∗ Second step (3.1.4) ∗/
initialSolution = ReducingTheNumberOfRoutes (routes, customersList, vehiclesList);
/∗ Third step (3.1.5) ∗/
//the initial solution marked as the initialSolution becomes the optimal routes
TabuSearch (initialSolution, customersList, vehiclesList, sdvrpConstraints);
/∗ Fourth step (3.1.6) ∗/
RoutesOptimization();
RoutesOptimization2Customers();
RoutesOptimization3Customers();
InverseTransformation (customersList, initialSolution);
/∗ Final step ∗/
//the result of the fourth step, RouteResList, is the optimal list of routes by vehicle
StoreOptimalRoutesInTheDatabase (RouteResList);