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

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

public class SimpleRandomGenerator
extends Object
implements GraphGenerator

Simple graph generator where |V| vertices are generated and |E| random edges chosen pairwise uniformly

Author:
William Giordano, Scott White

Constructor Summary
SimpleRandomGenerator(int numVertices, int numEdges)
          Constructs the generator
 
Method Summary
 ArchetypeGraph generateGraph()
          Generated the graph by creating |V| vertics and then picking |E| random edges
 long getNumEdges()
           
 long getNumVertices()
           
protected  Vertex newVertex()
           
 void setSeed(long seed)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleRandomGenerator

public SimpleRandomGenerator(int numVertices,
                             int numEdges)
Constructs the generator

Parameters:
numVertices - number of vertices the graph should have
numEdges - number of edges the graph should have
Method Detail

newVertex

protected Vertex newVertex()

setSeed

public void setSeed(long seed)

generateGraph

public ArchetypeGraph generateGraph()
Generated the graph by creating |V| vertics and then picking |E| random edges

Specified by:
generateGraph in interface GraphGenerator
Returns:
generated graph

getNumEdges

public long getNumEdges()
Returns:
Returns the mNumEdges.

getNumVertices

public long getNumVertices()
Returns:
Returns the mNumVertices.