No BSD License  

Highlights from
Dijkstra Shortest Path Routing

4.03333

4.0 | 31 ratings Rate this file 259 Downloads (last 30 days) File Size: 3.17 KB File ID: #5550
image thumbnail

Dijkstra Shortest Path Routing

by Xiaodong Wang

 

23 Jul 2004 (Updated 29 Jul 2004)

This function and example show shortest path routing based on Dijkstra algorithm.

| Watch this File

File Information
Description

This function performs Dijkstra algorithm based on the cost matrix, and shortest path can be found.

Acknowledgements
This submission has inspired the following:
Probabilistic Flooding Simulation, A-star Search Algorithm, dijkstra very simple, Dijkstra Algorithm Consistent with Cyclic Paths, Dijkstra's Shortest Path Algorithm
MATLAB release MATLAB 6.0 (R12)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (38)
04 Aug 2004 lili Woo

It is good that results are showed.

31 Mar 2005 Andrew Wagner

Worked beautifully. Not sure what the last couple parameters are for, but they can be initialized according the the commented out usage example at the top of the file.

24 Apr 2005 egis cioperiux  
25 May 2005 sanith Wijesinghe  
01 Jun 2005 Babis Grouzakis

excellent work,i have to study it carefully,step by step.

21 Jul 2005 Alg Searcher  
15 Oct 2005 samy jojo

not too bad

06 Mar 2006 lydiah asere  
03 Apr 2006 achilles boursianis  
24 Apr 2006 john bautista

very good

06 Jun 2006 An Vincint

I appreciate it very much!

23 Jun 2006 Joseph Kirk

This was very nice and I wanted to give it a 5, but when I changed the random state a couple times, the algorithm did not always find the shortest path... so I wonder if there is a bug that need to be fixed? (rand states = 1, 2, 4, 8 and 10 were the ones I checked that appeared to have an obviously shorter route than the one shown)

24 Jul 2006 Shahzada Rasool

good example, but farthestNextHop and PreviousHop should be explained

22 Sep 2006 Eyup Cinar

Good! but can be excellent with more comments and details inside the codes.It would be better to see more explanatory m file here.

30 Sep 2006 Brevetti Ge

I'm Italian...
what are "farthest..." , "...previous?"...
Help me, please...

17 Mar 2007 shankar velmurugan

good but need more comments to explain the m file

02 Apr 2007 hanan soliman  
20 May 2007 momo juju  
18 Sep 2007 chrystal Amutha

good

29 Sep 2007 khld ab  
14 Oct 2007 neha r

good

07 Nov 2007 ai yu

very good

24 Dec 2007 Rolf Bartstra

Poor (or no!) description of input/output parameters. For large nr of nodes, n, the netCostMatrix (nxn) may require vast amounts of memory; a link-based description may be more appropriate in this case (e.g. algorithm by Joseph Kirk)

24 May 2008 avdo tukic  
01 Nov 2010 Maxime  
13 Jan 2011 Alexander Wallar

im new to MATLAB and i was just wondering if you could give an example?

01 Mar 2011 Ying liu  
08 Jun 2011 Matthew Bays

Worked great the first time!

15 Jun 2011 Rick  
03 Aug 2011 Seifi

I met this Error in running the code:

??? Index exceeds matrix dimensions.
Error in ==> dijkstra at 77
  if ( ( netCostMatrix(u, v) + distance(u)) < distance(v) )

Could you please tell me how do you define the input?

02 Oct 2011 Chandra Kurniawan

wonderfull

10 Nov 2011 giorgio  
10 Nov 2011 giorgio  
12 Nov 2011 LA  
09 Jan 2012 Fardeen

well done

30 Mar 2012 Hakk1

well

13 May 2012 Meg

can you please define the input such as farthestPreviousHop, farthestNextHop, and netcostmatrix?

13 May 2012 MAOFAN

Well done

Please login to add a comment or rating.
Updates
29 Jul 2004

update figure.

Tag Activity for this File
Tag Applied By Date/Time
dijkstra Xiaodong Wang 22 Oct 2008 07:28:11
graph Xiaodong Wang 22 Oct 2008 07:28:11
shortest path routing Xiaodong Wang 22 Oct 2008 07:28:11
matlab Xiaodong Wang 22 Oct 2008 07:28:11
algorithm Xiaodong Wang 22 Oct 2008 07:28:11
algorithm Hucheng Ding 18 Mar 2009 07:49:39
dijkstra Luis Valdes 24 Mar 2009 11:39:16
dijkstra Akshay Morye 20 Apr 2009 16:47:31
algorithm nasser 31 Jul 2009 05:48:35
dijkstra nasser 31 Jul 2009 05:48:40
graph nasser 31 Jul 2009 05:48:45
matlab nasser 31 Jul 2009 05:48:47
shortest path routing nasser 31 Jul 2009 05:48:50
algorithm ucsb zhou 01 Oct 2009 20:33:25
dijkstra ucsb zhou 01 Oct 2009 20:33:28
dijkstra TIZIANA Ruta 11 Oct 2009 13:02:23
dijkstra Deepak Vig 21 Oct 2009 11:53:22
algorithm Jaideep 02 Dec 2009 06:12:56
dijkstra Nashat Abughalieh 20 Dec 2009 07:04:49
dijkstra sarwat nasir 28 Jan 2010 09:43:20
dijkstra Min-Gyu 16 Feb 2010 20:01:14
algorithm ivan31416 aldaya 10 Apr 2010 13:53:08
matlab sim chong shen 22 Apr 2010 13:28:15
algorithm sim chong shen 22 Apr 2010 13:28:20
algorithm Voitiuk Anna 11 May 2010 11:07:56
algorithm Nha Vo Thanh 23 Jul 2010 04:15:54
matlab Daniel Clavijo Plourde 03 Dec 2010 16:23:18
graph Daniel Clavijo Plourde 03 Dec 2010 16:23:21
algorithm Daniel Clavijo Plourde 03 Dec 2010 16:23:24
dijkstra Daniel Clavijo Plourde 03 Dec 2010 16:23:26
shortest path routing Daniel Clavijo Plourde 03 Dec 2010 16:23:29
algorithm MURALIKRISHNA 25 Apr 2011 06:10:59
shortest path routing Isaac 04 May 2011 22:24:53
algorithm Pierre 22 May 2011 15:29:32
dijkstra Pierre 22 May 2011 15:29:35
algorithm gligor Rad 19 Jun 2011 15:48:43
algorithm Tarik Dzananovic 25 Jun 2011 10:57:30
shortest path routing Ben-Guryon University 14 Sep 2011 07:28:24
graph Ben-Guryon University 14 Sep 2011 07:28:33
dijkstra Riya 20 Sep 2011 04:40:27
graph arun2190 21 Sep 2011 11:10:46
dijkstra Maja Maichi 26 Sep 2011 18:45:29
dijkstra bee 12 Oct 2011 02:24:36
dijkstra Tuan Truong 01 Nov 2011 04:13:40
shortest path routing Tuan Truong 01 Nov 2011 04:13:52
dijkstra Midhun 06 Dec 2011 06:31:57
algorithm Nima 08 Feb 2012 14:56:44
algorithm António Cunha 27 Feb 2012 10:51:54
dijkstra Vincent 16 Mar 2012 04:43:29
dijkstra Tyler 12 Apr 2012 13:01:30
algorithm Constantinos Karamartsoukis 25 Apr 2012 15:44:13

Contact us at files@mathworks.com