Savings Algorithm
Savings Algorithm
Savings Algorithm
1 Problem Formulation
Recall our formulation of the vehicle routing problem: There are a set of depots, vehicles,
and delivery locations, and the problem is to optimally design routes for the vehicles from
the depots to delivery locations. This is represented by an undirected graph G = (V, E) with
vertices representing locations and edges representing paths between locations. One impor-
tant facet of this model is that each vertex is connected by an edge. The depot is located
at vertex v0 , and there are delivery locations at the remaining vertices. Furthermore, the
edges eij are weighted by dij , which represents the distance between vertices vi and vj . The
maximum number of vehicles is n, which would be the situation in which exactly one vehicle
is assigned to each delivery location. Each vehicle has a maximum capacity of goods G, and
each vehicle has a maximum distance D that it can travel. Finally, each delivery location vi
for i ≥ 1 has a demand value wi .
3. Side constraints on maximum vehicle capacity and travel distance are satisfied;
2. Compute the savings for merging delivery locations i and j, which is given by sij =
di0 + d0j − dij , for all i, j ≥ 1 and i 6= j;
1
4. Starting at the top of the (remaining) list of savings, merge the two routes associated
with the largest (remaining) savings, provided that:
(a) The two delivery locations are not already on the same route;
(b) Neither delivery location is interior to its route, meaning that both notes are still
directly connected to the depot on their respective routes;
(c) The demand G and distance constraints D are not violated by the merged route.
3 Example
Consider the nodes described below, and note that the depot is located at node 0. Suppose
we would like to solve this vehicle routing problem (VRP) using the savings algorithm, for
the constraint that each vehicle has a capacity of 30 units (meaning it can carry less than or
equal to 30 units).
Distance Node 0 Node 1 Node 2 Node 3 Node 4 Node 5 Node 6 Node 7 Demand
Node 0 0
Node 1 4 12
Node 2 4 5.66 12
Node 3 2.83 6.32 2.83 6
Node 4 4 8 5.66 2.83 16
Node 5 5 8.54 8.06 5.39 3 15
Node 6 2 4.47 6 4.47 4.47 4.12 10
Node 7 4.24 3.16 7.62 7.07 7.62 7 3.16 8
2
We begin by computing the savings:
Next, we merge routes using the savings sorted in descending order and taking into
account the capacity constraints of the vehicles gives:
The nodes visited on each route, the demand associated with that route, and the route
length are given in the table above; note that routes in the solution are those that have not
3
been crossed out. Also note that depending on how duplicate values are sorted, it is possible
to get the routes {0 − −1 − −7 − −6 − −0, 0 − −3 − −4 − −0, 0 − −2 − −5 − −0} as a solution
which have lengths of 12.32, 9.66, 17.06, respectively.