Research Article

Modification of the Clarke and Wright Algorithm with a Dynamic Savings Matrix

Table 3

Functions.

Subprogram/functionMeaning

This function creates the initial routes R from the set of all orders It uses the functions and

This function creates the saving matrix. It uses the function

In the loop (until no positive savings are present in matrix A), the function selects the next route with the largest savings and adds route to the set of all routes R. The initial routes and (now joined into one) are removed from the set of routes and from savings matrix A by using the function


This function creates the initial route . The input parameters are the vertices of the new route. A variant of this function is selected based on information whether the operation is delivery, pickup, or goods transport between customers

This function creates savings . The input parameters are the route savings, the route consisting of vertices and coordinates in matrix A

If the capacity of vehicle on route was not exceeded in any of the vertices (where goods are loaded/unloaded), this function returns true; otherwise, it returns false

This function joins routes and into a new potential route and consecutively evaluates the specific variants where the end vertices of and starting vertices of may coincide:
(1)
(2)
(3)
Furthermore, the procedure examines if the vertices of route constitute a subset of route in the same direction:
(4).
If identical vertices are identified in the right position according to the above conditions, then those vertices are combined together for the new route by means of the function . If the vehicle capacity is met on the new route r (), the function is used to calculate the new savings , which are then saved in the savings matrix A

This function returns the highest savings s from matrix A

This function returns the new vertex obtained by joining vertices and

This function returns true if
i.e., if the last serviced vertex of route (before returning to the depot) coincides with the first serviced vertex on route (after the depot)

This function returns true if

This function returns true if

This function returns true if the vertices of route are subsets of route in the same direction

This function returns the cost of route

This function removes the i-th row and j-th column and the j-th row and i-th column from matrix A

This function adds a new row and a new column to matrix A