<< NL_R_TreeExtraction NL_R: Routing NL_R_TreePathN2R >>

NARVAL >> NL_R: Routing > NL_R_TreePathN2N

NL_R_TreePathN2N

Perform the path between two nodes of a tree.

Calling Sequence

[R] = NL_R_TreePathN2N(I,J,S,P)

Arguments

I :

Node.

J :

Node.

S :

Root.

P :

Predecessor vector.

R :

Path.

Description

NL_R_TreePathN2N performs the path R between the two nodes I and J of the tree defined by its root node S and its predecessor vector P. The algorithm finds a common ancestor between the two paths from each node I and J towards the root node. Finally the two sub-paths are merged into a single path.

Examples

n=150;//network size
L=1000;//network square area side
dmax=100;//Locality radius
[g]=NL_T_LocalityConnex(n,L,dmax);//generation of a topology in respect with the Locality method
[r,nind]=NL_F_RandVectorNoRepl(1:length(g.node_x));//selection of the root node
dw=5;//display parameter
ind=1;//window index
[ni,nind]=NL_F_RandVectorNoRepl(nind);//selection of ni
[nj,nind]=NL_F_RandVectorNoRepl(nind);//selection of nj
[go,v,pred]=NL_R_BFSPlot(g,r,dw,ind);//performance of the tree
[p1]=NL_R_TreePathN2R(ni,r,pred)//path between node ni and the root
[p2]=NL_R_TreePathN2R(nj,r,pred)//path between node nj and the root
[path]=NL_R_TreePathN2N(ni,nj,r,pred)//application of NL_R_TreePathN2N

Dependency

NL_R_TreePathN2R, NL_F_Unity

Report an issue
<< NL_R_TreeExtraction NL_R: Routing NL_R_TreePathN2R >>