How can I build branches from an adjacency matrix.

1 次查看(过去 30 天)
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 !

回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by