Vous êtes sur la page 1sur 4

Fig.

Shortest Path for (Setopul to Ratna Rajya School, Mahadevsthan) Baneswor Area
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
1 0 15.9 999999 999999 999999 999999 999999 370.66 999999 999999 999999 999999 999999 999999 999999 999999 999999 999999
2 15.9 0 153.6 999999 190.29 999999 999999 999999 999999 999999 999999 999999 999999 999999 999999 999999 999999 999999
3 999999 153.6 0 174.1 999999 145.96 999999 999999 999999 999999 999999 999999 999999 999999 999999 999999 999999 999999
4 999999 999999 174.1 0 999999 999999 174.22 999999 999999 999999 999999 999999 999999 999999 999999 999999 999999 999999
5 999999 190.29 999999 999999 0 142.79 999999 999999 157.57 999999 999999 999999 999999 999999 999999 999999 999999 999999
6 999999 999999 145.96 999999 142.79 0 132 999999 999999 999999 999999 999999 999999 999999 999999 999999 999999 999999
7 999999 999999 999999 174.22 999999 132 0 999999 999999 137.17 999999 999999 999999 999999 999999 999999 999999 999999
8 370.66 999999 999999 999999 999999 999999 999999 0 74.4 999999 309.5 999999 999999 999999 999999 999999 999999 999999
9 999999 999999 999999 999999 157.57 999999 999999 74.4 0 213.18 999999 999999 999999 999999 999999 999999 999999 999999
10 999999 999999 999999 999999 999999 999999 137.17 999999 213.18 0 999999 999999 999999 170.6 999999 999999 999999 999999
11 999999 999999 999999 999999 999999 999999 999999 309.5 999999 999999 0 199.8 999999 999999 999999 158 999999 999999
12 999999 999999 999999 999999 999999 999999 999999 999999 999999 999999 199.8 0 132.9 999999 999999 999999 109 999999
13 999999 999999 999999 999999 999999 999999 999999 999999 999999 999999 999999 132.9 0 189.7 129.2 999999 999999 999999
14 999999 999999 999999 999999 999999 999999 999999 999999 999999 999999 999999 999999 189.7 0 81.2 999999 999999 999999
15 999999 999999 999999 999999 999999 999999 999999 999999 999999 999999 999999 999999 129.2 81.2 0 999999 999999 125
16 999999 999999 999999 999999 999999 999999 999999 999999 999999 999999 158 999999 999999 999999 999999 0 190.8 999999
17 999999 999999 999999 999999 999999 999999 999999 999999 999999 999999 999999 109 999999 999999 999999 190.8 0 274.1
18 999999 999999 999999 999999 999999 999999 999999 999999 999999 999999 999999 999999 999999 999999 125 999999 274.1 0

Fig. O-D Matrix (input)

Fig. Matlab Code for Floyd Warshall


Fig. Solution O-D Matrix (output) in Matlab using Floyd Warshall

Thus, Floyd Warshall gives possible shortest path distance for all the nodes.

Taking an example route of 1 to 18.

Here, the shortest distance from Node-1 to Node-18 is solved out to be 953.74 metres.
Fig. alternate convenient way in matlab, input and solution (extra)

Taking the same example route of 1 to 18.

Here, the shortest route from Node-1 to Node-18 is solved out to be through nodes 1-2-5-9-10-14-18.