Modify the weight of links belonging to a path inside a network graph.
[g]=RoutingPathWeightMod(g,path,w)
maximal value.
connection path.
additional weight.
RoutingPathWeightMod 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.
g=load_graph('./demos/topo_100_1.graph');//loading of the network graph load('./demos/RoutingTables_topo_100_1.dat'); n=100;//network size [nd,nf]=Random_i_j(n);//generation of extremal connection nodes [path]=RoutingPathERT(rt1,nd,nf,n);//shortest path between nd and nf p=nodes_2_path(path,g);//indexes of links belonging to the shortest path w=1000; g.edges.data.length(p)//initial length values of each path link [g]=RoutingPathWeightMod(g,path,w);//application of RoutingPathWeightMod g.edges.data.length(p)//new length values of each path link | ![]() | ![]() |