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!