<< NL_R_ARCSubRoot NL_R: Routing NL_R_ARCSubTreeFromNode >>

NARVAL >> NL_R: Routing > NL_R_ARCSubRootARC

NL_R_ARCSubRootARC

Compute the new arc from a sub-root and a sub-heir.

Calling Sequence

[A,C,M,I]=NL_R_ARCSubRootARC(G,SR,SH,A,C,M,I)

Arguments

G :

Graph.

SR :

Sub-root.

SH :

Sub-heir.

A :

ARC set.

C :

Candidate nodes.

M :

ARCset matrix.

:

quantity of discovered arcs.

Description

NL_R_ARCSubRootARC computes the new arc starting from the sub-root SR and the sub-heir SH from the ARC set A describe by its matrix M composed by I arcs.

Examples

nodx=[600 400 800 300 500 700 900 200 400 600 800 100 300 500 700];
nody=[900 700 700 500 500 500 500 300 300 300 300 100 100 100 100];
he=[1 1 2 2 3 3 4 4 4 5 5 6 6 7 8 8 9 9 9 10 10 10 13 14];
ta=[2 3 4 5 6 7 5 8 9 9 10 7 11 11 9 12 10 13 14 11 14 15 14 15];
n=15;
[g] = NL_G_MakeGraph('ARC',n,ta,he,nodx,nody);
//R A B D C M K L E F J N G H I 
f=NL_G_ShowGraphN(g,1);
s=1;//root node
Heir1=2;
Heir2=3;
[mat1,mat2,nod1,nod2,arc,p1,p2]=NL_R_ARCFirstARC(g,s,Heir1,Heir2);//building of the first arc
cand=1:g.node_number;//list of candidate
arcset=unique(arc);
cand=NL_F_RemoveVecIndexes(cand,arcset);
matarc=zeros(g.node_number+3,g.node_number+3);
matarc(1,1:length(arc))=arc;
matarc(1,$)=length(arc);
imatarc=1;//number of arc stored
subrootselection=[s];
[subroot,subheir]=NL_R_ARCSubRoot(g,arcset,subrootselection,cand);
[arcset,cand,matarc,imatarc]=NL_R_ARCSubRootARC(g,subroot,subheir,arcset,cand,matarc,imatarc)//Application of NL_R_ARCSubRootARC

Dependency

NL_F_RemoveFirstOcc, NL_F_RandVectorNoRepl, NL_G_NodeNeighbors, NL_F_CommonValuesVectors

Report an issue
<< NL_R_ARCSubRoot NL_R: Routing NL_R_ARCSubTreeFromNode >>