SHORTEST PATH TRAJECTORY SYSTEM BASED ON DIJKSTRA ALGORITHM
INDAH PRATIWI PUTRl
UNIVERSITI UTARA MALAYSIA 2012
SHORTEST PATH TRAJECTORY SYSTEM BASED ON DIJKSTRA ALGORITHM
A project submitted to Dean o f Researcl~ and Postgraduate Studies Office in partial FulSillment of the requirement fdr tne degree
Master o f Science (I~lformatior? Technology) Universiti Utara Malaysia
BY
1ntl:ih Pratiwi Putri
KOLEJ SASTERA DAN SAINS (College of Arts and Sciences)
Universiti Utara Malaysia
PERAKUANKERJAKERTASPROJEK (Certificate of Project Paper)
Saya, ymg bertandatangan, memperakukan
Ijahawa (4
theundersigned, certifies that)
INDAH PEWTlWi
FO'TRI
18091051
calon untuk Ijazah
(candidate for the degree on
MSc.[Information
Technolorrvltelah mengemukakan kertas projek yang bertajuk (has
presented
his/her project of the following title)'
SHORTEST PATH TRAJECTORY SYSTEM BASED ON DIJKSTRA ALGORITHM
seperti yang tercatat di muka surat tajuk dan kulit kertas projek
(as it appears on the title page and @nt cover of project)
bahawa kertas projek tersebut boleh diterirna dari segi bentuk serta kandungan dan meliputi bidang ilmu dengan memuaskan.
(that this project is in acceptable form and content, and that a satisfactory knowledge of the field is covered by the project).
Nma
Penyelia(Name of Supervisor)
: PROF. DR.IN
RUZWHAIGU
8WUWWDTandatangan
(&nature) Tarikh
(Date) :6 / 6 / k a
12+
PERMISSION TO USE
In presenting this project in partial fulfillnlent of the requirements for a postgraduate degree fiom the Universiti Utara Malaysia, I agree that the University Library may make it fieely available for inspection. I further agree that permission for copying of'this project in any Illantler in whole or in part, for scholarly purposes may be granted by my supervisor(s) or in their absence by the Dean o f Awang Had Salleh Graduate School. It is understood that any copying or publication or use of this project or parts thereof for financial gain shall not be allowed without my written permission. It is also understood that due recognition shall be given to me and to Universiti Utara Malaysia for any scholarly use which may be made of any material from my project.
Requests for permission to copy or to make other use o f materials in this project, in whole or in part, should be addressed to
Dean of Awang :{ad Salleh Graduate School College of Arts and Sciences
Universiti Utnra Malaysia 060 10 UUM Sintok Kedah Danil Aman
Malaysia
ABSTRAK (BAHASA MALAYSIA)
Dalam projek sarjana ini, penyelidik membincangkan pcnyelesaian masalah lintasan terpendck daripada satu sumber tunggal dengan menggunakan algoritma Dijkstra sebagai konsep asas. Satu masalah yang dibincangkan dalam kajian ini adalah semua orang boleh bergerak menglkut laluan yang berbeza untuk sampai kepada destinasi yang berlainan. Ini boleh memakan masa apabila mereka tidak bergerak mengikuti laluan yang terbaik. Objektif projek ini adalah untiik rnenentukan setiap lokasi nod yang ~nenunjukkan semua item dalam senarai. Pemb~naan laluan dcngan nlenyarnbung nod telah diselidiki untuk menilai algoritrna yang dicadangkan bagi masalah sumber tiinggal laluan terpendek. Metodologi penyeliclikan yang ci~gunakan d a l a ~ n projek ini tcrmasuk pengubahsuaian algoritma induk yang tclall d~laksanakan dalam pembangunan prototaip. Kajian ini membincarigkan tentang lali~an terpendek yang menitikberatkan kepada sumber tunggal pada lokasi kajian tertentu. Kajian ini dapat menghasilkan sebuah prototaip pembuat keputusan.
Kcrtcz kzrnci: sllmber tunggal, laltru?~ terpenclek, algoritmn Dijkstrcl, lint(rsan,j(rlan
ABSTRACT (ENGLISH)
In the master project, the researcher discussed the shortest path solution to a single source problem based on Dijkstra algorithm as resolving the basic concepts.
Everybody can travel by different routes to reach a different destination point. This can be time consuming if they do not travel trough the best route. T h s project aims to determine locations of the node that reflect all the items in the list, build the route by connecting nodes and evaluate the proposed algorithm for the single source shortest path problem. This project includes the modification of main algorithm which has been implemented in the prototype development. This study discussed the emphasis on the single source shortest path at the location of specific studies. The s ~ u d y will produce a decision-makers prototype.
ACKNOWLEDGEMENT
Greatest gratitude to the presence of Allah S.W.T who always blesses me, grants me with good health, and allowed me to complete my study. The title of this master project is Shortest Path Trajectory System Based on Dijkstra Algorithm which inspired by a real world problem in travelling.
Appreciations to Prof. Dr. Ku Ruhana Ku Mahamud for her valuable supervision, preach and guidance that support this project. Honors to Dr. Azizi Aziz and Mdm Nur Azzah Abu Bakar whose gave their constructive criticisms and suggestion during the evaluation that helps me to refine the project.
Sincere accolades were also given to my mother Dra. Masayu Hnrncla Roni S.E, M.Si, father Drs. lsmi Iswandi, S.E, M.Si and my bcloved Maulidin, A.Md, S.kom, M.Sc (ICT) who always give their support, shared some thoughts and their ideas with regard to scientific world. Thanks also to my grandmothers and auntie Masayu Maryam Roni, S.H who always pray to Allah S.W.T to give the best for me.
TABLE OF CONTENTS
PERMISSION TO USE
ABSTRACT
ACKNOWLEDGEMENT
TABLE OF CONTENTS
LIST OF TABLES
LIST OF FIGURES
LIST OF ABBREVIATIONS
CHAPTER 1 : INTRODUCTION
1.1. Problem Statement 1.2. Research Questions
1.3. Research Objectives 1.4. Scope of The Study 1.5. Significance of The Study 1.6. Case Background
1.7. Organization of The Report
CHAPTER 11: LITERATURE REVIEW
2.1. Shortest Path Problem 2.1.1. All Pair Shortest Path
2.1.2. Node Pair Shortest Path 2.1 .j. Single-Source Shortest Path 2.2. Shortest Path Approach
2.2.1. Multi-Objective Shortest Path 2.2.2. Intermediate Shortest Path 2.2.3. Single-Objective Shortest Path 2.2.4. Generalization Shortest Path 2.2.5. Heuristic Searching
2.3. Application of Dijkstra Algorithm 2.3.1. Highway Transportation Network 2.3.2. Network Routing
2.3.3. Single Source Trajecto~y 2.4. Summary
CHAPTER 111: METHODOLOGY
3.1. Algorithm Formulation 3.1 . I . Algorithm
3.1.2. Theoretical Analysis 3.1.3. Algorithm Implementation 3.1.4. Experimental Analysis 3.2. Prototype Development 3.3. Summary
CHAPTER IV: IMPLEMENTATION AND FINDINGS
4.1. Experimental Findings 4.3. Comparati\~e Result
4.3. Experimental Proof 4.4. Summary
CHAPTER 5: CONCLUSION AND RECOMMENDATION49
5.1. Project Review 5.2. Limitation 5.3. Contributions
5.4. Recommendations And Future Work 5.5. Conclusion
REFERENCES
APPENDICES
Appendix A. Flowchart
Appendix B. Source Code
Appendix C. User Manual of The System
LIST OF TABLES
Tables
Table 4.1 Dijkstra Algorithm Table 4.2 Dijkstra Cloud Table 4.3 Dijkstra Tree
Table 4.4 Breadth First Search Tree Table 4.5 Depth First Search Tree
Figures
Figure 1.1 Figure 1.2 Figure 1.3 Figure 2.1 Figure 3.1 Figure 3.2 Figure 3.3 Figure 3.4 Figwe 4.1 Figure 4.2 Figure 4.3 Figure 4.5
LIST OF FIGURES
Organization Chart Department Store Layout Department Store Building Konigsberg Bridges
Experimenta t Design Phases Frame Box
Marker Layer U I Layer
Tr,?lectory Problem Set of Trnvelletl Vertices Weighted Iligrnph I'roblem Uniform Distribution
Page
10 1 i I ! 13 24 32 3 3 3 3 3 7 3 8 3 8 46
BFS D DFS D ( i j
E .fid
('11
S
T 1''
v
VB
15,
rv
LIST OF ABBREVIATIONS
Breadth First Search Digraph
Depth First Search Distance x
Edge Function x Edge n Space Time Velocity Vertices Visual Basic Vertex n Weight
CHAPTER I INTRODUCTION
In daily life, people commonly face some problems in finding an optimum pi~th. People usually explore every possible solution in finding an optimum path, but not every solution can produce the best shortest path. Shortest path problem is a problem in finding the fastest route or path from a directed graph. Every direction in a graph should have a cost to be calculated. This shortest path problem is a way to find a new route or path in a graph with a minimum sum of weight traveled through the direction. This shortest path problem can be solved by using an algorithm of finding the best edge path between vertices in a graph. There are several variations of algorithm that can be used to detennine the node that was pursued based on the direction given graph. Variations of the shortest path can be distinguished Sroin single-source objective, pair path and generalization. A pair of shortest path is finding the shortest path for two points of nodes. All pair of shortest path is a technique to find the shortest path among all directed nodes. Single-source shortest path is finding the shortest form traveled, starting fi-om a certain node to all other nodes in the graph.
Single-objective shortest path problem is find the shortest path from any node on the graph are directed to a single destination node. Intermediate shortest path is finding the shortest way between two nodes selected through other nodes. Generalization is significantly more efficient than the simple approach to run one-pair of shortest path algorithn~ on all pairs of vertices that are relevant.
The contents of the thesis is for
internal user
only
REFERENCES
[ l ] Y. Chao & W. Hongxia, "Developed Dijkstra Shortest Path Search Algorithm and Simulation." lirterilrrtioi~rll Coiljel-ei~cc on Conzputer Desiyiz and Appliw/iorr.\, vo I. 1 , pp. 1 16- 1 19, 20 10.
[2] T. Terada, M. M~yamae, Y. Kishino, K. Tanaka, S. Nishio, T. Nakagawa, &
Y. Yaniaguchi. "Design Of A Car Navigation System That Predicts User Destination." rn il/D,\f '06 P~*ocee~lrr~g..\ o f the 7/h In/e~~nationcrl Confir*enrc
0 1 1 hfohilc Drrttr .I/frrirrrgeii~~v~t, Washington, DC, USA: IEEE Computer
Society, pp. 145, 3006
[3] .I. Froehlich & .I. I<ri~nl~n. "l<oute Prediction Fro111 Trip Observations," in l i i t c ~ / / ~ g ~ ~ ~ ~ t K ~ J / I I C / L > 111itIrrt11~c~ (1Vl) T~~clii~ology /Irl~~riiicecl Coi~ti-ol~s ~ 1 x 1 Mr~.igrrtioii Sl;vteiii.v, SAE World Congress 22 Exhibition, Detroit, Michigan, USA, 2008
[4] A. Monreale, F. Pinelli, R. Trasarti, & F. Giannoti, '-Wherenext: A Location Predictor o n Trqectory Pattern Mining." in MLD,M '07: P~*oceedings o f the 5t11 iritcr.rzcrtiorir~l coirfcrcizce oil Mrtcliirzc Lcrrnzirzg & Data Mining in Pattern Recoyi~i[iorz, 2009.
[5] N . Edmo~lds, A. Breuer, D. Gregor, 8c A. Lumsdaine, "Single-Source Shortest Paths with the I'arallel Boost Graph Library," ed. Blnomington: Indiana University, 2007, pp. 1-20.
[6] G. D. Lorcnzo, F. Pinelli, F. C. Pereira, A. Biderman, C. Ratti, C. Lee, & C.
Lce, " A n A fictive Intelligent Driving Agent: Driver's Trajectory & Activit~es Prediction. Institute of Electrical & Electronics Engineers," in Vehiczrlar Tc,clr~rolog\. C70/~fi./-etrce Full ed. Massachusetts: Massachusetts Institute o f Tccllno logy, 2009.
[7] D. A. Marcus, G/.cq)l; Tlreory: A Prohlenl Oriented Approach. USA: MAA Textbook. 2008.
[8] N. Dale, D. T. Joyce, & C. Weems, Ot?j!ject Oric~ntc~d Data Strzrctzlres using Jrrlvrr. Massachusetts: Jones & Bartlett. 2002.
[9] C. B. GUPICI. S. R S ~ ~ l g l l , &L S. Kumar, ilch>a/rce Discrete Structrrre: I.K.
In~erna~lonnl P~~blishing IIouse Pvt., Limited, 2010.
[ I O ] S. B. Ciupta. ('o/)r~~/.cl~or.vi~v~ Di.vc/.c>rc Mrrthe~ncrtics B Str-irctzrres. New Delhi:
1,axml P~tbllcations, 3006
[ l 11 G. Singh, Vi.sricil Brr,sic 6. India: Laxmi Publications Pvt Ltd, 2007
1121 Y. Dou, H. 6110, & J . Zhou, "A New Approach for the Shortest Path Problem with Vague Sets" International Symposium on Computational Intelligence &
Design, p. 4, 2008.
11 31 R. Johnsonbaugh, Discr.clfe Mcrr11emcrric.s. USA: Pearson, 2009.
[14] .I.-X. Xiao & F.-L. Lu, "An Improvement of the Shortest Path AIgorithm Based on Dijkstra Algorithm," IEEE, vol. 2, p. 3, 2010.
[15] 1\'. Shu-Xi & Z. Xing-Qiu, "The Improved Dijkstra's Shortest Path Algoritlim"
13. 1. 20 1 1 .
[ 161 K . 11. Rosen, D i \ ~ . ~ t e S / I , I I L . I I I I - ~ & Its Applic~ltioli. Singapore: McGraw Hill.
2007
[17] Y. 1-1. Z. Nlc, & S. Lhou, "Finding the Optimal Shortest Path Tree with Respect to Slngle Link Failure Recovei y," Fourth International Conference on Netunrked Computi~ig & Advanced Information Management, p. 4, 2008.
[ 1 81 R. La fore, Drrtri Str-rictlrl-c.s & .4 1gor.ithms in Java. Indianapolis: SAMS, 2003.
[I91 L. Sin-Mian, T. Sic, & Q. Ming-ming, "Computing Shortest Path Problem
\vith Subtractive Weight Based on Tableau Method," IEEE, pp. 4299, 3, 2007.
[30] C. C;ln[3er, C. Reitwic[\ncr & M. Witck. "Improved & Generalized Approximations tbr Two-Objective Travelicg Salesman" Elcctroriic C'ollor/riirirr~ or1 C'o~~rl~iitrrtio~rrrl C'on~plc.~ity, p. 32, 20 10.
[21] T. Fcyessa, M. Bikdash, & G. Lebby, "Node-pair Feature Extraction for Link Prediction," /EEL.: Irlte~-rlntional Cor~fkrerice or7 Privacy, S~>crlrit-y, Risk, &
Tl.rr.st, p. 4, 20 1 1.
[33] W. Jigang, P. Han, G. R. .lagadeesh, & T. Srlkanthan, "Practical Algorithm for Shortest Path on Large Networks with Time-dependent Edge-length," p. 4, 2010.
[31] B. S. Hasan, M. A. Khamees, & A. S. H. Mahmoud, "A Heuristic Genetic Algorithm for the Single Source Shortest Path Problem," / E M . p. 8. 7007.
[32] S. Baswana, T. Friedrich, S. Biswas, P. P. Kurur, B. Doerr. & F. Neumann,
"Computing Single Source Shortest Paths using Single-0bjectii.e Fitness Functions," ACM I~~te~~rrr~tio~iczl Compzrter Science, p. 7, 2009.
[33] Y. Li, Z.-L. Zhang, 6r D. Boley, "The Routing Continuum from Shortest-path to All-path: A Unifying Theory," International Colzference 011 Dl.strihlltec1 Cnlllp~rtirlg Systenw, p. 10, 201 1.
[34] S. Peycr, D. Rautenbach, & J. Vygen, "A Generalization of Dijkstm's Shortest Path Algorithm with Applications to VLSI Routing," 111stitrrt.frrl. ~Mtrrlicn~rrtik, 7-C' Ilnlc,lrrrrr, 2007.
[35] L. Wang, M. Springer. H. He~bel, & N. Navab, "Floyd-Warshall All-Pail.
Shortest Path for Accurate Multi-Marker Calibration," IEEE I~rtci-irotiolrrrl Svrrrj)o.\irr~ll 011 hli.~c~cl 8 Alrgnrellterl Rerrlity, p. 2, 2010.
[36] M.L. Fredman & R.E. Tarjan. Fibolzncci heaps & tl?eir 1rse.s ill in1171.01.c~tl rretu~ork opti1?7izi1tion ~ l g o r i t l ~ m s . J . ASSOC. Computer Mach., 34(3):596 (6 15,
1987
[37] D. Jol~nson, '-Efficient Algorithms For Shortest Paths In Sparse Net~vorks,"
Journal of the ACM, vol. 24, no. 1, pp. 1-13, 1977
[38] A.A.Puntambekar, Ilesign 8 A~rtll-v.si~s Of' A1gorith11r.s. Bangalore: Technical Publications. 201 0.
[39] M.Y. Kao, E~~cj~cloperlia ufAl~orithnzs. Shanghai: Spr~ngcr, 2008
[40] H. Henderson, Encyclopedia of Computer Science k Technology. New York:
InfoBase Publishing, 2009.
[41] M. McMillan, Dntcz Stnlctzlrc.~ & Algoritllnl Usi~ig C;t. Cambridge: Cambridgc University Press. 2007.
[42] F. Bu & H. Fang, "Shortest Path Algorithm within Dynamic Restricted Searching Area in City Emergency Rescue " Depcrrn~rc~~it of E~zgi~lceri~ig o f S ~ L ' I I I . ~ ~ ~ &Protection System, p. 4, 201 0.
[43] W. An, F.-M. Shao, & H. Meng, "The Expected Energy Consumption o f Wireless Distributed Sensor Networks Based on Node R&om Fa~lures." /I:FI;
C ' o i ~ ~ n ~ ~ i ~ ~ ~ ~ r l t i o i i , \ 13'7 !Vctll.orkiil,y ill C l ~ i i ~ c ~ , p. 5 , 3007.
[44] S. Asadi, V. Azirnirad, A. Elami & A. Ghanbari, "A Novel Global Optimal Path Planning & Trajectory Method Based on Adaptive Dijkstra-liiiniuiie Approach for Mobile Robot," IEEE, pp.1093,6 201 I .
[45] Neapoli Tan, Richard, & Kumarss Naimipour. Folii~tl(ltiorls o f Algorithnw Usi~zg C++ Psez~~locode. Third Edit ion. Sudbury, Massachusetts: Jones &
Bart1 ett Publishers, 2008.
[46] Y. Hu, Z. Chang, L. Sun, & Y. Wang, "Analysis of the Shortest Repaired Path of Distribution Network Based on Dijkstra Algorithm," International Conference on Energy & Environment Technology. p. 1. 2009.
[47] J. Gao, .I. X. Yu, H. Qiu, X. Jiang, T. N'ang. & D. Yang, "Holistic Top-k Simple Shortest Path Join in Graphs," lEEE Transactions on Knowledge &
Data Engineering, p. 13, 2012.
[48] Y. Chao, "A Developed Dijkstra Algorithni & Simulation of Urban Path Search," T l ~ e 5th It1ternatior7c11 CorlJ1.t-etice oti Coniplrtel- Scie~ice ct; Erl~rccrtio~i.
p. 4, 2010.
[49] J. Bang-Jensen & G. Gutin, Digraphs Tlieol?~. Algorithms & Apj)Iicrrtio~i.s.
Berlin: Springer-Verlag, 2007.
[50] Z. Fuhao & L. Jiping, "An Algorithm of Shortest Path Based On Dijkstra for Huge Data" Sixth International Conference on Fuzzy Systcms Xr Knowledge Discovery, p. 4, 2009.
[ 5 I] M. Thorup. "On RAM Priority Queues." Pi-occ~etlii~g.\ of t l ~ c ~ S C J I ~ O I I ~ ~ I 1 1 1 1 1 1 1 1 ~ 1 1
rlCiV-SIAM $ny)o,sirrirl oli Discrete illgoi-itlii~rs, pages 59167. N e n York, 1996. ACM Press.
[52] M. Thorup. "Utidirected Sir7glc~-Sorrrce Slioi.tc~.\.t Prrths ~,itli Po.siti\~~ /irtcge>t.
Weights in Linear Time. " Journal of the Association for Cornp~ltillg Machinery, 46:362 (394, 1999.
[53] C. McGeoch, Design of Experinlent ,for- Coirlprrter Scic~ice ct; :Vr~rl~e~nirtic~.s.
Amherst: Amherst College. 2009
[54] C. Demetrescu & G. F. Italiano, "Engineering Shortest Path Algorithms," p. 8, 2004.
[55] Montgomery, Douglas C., Dc..sigri R . I~rrl/.y.sis ~fEsy,er-inz~rlt.s. USA: Wiley, 2008.
[56] J. Antony, Design of E.~pc.rir~zent.s for- Erlgirleera & Scic~r1rist.s. Butterworth:
Heinemann, 2003.
[57] Y. Zhang, Z. Lin, H. Zhou, & H. Wang. "A Method of Image Processing Algorithm Evaluation Based on Orthogonal Experimental Design" Fiftli Irlterrltltiontri Coil f&re~zcc or1 Iinclge & Gr.clj>llic.s, p. 5. 3009.
[58] S. T. Thornton, & A. Rex, Mor/er.rl Pl1~v.sics ,fi)r- Sc.icrlti.si.s orltl I.lrl~<' 7 1 11 <>or ..s . Boston: Cengage Learning, 20 12.
[59] A. Khm, S. Beg, F. Ahsan, & S. Mohsin, "Bionomic Algorithm For Shortest Path First," Jollrrlcrl of Tlzeor.etictr/ B Aj)p/ic)r/ /r!fi)r.rrltriiori 7>cliiiolog~~. vol.
34, p. 8, 201 1
[60] N. Subadra, M. B. Das, & C. R. S. Rao, " Dlrected Graph Algorithins for Tours - A Case Study" Jo11r1zt11 of E~nergi~zg Trcrlcls irl Erzglrrcerirlg ctl. Aj>p/iet/
Scierzces (JETEAS), 2(4), p. 4, 20 1 1.
[61] N. Anastopoulos, K. Nikas, G. Goumas, & N. Koziris, "Early Experiences on Accelerating Dijkstra's Algorithm Using Transactional Memory," ~Vtrtiorrtll 7i~cllrlictrl U~liver=c.ity
of
Ar/lc.rr.s, p. 8, 2008.[62] E. Petroutsos, Mri.ster.irrg Jlic.r.o.soft Visrrtil Brrsic 20 10. USA: John W iley 81 Sons. 2010.
[63] P. COOS & B. Jones, Optirturl Dc,iigrl c?f'Espcrirnerlts: i l Crrsc Stlrrlv ~ I / ) / I / w L I c / I . USA: John Wiley & Sons, 30 1 1.
[64] T. Z. Warfel, Prototypi~ry. Singapore: O'Reilly Media, Inc, 30 1 I .
[65] P. S. Ioannis G. Stamelos, .4gilc) So/irrurrc De\~clopnlerlt Qlrrrlity rls.slrr.rr~lcc~.
Singapore: Idea Group Inc (IGI), 2007.
[66] S. McConnell, SoJiw~zre E.rtirrlrrtion: Der?zystifyirrg tllc~ Bltrck i11.t. Singapore:
O'Reilly Media Inc., 2009.
[67] K. E. Kurbel, The Mrrkirrg c?f'Ir!fbr.rrlrrtiorl Sv,c./crrl.s: .S ; ? f t l ~ . r r ~ ~ ~ I<rlgirro(~r.irlg ct?
hfrrrlrryernerrt i l l rr Glohrrlized Ili)r./c/. Intlinnapolis: Springer: 30 10.
[68] S. G. Ganesh, Cvtrckirzg tllc. C, C + + c% .Jcrlltr / r 1 / ~ , r 7 . i ( , ~ 1 . . B I I I ~ ~ : I ~ U I . C : ~IC'GI-:IW- Hill, 2009.
[69] D. E. Knuth, Thc Art c!f'Conlprrtc)r Pr.o~r.rrrnniirlg. Indianapolis: Prentice Hall, 2009.
[70] C. P. Williams, Explortrtiorrs ill Qlrnlrtrrrll Conlpilting. Indianapolis: Springer, 2010.