Display a network graph in respect with a defined metric per node.
[g]=DisplayGraph(g,bu,bo,bum,p)
network graph.
metric level of each network node used for the display.
maximal node border.
maximal metric level.
display ratio.
DisplayGraph displays the graph g in respect with a defined metric stored in the vector bu. For instance, it can be used to represent the network load state consisting of the current level of each router buffer at the time t. Thus if this metric is bounded by bum, then the nodes having this extremal value will be displayed with a border equal to bo. This function has been designed in order to show the congestion state of a network. Thus when a router buffer is inferior to one half of bum, it is displayed in black. Moreover the node border is proportional to its metric value. When it is included into the range [1/2,3/4]*bum, it is represented in blue. Else it is displayed in red when it is greater than 3/4*bum.
n=80;//network size L=1000;//network square area side dmax=100;//locality radius [g]=NtgLocalityConnex(n,L,dmax);//generation of a random topology in respect with the Locality method. bo=20;//maximal node border bum=bo;//maximal metric level p=1;//the graph is fully represented 100% nf=length(g.node_x);//real network size bu=int((bo+1)*rand(nf,1));//generation of a random state [g]=DisplayGraph(g,bu,bo,bum,p);//application of DisplayGraph g | ![]() | ![]() |