Class EppsteinPowerLawGenerator<V,E>
- java.lang.Object
-
- edu.uci.ics.jung.algorithms.generators.random.EppsteinPowerLawGenerator<V,E>
-
- All Implemented Interfaces:
GraphGenerator<V,E>
,org.apache.commons.collections4.Factory<edu.uci.ics.jung.graph.Graph<V,E>>
public class EppsteinPowerLawGenerator<V,E> extends java.lang.Object implements GraphGenerator<V,E>
Graph generator that generates undirected graphs with power-law degree distributions.- See Also:
- "A Steady State Model for Graph Power Law by David Eppstein and Joseph Wang"
-
-
Constructor Summary
Constructors Constructor Description EppsteinPowerLawGenerator(org.apache.commons.collections4.Factory<edu.uci.ics.jung.graph.Graph<V,E>> graphFactory, org.apache.commons.collections4.Factory<V> vertexFactory, org.apache.commons.collections4.Factory<E> edgeFactory, int numVertices, int numEdges, int r)
Creates an instance with the specified factories and specifications.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description edu.uci.ics.jung.graph.Graph<V,E>
create()
Generates a graph whose degree distribution approximates a power-law.protected edu.uci.ics.jung.graph.Graph<V,E>
initializeGraph()
void
setSeed(long seed)
Sets the seed for the random number generator.
-
-
-
Constructor Detail
-
EppsteinPowerLawGenerator
public EppsteinPowerLawGenerator(org.apache.commons.collections4.Factory<edu.uci.ics.jung.graph.Graph<V,E>> graphFactory, org.apache.commons.collections4.Factory<V> vertexFactory, org.apache.commons.collections4.Factory<E> edgeFactory, int numVertices, int numEdges, int r)
Creates an instance with the specified factories and specifications.- Parameters:
graphFactory
- the factory to use to generate the graphvertexFactory
- the factory to use to create verticesedgeFactory
- the factory to use to create edgesnumVertices
- the number of vertices for the generated graphnumEdges
- the number of edges the generated graph will have, should be Theta(numVertices)r
- the number of iterations to use; the larger the value the better the graph's degree distribution will approximate a power-law
-
-
Method Detail
-
create
public edu.uci.ics.jung.graph.Graph<V,E> create()
Generates a graph whose degree distribution approximates a power-law.- Specified by:
create
in interfaceorg.apache.commons.collections4.Factory<V>
- Returns:
- the generated graph
-
setSeed
public void setSeed(long seed)
Sets the seed for the random number generator.- Parameters:
seed
- input to the random number generator.
-
-