No BSD License  

Highlights from
dijkstra very simple

3.75

3.8 | 4 ratings Rate this file 105 Downloads (last 30 days) File Size: 1.62 KB File ID: #14661

dijkstra very simple

by Jorge Barrera

 

14 Apr 2007 (Updated 16 Apr 2007)

dijkstra's algorithm to fid the shortest path

| Watch this File

File Information
Description

This is an implementation of the dijkstra´s algorithm, which finds the minimal cost path between two nodes. It´s supposed to solve the problem on
positive weighted instances.

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
Dijkstra Shortest Path Routing
This submission has inspired the following:
Modified Dijsktra's Algorithm to return all paths that tie for shortest

MATLAB release MATLAB 7.1.0 (R14SP3)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (10)
29 Dec 2007 Dimitri Strobbe

I loved this! Not too much information about the algorithm itself (dijkstra), but very nice and helpfull for my thesis!
Thanks!

29 Dec 2007 Dimitri Strobbe

I loved this! Not too much information about the algorithm itself (dijkstra), but very nice and helpfull for my thesis!
Thanks!

24 Jul 2008 Dominik Kaspar

A convenient implementation of Dijkstra's Shortest Paths algorithm.

28 Jul 2008 li li

need it to research

06 Dec 2010 Petr

Any information about the inputs and outputs of dijkstra's algorithm. Can you present an example? Thanks!

02 Mar 2011 cynthia

matriz_costo means?

03 Oct 2011 Yannos M

script should be removed! One of the worst documentations ever..and very bad English.what is the size of s,d, matriz_costo???

02 Dec 2011 Chua

gud

01 Mar 2012 Frederick

For the people who look for input:
matriz_costo is the adjacency matrix (n by n matrix with distance or cost from one point/node to another
s is startnode
d is endnode

08 Apr 2012 David B

This is great code. As others have pointed out, it could be commented better, but having said that, it's the easiest implementation of Dijkstra's Algorithm to understand that is available on the file exchange. As a beginner programmer, I appreciate the simplicity.

The previous commenter pointed out, matriz-costo is an n x n adjacency matrix. To elaborate, elements reflect the cost of traveling between corresponding nodes. Any element set to zero implies a cost-free path exists between those two nodes. I usually set the elements corresponding to non-adjacent nodes to an arbitrarily large number (it might also work to set them to inf -- I haven't tried it).

My one wish is that the output included multiple paths if there is a tie for which path is shortest. I modified the code to return ties. It is posted here:

http://www.mathworks.com/matlabcentral/fileexchange/36086

Thank you!!

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
dijkstra Jorge Barrera 22 Oct 2008 09:09:24
dijkstras Jorge Barrera 22 Oct 2008 09:09:24
shortest Jorge Barrera 22 Oct 2008 09:09:24
path Jorge Barrera 22 Oct 2008 09:09:24
mathematics Jorge Barrera 22 Oct 2008 09:09:24

Contact us at files@mathworks.com