Perform the 1-Hop neighborhood of the shortest path between two network nodes in respect with a routing table.
[V] = NL_G_ConnectionNeighbors(G,R,I,J,N)
Graph.
Routing table.
Emission node.
Destination node.
Graph size.
1-Hop neighborhood.
NL_G_ConnectionNeighbors performs the 1-Hop neighborhood V of the shortest path between the two nodes I and J inside the network graph G of size N. corresponds to the ith routing table used to calculate the shortest path between the connection extremal nodes.
stores all paths between any couple of distinct nodes within the network.
can be generated with the application of NL_R_RT2ERT on the routing tables created from NL_R_FloodRT, NL_R_DijkstraRT, or NL_R_BellmanFordRT. For a better convenience, we already generated a scenario whith the creation of a graph composed by 100 nodes. We have also performed 5 enhanced routing tables
providing multiple paths for each connection between two nodes. The route between the nodes
and
can be extracted at the line of index
where
represents the graph size. Then for each path stored into a single line, its hop length can be found in the first column, followed by its length and finally the path composed by a list of nodes ([hop length | length | path]).
[path]=NL_F_NLPath();//path to NARVAL module path=path+'/demos/';//folder path load(path+'RoutingTables_topo_100.dat','pt','rt1','rt2','rt3','rt4','rt5');//loading of the network routing tables load(path+'topo_100.graph','g');//loading of the network graph n=100;//network size [nd,nf]=NL_F_RandIntNiNj(n);//generation of connection extreme nodes [vs]=NL_G_ConnectionNeighbors(g,rt1,nd,nf,n);//application of NL_G_ConnectionNeighbors p=NL_R_PathERT(rt1,nd,nf,n);//shortest path extraction between nd and nf i1=1;//window index [gr,f]=NL_G_HighlightNodes(g,vs,5,10,30,i1); [pl]=NL_G_Nodes2Path(p,g); nl=length(gr.head); ec=ones(1,nl); ec(pl)=2; eb=ones(1,nl); eb(pl)=2; gr.edge_width=eb; gr.edge_color=ec; NL_G_ShowGraph(gr,i1);//graph visualization | ![]() | ![]() |