randomEGraph {graph}R Documentation

Random Edge Graph

Description

A function to create random graphs according to a random edge model. The user supplies the set of nodes for the graph as V and a probability, p, for an edge existing.

Usage

randomEGraph(V, p)

Arguments

V The nodes for the graph.
p The probability of an edge being selected.

Details

Let nV denote the number of nodes. There are choose(nV, 2) edges in the complete graph. Conceptually. for each of these a biased coin (probability of heads being p) is tossed and if it is heads that edge is selected.

Value

An object of class graphNEL-class that contains the nodes and edges.

Author(s)

R. Gentleman

See Also

randomGraph

Examples

  set.seed(123)
  V <- letters[14:22]
  g1 <- randomEGraph(V, .2)


[Package Contents]