<< NARVAL_R_TBellmanFord NARVAL NARVAL_R_TFlood >>

NARVAL >> NARVAL > NARVAL_R_TDijkstra

NARVAL_R_TDijkstra

Perform the routing table of a topology in respect with the Dijkstra's algorithm.

Calling Sequence

[rt] = NARVAL_R_TDijkstra(g)

Parameters

g :

network graph.

rt :

routing table.

Description

RoutingTableDijkstra computes the shortest paths between all couples of distinct network nodes of the graph g composed by n nodes in respect with the Dijkstra's algorithm (WIKIPEDIA). The paths are stored in the routing table matrix rt. Thus the route between the nodes i and j can be read at the line of index (i-1)*n+j. The first column of rt provides each path length.

Pseudo-Code (Wikipedia)

1  function Dijkstra(Graph, source):
2      for each vertex v in Graph:           // Initializations
3          dist[v] := infinity               // Unknown distance function from source to v
4          previous[v] := undefined          // Previous node in optimal path from source
5      dist[source] := 0                     // Distance from source to source
6      Q := the set of all nodes in Graph
       // All nodes in the graph are unoptimized - thus are in Q
7      while Q is not empty:                 // The main loop
8          u := vertex in Q with smallest dist[]
9          if dist[u] = infinity:
10              break                         // all remaining vertices are inaccessible from source
11          remove u from Q
12          for each neighbor v of u:         // where v has not yet been removed from Q.
13              alt := dist[u] + dist_between(u, v) 
14              if alt is inferior to dist[v]:             // Relax (u,v,a)
15                  dist[v] := alt
16                  previous[v] := u
17      return dist[]

Examples

n=80;//network size
l=1000;//network squared area side
d=100;//Locality radius
[g]=NARVAL_T_LocalityConnex(n,l,d);//generation of a topology
ind=1;//window index
f=NARVAL_G_ShowNodesIndex(g,ind);//graph visualization
[rt]=NARVAL_R_TDijkstra(g);//application of NARVAL_R_TDijkstra
rt

Dependency

NARVAL_R_Dijkstra_i_j, NARVAL_F_RVector

Authors

Foued Melakessou

Contact

Dr. Foued Melakessou

Research Associate

Interdisciplinary Centre for Security, Reliability and Trust

Room F106

University of Luxembourg

6, rue Coudenhove Kalergi

L-1359 Luxembourg-Kirchberg

E-mail: foued.melakessou@uni.lu

Tel: (+352) 46 66 44 5346

Home Page


<< NARVAL_R_TBellmanFord NARVAL NARVAL_R_TFlood >>