edu.uci.ics.jung.random.generators
Class ErdosRenyiGenerator

java.lang.Object
  extended by edu.uci.ics.jung.random.generators.ErdosRenyiGenerator
All Implemented Interfaces:
GraphGenerator

public class ErdosRenyiGenerator
extends Object
implements GraphGenerator

Random Generator of Erdos-Renyi "binomial model"

Author:
William Giordano, Scott White, Joshua O'Madadhain

Constructor Summary
ErdosRenyiGenerator(int numVertices, double p)
           
 
Method Summary
 ArchetypeGraph generateGraph()
          Returns a graph in which each pair of vertices is connected by an undirected edge with the probability specified by the constructor.
 void setSeed(long seed)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ErdosRenyiGenerator

public ErdosRenyiGenerator(int numVertices,
                           double p)
Parameters:
numVertices - number of vertices graph should have
p - Connection's probability between 2 vertices
Method Detail

generateGraph

public ArchetypeGraph generateGraph()
Returns a graph in which each pair of vertices is connected by an undirected edge with the probability specified by the constructor.

Specified by:
generateGraph in interface GraphGenerator
Returns:
the generated graph

setSeed

public void setSeed(long seed)