Modify the weight of links belonging to a path inside a network graph.
[Go] = NL_R_PathWeightChange(G,P,W)
Graph.
Path.
Weight.
Output graph.
NL_R_PathWeightChange modifies the weight of links belonging to the route P inside the graph G. The constant weight W is added to each link of the path.
[path]=NL_F_NLPath();//path to NARVAL module path=path+'/demos/';//folder path load(path+'topo_100.graph');//loading of the network graph load(path+'RoutingTables_topo_100.dat','pt','rt1','rt2','rt3','rt4','rt5');//loading of the network routing tables n=100;//network size [nd,nf]=NL_F_RandIntNiNj(n);//generation of extremal connection nodes [path]=NL_R_PathERT(rt1,nd,nf,n);//shortest path between nd and nf p=NL_G_Nodes2Path(path,g);//indexes of links belonging to the shortest path w=1000; g.edge_length(p)//initial length values of each path link [go]=NL_R_PathWeightChange(g,path,w);//application of NL_R_PathWeightChange go.edge_length(p)//new length values of each path link | ![]() | ![]() |