<< NARVAL_M_DijkstraMP NARVAL NARVAL_M_DistanceNPoi >>

NARVAL >> NARVAL > NARVAL_M_DijkstraWeight

NARVAL_M_DijkstraWeight

Perform the Dijkstra's algorithm on a network topology from a source node in respect with given links weights.

Calling Sequence

[dist,pred]=NARVAL_M_DijkstraWeight(n,head,tail,weight,ni)

Parameters

n :

network size.

head :

links head vector.

tail :

links tail vector.

weight :

links weight vector.

ni :

source node.

dist :

distance vector from the source node towards remaining network nodes.

pred :

predecessors vector to reach the source node from remaining network nodes.

Description

NARVAL_M_DijkstraWeight aims to perform the Dijkstra's Algorithm from the source node ni on a network topology represented by 3 vectors: head, tail and weight. Links weights are provided by the user. dist and pred permit to reconstruct the shortest path between any network nodes towards the source node ni.

Examples

n=80;//network size
L=1000;//network square area side
dmax=100;//locality radius
[g]=NARVAL_T_LocalityConnex(n,L,dmax);//generation of a random topology in respect with the Locality method. 
i=NARVAL_F_Random(length(g.node_x));//selection of the source node
ind=1;
f=NARVAL_G_ShowGraph(g,ind);
c=5;//visualization parameters 
b=10;
d=30;
i2=2;//window index
[gc,f2]=NARVAL_G_ShowNodes(g,i,c,b,d,i2);
[dist,pred]=NARVAL_M_DijkstraWeight(g.node_number,g.head,g.tail,g.edge_length,i);//Application of NARVAL_M_DijkstraWeight
i
dist
pred

Dependency

NARVAL_F_Remov, NARVAL_M_NeighborhoodN

Author

http://wwwen.uni.lu/interdisciplinary_centre_for_security_reliability_and_trust

Contact

<< NARVAL_M_DijkstraMP NARVAL NARVAL_M_DistanceNPoi >>