4.09091

4.1 | 12 ratings Rate this file 14 Downloads (last 30 days) File Size: 28.81 KB File ID: #7869
image thumbnail

Dijkstra Algorithm Consistent with Cyclic Paths

by Yi Wang

 

19 Jun 2005 (Updated 24 Jun 2005)

This function and attached examples show finding shortest-paths (including cyclic paths) from a dire

| Watch this File

File Information
Description

Given adjacent matrix (transmat) and starting/ending node (pathS, pathE), this function finds the shortest-path (path) that connecting pathS and pathE, and returns the cost (cost):

[path, cost]=dijkstra(pathS, pathE, transmat);

NOTE: Except for the simple interface, the pathS and pathE can be the same node, i.e., this implementation can find _cyclic_ paths.

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
Dijkstra Shortest Path Routing

MATLAB release MATLAB 7 (R14)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (12)
04 Oct 2005 xialing wu

It is simple and effective. But I have 2 confusions:
1) Subprogram 1 has no relationship with Subprogram 2.
2) The 2nd result: Cycle from 2 -> 2 and Cycle from 3 -> 3 are same cycle.Why here name them as different?

11 Jan 2006 David Lusseau  
12 Jan 2006 David Lusseau

There is one problem: the algorithm does not deal with duplicate path. That is if there are more than 1 path with the same minimal cost it only finds one of them.

02 Feb 2006 Will Gikandi

Very good. Quick and efficient. As a newbie, I could have used a little more info on in the documentation. But still very very good.

15 Apr 2006 Sergey Seleznev

Thanks, very useful!

24 Sep 2006 Student Alexander

Sorry, but the 1 path problem is VERY consistent

24 Jan 2007 Olivier Planchon

The good things: The code is simple to understand and to use. Only one function in one file. Short code. And it works.
 
The less good: Massive use of embeded loops make the code very slow. Some of them are really EZ to chnage into more efficient MATLAB code. Others need more work.

My conclusion: This function have met my (simple) needs. Many thanks. Olivier

21 Sep 2007 w l  
10 Nov 2007 rakesh nune

The code is really simple and i have used it for creating a new algorithm

22 Feb 2008 vijayan duraiswamy

The code is really useful and i have used and modified for my application

17 Mar 2008 Choi Uk

good algorithm!!! thx!!

26 Mar 2008 Arun Kumar Mondal

good

Please login to add a comment or rating.
Updates
24 Jun 2005

corrent Summary

Tag Activity for this File
Tag Applied By Date/Time
coding theory Yi Wang 22 Oct 2008 07:50:41
information theory Yi Wang 22 Oct 2008 07:50:41
dijkstra Yi Wang 22 Oct 2008 07:50:41
cycle Yi Wang 22 Oct 2008 07:50:41
shortestpath Yi Wang 22 Oct 2008 07:50:41
matrix Yi Wang 22 Oct 2008 07:50:41
transmat Yi Wang 22 Oct 2008 07:50:41
paths Yi Wang 22 Oct 2008 07:50:41
nodes Yi Wang 22 Oct 2008 07:50:41
graph Yi Wang 22 Oct 2008 07:50:41
transmat lily 12 Aug 2010 08:49:57

Contact us at files@mathworks.com