Macaulay2 » Documentation
Packages » Graphs :: density
next | previous | forward | backward | up | index | toc

density -- computes the density of a graph



A dense graph has a high edge to vertex ratio, whereas a sparse graph has a low edge to vertex ratio. Density is equal to 2*|E| divided by |V|*(|V|-1). A complete graph has density 1; the minimal density of any graph is 0.

i1 : G = graph({{1,2},{2,3},{3,4},{4,2},{1,4}},EntryMode=>"edges");
i2 : density G

o2 = -

o2 : QQ

See also

Ways to use density :

For the programmer

The object density is a method function.