How can I build branches from an adjacency matrix.

1 view (last 30 days)
Hello, In my optimization program, I want to penalize branches that have a high number of nodes. For that I must build branches from an adjacency matrix.
Let's take an example, I will consider the graph and the adjacency matrix in the attached figure.
The last node number in the matrix node (the highest) is always the reference node.
Therefore the adjacency matrix is :
0 1 0 0 0 0 0
1 0 0 0 0 0 1
0 0 0 1 0 0 0
0 0 1 0 0 1 1
0 0 0 0 0 0 1
0 0 0 1 0 0 0
0 1 0 1 1 0 0
So I need to obtain vectors that contain branch nodes:
Branch 1: 7 2 1
Branch 2: 7 4 3 6
Branch 3: 7 5
Thank you so much for your help !

Answers (0)

Categories

Find more on Graph and Network Algorithms in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!