Perform the modified Dijkstra's algorithm on a network topology between two nodes in respect with given links weights.
[P1,P2,P3,P4,P5]=MobilityDijkstraMP(n,head,tail,weight,ni,nj,w)
network size.
links head vector.
links tail vector.
links weight vector.
source node.
destination node.
weight.
first path.
second path.
third path.
fourth path.
fifth path.
MobilityDijkstraMP performs the modified Dijkstra's Algorithm in order to find multiple paths between a source node ni and a destination node nj on a network topology. Weights of links are assumed to be stored in the vector weight. The generation of new paths is made according to iterative applications of the Dijkstra's algorithm on a changing topology where weights of links belonging to the current shortest path are changed to larger values.
n=80;//network size L=1000;//network square area side dmax=100;//locality radius [g]=NtgLocalityConnex(n,L,dmax);//generation of a random topology in respect with the Locality method. [ni,nj]=Random_i_j(length(g.node_x));//selection of connection nodes show_graph(g); hilite_nodes([ni nj]); [P1,P2,P3,P4,P5]=MobilityDijkstraMP(length(g.node_x),g.head,g.tail,g.edges.data.length,ni,nj,L);//Application of MobilityDijkstraMP P1 P2 P3 P4 P5 | ![]() | ![]() |