Label correcting algorithm for shortest path

Would you please write a code for Label correcting algorithm for shortest path??

11 Kommentare

Information about Label Correcting Algorithms: http://www.mit.edu/~dimitrib/SLF.pdf
The present version of your Question sounds like you are asking us to write code for a homework assignment for you. That is not the purpose of MATLAB Answers: MATLAB Answers is about the MATLAB language. We will help you interpret error messages and help you find information in the documentation, but we will seldom just write non-trivial code for you.
See also "Label-Correcting Shortest Path Algorithms Revisited. María G. Bardossy, Douglas R. Shier". They implemented in MATLAB. I do not know if you will be able to find their full paper for free but you can read parts of it.
nazi hafez
nazi hafez am 19 Sep. 2015
I do not have much experience in programming with MATLAB. If it is possible suggest me applied materials and pamphlets.
Steven Lord
Steven Lord am 19 Sep. 2015
There are a lot of good suggestions for how to learn MATLAB in this Answer. Once you've read through that thread (and possibly some of the resources linked there) then give implementing your algorithm a shot. Some of the new graph algorithm tools introduced in release R2015b may help you with your implementation. If you get stuck during your implementation, come back to MATLAB Answers, show where you're stuck, and ask a specific question about the difficulty and someone will probably give you a nudge in the right direction.
nazi hafez
nazi hafez am 20 Sep. 2015
Bearbeitet: Walter Roberson am 20 Sep. 2015
Hi, As I said before I am not good in Matlab :( I tried to write a code for "Label-Correcting Shortest Path Algorithms" but still many problems are existed. What I wrote can be seen in the following. Pls read and help me for continuing. More exactly, I do not know how I could write "for each (i,j) belong to A(i)".
d(1)=0
pred(1)=0
for j=2:6
w(j)=Inf
end
list=[1]
while list~=[]
i=list(1)
list(1)=[]
end
You can represent your set of arcs as a cell array. Or, since you will have the same amount of information for each arc, you can use a 2 dimensional numeric array. For example if for each arc you have the Source, Destination, and Cost, then you could represent as an array of three columns, such as
[1 2 5; %node 1 to 2, cost 5
1 4 3; %node 1 to 4, cost 3
2 5 2] %node 2 to 5, cost 2
Then arc #3 would be the third row of this array.
Alex Taylor
Alex Taylor am 28 Sep. 2015
Walter, if the OP is interesting in a graph theory representation of solving this, they should look at the brand new graph functionality that went into R2015b (assuming they have R2015b).
Specifically, there are several functions related to computing shortest path problems.
Alternatively, they could just use the IPT function bwdistgeodesic if they want to use a more simple image-based approach to the problem.
Interesting, Alex; I had not noticed those yet.
nazi hafez
nazi hafez am 6 Nov. 2015
Label correcting algorithm is just find the shortest path between a single source node and a single destination node. Am I right? Now how I want to find shortest path between all pairs of nodes in a network. How label correcting algorithm will be changed for this?
Did you see Alex's comment above? Did you try anything yourself? (If we had any code all ready to go, we would have given it to you.)

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Image Analyst
Image Analyst am 19 Sep. 2015

0 Stimmen

If you want to learn about MATLAB's capabilities, with code examples, for shortest path, see Steve's blog series: http://blogs.mathworks.com/steve/2011/11/01/exploring-shortest-paths-part-1/

Kategorien

Mehr zu Graph and Network Algorithms finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 17 Sep. 2015

Kommentiert:

am 6 Nov. 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by