Initialize a graph structure.
[G] = NL_G_GraphStructure(N,R,M,X,Y)
Graph size.
Communication range vector.
Placement mode.
Nodes' x-coordinate vector.
Nodes' y-coordinate vector.
Graph structure.
NL_G_GraphStructure initializes the graph structure G, composed by N nodes defined by their x-coordinate node.x, their y-coordinate node.y, their communication range node.cr, their speed node.v, their neighbors node.neigh, their destination coordinates [node.destx node.desty] and their energy node.en. There are 2 modes of nodes placement. If the mode M is 0, then nodes are randomly placed inside a square of side L=1000. If M=1, then the nodes are placed in the given position [X,Y].
n=100; crk=50; cr=crk*ones(1,n); m=0; [N]=NL_G_GraphStructure(n,cr,m,[],[]);//application of NL_G_GraphStructure N(1) m=1; [M]=NL_G_GraphStructure(3,cr,m,[100 200 300],[100 200 300]);//application of NL_G_GraphStructure M(1) | ![]() | ![]() |