Finding a chain in an adjacency matrix
이전 댓글 표시
Hi everyone,
I have a binary matrix A representing edges in a graph, of size n x m. It is easy to know if elements i and j are connected by an edge: I simply look up if A(i,j)==1. However, I want to know if there is a chain of size k (or smaller) that connects i and j. For example, A(i,k)==1 and A(k,j)==1. Any ideas or maybe a pre-existing function that I have not found?
I have no interest whatsoever in finding the shortest path, I just care if there is any. Thanks
댓글 수: 2
David Goodmanson
2016년 10월 25일
Hello Josue, If A is an adjacency matrix, could you explain how it is not a square matrix?
Josue Sandoval
2016년 10월 30일
채택된 답변
추가 답변 (1개)
You can use the power of the adjacency matrix as detailed in
카테고리
도움말 센터 및 File Exchange에서 Data Distribution Plots에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!