public class RandomGraphGenerator<V,E> extends Object implements GraphGenerator<V,E,V>
However, two instances which use the same constructor parameters will produce two different random graphs (note: as with any random generator, there is always a small possibility that two instances will create the same results).
Modifier and Type | Class and Description |
---|---|
class |
RandomGraphGenerator.DefaultEdgeTopologyFactory<VV,EE>
Default implementation of the EdgeTopologyFactory interface.
|
static interface |
RandomGraphGenerator.EdgeTopologyFactory<VV,EE>
This class is used to generate the edge topology for a graph.
|
Modifier and Type | Field and Description |
---|---|
protected int |
numOfEdges |
protected int |
numOfVertexes |
protected Random |
randomizer |
Constructor and Description |
---|
RandomGraphGenerator(int aNumOfVertexes,
int aNumOfEdges) |
RandomGraphGenerator(int aNumOfVertexes,
int aNumOfEdges,
long seed) |
Modifier and Type | Method and Description |
---|---|
void |
generateGraph(Graph<V,E> target,
VertexFactory<V> vertexFactory,
Map<String,V> resultMap)
(non-Javadoc)
|
long |
getRandomSeed() |
protected int numOfVertexes
protected int numOfEdges
protected Random randomizer
public RandomGraphGenerator(int aNumOfVertexes, int aNumOfEdges)
public RandomGraphGenerator(int aNumOfVertexes, int aNumOfEdges, long seed)
public long getRandomSeed()
public void generateGraph(Graph<V,E> target, VertexFactory<V> vertexFactory, Map<String,V> resultMap)
generateGraph
in interface GraphGenerator<V,E,V>
target
- receives the generated edges and vertices; if this is
non-empty on entry, the result will be a disconnected graph since
generated elements will not be connected to existing elementsvertexFactory
- called to produce new verticesresultMap
- if non-null, receives implementation-specific mappings
from String roles to graph elements (or collections of graph elements)IllegalArgumentException
- if the aNumOfEdges passed in the
constructor, cannot be created on a graph of the concrete type with
aNumOfVertexes.
org.jgrapht.generate.RandomGraphGenerator.DefaultEdgeTopologyFactory#isNumberOfEdgesValid(org.jgrapht.Graph,
int)GraphGenerator.generateGraph(Graph, VertexFactory, Map)
Copyright © 2016. All rights reserved.