GraphDensity
GraphDensity[g]
gives the graph density of the graph g.
GraphDensity[{vw,…}]
uses rules vw to specify the graph g.
Details and Options
- GraphDensity is the ratio of the number of edges divided by the number of edges of a complete graph with the same number of vertices.
- A simple undirected graph with vertices and edges has graph density .
- A simple directed graph with vertices and edges has graph density .
Examples
open allclose allBasic Examples (2)
Scope (6)
GraphDensity works with undirected graphs:
Use rules to specify the graph:
GraphDensity works with large graphs:
Applications (4)
Find the proportion of games between teams during an American college football season:
Compute the probability that two randomly chosen friends in a network are connected:
The expected number of edges matches the original graph:
Distribution of density in BernoulliGraphDistribution[n,p]:
Properties & Relations (6)
GraphDensity measures the density of the AdjacencyMatrix:
Get the density from AdjacencyMatrix:
The graph density is between 0 and 1:
The density of an empty graph is 0:
Use EmptyGraphQ to test for emptiness:
The density of a complete graph is 1:
Use CompleteGraphQ to test for complete graphs:
Converting an undirected graph to a directed graph does not change the density:
Unless self-loops are taken into consideration:
LocalClusteringCoefficient gives a local measure of density:
Text
Wolfram Research (2012), GraphDensity, Wolfram Language function, https://reference.wolfram.com/language/ref/GraphDensity.html (updated 2015).
CMS
Wolfram Language. 2012. "GraphDensity." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2015. https://reference.wolfram.com/language/ref/GraphDensity.html.
APA
Wolfram Language. (2012). GraphDensity. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/GraphDensity.html