Skip to main content
. 2018 Oct 16;18(10):3477. doi: 10.3390/s18103477
Algorithm 1 The Generation of Minimum Routing Graph
Input: the link cost matrix U, the network size N
Output: the shortest path set MPis
1. for I = 1:N
2.  Calculate the initial shortest path mp0is of node i by Dijkstra algorithm.
3.  update MPis←MPis+mp0is
4.  Find the set of adjacent nodes NBS(i) of the shortest path mp0is.
5.  k = 1   // Start finding adjacent nodes from the first node of mp0is.
6. while (k < |mp0is|)
7.   Insert adjacent nodes from the kth node of mp0is, and get the candidate path pathtis under the current k.
8.   update Pis←Pis+pathtis
9.   k = k + 1
10. end    // Get the candidate path set Pis.
11. g = 2
12. while (g≤n)
13.  Calculate the link cost wgis by Equation (6).
14.  if wgis=w1is
15.    update MPis←MPis+pathgis
16.  end
17.  g = g + 1
18. end
19. end
20. return the shortest path set MPis