Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

JOURNAL OF COMPUTING, VOLUME 2, ISSUE 8, AUGUST 2010, ISSN 2151-9617

HTTPS://SITES.GOOGLE.COM/SITE/JOURNALOFCOMPUTING/
WWW.JOURNALOFCOMPUTING.ORG 102

Optimization of Landmark preprocessing with


Multicore Systems
R. KALPANA and Dr. P. THAMBIDURAI

Abstract—Determining a shortest path between two given nodes in a directed graph is a common task which is traditionally solved using
Dijkstra’s algorithm [1]. There are many techniques available to speedup the Dijkstra’s algorithm while guaranteeing the optimality of the solu-
tion. Almost all of the speedup techniques have a substantial amount of parallelism that can be exploited to decrease its running time. The
main focus of the work is to implement landmark technique and to identify the segment of the code in landmark preprocessing which can be
parallelized to obtain better speedup. The results are compared and analyzed for better performance improvements.

Index Terms— Dijkstra’s Algorithm, Graph Theory, parallel programming, running time, speed-up
——————————  ——————————

1 INTRODUCTION
A directed simple graph G is a pair (V, E), where paths in a directed graph with nonnegative edge weights
V is the set of nodes / vertices and E  V  V is a set of is that of Dijkstra’s algorithm[1]. Dijkstra’s algorithm im-
edges, where an edge is an ordered pair of nodes of the plemented with Fibonacci heaps is still the fastest known
form (u, v) such that u , v  V . Usually the number of algorithm for the general case of arbitrary nonnegative
nodes V is denoted by n and the number of edges E is edge lengths, taking O ( m  n log n) worst-case time. For
denoted by m. A path in graph G is a sequence of nodes special cases (eg. undirected graphs, integral or uniformly
( u ,..., u ) so that (u , u )  E for all 1  i  k . A distributed edge weights), better algorithms are known.
path 1 in which
k i  1 a cycle or cyclic path.
iis called
u u
1 edge
Given the k weights l : E  R , the length of
2 RELATED WORK
the path P  (u ,..., u ) is the sum of the lengths of its
edges l ( P ) : 1 k Computing shortest paths between nodes in a given di-
1  i  k l ( ui , ui  1 ) . For any two nodes
s , t  V , a shortest s-t path is a path of minimal length rected graph is classically solved by Dijkstra’s algorithm.
with u  s and u  t . The distance d ( s , t ) between s But besides Dijkstra’s algorithm there are many recent
and t is1 the length kof the shortest path s-t. A layout of a algorithms that solve variants and special cases of the
graph G  (V , E ) is a function L : V  R 2 that assigns shortest-path problem with better running time. Typical-
each node a position in R 2 . A graph is called sparse if ly, such improvements of Dijkstra’s algorithm cannot be
m  O (n ) . proved to be asymptotically faster than the original algo-
A. Shortest Path Problem rithm, and, in this sense are heuristics. However, it can be
Let G = (V, E) be a directed graph whose edges empirically shown that they indeed improve the running
are weighted by a function w : E  R . The weights are time drastically for many realistic data sets. The speedup
interpreted as the edges’ lengths in the sense that the techniques namely Bidirectional search[2], Goal directed
length of a path is the sum of the weights of its edges. The search[3], Multilevel search[4],[5], Shortest path contain-
single-source single-target (SSST) shortest-path problem ers[6] are validated to give better improvements over
consists in finding a path of minimum length from a giv- Dijkstra. The combination of the above mentioned spee-
en source s  V to a given target t  V . The problem is dup techniques are discussed in [7]. Parallelizing the
only well defined for all pairs, if G does not contain nega- speedup techniques is discussed in [8]. Highway node
tive cycles. In the presence of negative weights, but not routing is parallelized to obtain better speedup. 
negative cycles, it is possible, using Johnson’s algorithm,
to convert in O(nm  n 2 log n) time the original edge A* SEARCH AND LANDMARKS 
weights w : E  R to non-negative edge weights   A  new  shortest  path  algorithm  that  uses  A* 

w : E  R0 that result in the same shortest paths. search in combination with a new graph‐theoretic lower‐
Hence, it can be safely assumed that the edge weights are bounding technique based on landmarks and the triangle 
non-negative. It can also be assumed that for all pairs inequality  is  explained[7].  The  algorithm  computes  op‐
( s, t )  V  V , the shortest path from s to t is unique. timal  shortest  paths  and  works  on  any  directed  graph. 
The classical algorithm for computing shortest
Experimental results show that the new technique outper‐
forms A*  search  with  Euclidean  bounds,  by  a  wide  mar‐
————————————————
 F.A. Author is with Department of Computer Science & Engineering,
gin on road networks [7]. 
Pondicherry Engineering College, Pondicherry -605014, India.   It is noted in [7] that to find a shortest path with 
 S.B. Author is with Perunthalaivar Kamarajar Institute of Engineering & 1,000 vertices on a graph with 3,000,000 vertices, the algo‐
Technolgy, Karaikal, Pondicherry, India
rithm typically scans only 10,000 vertices, which is a tiny 
fraction of the total number of vertices. 
JOURNAL OF COMPUTING, VOLUME 2, ISSUE 8, AUGUST 2010, ISSN 2151-9617
HTTPS://SITES.GOOGLE.COM/SITE/JOURNALOFCOMPUTING/
WWW.JOURNALOFCOMPUTING.ORG 103

  imized. 
2.3.1 Potential Function    For  road  graphs  and  other  geometric  graphs, 
  A  potential  function  is  a  function,  from  vertices  having  a  landmark  geometrically  lying  behind  the  desti‐
to reals. Given a potential function π, the reduced cost of  nation  tends  to  give  good  bounds.  Consider  a  map  or  a 
an edge is defined as follows  graph  drawing  on  the  plane  where  graph  and  geometric 
     l ( v , w )  l ( v , w )   ( v )   ( w )                    (2.1)  distances  are  strongly  correlated.  The  graph  does  not 

need  to  be  planar;  for  example,  road  networks  are  not 
  Suppose  l  is replaced by l then for any two ver‐
 planar. A simple landmark selection algorithm in this case 
tices  x  and  y,  the  length  of  any  x‐y  path  changes  by  the  works  as  follows.  First  a  vertex  c  closest  to  the  centre  of 
same amount   ( y )   ( x ) . Thus a path is a shortest path  the embedding is found. The embedding is divided into k 
with respect to  l  iff it is a shortest path with respect to  l   pie  slice  sectors  centred  at  c,  each  containing  approx‐
 imately  the  same  number  of  vertices.  For  each  sector,  a 
and the two problems are equivalent.  vertex is selected that is farthest away from the centre. To 
  Note  that,  π  is  feasible  if  l   is  nonnegative  for  avoid having two landmarks close to each other, if sector 

A  is  processed  and  sector  B  is  being  processed  such  that 
all arcs. It is well known that if   (t )  0  and π is feasible, 
the landmark for A is close to the border of A and B, the 
then  for  any  v,   (v )   is  a  lower  bound  on  the  distance 
vertices  of  B  close  to  the  border  are  skipped.  This  is  re‐
from v to t. It is to be noted that  ferred to as planar landmark selection.  
  Lemma  2.1  If   and   are  feasible  potential    With  the  landmarks  selected,  the  distance  be‐
1 2
tween  the  other  vertices  and  the  landmarks  can  be  uti‐
functions, then  p  max(  ,  ) is feasible. 
1 2 lized for obtaining estimates on the distance to the target.  
  Feasible  potential  functions  can  be  combined  by     
taking the minimum, or, the average of feasible potential  2.4 OPENMP 
functions. The maximum is used in particular to combine  OpenMP  is  an  Application  Programming  Inter‐
feasible  lower  bound  functions  in  order  to  get  one  that  face  (API)  [9]  for  portable  shared  memory  parallel  pro‐
any vertex is at least as high as each original function.  gramming.  The  API  allows  an  incremental  approach  to 
2.3.2 A* Search  parallelize an existing code, so that portions of a program 
  Consider the problem of looking for a path from  can  be  parallelized  in  successive  steps.  This  is  a  marked 
s to t and assume that a function   : V  R  exists such  difference  between  OpenMP  and  other  parallel  pro‐
t
gramming  paradigms  where  the  entire  program  must  be 
that   (v ) gives  an  estimate  on  the  distance  from  v  to  t. 
t converted in one step. 
A*  search  is  an  algorithm  that  works  like  Dijkstra’s  algo‐ 2.4.1 Fork and Join Model of OpenMP 
rithm, except that at each step it selects a labelled vertex v     Multithreaded programs can be written in differ‐
with  the  smallest  value  k ( v )  d ( v )   ( v )   to  scan  ent  ways  that  allows  complex  interaction  between 
s t threads. OpenMP provides a simple structured approach 
next.  It  is  easy  to  verify  that  A*  search  is  equivalent  to 
to  multithreaded  programming.  OpenMP  supports  a 
Dijkstra’s  algorithm  on  the  graph  with  length  function 
fork‐join programming model as shown in Fig. 1. 
l .  
   In this approach, the program starts as a 
t
single thread of execution. Whenever an OpenMP parallel 
2.3.3 Landmark Selection  construct is encountered by a thread while it is executing 
  Finding good landmarks is critical for the overall  the program, it creates a team of threads (this is the fork), 
performance of lower‐bounding algorithms. Let k denote  becomes the master of the team, and collaborates with the 
the  number  of  landmarks.  The  simplest  way  of  selecting  other  members  of  the  team  to  execute  the  code  enclosed 
landmarks  is  to  select  k  landmark  vertices  at  random.  by  the  construct.  At  the  end  of  the  construct,  only  the 
Better choices are possible.  original thread continues; all others terminate (this is the 
  One greedy landmark selection algorithm works  join).  Each  portion  of  code  enclosed  by  a  parallel  con‐
as  follows.  A  start  vertex  is  selected  and  a  vertex  that  is  struct is called a parallel region. 
farthest away from it is found. Add the new vertex to the   
set of landmarks. Proceed in iterations, at each of the ite‐
ration finding a vertex that is farthest away from the cur‐
rent  set  of  landmarks  and  adding  the  vertex  to  the  set. 
This algorithm can be viewed as a quick approximation to 
the problem of selecting a set of k vertices so that the min‐
imum distance between a pair of selected vertices is max‐
JOURNAL OF COMPUTING, VOLUME 2, ISSUE 8, AUGUST 2010, ISSN 2151-9617
HTTPS://SITES.GOOGLE.COM/SITE/JOURNALOFCOMPUTING/
WWW.JOURNALOFCOMPUTING.ORG 104

on  1  processor,  then  in  an  ideal  situation,  the  execution 


time  on  P  processors  should  be  T1/P.  If  TP  denotes  the 
execution time on P processors, then the ratio 
S  T / T                                                                     (2.3) 
1 P
is referred to as the parallel speedup and is a measure for 
the  success  of  the  parallelization.  However,  a  number  of 
obstacles  usually  have  to  be  overcome  before  perfect 
speedup  is  achievable.  Virtually  all  programs  contain 
some regions that are suitable for parallelization and oth‐
er regions that are not. By using an increasing number of 
processors, the time spent in the parallelized parts of the 
  program  is  reduced,  but  the  sequential  section  remains 
Fig. 1. Fork and Join of OpenMP (from [9]) the  same.  Eventually  the  execution  time  is  completely 
dominated  by  the  time  taken  to  compute  the  sequential 
  OpenMP  expects  the  application  developer  to  portion, which puts an upper limit on the expected spee‐
give  a  high‐level  specification  of  the  parallelism  in  the  dup.  This  effect,  known  as  Amdahl’s  law,  can  be  formu‐
program  and  the  method  for  exploiting  that  parallelism.  lated as 
The  OpenMP  implementation  will  take  care  of  the  low‐ 1                                           (2.2) 
S
level  details  of  actually  creating  independent  threads  to  (f / P  (1  f ))
par par
execute the code and to assign work to them according to 
where fpar is the parallel fraction of the code and P is the 
the strategy specified by the programmer. 
number  of  processors.  In  the  ideal  case  when  all  of  the 
2.4.2 Features provided by OpenMP 
code  runs  in  parallel,  fpar  =  1,  the  expected  speedup  is 
OpenMP provides the following features that can 
equal to the number of processors. 
be utilized by a user (i) create teams of threads for parallel 
execution   (ii) specify how work  must be shared among 
the  threads  (iii)  scope  for  variables  (iv)  synchronization  3 SPEEDUP TECHNIQUES
constructs.  Creating  a  team  of  threads  is  achieved  using  A* search in combination with a new graph-theoretic
parallel construct.  lower-bounding technique based on landmarks and the
#pragma omp parallel [clause [[,] clause]…]  triangle inequality is explained in [3]. The algorithm
        Structured block  computes optimal shortest paths and works on any di-
  rected graph. Experimental results show that the new
technique outperforms A* search with Euclidean bounds,
  Although  this  construct  ensures  that  computa‐
by a wide margin on road networks [3]. Phol [2] studied
tions  in  the  associated  parallel  region  are  performed  in  the relationship between A* search and Dijkstra’s algo-
parallel,  it  does  not  distribute  the  work  among  the  rithm in the context of P2P problem.
threads in a team. There is an implied barrier at the end of 
the parallel region that forces all threads to wait until the  3.1 LandMarks
work inside the region has been completed.  The search space of Dijkstra’s algorithm can be
  There are three work sharing constructs available  reduced by using landmarks. Heuristic estimates on the
in OpenMP.  distance of a vertex to the target can be calculated using
1) #pragma omp for         (Used  for  sharing  landmarks. Landmarks tend to attract the search towards
them and so by appropriately selecting landmarks the
iterations in a loop) 
overall performance can be improved.
3.2 Landmark Selection
2) #pragma  omp  sections  (Specify  different 
For incorporating landmarks into shortest path
work for each thread individually)  computation the following additions are to be made to
the existing shortest path computation technique: A pro-
3) #pragma  omp  single          (Allow  only  one  cedure for selecting landmarks, computing the distance
thread to execute the enclosed region)  values from the landmarks to the remaining vertices and
utilizing the computed distance values to obtain heuristic
  OpenMP  provides  many  constructs  for  synchro‐ estimates which could be used to modify the priority of
nization. Locks are also supported.   vertices to be considered.
  This section presented a brief introduction to the 
OpenMP API used for parallel programming.   The landmark selection procedure is briefed in
2.4.3 Amdahl’s Law  code segment 1. The procedure used for selecting land-
If T1 denotes the execution time of an application  marks is called “Farthest landmark selection technique”.
JOURNAL OF COMPUTING, VOLUME 2, ISSUE 8, AUGUST 2010, ISSN 2151-9617
HTTPS://SITES.GOOGLE.COM/SITE/JOURNALOFCOMPUTING/
WWW.JOURNALOFCOMPUTING.ORG 105
The idea behind this procedure is that, landmarks are 3.4 Land marks with parallelised preprocessing
chosen in such a way that they are far apart, i.e. the The distance calculation part in the preprocess-
landmarks are spread throughout the entire graph and ing phase can be parallelised as follows: The shortest path
this helps to obtain good potential values for any vertex distance computation between each landmark and the
chosen at random without any bias. The data structure remaining vertices can be carried out in parallel. Code
“landmarks” is a list containing the landmarks chosen by Segment 2 highlights the modifications to be made during
the procedure. “LANDMARKCOUNT” indicates the the actual shortest path evaluation. Before updating the
number of landmarks required. The selection procedure distance value of a vertex ‘v’, the maximum “distance
proceeds as follows. A single-source all-target shortest difference” between the vertex ‘v’ and the various land-
path query is initiated similar to traditional Dijkstra’s al- marks is calculated and stored in “maxdiff”. This serves
gorithm. as a heuristic estimate of the distance between the vertex
and the target. Hence the priority is updated only if the
sum of, known distance from source and an estimate of
1 for(int landmarkSelected = 0; landmarkSelected < LAND-
MARKCOUNT; the distance from the vertex to the target is less than the
2 landmarkSelected++) { previously available priority.
3 forall_nodes(v,G) {
4 if(v == s) dist[v] = 0; else dist[v] = MAXDOUBLE;
5 PQ.insert(v,dist[v]); 1 //Include Landmark based potentials also
6 } 2 maxdiff = nodeLandmarkInfo[v].nLInfo[0].dist –
7 while ( !PQ.empty() ) { 3 nodeLandmarkInfo[t].nLInfo[0].dist;
8 u = PQ.del_min(); 4 for(int landmarkCount = 1; landmarkCount <
9 if( dist[u] == MAXDOUBLE ) { LANDMARKCOUNT;
10 PQ.clear(); 5 landmarkCount++) {
11 break; 6 diff = nodeLandmarkIn-
12 } fo[v].nLInfo[landmarkCount].dist –
13 forall_adj_edges(e,u) { 7 nodeLandmarkIn-
14 v = target(e); fo[t].nLInfo[landmarkCount].dist;
15 8 //Triangle Inequality part
16 double c = dist[u] + cost[e];
17 if ( c < dist[v] ) { 9 if( diff > maxdiff )
18 PQ.decrease_p(v,c); dist[v] = c; 10 maxdiff = diff; //Choose the max Lower Bound
19 } 11 }
20 }//Neighbour distance updation ends 12 double c = dist[u] + cost[e] + maxdiff; //Update cost
21 }//While the Priority Queue has vertices to be explored with heuristic value
22 landmarks.append( u ); //Select the farthest node from s as
landmark Code Segment 2. Updating cost using Landmark based heuristic values
23 s = u; //Next Source for another landmark selection
24 } //Landmark Selection loop
4 EXPERIMENTAL ANALYSIS
Code Segment 1 Farthest Landmark Selection Technique
The different speedup techniques for Dijkstra’s
algorithm were implemented in C++ with the help of
The vertices deleted from the priority queue are
LEDA library version 6.2 (Library of Efficient Data Types
kept track of and the final vertex to be deleted from the
and Algorithms) [10]. The graph and priority queue data
queue is added to the list of landmarks. The final vertex is
structures as well as other utilities such precise time mea-
selected as a landmark because in Dijkstra’s algorithm the
surement function provided by LEDA were used in the
vertices are always considered in the increasing order of
implementation. For parallelising the regions of code, the
their shortest path distance and the final vertex deleted
OpenMP API was utilized. The use of OpenMP helps to
from the queue is the one farthest from the source. The
maintain a single source for both the sequential and pa-
selection procedure is repeated with the newly selected
rallel versions of the algorithm. The code was compiled
landmark as the source. Once the required number of
using Microsoft ® 32-bit C/C++ Compiler (version
landmarks are selected the procedure stops.
15.00.30729.01) and the experiments were performed on
an Intel Core2Duo machine (2.20 GHz) with 1 GB RAM
3.3 Calculating and Using Heuristic Values
running Windows 7 32-bit operating system.
The distance from landmarks to the remaining vertices
Even though the shortest path computation of
should be calculated for obtaining potential values. The
Landmarks are experimented in [3], for the purpose of
distance calculation requires initiating a single-source all-
comparison it is experimented here again and compared
target shortest path computation from each of the land-
with the results from OpenMp and Windows
marks. The obtained values are stored as follows. “node-
LandmarkInfo” is a vertex array, containing an array of
4.1 Analysis of Landmarks on random graphs
landmark and corresponding distance values. So the dis-
Always the preprocessing time steadily increases with the
tance between a vertex ‘v’ and the ith landmark can be number of vertices. This is acceptable because the distance
accessed as nodeLandmarkInfo[v].nLInfo[i].dist. between a landmark and all the remaining vertices are com-
puted during preprocessing. The running time of the mod-
ified search procedure with landmarks included is either
nearly equal to or slightly higher than that of the traditional
JOURNAL OF COMPUTING, VOLUME 2, ISSUE 8, AUGUST 2010, ISSN 2151-9617
HTTPS://SITES.GOOGLE.COM/SITE/JOURNALOFCOMPUTING/
WWW.JOURNALOFCOMPUTING.ORG 106
Dijkstra’s algorithm. The performance with landmarks is
expected to improve on real world graphs. The number of
vertices visited is reduced by using landmarks. A speedup of
nearly 1.2 is achieved. Fig. 2 shows the number of vertices
visited by the search procedure with landmarks and that of
traditional Dijkstra plotted against the number of vertices
present in the graph. The number of vertices visited by
searching with landmarks is considerably less in most
searches.
TABLE 1
TRADITIONAL DIJKSTRA’S ALGORITHM WITH LANDMARKS BASED
ON RUNNING TIME AND VERTICES VISITED DURING SHORTEST
PATH COMPUTATION ON RANDOM GRAPHS
Vertic- Fig. 2. Vertices visited during shortest path computation by traditional
Runtime Dijkstra and search procedure with Landmarks on random graphs
Ver- Vertices Run- es
Prepro- [with
tex Edge Visited time Vi-
cessing Land- plots the vertices visited by traditional Dijkstra and a
Cou Count [Land- [Dijkst sited
Time (s) marks]
nt
(s)
marks] ra] (s) [Dijkst search using landmarks on the planar graphs generated
ra]
by LEDA.
10000 75500 0.332 0.0489 3698 0.0408 5365

11000 85250 0.41 0.0703 5215 0.0543 6295 TABLE 2


COMPARISON OF TRADITIONAL DIJKSTRA’S ALGORITHM WITH
12000 90600 0.477 0.0678 4626 0.0451 4739
LANDMARKS BASED ON RUNNING TIME AND VERTICES VISITED
13000 91000 0.518 0.081 5793 0.0536 6378 DURING SHORTEST PATH COMPUTATION ON PLANAR GRAPHS
Ver‐ Runtime  Vertices  Run‐ Vertices 
14000 107800 0.582 0.0759 4629 0.0621 5629 Edge 
tex  Preprocess‐ [with  Visited  time  Visited 
Coun
Coun ing Time (s)  Land‐ [Land‐ [Dijkstr [Dijkstr
15000 112500 0.642 0.0899 5682 0.0715 7940 t 
t  marks] (s)  marks]   a] (s)  a] 
16000 120800 0.678 0.0984 6274 0.0739 7712 10000  17509  0.0193  0.00475  439  0.0044  439 

17000 127500 0.765 0.129 7747 0.0899 9177 11000  19344  0.0208  0.00505  416  0.00445  434 

18000 133200 0.886 0.107 5814 0.105 10380 12000  21166  0.0226  0.00555  488  0.00515  488 

19000 142500 0.878 0.108 6139 0.0905 8535 13000  22999  0.0248  0.0058  494  0.0053  493 

20000 161000 0.969 0.149 8147 0.132 12390 14000  24869  0.0269  0.0063  540  0.00565  548 

21000 155400 1.03 0.152 8313 0.125 11826 15000  26698  0.0282  0.0068  536  0.00635  550 

22000 167200 1.06 0.194 11341 0.124 10558 16000  28555  0.0304  0.00725  554  0.00655  554 

23000 154100 1.04 0.189 11749 0.104 10420 17000  30399  0.0358  0.00945  656  0.0087  656 

24000 166800 1.07 0.168 10432 0.119 11639 18000  32251  0.0383  0.00955  580  0.00905  594 

25000 186250 1.27 0.187 10245 0.137 11857 19000  34111  0.0412  0.01  652  0.0093  679 

20000  35966  0.0452  0.0112  648  0.0102  666 

21000  37844  0.0479  0.0113  683  0.0109  626 


4.2 Analysis of Landmarks on planar graphs
The effect of using landmarks during shortest path 22000  39705  0.0518  0.0127  675  0.0112  718 

23000  41550  0.0578  0.0139  801  0.0146  828 

24000  43435  0.0603  0.0144  767  0.0129  766 

25000  45286  0.0655  0.0144  794  0.0136  794 

4.3 Parallelising the pre-processing phase of


Landmarks (Random Graphs)
A speedup of 1.13 was achieved on the random
graphs generated by LEDA. Fig. 4 presents a graph,
which gives the preprocessing time in the preprocessing
phase of landmarks before and after parallelism.
The fractional difference incurred in preprocess-
Fig. 3. Vertices visited during shortest path computation by traditional
Dijkstra and search procedure with Landmarks on planar graphs ing time will have greater significance in the running time
of the algorithm.
computation on planar graphs is analysed below. The
performance of the technique in this graph type is nearly
equal to that of traditional Dijkstra’s algorithm. Fig. 3
JOURNAL OF COMPUTING, VOLUME 2, ISSUE 8, AUGUST 2010, ISSN 2151-9617
HTTPS://SITES.GOOGLE.COM/SITE/JOURNALOFCOMPUTING/
WWW.JOURNALOFCOMPUTING.ORG 107

TABLE 3
ANALYSIS OF PARALLELISED PREPROCESSING IN LANDMARKS
(RANDOM GRAPHS)
Preprocess  Preprocess 
Vertex 
Edge Count  Time [Land‐ Time with 
Count 
marks] (s)  parallelism (s) 

  10000  78000  0.274  0.246 

11000  82500  0.361  0.323 

12000  90600  0.368  0.324 

13000  97500  0.373  0.335 

14000  103600  0.424  0.374 

15000  108000  0.44  0.393 

16000  104000  0.507  0.443 

17000  127500  0.569  0.507 

18000  128700  0.663  0.573 


Fig. 4. Comparison of Preprocessing Time for Landmarks with and
19000  138700  0.644  0.579  without Parallelism on random graphs

20000  141000  0.704  0.622 

21000  162750  0.833  0.73 


TABLE 4
22000  157300  0.902  0.779  ANALYSIS OF PARALLELISED PREPROCESSING IN LANDMARKS
23000  167900  0.794  0.715 
(PLANAR GRAPHS)

24000  175200  0.961  0.832 


Preprocess 
25000  178750  0.932  0.83  Preprocess 
Vertex  Edge  Time 
Time with 
Count  Count  [Landmarks] 
4.4 Parallelising the pre-processing phase of parallelism (s) 
Landmarks(Planar Graphs) (s) 
A speedup of 1.22 was achieved on the planar 10000  17516  0.0163  0.0132 
graphs generated by LEDA. Fig. 5 plots the pre-
11000  19342  0.018  0.0147 
processing time required for landmarks with and without
parallelism against the number of vertices. 12000  21190  0.0197  0.0161 

13000  23018  0.0215  0.0173 

14000  24856  0.0227  0.0188 

15000  26685  0.0243  0.0195 

16000  28561  0.0263  0.0215 

17000  30400  0.0301  0.0243 

18000  32246  0.0321  0.0261 

19000  34118  0.0331  0.0269 

20000  35954  0.0349  0.0284 

21000  37813  0.0365  0.0298 

22000  39705  0.0385  0.0316 


Fig. 5. Comparison of Preprocessing Time for Landmarks with and 23000  41570  0.0402  0.0332 
without Parallelism on planar graphs
24000  43437  0.0418  0.0343 

25000  45308  0.0434  0.0355 


JOURNAL OF COMPUTING, VOLUME 2, ISSUE 8, AUGUST 2010, ISSN 2151-9617
HTTPS://SITES.GOOGLE.COM/SITE/JOURNALOFCOMPUTING/
WWW.JOURNALOFCOMPUTING.ORG 108

REFERENCES

[1] Dijkstra. E. W , A note on two problems in connection with


5 CONCLUSION
graphs, In Numerische Mathematik. Vol. 1. Mathematisch Centrum,
The Landmark technique is incorporated in Dijkstra. The Amsterdam, The Netherlands, 1959, 269–271.
results were tested in random graphs and planar graphs. [2] I. Phol, “Bi-directional Search”, In Machine Intelligence, volume
For random graphs the number of vertices visited is 6, pages 124-140. Edinburgh Univ. Press, Edinburgh, 1971.
found to be favorable. And for planar graphs, the running [3] Andrew V.Goldberg, Chris Harrelson, “Computing the Shortest
time of the algorithm is positive. The preprocessing phase Path: A* Search Meets Graph Theory”, In Proc. 16th Annual ACM-
in Landmark technique is parallelised and the results SIAM Symposium on Discrete Algorithms, 2005
were compared with original Dijktra and Land marked [4] Martin Holzer, Hierarchical speedup techniques for shortest path
Dijkstra for random graphs and planar graphs. The pre- algorithms, M, Tech. report, Dept of Informatics, University of Kons-
processing phase of a search using landmarks was paral- tanz, Germany, 2003.
lelised and a speedup of 1.2 was achieved. [5] Frank Schulz, Dorothea Wagner, and Christos Zaroliagis, “Using
Some of the extensions that could be made to this multi-level graphs for timetable information in railway systems”, In
work are: For selecting landmarks “Farthest landmark Proc. 4th Workshop on Algorithm Engineering and Experiments.
selection” technique was used. This could be suitably LNCS, vol. 2409. Springer-Verlag, New York. 43- 59.
modified so that containers present, are also taken into [6] DOROTHEA WAGNER and THOMAS WILLHALM, Geometric
account to get better performance. The landmarks tech- Containers for Efficient Shortest-Path Computation, ACM Journal of
nique can be modified so that it works for directed graphs Experimental Algorithmics, Vol. 10, Article No. 1.3, 2005.
also. It is to be noted that on directed graphs the shortest [7] Martin Holzer, Frank Schulz, Dorothea Wagner, and Thomas
path distance calculation between vertices and landmarks Willhalm, Combining Speed-up Techniques for Shortest-Path Com-
should be carefully done for obtaining a suitable heuristic putations, ACM Journal of Experimental Algorithmics, Vol. 10,
value. This parallelised landmark technique can be tested Article No. 2.5, 2005.
on real world graphs for obtaining a better performance [8] Dominik Schultes, Johannes Singler, Peter Sanders, Parallel
estimate. Highway Node Routing, A Technical Report, Feb,2008. al-
go2.iti.kit.edu/schultes/hwy/parallelHNR.pdf

ACKNOWLEDGMENT [9] OpenMP, http://www.openmp.org


The authors wish to thank Mr. Arvind kumar, Dept. of
Computer Science & Engineering, Pondicherry Engineer- [10] LEDA, http://www.algorithmic-solutions.com
ing College, Pondicherry, India for helping in conducting
the experiments.

R. Kalpana is working as Assistant Professor in the Department of Com-


Prof. Dr. P. Thambidurai is the Principal and Professor of Computer
puter Science & Engineering, Pondicherry Engineering College, Pondicher-
Science & Engineering, Perunthalaivar Kamarajar College of Engi-
ry, India.She has completed her B.Tech(Computer Science & Engineering)
neering and Technology, Karaikal. He has completed his
from Pondicherry University.She has completed her M.Tech(Computer
M.E(Computer Science & Engineering) from Anna University, Chen-
Science & Engineering) from Pondicherry University. She is pursuing Ph.d
nai. He has completed his Ph.d from Alagappa University, Karaikudi,
at Pondicherry University. She has published ten papers in national and
Tamilnadu. He has published more than hundred papers in national
international conferences/ journals.
and International journals and conferences.

You might also like