<< NARVAL_R_DFS NARVAL NARVAL_R_Dijkstra >>

NARVAL >> NARVAL > NARVAL_R_DFSW

NARVAL_R_DFSW

Perform the Depth First Search algorithm from a source node on a topology in respect the node degree metric.

Calling Sequence

[go,v,pred]=NARVAL_R_DFSW(g,i,dw,ind)

Parameters

g :

network graph.

i :

source node.

dw :

display parameter.

ind :

window index.

go :

output graph.

v :

vector that gathers the chronological order how network nodes are visited.

pred :

vector composed by the predecessor of each node in order to reach the source node.

Description

NARVAL_R_DFSWeight is an enhanced version of RoutingDFS that considers the node degree metric for the research propagation along the graph rather than the node index metric. RoutingDFS aims to construct a tree inside the graph g in respect with a source node i defined as the root. This graph search algorithm begins at the root node and explores all the neighboring nodes. Then for each of those nodes with the smallest index, unexplored neighbor nodes are explored, and so on. The search is done in depth. v is a vector that gathers the chronological order how network nodes are visited. pred provides the predecessor of each node in order to reach the source node. dw is used to display the research propagation on the graph. Thus the tree starts with an initial edge width rating one unit. The last edges connected to the tree leafs are displayed with a width equal to dw. The graph is plotted in window ind.

Pseudo-Code (Wikipedia)

void DFS(Graph G, int v) { // DFS
   PreVisit(G, v); // action on the vertex v
   G.setMark(v, VISITED); // v is set as visited
   for (Edge w = G.first(v); G.isEdge(w); w = G.next(w))
              if (G.getMark(G.v2(w)) == UNVISITED)
                   DFS(G, G.v2(w));
   PostVisit(G, v); // action on the vertex v
}

Examples

n=150;//network size
L=1000;//network square area side
dmax=100;//Locality radius
[g]=NARVAL_T_LocalityConnex(n,L,dmax);//generation of a topology in respect with the Locality method
i=NARVAL_F_Random(length(g.node_x));//selection of the source node
dw=2;//display parameter
ind=1;
[go,v,pred]=NARVAL_R_DFSW(g,i,dw,ind);//application of NARVAL_R_DFSW
v
pred

Dependency

NARVAL_G_GraphDegDistWD, NARVAL_R_SearchEndW, NARVAL_G_Nodes2Path, NARVAL_G_ShowGraph

Author

http://wwwen.uni.lu/interdisciplinary_centre_for_security_reliability_and_trust

Contact

<< NARVAL_R_DFS NARVAL NARVAL_R_Dijkstra >>