How can I build branches from an adjacency matrix.

1 Ansicht (letzte 30 Tage)
Eyman FAKHRI
Eyman FAKHRI am 25 Jun. 2018
Bearbeitet: Eyman FAKHRI am 27 Jun. 2018
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 !

Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by