find a cycles in undirected graph
조회 수: 3 (최근 30일)
이전 댓글 표시
My graph is something like this
(1,2)
(2,3)
(2,4)
(3,4)
(1,5)
(2,5)
(4,5)
(5,6)
(4,7)
(7,8)
(4,9)
(7,9)
(9,10)
(6,11)
(10,11)
(6,12)
(6,13)
(12,13)
(9,14)
(13,14)
I want to write a code that gives me this answer.
cycle_in_graph = {[1,2,5],[2,4,5],[2,3,4],[4,7,9],[6,12,13],[6,9,10,11,13,14],[4,5,6,9,10,11]};
댓글 수: 1
Walter Roberson
2018년 9월 30일
https://www.mathworks.com/matlabcentral/fileexchange/4266-grtheory-graph-theory-toolbox can find all independent cycles
There are some routines such as https://www.mathworks.com/matlabcentral/fileexchange/60814-cyclecount-a-l0 for counting cycles; perhaps they could be modified to return the cycles.
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Undirected Graphs에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!