1 Introduction

The vehicle routing problem (VRP) in its classical setting involves finding the optimal delivery routes originating from a central depot for a fleet of homogeneous vehicles, each of limited capacity, so as to minimize the total distance traveled. In this paper, a new version of the VRP, originating from the policies of a Nordic distribution company, is presented, its mathematical programming model is developed, and its relations to other, previously stated VRP variants are analyzed and illustrated. In the situation considered, in addition to the central depot, there is a non-predetermined hierarchy of intermediate facilities, called switch points, and instead of one fleet, fleets of vehicles consisting of two kinds of vehicles: original vehicles belonging to the central depot and local vehicles belonging to the switch points. Original vehicles have the capacity to carry up to three swap-bodies, while local vehicles have restricted capacity to one swap-body.

Original vehicles with loaded swap-bodies depart from the central depot and can

  • Either visit customers carrying just one loaded swap-body, or

  • Visit one or two consecutive switch points in order to transfer one or two loaded swap-bodies to the corresponding number of local vehicles which are subsequently routed to customers while itself may well proceed to serve customers with one loaded swap-body

Every route servicing customers thus corresponds to one vehicle, be it local or original, with exactly one swap-body. In this setting, a hierarchical structure of central depot, switch points, and customers is imposed. All customers must be served, each by exactly one vehicle carrying exactly one swap-body. Each route terminates at its starting point, which may be the central depot, a switch point at the first level of the hierarchy, or a switch point at the second level of hierarchy.

Since the supply network considered is also divided into echelons containing the central depot, the switch points, and the customers, we have chosen to address this new variant of VRP as the Hierarchical Multi-Switch Multi-Echelon Vehicle Routing Problem (HMSME-VRP). The described problem bears some resemblance and shares some characteristics with two other VRP variants,

  • The two-echelon VRP (2E-VRP), and

  • The truck and trailer routing problem (TTRP).

However, as far as we know, this is a new and different problem, distinct in several aspects:

  1. 1.

    The 2E-VRP does not allow upper-level vehicles to continue from an intermediate facility to serve customers at the lower level.

  2. 2.

    Unlike the 2E-VRP, customers can be served directly from the central depot.

  3. 3.

    The TTRP and its extensions include only one fleet of homogeneous vehicles, all originating from the central depot. In addition, swap-bodies cannot be transferred between vehicles.

The rest of the paper is organized as follows: Since there are no previous studies on HMSME-VRP, in Sect. 2, we briefly review the literature on the related problems of 2E-VRP and TTRP, further discussing shared and non-shared characteristics. In Sect. 3, the problem is stated formally, and a mixed integer programming model is developed and explained. In Sect. 4, an illustrative example is given to demonstrate the solution of the problem and discuss its relation to other, previously stated VRP variants. In Sect. 5, a set of small instances are solved to demonstrate the difficulties in solving the problem. Lastly, we conclude the paper in Sect. 6 and propose several directions for future research.

2 Comparative literature review

This section reviews the literature on problems that bring similarities to the HMSME-VRP, namely the 2E-VRP and the TTRP.

The 2E-VRP is concerned with a situation in which goods are delivered to intermediate facilities, called satellites, stored or consolidated, and transferred to other vehicles before being shipped to their final destination [5]. The satellites may be limited by capacity, in which case the problem is known as 2E-CVRP [18]. Handling costs are incurred at the satellite for loading and unloading vehicles. A fleet of primary vehicles is located at a depot, while a set of secondary vehicles are shared by the satellites. The 2E-VRP aims to find the optimal set of primary and secondary vehicle routes while ensuring that customer demands are met. In this respect, there is a similarity to HMSME-VRP where, however, instead of intermediate facilities, there are switch points. Moreover, the primary vehicles, called original vehicles, in HMSME-VRP may serve the customers and may consecutively visit up to two switch points, imposing thus a hierarchy between them, where they transfer swap-bodies to the local or secondary vehicles, that is, there are no loading and unloading operations at the switches.

A mixed-integer formulation of the 2E-CVRP was presented in Perboli and Tadei [17] and two families of valid inequalities were also introduced in order to strengthen the linear relaxation of the model. Crainic et al. [4] present a family of multi-start heuristics for the 2E-VRP while Grangier et al. [9] extend it to allow multiple trips, time windows, and synchronization constraints. In this formulation, the lower level vehicles are allowed multiple trips, and these do not have to originate from the same satellite. Dellaert et al. [6] presented path-based and arc-based formulations of the problem and derived specific solution methods for each formulation based on the branch-and-price framework. Wang et al. [24] studied stochastic demand in a 2E-VRP.

The TTRP introduced by Chao [3] do share certain characteristics with 2E-VRP and the HMSME-VRP. However, it is not based on a two-echelon supply chain. Instead, it considers the situation in which vehicles are divided into trucks and trucks pulling a trailer, the latter being referred to as complete vehicles. Due to real-life constraints, such as limited maneuvering space, inaccessible locations, or regulations prohibiting large vehicles at the customer location, some customers can only be visited by trucks (truck customers). In contrast, others can be served by either a truck or a complete vehicle (vehicle customers). Consequently, a complete vehicle may need to temporarily detach its trailer at specific customers to be able to visit others. This results in that three different types of routes can form a feasible solution for the TTRP; pure truck routes, pure vehicle routes, and complete vehicle routes, respectively. The objective of TTRPs is to minimize costs incurred while determining the optimal set of routes that ensure that each customer is served by a suitable vehicle.

Comparing TTRP to HMSME-VRP, the situation considered by the latter is quite different; there are two fleets of vehicles, distinguished by capacity and location, all customers are visited by exactly one vehicle (of any type) pulling exactly one swap-body, and swap-bodies are transferred from high capacity trucks to lower capacity trucks at switch points.

For the TTRP, Chao [3] utilized tabu search to solve it while Scheuerer [19] further improved the tabu search approach. Lin et al. [14] introduced time windows to the problem and developed a simulated annealing approach. Mirmohammadsadeghi and Ahmed [16] developed a memetic algorithm in order to solve the problem with stochastic demand. Derigs et al. [7] study the TTRP both with and without load transfers and time windows. They apply a hybrid approach combining local search and large neighborhood search and develop problem-specific neighborhood structures. TTRP with transshipment points (that is, satellites) independent of customer locations en route are introduced by Villegas et al. [23] and Drexl et al. [8]. A further extension is introduced by Accorsi and Vigo [1] as they consider truck and vehicle customers with and without parking facilities and parking only locations.

A problem closely related to TTRP is the so-called Swap-Body VRP (SB-VRP). It considers trucks and trailers and the situation in which some customers can be served by truck only, while others can be served by a truck or a trailer, similar to the case in TTRP. However, some customer demands exceed the capacity of a single swap-body and must therefore be served by a trailer. In addition, swap locations are independent of customer locations, and no transshipments are allowed. As opposed to the TTRP, where only park and pick-up are allowed, the SB-VRP vehicles can, in addition, perform swaps and exchange operations.

Huber and Geiger [12] proposed an iterated Variable Neighborhood Search procedure with problem-specific neighborhood structures but only allowed each vehicle to approach one swap location. A Greedy Randomized Adaptive Search Procedure was proposed by Miranda-Bront et al. [15]. Toffolo et al. [21] presented a stochastic local search algorithm. They first formulate a naïve feasible solution, then improve it by a local search considering several neighborhood structures. To the best of our knowledge, the only extension of the SB-VRP is presented by Huber and Geiger [13], which studies a bi-objective swap-body inventory routing problem.

In HMSME-VRP, swap-bodies are also considered, and the switch points, similarly to the swap locations in SB-VRP, are independent of the customer locations. However, each customer is served by a vehicle with a swap-body, there are two fleets of vehicles and a non-predetermined hierarchy of switch points. Table 1 further lists the essential differentiating characteristics between HMSME-VRP and the problems reviewed above.

Table 1 Characteristics of the HMSME-VRP, 2E-VRP, and the TTRP

3 Problem description

The HMSME-VRP can be defined on a network graph \(G = (N,A)\), where N represents the set nodes and A represents the set of arcs. The set of nodes consists of three subsets; the singleton central depot \((O=\{o\})\), the set of switch points (S), and the set of customers (C). Thus, \(N = O\cup S \cup C\). We further define the subsets of the upper level, \(W = O \cup S\), and that of the lower level \(K = S \cup C\). A fleet of homogeneous vehicles in terms of capacity is associated with the central depot. These vehicles, referred to as original vehicles, can pull up to three swap-bodies, all of which have the same loading capacity. A second fleet of homogeneous vehicles, the local vehicles, is shared by the switch points. Compared to the original vehicles, local vehicles can only pull one swap-body at time. Each customer is associated with a corresponding demand and can only be visited by exactly one vehicle pulling exactly one attached swap-body. A local vehicle can serve customers only if an original vehicle transfers to it one of the swap-bodies it pulls at the switch point from which the local vehicle departs.

All customer routes start and end at the same point which may be the depot or a switch point. All swap-bodies are returned to the central depot by the same original vehicle by which they left the depot in the first place. Original vehicles departing from the central depot and pulling only one swap-body visit customers directly, otherwise, if they pull two or three swap-bodies, they have to visit at least one switch point in order to transfer swap-bodies to local vehicles. In the case of three swap-bodies, two can be transferred to two local vehicles either at one switch point or at two consecutive switch points.

Figure 1 depicts possible routes that may arise in an HMSME-VRP solution. Note that possible partial travel paths are \(\{(o,s),(s,c)\}, \quad o \in O, s \in S, c\in C\), or \(\{(o,s), (s,s'), (s,c)\}, \quad o \in O, s,s' \in S, c\in C\) and, \(\{(o,c)\},\quad o \in O, c\in C\).

Fig. 1
figure 1

Possible HMSME-VRP distribution routes

The goal is to determine

  • Routes for original vehicles to directly serve customers,

  • And/or routes for original vehicles to transfer swap-bodies to local vehicles at switch points and subsequently serve customers, and

  • Routes for local vehicles after they have been attached swap-bodies transferred from original vehicles,

and in the process

  • To identify the switch points actually needed,

  • To determine the number of vehicles needed at the depot and these switch points,

while ensuring the satisfaction of customer demands without violating vehicle and swap-body capacities at a minimum total cost.

We further make the following assumptions:

  • The demand of each customer is known and less or equal to the capacity of a single swap body;

  • Vehicles and swap-bodies are capacitated;

  • Only one trip can be performed by each vehicle;

  • The depot and the switch points are uncapacitated;

  • The locations of the depot and possible switch points are fixed

3.1 Mixed-integer formulation

The following notation will be used to describe the mixed-integer problem:

Sets

N ::

All nodes.

A : :

All arcs.

O : :

Singleton containing the depot.

S : :

Set of switch points.

C : :

Set of customers.

K : :

\(S \cup C\).

T : :

Set of available swap-bodies.

\(V_o:\) :

Set of available original vehicles.

\(V_s\)::

Set of available local vehicles.

V : :

\(V_o \cup V_s\).

W : :

\(o \cup S\).

Variables

\(x_{ij}^{c}\):

= Flow on arc \((i,j) \in A\) towards customer \(c \in C, \quad x^c_{ij} \ge 0\)

$$\begin{aligned} y_{ij}^{vt}= & {} \left\{ \begin{array}{rl} 1, &{} \hbox {if original vehicle } v \in V_o \hbox { with swap-body } t \in T \text{ traverse arc }(i,j) \in A\\ 0, &{} \text {otherwise.} \end{array}\right. \\ z^{vt}_{ij}= & {} \left\{ \begin{array}{rl} 1, &{} \hbox {if local vehicle } v \in V_s \hbox { with swap-body } t \in T \text{ traverse arc }(i,j) \in K\\ 0, &{} \text {otherwise.} \end{array}\right. \\ q^v_{ij}= & {} \left\{ \begin{array}{rl} 1 &{} \hbox {if vehicle } v \in V_o \hbox { traverse arc } (i,j) \in A\\ 0 &{} \text{ otherwise } \end{array}\right. \\ f_{v}= & {} \left\{ \begin{array}{rl} 1 &{} \text{ if } \text{ vehicle } v \in V \text{ is } \text{ used }\\ 0 &{} \text{ otherwise } \end{array}\right. \\ b_{t}= & {} \left\{ \begin{array}{rl} 1 &{} \text{ if } \text{ swap-body } t \in T \text{ is } \text{ used }\\ 0 &{} \text{ otherwise } \end{array}\right. \\ \end{aligned}$$

Parameters

\(d_c:\):

Demand of customer \(c \in C\).

\(u_t:\):

Capacity of swap-body \(t \in T\).

\(c_{ij}:\):

Cost of traversing arc \((i,j) \in A\).

\(c^1_v:\):

Fixed cost of using original vehicle \(v \in V_o\).

\(c^2_v:\):

Fixed cost of using local vehicle \(v \in V_s\).

\(c^3_t:\):

Fixed cost of using swap-body \(t \in T\).

M::

Big number (number of arcs).

Objective function

$$\begin{aligned} \begin{aligned} \min TC =&\sum \limits _{i \in N} \sum \limits _{j \in N} \sum \limits _{v \in V_o} c_{ij}\cdot q^{v}_{ij} + \sum \limits _{i \in K} \sum \limits _{j \in K} \sum \limits _{v \in V_s} \sum \limits _{t \in T} c_{ij} \cdot z^{vt}_{ij}\\&+ \sum \limits _{v \in V_o} f_v \cdot c^1_v+ \sum \limits _{v \in V_s} f_v \cdot c^2_v + \sum \limits _{t \in T} b_t\cdot c^3_t. \end{aligned} \end{aligned}$$
(1)

Constraints

$$\begin{aligned}\sum _{j \in N}x_{ij}^c -\sum _{j \in N}x_{ji}^c = \left\{ \begin{array}{rl}d_c,&{}\text{ if } i=o\\ -d_c,&{}\text{ if } i=c,\\ 0,&{}\text{ otherwise }\end{array}\right. \forall i\in N, \forall c\in C; \end{aligned}$$
(2)
$$\begin{aligned}&\quad x^{c'}_{cs} = 0, \quad \forall c,c' \in C, \forall s \in S; \end{aligned}$$
(3)
$$\begin{aligned}&\quad x^{c'}_{co} = 0, \quad \forall c,c' \in C; \end{aligned}$$
(4)
$$\begin{aligned} x^{c1}_{cc'} \le (\sum _{v \in V_o}\sum _{t \in T } y^{vt}_{cc'} + \sum _{v' \in V_s}\sum _{t \in T } z^{v't}_{cc'}) \cdot d_{c1},\quad \forall c,c',c1 \in C, \quad c\ne c'; \end{aligned}$$
(5)
$$\begin{aligned} x^c_{oj} \le d_{c} \cdot \sum _{v \in V_o} \sum _{t \in T} y^{vt}_{oj}, \quad \forall j \in K, \forall c \in C, \quad j \ne c; \end{aligned}$$
(6)
$$\begin{aligned} x^{c'}_{sc} \le d_{c'} \cdot (\sum _{v \in V_o} \sum _{t \in T} y^{vt}_{sc} + \sum _{v' \in V_s}\sum _{t \in T } z^{v't}_{sc}), \quad \forall s\in S, \forall c,c' \in C; \end{aligned}$$
(7)
$$\begin{aligned}\sum _{c \in C} x^c_{ij} \le \sum _{v \in V_o} \sum _{t \in T} u_{t} \cdot y^{vt}_{ij} + \sum _{v' \in V_s}\sum _{t \in T } u_{t} \cdot z^{v't}_{ij}, \quad \forall i,j \in K, \quad i \ne j; \end{aligned}$$
(8)
$$\begin{aligned} \sum _{c \in C} x^c_{oj} \le \sum _{t \in T}(\sum _{v \in V_o} y^{vt}_{oj}) \cdot u_t, \quad \forall j \in K; \end{aligned}$$
(9)
$$\begin{aligned}\sum _{j \in N \backslash \{c\}}\sum _{v \in V_o}\sum _{t \in T} y^{vt}_{jc} + \sum _{i \in K \backslash \{c\}}\sum _{v' \in V_s}\sum _{t \in T} z^{v't}_{ic} = 1, \quad \forall c \in C; \end{aligned}$$
(10)
$$\begin{aligned}\sum _{j \in N \backslash \{c\}}\sum _{v \in V_o}\sum _{t \in T} y^{vt}_{cj} + \sum _{i \in K \backslash \{c\}}\sum _{v' \in V_s}\sum _{t \in T} z^{v't}_{ci} = 1, \quad \forall c \in C; \end{aligned}$$
(11)
$$\begin{aligned} q^v_{ij} \cdot 3 \ge \sum _{t \in T} y^{vt}_{ij}, \quad \forall i,j \in N, \forall v \in V_o; \end{aligned}$$
(12)
$$\begin{aligned} \sum _{j\in N \backslash \{c\}} y^{vt}_{jc} = \sum _{j\in N \backslash \{c\}} y^{vt}_{cj}, \quad \forall c \in C, \forall v \in V_o, \forall t \in T; \end{aligned}$$
(13)
$$\begin{aligned}\sum _{j\in K \backslash \{c\}} z^{vt}_{jc} = \sum _{j\in K \backslash \{c\}} z^{vt}_{cj},\quad \forall c \in C, \forall v \in V_s, \forall t \in T; \end{aligned}$$
(14)
$$\begin{aligned} y^{vt}_{ws} = y^{vt}_{sw}, \quad \forall w \in W,\forall s \in S, \forall v \in V_o, \forall t \in T, w \ne s; \end{aligned}$$
(15)
$$\begin{aligned} \sum _{i \in W} q^v_{is} = \sum _{i \in W } q^v_{si}, \quad \forall s \in S, \forall v \in V_o; \end{aligned}$$
(16)
$$\begin{aligned}\sum _{c \in C} z_{sc}^{{v'}t} = \sum _{c \in C} z_{cs}^{{v'}t}, \quad \forall s \in S, \forall {v'} \in V_s, \forall t \in T; \end{aligned}$$
(17)
$$\begin{aligned}\sum _{c \in C} y_{sc}^{vt} = \sum _{c \in C} y_{cs}^{vt}, \quad \forall s \in S, \forall v \in V_o, \forall t \in T; \end{aligned}$$
(18)
$$\begin{aligned} \sum _{j \in K} q^v_{oj}, \le 1, \quad \forall v \in V_o; \end{aligned}$$
(19)
$$\begin{aligned} \sum _{w \in W}\sum _{c \in C} \sum _{t \in T} y^{vt}_{wc} \le 1, \quad \forall v \in V_o; \end{aligned}$$
(20)
$$\begin{aligned}\sum _{s \in S}\sum _{c \in C} \sum _{t \in T} z^{v't}_{sc} \le 1, \quad \forall v' \in V_s; \end{aligned}$$
(21)
$$\begin{aligned}\sum _{s' \in S \backslash \{s\}}\sum _{t \in T} z^{v't}_{ss'} =0,\quad \forall s \in S, \forall v' \in V_s; \end{aligned}$$
(22)
$$\begin{aligned}\sum \limits _{c \in C} q^v_{sc} \le \sum \limits _{w \in W \ne s} q^v_{ws},\quad \forall s \in S, \quad \forall v \in V_o; \end{aligned}$$
(23)
$$\begin{aligned}\quad \sum _{t \in T} y^{vt}_{ss'} = 2 \cdot q^v_{ss'},\quad \forall s,s' \in S, \forall v \in V_o; \end{aligned}$$
(24)
$$\begin{aligned}\quad 2 - ( q^v_{os} + q^v_{ss'}) \ge q^v_{sc},\quad \forall s,s' \in S, s \ne s', \forall v \in V_o, \forall c \in C; \end{aligned}$$
(25)
$$\begin{aligned}\quad \sum _{j \in K}\sum _{t \in T} y^{vt}_{sj} \ge \sum _{i \in W} q^v_{is}, \quad \forall s \in S, \forall v \in V_o; \end{aligned}$$
(26)
$$\begin{aligned}&\quad \sum _{j \in N}\sum _{v \in V_o}\sum _{t \in T} y^{vt}_{js} +\sum _{c \in C}\sum _{v' \in V_s}\sum _{t \in T} z^{v't}_{cs}\nonumber \\&= \sum _{j \in N}\sum _{v \in V}\sum _{t \in T} y^{vt}_{sj} + \sum _{c \in C}\sum _{v' \in V_s}\sum _{t \in T} z^{v't}_{sc}, \quad \forall s \in S, j \ne s; \end{aligned}$$
(27)
$$\begin{aligned}\quad \sum _{j \in K}\sum _{v \in V_o} y^{vt}_{oj} \le 1, \quad \forall t \in T; \end{aligned}$$
(28)
$$\begin{aligned}&\quad \sum _{t \in T} y^{vt}_{os} \le 3 \cdot q^v_{os}, \quad \forall s \in S, \forall v \in V_o; \end{aligned}$$
(29)
$$\begin{aligned}\quad \sum _{t \in T} y^{vt}_{jc} \le 1, \quad \forall j \in N, \forall c \in C, \forall v \in V_o, \quad j \ne c; \end{aligned}$$
(30)
$$\begin{aligned}\quad \sum _{t \in T} z^{v't}_{ic} \le 1, \quad \forall i \in K, \forall c \in C, \forall v' \in V_s, \quad i \ne c; \end{aligned}$$
(31)
$$\begin{aligned}\sum _{t \in T} y^{vt}_{jc} + \sum _{t \in T} z^{v't}_{ic} \le 1, \quad \forall j \in N, \forall i \in K, \forall c \in C, \forall v \in V_o, \quad j,i \ne c; \end{aligned}$$
(32)
$$\begin{aligned} 2-(y_{os}^{vt} + y^{vt}_{ss'}) \ge \sum \limits _{c \in C} z^{v't}_{sc}, \quad \forall s,s' \in S, \quad \forall v \in V_o, \quad \forall v' \in V_s; \end{aligned}$$
(33)
$$\begin{aligned} \sum \limits _{j \in W \backslash \{s\}}\sum \limits _{v \in Vo} y^{vt}_{js} \ge \sum \limits _{c \in C}\sum \limits _{v \in Vo} y^{vt}_{sc} + \sum \limits _{c \in C}\sum \limits _{v' \in Vs} z^{v't}_{sc}, \quad \forall s \in S, \forall t \in T; \end{aligned}$$
(34)
$$\begin{aligned}\sum \limits _{s' \in S \backslash \{s\}} y^{vt}_{ss'} \le y^{vt}_{os} + \sum \limits _{c \in C} y^{vt}_{cs} + \sum \limits _{c \in C}\sum \limits _{v' \in Vs} z^{v't}_{cs},\quad \forall s \in S, \forall v \in V_o, \forall t \in T; \end{aligned}$$
(35)
$$\begin{aligned}& \sum _{s \in S}\sum _{c \in C}\sum _{v \in V_o} y^{vt}_{sc} + \sum _{s \in S}\sum _{c \in C}\sum _{v' \in V_s} z^{v't}_{sc} \le 1, \quad \forall t \in T; \end{aligned}$$
(36)
$$\begin{aligned}\sum _{i \in N}\sum _{j \in N}\sum _{t \in T} y^{vt}_{ij} \le f_v \cdot M, \quad \forall v \in V_o; \end{aligned}$$
(37)
$$\begin{aligned}\quad \sum _{i \in K}\sum _{j \in K}\sum _{t \in T} z^{v't}_{ij} \le f_v \cdot M, \quad \forall v' \in V_s; \end{aligned}$$
(38)
$$\begin{aligned}\sum \limits _{i \in N}\sum \limits _{j \in N}\sum \limits _{v \in Vo}y^{vt}_{ij} +\sum \limits _{p \in K}\sum \limits _{q \in K}\sum \limits _{v' \in Vs} z^{v't}_{pq} \le M \cdot b_t, \quad \forall t \in T; \end{aligned}$$
(39)
$$\begin{aligned}&\quad x^t_{ij} \ge 0, \quad \forall (i,j) \in A, \quad \forall t \in T; \end{aligned}$$
(40)
$$\begin{aligned}&\quad y_{ij}^{vt} \in \{0,1\}, \quad \forall (i,j) \in A, \quad \forall v \in V_o, \quad \forall t \in T; \end{aligned}$$
(41)
$$\begin{aligned}&\quad z_{ij}^{vt} \in \{0,1\}, \quad \forall (i,j) \in K, \quad \forall v \in V_s, \quad \forall t \in T; \end{aligned}$$
(42)
$$\begin{aligned}&\quad q_{ij}^{v} \in \{0,1\}, \quad \forall (i,j) \in A, \quad \forall v \in V_o; \end{aligned}$$
(43)
$$\begin{aligned}&\quad f_{v} \in \{0,1\}, \quad \forall v \in V; \end{aligned}$$
(44)
$$\begin{aligned}&\quad b_{t} \in \{0,1\}, \quad \forall t \in T. \end{aligned}$$
(45)

Equation (1) states the objective function to be minimized. It is the sum of total tour lengths and fixed and variable costs generated by original and local vehicles as well as swap-bodies. While Eqs. (2)–(7) are flow constraints which guarantee connectivity of the solution and satisfaction of customer demands. Constraints (3) and (4) ensure that there is no flows from customers to switch points or to the central depot. Equations (5)–(7) ensure that flow on any arc with final destination any customer does not exceed that customer’s demand. Equation (5) is stated for original and local vehicles on arcs between customers while (6) is stated for original vehicles on arcs between the central depot and customers or switch points. Finally, (7) is stated for both original and local vehicles on arcs between switch points and customers.

Equations (8) and (9) are capacity constraints ensuring that the flow on any arc should not exceed the total capacity of the swap-bodies on the same arc. Equation (8) is stated for arcs used by both original and local vehicles, that is, for the lower level in the hierarchy, while Eq. (9) is stated for original vehicles serving both the upper and lower levels. Similarly, Eqs. (10) and (11) are degree constraints which ensure that exactly one vehicle with exactly one swap-body enters and leaves each customer.

Equations (12)–(26) are are concerned with constraints imposed on vehicles. Equation (12) states that if an original vehicle with at least one swap-body traverses an arc then a corresponding cost for traversing the arc incurs. Equation (12) ensures that a swap-body attached to an original vehicle must leave any customer it arrives to with the same original vehicle while (14) guarantees the same for local vehicles. Any original vehicle leaving the central depot or a switch point to visit a switch point must return to the previous destination carrying the same swap-body. This is ensured by constraint (15) while (16) is a balancing constraint ensuring that original vehicles entering any switch point also leave it.

Constraints (17) and (18) ensure that local and original vehicles return to the switch point from which they departed in order to serve customers. Equation (19) ensures that an original vehicle can visit at most one switch point or only one customer directly after departing from the central depot. Equations (20) and (21) ensure that any vehicle can perform at most one customer tour; where the first equation addresses original vehicles and the latter the local vehicles. Equation (22) ensures that a local vehicle cannot visit a switch point from any other switch point and (23) ensures that an original vehicle cannot leave a switch point to visit a customer unless it has previously arrived to that switch point.

If an original vehicle departs from a switch point to visit another switch point it has to carry two swap-bodies, and this is ensured by constraint (24). Furthermore, a vehicle cannot perform a customer visit from a switch point if it pulls more than one swap-body, and this is guaranteed by constraint (25). Constraint (26) ensures that any original vehicle arriving to a switch point also departs from it to either visit another switch point or to vist a customer.

Constraints (27)–(36) are swap-body constraints. Equation (27) is a balancing constraint which ensures that the number of swap-bodies arriving to a switch point must equal the number of swap-bodies leaving it, attached either to original vehicles and proceeding to a customer or a different switch point, or to local vehicles performing customer visits. A swap-body can depart from the central depot only once, to visit either a switch point or a customer directly. Equation (28) states this. Constraint (29) makes sure that an original vehicle can carry at most three swap-bodies between the central depot and any switch point, while constraints (30)–(32) ensure that each customer can be served by exactly one swap-body, either pulled by an original or a local vehicle.

Constraint (33) ensures that a swap-body either leaves a switch point to directly visit a customer or it proceeds to another switch point, while Eq. (34) prohibits a swap-body to leave a switch point towards any customer unless it has previously arrived to that switch point. Similarly, Eq. (35) ensures that a swap-body can only leave a switch point to proceed to another switch point if it has previously arrived to the first one either directly from the central depot or returning from a customer.

Constraint (36) ensures that a swap-body can perform exactly one customer tour, while constraints (37)–(39) imply that costs incur by utilizing local and original vehicles as well as swap-bodies. Lastly, (40)–(45) specify the domains of the variables.

4 Illustrative example

For illustration purposes and comparison to related problems mentioned in Sect. 2 the solution of the U-n16-s3 instance (see Table 3) is depicted in Fig. 2. Table 2 summarizes the values for the instance parameters.

Table 2 Instance parameters
Fig. 2
figure 2

Solution of the U-n16-s3 instance

The solution depicted in Fig. 2 requires two original vehicles, two local vehicles, and four swap-bodies. The first original vehicle, \(OV_1\), leaves the central depot with three swap-bodies attached. It first visit switch point \(s_1\) to drop of one swap-body and then continues to switch point \(s_2\) to detach a second swap-body before serving customers \(c_8\), \(c_9\), and \(c_7\). When swap-bodies have been dropped of at \(s_1\) and \(s_2\) a local vehicle, \(LV_1\), departs from \(s_1\) to serve customers \(c_6\), \(c_5\), and \(c_4\) while local vehicle, \(LV_2\), departs from \(s_2\) to serve customers \(c_{10}\), \(c_{11}\), and \(c_{12}\). When \(OV_1\) has finished its customer tour, it returns to \(s_2\) and then to \(s_1\) to re-attach the previously detached swap-bodies before returning to the central depot. Meanwhile, an original vehicle, \(OV_2\), departs from the central depot with only one attached swap-body to directly serve customers \(c_3\), \(c_1\), and \(c_2\).

As previously stated, the HMSME-VRP shares similarities with the problem classes 2E-VRP, the TTRP, and their extensions. However, the solution depicted above also highlights some of the differences. The 2E-VRP does not allow customers to be served directly from the central depot. Therefore, in such a solution, customers \(c_1\), \(c_2\), and \(c_3\) would need to first be assigned to a satellite before being served (see Fig. 3b). Compared to the TTRP and the SB-VRP, which explicitly consider swap-bodies, the HMSME-VRP allows swap-bodies to be transferred from one vehicle to another. Allowing customers to be served directly and swap-bodies being transferred between vehicles enables the HMSME-VRP solution to cover all customers in a more time-efficient manner compared to the solution of the other two problem classes. As customers close to the central depot can be served directly, commodities do not have to be unloaded from upper-level vehicles and loaded into lower-level vehicles at the intermediate facilities. By transferring swap-bodies from original vehicles to local vehicles, a larger number of customers can be served within the same time interval.

However, in the case of the HMSME-VRP solution, more vehicles may be needed compared to TTRP. Although after transferring swap-bodies to local vehicles in the HMSME-VRP solution, original vehicles continue to serve customers, which, compared to the case of 2E-VRP, may decrease the number of vehicles required. Figure 3 further illustrates the differences in solutions of the problems.

Fig. 3
figure 3

Comparative solutions of the HMSME-VRP, 2E-VRP, and TTRP

5 Computational experimentation

The VRP is known to be NP-hard [22], and the HMSME-VRP as an extension of the VRP adds further to the complexity, rendering it computationally hard to solve. Indeed, several instances were constructed to verify and test the solvability of the model, see Tadaros [20]. However, only very small instances could be solved within reasonable computational time. For demonstration purposes, we report here on instances where the number of customers spans from 9 to 18 and the number of switch points are 3 or 4, depending on the number of customers. Furthermore, the demand is either unitary, i.e., set to 1 for each customer, or randomly generated from a discrete uniform distribution with low numbers and either low or high variance. The average tour length was assumed to include three customer stops. Therefore, the swap body capacity was set to 3 for all instances with unitary demand distribution, while for instances with randomly generated demands it was determined by \(u_t = \lceil \frac{3 \cdot \sum _{i=1}^c d_i}{c} \rceil\), where c is the number of customers. Additionally, the cost of traversing an arc, \(c_{ij}\), corresponds to the euclidean distance between the nodes i and j while fixed costs for original vehicles, \(c^1_{v}\), local vehicles, \(c^2_{v}\), and swap-body, \(c^3_{t}\), were set to 10, 5, and 1 respectively. Table 3 further describes the generated instances.

Table 3 Generated test instances

The model was implemented in Pyomo [2, 11] and all instances were solved with the Gurobi 9.5 solver [10] on a laptop with a 2.3 GHz Quad-Core Intel Core i7 processor. We attempted to solve each instance within a time limit of one hour. The results of the tests are presented in Table 4.

Table 4 Computational results

The results show that the solver could solve optimally instances of up to 12 customers and 3 switch points within a time interval not exceeding the limitation of one hour. For the instances, including up to 12 customers, all but one could be solved optimally. On the other hand, none of the instances which included more than 12 customers could be solved within the time limit. It is also evident that both the number of nodes and the demand distribution have an impact on the solution time. Considering the same amount of nodes, instances with high variance in demand distribution tend to require more time. In addition, the problem does not scale well and requires significantly more time as the number of nodes increases. A test was also performed on an instance of 20 customers and 6 switch points with unitary demand distribution, the solver could not obtain an optimal solution after running for 498,000 seconds and a gap equal to \(5.83\%\). Thus, development of heuristics and metaheuristics would then be required to solve real case instances or instances of realistic sizes.

6 Conclusions and further research

In this paper, we have introduced the HMSME-VRP, which originates from the policies of a real-world distribution company. While it shares certain similarities with previously well-studied problems, it differs from them in several important aspects, as we have demonstrated. A mixed-integer formulation of the problem is proposed, and small instances are solved to demonstrate the solution and verify the model.

As the HMSME-VRP is computationally hard to solve, further research should be directed towards developing new solution methods able to solve larger and more realistic instances. Possible methods could for example be different metaheuristics such as Variable Neighborhood Search or Ant-Colony Optimization or decomposition based methods like column generation.

It is also worth mentioning that several extensions are possible; for instance, service times and time windows can be introduced, and the inclusion of location decisions for the switch points can elevate the model to a more strategic decision making level. Additionally, the model could be used in connection with sustainable routing policies by considering mixed fleets of conventional and alternative fuel vehicles. Such a formulation would enable the optimization of fleet composition and the use of different types of vehicles for various tours. The extension would enable inclusion of additional objectives to minimize the environmental impact. The authors are currently working on several of the proposed extensions and solution methods.