public class ErdosRenyiGenerator<V,E> extends Object implements GraphGenerator<V,E>
Constructor and Description |
---|
ErdosRenyiGenerator(org.apache.commons.collections4.Factory<UndirectedGraph<V,E>> graphFactory,
org.apache.commons.collections4.Factory<V> vertexFactory,
org.apache.commons.collections4.Factory<E> edgeFactory,
int numVertices,
double p) |
Modifier and Type | Method and Description |
---|---|
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 . |
public ErdosRenyiGenerator(org.apache.commons.collections4.Factory<UndirectedGraph<V,E>> graphFactory, org.apache.commons.collections4.Factory<V> vertexFactory, org.apache.commons.collections4.Factory<E> edgeFactory, int numVertices, double p)
numVertices
- number of vertices graph should havep
- Connection's probability between 2 verticespublic Graph<V,E> create()
public void setSeed(long seed)
seed
.
Enables consistent behavior.Copyright © 2015. All rights reserved.