How can I build branches from an adjacency matrix.
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!