Learn R Programming

KEGGgraph (version 1.30.0)

graphDensity: Graph density

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

graphDensity(graph)

Arguments

graph
A graph object

Value

A value between [0,1]

Details

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

References

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

Examples

Run this code
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)

Run the code above in your browser using DataLab