Dijkstra's Shortest Path Algorithm
by Joseph Kirk
01 Nov 2006
(Updated 21 May 2007)
calculates the shortest path and distance between two nodes on a map
|
Watch this File
|
| File Information |
| Description |
This function can
1. Find the shortest path and distance from a starting node to an ending node on a map**
2. Find the shortest paths and distances from a starting node to ALL other nodes on a map**
**The map should consist of nodes and segments, such that:
1. nodes have the format [ID X Y] or [ID X Y Z] (with ID being an integer, and X,Y,Z representing position coordinates and of type double)
2. segments have the format [ID N1 N2] (with ID being an integer, and N1 N2 representing IDs from the nodes list such that there is an [undirected] edge/segment between node N1 and node N2, and obviously of integer type also)
Note:
The function generates a random map of nodes and segments that it uses if no inputs are given. This way, it acts like a script if it is run with no inputs, and it acts like a function otherwise. |
| Acknowledgements |
Dijkstra Shortest Path Routing
inspired this file.
This file inspired
Advanced Dijkstra's Minimum Path Algorithm.
|
| MATLAB release |
MATLAB 7.3 (R2006b)
|
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Comments and Ratings (18) |
| 12 Sep 2012 |
Andrea
|
|
|
| 09 Aug 2012 |
Jesus Luevano
|
|
|
| 06 Mar 2012 |
Xilu Wang
|
|
|
| 29 Sep 2009 |
Benjamin Knight
|
|
|
| 28 May 2009 |
abdullah rfdgsdf
|
|
|
| 04 May 2009 |
Michael Ashby
|
|
|
| 01 Dec 2008 |
Weihao Yin
|
|
|
| 18 Jun 2008 |
Kuba Wu
|
|
|
| 10 Dec 2007 |
ioannis tsolakidis
|
|
|
| 14 Oct 2007 |
Charles Kingston
|
|
|
| 08 Oct 2007 |
Nikhil M
|
|
|
| 07 Sep 2007 |
The Author
|
|
|
| 07 Sep 2007 |
Chuthamart Panklin
|
|
|
| 28 Jun 2007 |
Omer KAMAL
|
|
|
| 31 May 2007 |
Bandi Reddy
|
|
|
| 13 Apr 2007 |
han daza
|
|
|
| 08 Feb 2007 |
titin siburian
|
|
|
| 02 Jan 2007 |
Daren O'Connor
|
|
|
| Updates |
| 09 Jan 2007 |
Combined script and function into a single m-file that can be run "as is" or with user specified inputs. |
| 21 May 2007 |
Improved m-file and help notes. |
|
Contact us