edu.uci.ics.jung.algorithms.generators.random
Class ErdosRenyiGenerator<V,E>
java.lang.Object
edu.uci.ics.jung.algorithms.generators.random.ErdosRenyiGenerator<V,E>
- All Implemented Interfaces:
- GraphGenerator<V,E>, org.apache.commons.collections15.Factory<Graph<V,E>>
public class ErdosRenyiGenerator<V,E>
- extends Object
- implements GraphGenerator<V,E>
Generates a random graph using the Erdos-Renyi binomial model
(each pair of vertices is connected with probability p).
- Author:
- William Giordano, Scott White, Joshua O'Madadhain
Constructor Summary |
ErdosRenyiGenerator(org.apache.commons.collections15.Factory<UndirectedGraph<V,E>> graphFactory,
org.apache.commons.collections15.Factory<V> vertexFactory,
org.apache.commons.collections15.Factory<E> edgeFactory,
int numVertices,
double p)
|
Method Summary |
Graph<V,E> |
create()
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)
Sets the seed of the internal random number generator to seed . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ErdosRenyiGenerator
public ErdosRenyiGenerator(org.apache.commons.collections15.Factory<UndirectedGraph<V,E>> graphFactory,
org.apache.commons.collections15.Factory<V> vertexFactory,
org.apache.commons.collections15.Factory<E> edgeFactory,
int numVertices,
double p)
- Parameters:
numVertices
- number of vertices graph should havep
- Connection's probability between 2 vertices
create
public Graph<V,E> create()
- Returns a graph in which each pair of vertices is connected by
an undirected edge with the probability specified by the constructor.
- Specified by:
create
in interface org.apache.commons.collections15.Factory<Graph<V,E>>
setSeed
public void setSeed(long seed)
- Sets the seed of the internal random number generator to
seed
.
Enables consistent behavior.
Copyright © 2009. All Rights Reserved.