Modify the weight of links belonging to a path inside a network graph.
[g]=NARVAL_R_PathWeightMod(g,path,w)
maximal value.
connection path.
additional weight.
NARVAL_R_PathWeightMod modifies the weight of links belonging to the route path inside the network graph g. The constant weight w is added to any link of the path.
[path]=NARVAL_F_NARVALPath();//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]=NARVAL_F_Random_i_j(n);//generation of extremal connection nodes [path]=NARVAL_R_PathERT(rt1,nd,nf,n);//shortest path between nd and nf p=NARVAL_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 [g]=NARVAL_R_PathWeightMod(g,path,w);//application of NARVAL_R_PathWeightMod g.edge_length(p)//new length values of each path link | ![]() | ![]() |