Class ErdosRenyiGenerator<V,E>
java.lang.Object
edu.uci.ics.jung.algorithms.generators.random.ErdosRenyiGenerator<V,E>
- All Implemented Interfaces:
com.google.common.base.Supplier<Graph<V,,E>> GraphGenerator<V,,E> Supplier<Graph<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
ConstructorsConstructorDescriptionErdosRenyiGenerator(com.google.common.base.Supplier<UndirectedGraph<V, E>> graphFactory, com.google.common.base.Supplier<V> vertexFactory, com.google.common.base.Supplier<E> edgeFactory, int numVertices, double p) -
Method Summary
-
Constructor Details
-
ErdosRenyiGenerator
public ErdosRenyiGenerator(com.google.common.base.Supplier<UndirectedGraph<V, E>> graphFactory, com.google.common.base.Supplier<V> vertexFactory, com.google.common.base.Supplier<E> edgeFactory, int numVertices, double p) - Parameters:
graphFactory- factory for graphs of the appropriate typevertexFactory- factory for vertices of the appropriate typeedgeFactory- factory for edges of the appropriate typenumVertices- number of vertices graph should havep- Connection's probability between 2 vertices
-
-
Method Details
-
get
Returns a graph in which each pair of vertices is connected by an undirected edge with the probability specified by the constructor. -
setSeed
public void setSeed(long seed) Sets the seed of the internal random number generator toseed. Enables consistent behavior.- Parameters:
seed- the seed to use for the internal random number generator
-