1. Introduction
The shortest path problem (SPP) is among the most fundamental ones in graph theory. It is concerned with finding the shortest path from a specified origin to a destination in a given graph or network. In general, each edge’s distance, time, and price is called cost. This paper uses “cost” to indicate the distance, time, and other physical attributes of a network. It is applied in a variety of domains (both as a stand-alone model and as a subproblem in complex problems), such as transportation [
1,
2,
3], biological networks [
4], social networks [
5], circuit board layout [
6], and robotic search/navigation processes [
7,
8,
9,
10,
11,
12,
13]. In recent years, the rapid development of sensing and Internet of Things (IoT) technology has allowed us to obtain environmental changes rapidly [
14,
15]. Since such changes impact SPP solutions, it becomes increasingly important for us to find SPP solutions efficiently. Efforts are required to develop faster algorithms than traditional and existing ones to solve SPP.
Many classical algorithms and a series of their variants are proposed, e.g., Dijkstra [
16,
17,
18], Bel, Floyd [
19,
20], Dreyfus [
21], and A-Star [
22,
23], to solve SPP. There are some other ways to solve SPP, such as simple heuristics, meta-heuristics, and neural networks. Otte and Correll (2013) [
24] propose a parallel framework of the shortest path planning algorithm based on single-query sampling. Zhang, et al. (2014) [
25] propose a novel parameter-free minimum resource neural network framework to solve shortest path problems for various graph types. Jan, et al. (2014) [
26] present a method based on Delaunay triangulation, improved Dijkstra algorithm (DA), and Fermat points to construct a new graph that can obtain near-shortest paths in a short computational time. Lei, et al. (2015) [
27] propose a parallel field-programmable gate array implementation to solve SPP. An extended systolic array priority queue is proposed to allow large-scale priority queue processing. Wang, et al. (2016) [
28] suggest an improved A-star algorithm to solve SPP with position-based learning effects. Huang, et al. (2017) [
29] adopt a position-based pruning strategy to reduce the number of node pairs. An algorithm based on point-to-point shortest path calculation is presented to improve efficiency. Li, et al. (2018) [
30] designed an efficient shortest-path algorithm that compresses an original network into a small one that preserves the graph properties used to calculate a path. Yang, et al. (2020) [
31] present an ant colony algorithm to solve the shortest path problem. Krauss, et al. (2020) [
32] propose three different approaches for solving SPP using a quadratic unconstrained binary optimization formulation suitable for development on a quantum annealing machine.
SPP expansions are also widely studied. Examples of other generalizations of SPP are the K-shortest path problem [
33], the shortest time path problem with time windows [
34], and the traveling salesman problem [
35,
36,
37,
38]. The application of the SPP extends to the realm of industrial automation. The SPP has been used to optimize and streamline processes, e.g., the design of mechanical components for automation platforms [
39], measurement of industrial robot poses [
40], and solution of characteristic equations for the elliptical trajectories of industrial robots [
41].
Chen, et al. (2013) [
42] present a stochastic travel speed model to express the problem of finding the minimal expected time path in stochastic time-dependent road networks. Feng and Korkmaz (2015) [
43] propose a new Lagrangian relaxation algorithm to solve a multi-constrained multiple SPP. Talebi, et al. (2017) [
44] study online shortest path routing over multi-hop networks. Chemodanov et al. (2018) [
45] propose a novel neighborhood method for a constrained SPP. The neighborhood method uses a search space reduction technique and has a theoretical quadratic speed-up that allows it to reach solutions faster than its peers. Li, et al. (2018) [
46] present an index-based A-Star algorithm to solve the SPP in a weighted directed acyclic graph with unknown vertex coordinates. Ganganath, et al. (2018) [
47] designed a heuristic search algorithm to find solutions to the shortest path on uneven terrains. Su, et al. (2019) [
48] propose a multi-stage meta-heuristic algorithm for solving the SPP with must-pass nodes. Kou, et al. (2019) [
49] propose two algorithms for a single-constrained SPP. Jie, et al. (2019) [
50] establish an information transmission time expectation-variance shortest path model and a fuzzy shortest path critical edge model. An improved ant colony algorithm with traffic congestion factor and random variables is developed to solve the SPP in an uncertain environment. Binh, et al. (2019) [
51] suggest an improved evolutionary algorithm that reduces the search space to overcome massive resource consumption in solving clustered shortest-path tree problems. Liu, et al. (2019) [
52] propose an optimal path selection algorithm that applies reinforcement learning strategies and designs a new length-first optimal path selection method based on prior knowledge. Xiong, et al. (2020) [
53] present an integer programming model for one-to-one pickup and a delivery problem. Two different splitting strategies are proposed to solve the split demand one-to-one pickup and delivery problem with the shortest-path transport along real-life paths. Krauss and McCollum. (2020) [
32] designed three different ways to implement the formula of the SPP on a quantum annealing computer. Thanh, et al. (2021) [
54] proposed a new method to solve clustered shortest-path tree problems based on a multifactorial evolutionary algorithm. Cosma, et al. (2021) [
55] designed a novel genetic algorithm to solve the clustered shortest path tree problem that defines meaningful genetic operators and uses an initial hybrid population.
Although the SPP is studied extensively, researchers face a challenging task when handling large and complex networks in engineering applications. Its various extension problems, such as k-shortest paths, traveling salesman problems, shortest path with time windows, and multiobjective shortest path, are all NP-hard problems. The SPP is frequently invoked when solving these problems. Reducing the running time of the SPP can greatly improve the efficiency of these algorithms. The proposal of a meta-heuristic algorithm to solve the SPP can be regarded as laying the foundation for solutions to other NP-hard problems involving the SPP. In many specific cases, practitioners just need high-quality paths within a very short time instead of the shortest ones but an unacceptably long time during which any parameter/environmental changes may void an optimal one. In other words, they need the shortest possible time or real-time response to obtain an approximate shortest path. For example, a number of attributes affecting the optimal path in an urban road can change at any time. Such changes require a real-time update of the optimal path. If the guidance is not given quickly, a driver might end up missing an intersection or entering the wrong path. A meta-heuristic algorithm becomes a preferred choice due to its controllable and limited running time and ability to find a high-quality solution [
56,
57]. The work [
58] proposes a simple meta-heuristic algorithm called Jaya to solve continuous optimization problems. Compared with other meta-heuristic algorithms, Jaya is easier to be applied because it does not need to consider complex parameters but just needs to set the number of iterations and population size as its outstanding feature. Jaya is highly competitive in comparison with other heuristic algorithms, e.g., particle swarm optimizer (PSO), genetic algorithm (GA), differential evolution (DE), artificial bee colony (ABC), and teaching-learning-based optimizer (TLBO). It has been extensively used in various fields, such as photovoltaic systems [
59], electricity theft detection [
60], power transmission [
61], unmanned aerial vehicle control [
62], manufacturing [
63], and scheduling [
64,
65].
We propose to adopt Jaya to solve the SPP for the first time because of its excellent performance and successful engineering optimization problems. The SPP aims to find the shortest path on a given network that requires connecting discrete points in series and finally giving a set of nodes and their order. It is a discrete problem. The original Jaya algorithm is not suitable for solving discrete problems. Gao, et al. (2016) [
57] propose a discrete Jaya algorithm by improving the strategy for new solution generation and applying it to manufacturing process scheduling problems. This work proposes an improved discrete Jaya (IDJaya) algorithm for solving the SPP.
Figure 1 shows the flowchart of our proposed method. This work contributes to the field of the SPP by (a) developing a discrete version of Jaya to solve it and a local search operator to improve the performance of the discrete Jaya algorithm (DJaya) and (b) comparing the proposed IDJaya with its peers.
The remainder of this paper is organized as follows. The mathematical model of the SPP is formulated in
Section 2.
Section 3 introduces the IDJaya to solve the SPP.
Section 4 presents the experimental results and their comparisons with their competitive peers. Finally,
Section 5 concludes this paper.
2. Problem Description and Mathematic Formulation
In this section, we illustrate our concerned SPP. A network is represented by an undirected and connected graph G = (V, E), where V = {v1, v2, …, vn} represents the set of nodes and E = {e1, e2, …, em} represents the set of edges. |V| = n and |E| = m represent the total number of nodes and edges in graph G, respectively. An edge between nodes va and vb is denoted by eab. Each edge has a cost cab (e.g., representing distance, time, or price) that indicates the cost between nodes va and vb. pod ∈ P is a path connecting origin (vo) and destination (vd), where P is the set of paths. The cost of pod is represented by Cod, which is calculated by summing the costs of each edge in pod.
Definition 1 (Shortest Path): For a given graph G, the shortest path from vo to vd is defined as the path with the smallest Cod.
As shown in
Figure 2, there are three alternative paths, i.e.,
: 1-2-3,
: 1-3 and
: 1-4-3. Accordingly,
= 7,
= 5 and
= 9. Here,
: 1-3 is the shortest path in this network. If there is more than one shortest path between
vo and
vd,
pod is one of them.
We formulate the SPP as follows:
subject to:
The objective function (1) serves to minimize path costs. Constraint (2) guarantees network connectivity. (3) restricts that the network is an undirected graph. (4) ensures that each node is accessed at most once, i.e., paths have no loops. (5) defines a binary decision variable.
3. Proposed Solution Approach
As networks become large, classic SPP algorithms fail to handle the SPP. A new discrete Jaya algorithm is thus proposed to solve it. Original Jaya is not suitable for solving the SPP because each node is discrete, and Jaya cannot give a solution with discrete values. We extend Jaya by revising a generation strategy of solutions to address this problem such that the proposed IDJaya can access nodes in a network to generate candidate solutions (paths).
3.1. Original Jaya Algorithm
Jaya is a novel and simple algorithm. It produces new solutions and constantly tries to find the solutions closer to the optimal solution but away from the worst one. Note that “Jaya” means victory in Sanskrit. Its performance relies on only two parameters, i.e., the number of iterations and population size. It can be viewed as being parameter-free when compared with other popular nature-inspired algorithms such as PSO and ACO. Its simplicity makes it convenient to implement in any programming language, and it is also easy to convert codes between different programming languages. It has the following steps according to [
58]:
1. Initializing the population size (K), termination condition (i.e., number of iterations), and number of decision variables.
2. Finding the best and worst solutions in population.
3. Generating new solutions via:
4. If the new solution is superior to the best solution, then replace the latter with the former.
5. Comparing original solutions with new ones and saving top K results.
6. Determining whether a pre-given termination condition is met. If so, output results. Otherwise, repeat Steps 2–6.
3.2. Discrete Jaya Algorithm for SPP
Jaya is proposed to solve a continuous optimization problem. Since the SSP is discrete, we have to design a new solution generation strategy to make Jaya suitable for the SPP. Therefore, a discrete Jaya algorithm (DJaya) for solving the SPP is proposed. An additional term that can randomly generate adjacent nodes is added to increase the exploration ability of DJaya, called IDJaya. The difference between IDJaya and DJaya is that IDJaya adds a local search algorithm to improve its solution accuracy. Due to the particularity of the SPP, a newly produced node may not be in an original path, and parameters
// are thus added to ensure the connectivity of the generated paths. IDJaya generates a set of points and builds a path as follows:
where
ri is a binary random number taking 0 or 1 at random and satisfying that only one of them be 1, implying that only one of them is selected to produce a new node;
,
and
are introduced to prevent IDJaya from being unable to continue running since newly generated nodes are not in the paths. They are used to determine whether the node is in the initial path, best path, and worst path, respectively. They are binary decision variables.
= 1 when the node can be found in the initial path, and otherwise zero. So are
and
. For example, a newly generated node is 6. Assuming that the initial path and best path contain node 6, we have:
=
= 1 and
= 0.
is a newly generated node and
is an alternative one that is the next node on the selected path.
and
represent the next node on the best and worst paths, respectively.
includes all nodes accessible by the previous point (except the points that are already in the path). We later give a simple example to show how it works.
Unlike Jaya’s solution generation strategy, (7) generates a node in a new path instead of a complete solution. It is constantly called until a new complete path is generated from the origin to the destination. These newly generated nodes build a new path, as shown in (8). The remaining process of the IDJaya is the same as that of the original Jaya.
Figure 3 shows the flowchart of IDJaya.
IDJaya requires initial solutions for operation. Initial solutions refer to random paths between an origin to a destination. In order to overcome the difficulty of initial path acquisition in large networks, we propose a random path generation method based on orientation. It always visits a new point in the same direction toward the destination to ensure that a random path can be found quickly.
The idea of our algorithm is based on Jaya. We propose a new solution generation strategy such that Jaya can solve the path problems. A node in a new path is generated when the strategy is invoked. (7) is repeatedly used until the destination is visited and a new path is produced. Its complete procedure is described in pseudo-code of IDJaya with the following steps: (1) set parameters, i.e., population size and the number of iterations; (2) calculate the cost of initial paths and find out the best and worst solutions; (3) select a path in sequence and generate a new point according to Step 6; (4) repeat steps 5–7 until the destination is visited, thus resulting in a new path; (5) use this method to produce corresponding new paths for all initial ones; (6) call the local search algorithm to generate new solutions; (7) compare all paths and select the top K optimal solutions as the latest path group. (8) repeat the above steps until termination conditions are met, i.e., the maximum number of iterations is reached.; (9) output a path with the lowest cost. {Rk} is a set of paths that is constantly being updated as the algorithm is executed (Algorithm 1).
Algorithm 1. Improved discrete Jaya for shortest path problems (IDJaya) |
Input: Origin O, Destination D, Road network G, Population size K, Maximal iteration count Output: The shortest path- 1.
Calculate {COD} - 2.
Obtain the best value of C (i.e., (COD)best) and the worst value of C (i.e., (COD)worst) - 3.
- 4.
for k = 1 to K - 5.
for j = 1 to c - 6.
- 7.
end for - 8.
←} - 9.
Pk ←) - 10.
end for - 11.
{Rk} ←, Pk} - 12.
end for - 13.
output min C{Rk}
|
A local search algorithm is applied to IDJaya to expand the scope of solution exploration and improve the quality of solutions. In the local search algorithm, α is a randomly selected point in pod. ε represents newly extended points that form a segment. Its steps are as follows: (1) randomly select a node in a path generated by IDJaya; (2) randomly access adjacent nodes from a node selected in the previous step; (3) stop access when a newly accessed node belongs to the initial path or the number of iterations reaches a set value; (4) connect several segments to form a new path; (5) repeat the above steps until the number of paths generated reaches the set value. It ends when the iteration is completed or a newly generated segment returns to the original path. Its time complexity is O(nβγ), and TLocal ≈ O(n) can be obtained. TLocal is the time complexity of a local search algorithm. n is the number of nodes. β and γ are two parameters in a local search algorithm. They mean that a local search algorithm is executed to generate at most β paths by exploring no more than γ nodes. Their settings need to prevent the algorithm from wasting too much computing time. As β and γ increase, more paths are generated, and accordingly, more high-quality solutions are likely to be obtained. However, as they increase, so does the running time. β and γ are not sensitive to the size of a network. Their values directly affect the selection range of alternative paths. Larger networks may require more alternative paths to find the optimal solution, but the size of a network does not affect β and γ values. After some experiments, we set β = 5 and γ = 10 as their proper values (Algorithm 2).
Algorithm 2. Local search algorithm |
Input: A path generated by IDJaya (pod) Output: A set of paths
- 1.
for β = 1 to 5 - 2.
in pod (except origin and destination) - 3.
from the other points in pod - 4.
and segment = ∅ - 5.
for γ = 2 to 11 - 6.
(excluding connections severed in step 3) - 7.
∈ pod - 8.
P ← p - 9.
end if - 10.
segment ←segment + - 11.
end for - 12.
- 13.
p ←segmentoε + segment + segmentαd - 14.
else if - 15.
p ←segmentoα + segment + segmentεd - 16.
end if - 17.
P ← p - 18.
end for - 19.
Output P
|
Theorem 1. The computational complexity of IDJaya is O(cK).
Proof of Theorem 1. First of all, we summarize the complexity of each step in IDJaya in
Table 1.
Based on
Table 1, we formulate the computational complexity of IDJaya as follows:
where
is the number of iterations and
K is the population size.
c is the number of nodes on a path. In the worst case, a path passes through all nodes in a network, i.e.,
c =
m. On average,
c << m.
n is a constant. □