Effacer les filtres
Effacer les filtres

How to compute total links in a Graph?

1 vue (au cours des 30 derniers jours)
charu shree
charu shree le 20 Avr 2023
Commenté : charu shree le 20 Avr 2023
Hello all, I am trying to compute total links in a following graph but not getting it correctly.
Suppose there are 15 small mobile towers which can act as source as well as target and 1 Big mobile tower which will only act as target and are modelled as below:
My query is how to compute the total links in this Graph. Any help in this regard will be highly appreciated.
diff_smt = 15; % different number of small mobile towers
bmt = 1; % only one big mobile tower which is target
idx_bmt = diff_smt +1; % index of big mobile tower (target)
sr = [1 1 1 2 2 2 3 3 4 4 4 5 5 5 6 6 6 7 7 7 8 8 8 9 9 9 10 10 10 11 11 12 12 13 13 13 14 14 15 15 15]; % various possible sources
ta=randi([2,16],1,length(sr)); % various possible targets
G = graph(sr,ta);
plot (G);

Réponse acceptée

Steven Lord
Steven Lord le 20 Avr 2023
There are many functions you can call on graph objects, including the numedges function.
  1 commentaire
charu shree
charu shree le 20 Avr 2023
Thanks a lot sir for your to the point answer.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Startup and Shutdown dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by