<< Remov Network Topology Generator RoutingBFSWeight >>

Network Topology Generator >> Network Topology Generator > RoutingBFS

RoutingBFS

Perform the Breadth First Search algorithm from a source node on a topology in respect the node index metric.

Calling Sequence

[v,pred]=RoutingBFS(g,i,dw)

Parameters

g :

network graph.

i :

source node.

dw :

display parameter.

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

RoutingBFS constructs 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 breadth. v is a vector that gathers the chronological order how the 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.

Pseudo-Code (Wikipedia)

1. Enqueue the root node.
2. Dequeue a node and examine it.
       * If the element sought is found in this node, quit the search and return a result.
       * Otherwise enqueue any successors (the direct child nodes) that have not yet been discovered.
3. If the queue is empty, every node on the graph has been examined  quit the search and return "not found".
4. Repeat from Step 2.

Examples

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

Dependency

Author

http://wwwen.uni.lu/interdisciplinary_centre_for_security_reliability_and_trust

Contact


<< Remov Network Topology Generator RoutingBFSWeight >>