<< RoutingPathWeightMod Network Topology Generator RoutingPrim >>

Network Topology Generator >> Network Topology Generator > RoutingPredRoute

RoutingPredRoute

Perform the shortest path between two network nodes in respect with the predecessor vector generated by the Bellman-Ford algorithm, the Dijkstra's algorithm, BFS, DFS or the Prim's algorithm.

Calling Sequence

[path]=RoutingPredRoute(pred,dist,i,j)

Parameters

pred :

vector composed by the predecessor of each node in order to reach the source node.

dist :

vector composed by the distance between each node and the source node.

i :

emission node.

j :

destination node.

path :

route between i and j.

Description

RoutingPredRoute performs the path path between 2 network nodes i and j in respect with the predecessor vector pred generated by the Bellman-Ford algorithm, the Dijkstra's algorithm, BFS, DFS or the Prim's algorithm applied in i.

Examples

n=150;//network size
l=1000;//network squared area side
d=100;//Locality radius
[g]=NtgLocalityConnex(n,l,d);//application of NtgLocalityConnex
nf=length(g.node_x);//real network size
nl=length(g.head);//quantity of network links
[i,j]=Random_i_j(nf);//selection of the emission and destination nodes
[dist,pred]=RoutingDijkstraO(g,i);//application of DijkstraO
[path]=RoutingPredRoute(pred,dist,i,j)//application of PredRoute
p=nodes_2_path(path,g);//display the path between i and j
EC=ones(1,nl);
EB=ones(1,nl);
EC(p)=5;
EB(p)=2;
D=ones(1,nf);
D(path)=3;
g.node_border=D;
g.edge_color=EC;
g.edge_width=EB;
show_graph(g);
path

Author

http://wwwen.uni.lu/interdisciplinary_centre_for_security_reliability_and_trust

Contact


<< RoutingPathWeightMod Network Topology Generator RoutingPrim >>