Perform the neighborhood of the shortest path between two network nodes of a graph in respect with a routing table.
[vs]=RoutingConnNeighbor(g,rt,nd,nf,n)
network graph.
routing table.
emission node.
destination node.
network size.
1-hop neighborhood.
RoutingConnectionNeighbor performs the 1-hop neighborhood vs of the shortest path between two nodes nd and nf inside the network graph g of size n. rt corresponds to the routing table used to calculate the shortest path between the extremal connection nodes.
g=load_graph('./demos/topo_100_1.graph');//loading of the network graph load('./demos/RoutingTables_topo_100_1.dat');//loading of the network routing tables n=100;//network size [nd,nf]=Random_i_j(n);//generation of extremal connection nodes [vs]=RoutingConnNeighbor(g,rt1,nd,nf,n);//application of RoutingConnNeighbor path=RoutingPathERT(rt1,nd,nf,n);//shortest path extraction between nd and nf p=nodes_2_path(path,g);//display the neighborhood nl=length(g.head); ec=ones(1,nl); ec(p)=2; eb=ones(1,nl); eb(p)=2; nc=ones(1,n); nb=ones(1,n); nc(vs)=5; nb(vs)=2; g.node_border=nb; g.node_color=nc; g.edge_width=eb; g.edge_color=ec; show_graph(g); | ![]() | ![]() |