compute graph density
The GraphDensity(G) command returns the graph density of G.
For an undirected graph with n vertices and m edges, the graph density is 2⁢mn⁢n−1.
For a directed graph with n vertices and m arcs, the graph density is mn⁢n−1.
Note that self-loops are not included in the edge count for the purposes of computing graph density.
K4 ≔ CompleteGraph⁡4
K4≔Graph 1: an undirected graph with 4 vertices and 6 edge(s)
H ≔ Digraph⁡Trail⁡1,2,3,1,4,3,Trail⁡4,2,1,3:
The GraphTheory[GraphDensity] command was introduced in Maple 2021.
For more information on Maple 2021 changes, see Updates in Maple 2021.
Download Help Document
What kind of issue would you like to report? (Optional)