필터 지우기
필터 지우기

find all possible paths of length K from source node to any other nodes????

조회 수: 4 (최근 30일)
Aseel H
Aseel H 2014년 3월 27일
댓글: Aseel H 2014년 3월 27일
I want the the code to find all paths of length K originating from source node to other nodes in the graph , where source node is the node that the path of length K will start in it ,and the other node are all nodes the path will end in it . note no edge appear more than once in path

답변 (1개)

Walter Roberson
Walter Roberson 2014년 3월 27일
Read about the Dijkstra algorithm. It will not be exactly what you need in order to record all the paths, but it will form the mathematical basis for finding those paths.
See also:
With the breadth-first approach mentioned above, you could stop after descending K deep.
Steve Lord examined a number of shortest path approaches.
  댓글 수: 1
Aseel H
Aseel H 2014년 3월 27일
thank you very much about those links, but please help me more to write the code in matlap. i want to find the path of length k and the distance of it , where k is an integer, not to find the shortest path.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Graph and Network Algorithms에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by