Label correcting algorithm for shortest path
显示 更早的评论
Would you please write a code for Label correcting algorithm for shortest path??
11 个评论
Walter Roberson
2015-9-17
Walter Roberson
2015-9-17
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.
Walter Roberson
2015-9-17
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
2015-9-19
Steven Lord
2015-9-19
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
2015-9-20
编辑:Walter Roberson
2015-9-20
Walter Roberson
2015-9-20
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
2015-9-28
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.
Walter Roberson
2015-9-28
Interesting, Alex; I had not noticed those yet.
nazi hafez
2015-11-6
Image Analyst
2015-11-6
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.)
回答(1 个)
Image Analyst
2015-9-19
0 个投票
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/
类别
在 帮助中心 和 File Exchange 中查找有关 Graph and Network Algorithms 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!