How to find graph density in MATLAB for a given graph G?
10 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I want to find the density of a graph in matlab. Is there any function to find that? Thanks.
0 Commenti
Risposta accettata
Kelly Kearney
il 2 Lug 2021
You can simply calculate the number of non-zero elements relative to total elements in the adjacency matrix:
nnz(adjacency(G))./numel(adjacency(G))
3 Commenti
Steven Lord
il 3 Lug 2021
You can use the numnodes and numedges functions on a graph or digraph to get the numbers of nodes or edges respectively.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Graph and Network Algorithms in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!