graphDensity: Graph density

Description Usage Arguments Details Value Author(s) References Examples

View source: R/graph.R

Description

The graph density is defined as d = E/(V*(V-1)/2) where E is the number of edges and V of nodes.

Usage

1
graphDensity(graph)

Arguments

graph

A graph object

Details

The density of a graph lies between [0,1]

Value

A value between [0,1]

Author(s)

Jitao David Zhang jitao_david.zhang@roche.com

References

Aittokallio and Schwikowski (2006), Graph-based methods for analysing networks in cell biology, Briefings in Bioinformatics, 7, 243-255.

Examples

1
2
3
4
5
tnodes <- c("Hamburg","Dortmund","Bremen", "Paris")
tedges <- list("Hamburg"=c("Dortmund", "Bremen"),
"Dortmund"=c("Hamburg"), "Bremen"=c("Hamburg"), "Paris"=c())
tgraph <- new("graphNEL", nodes = tnodes, edgeL = tedges)
graphDensity(tgraph)

Example output

Attaching package: 'KEGGgraph'

The following object is masked from 'package:graphics':

    plot

[1] 0.3333333

KEGGgraph documentation built on Nov. 8, 2020, 5:42 p.m.