How can i get all paths between two nodes ??
이전 댓글 표시
How can i get all paths between two nodes
댓글 수: 2
Geoff Hayes
2015년 1월 24일
Shaifali - you will need to provide some more details. Do you have a matrix representing all paths between a set of nodes and you wish to find all paths between just two of them?
shaifali shakya
2015년 1월 24일
채택된 답변
추가 답변 (2개)
Emad NB
2018년 12월 14일
You can use my function below. I use weight factor as a signal to find different pathes:
function pth=pathof(graph,startn,endn)
stop=0;
n=0;
while stop~=1
n=n+1;
Temp=shortestpath(graph,startn,endn);
eidx=findedge(graph,Temp(1:end-1),Temp(2:end));
if n~=1
if length(Temp)==length(pth{n-1,1})
if Temp==pth{n-1,1}
stop=1;
else
pth{n,1}=Temp;
graph.Edges.Weight(eidx)=100;
end
else
pth{n,1}=Temp;
graph.Edges.Weight(eidx)=100;
end
else
pth{n,1}=Temp;
graph.Edges.Weight(eidx)=100;
end
clear Temp eidx;
end
댓글 수: 2
mujahid razman
2020년 6월 21일
Simulate any shortest path algorithm between point A to point B if the map is known. Consider the map consists of free space and any configuration of finite obstacles. The result can be shown in 2-D graph where 0 means obstacle, 1 means free space and 2 means trajectory followed. For instance you can simulate A* algorithm in Matlab.
how to solve please help
Image Analyst
2020년 6월 21일
Why not use bwdistgeodesic()? Your problem statement is exactly what Steve worked on. Did you overlook my answer with the link to his blog?

The above image is from part 5 of his blog series. Don't you think that pretty much describes your problem?
Image Analyst
2015년 1월 24일
1 개 추천
See Steve's blog series on this: http://blogs.mathworks.com/steve/2011/11/01/exploring-shortest-paths-part-1/
카테고리
도움말 센터 및 File Exchange에서 Networks에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!