edu.uci.ics.jung.random.generators
Class ErdosRenyiGenerator
java.lang.Object
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
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 |
ErdosRenyiGenerator
public ErdosRenyiGenerator(int numVertices,
double p)
- Parameters:
numVertices
- number of vertices graph should havep
- Connection's probability between 2 vertices
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)