Package org.jgrapht.generate
Interface RandomGraphGenerator.EdgeTopologyFactory<VV,EE>
- All Known Implementing Classes:
RandomGraphGenerator.DefaultEdgeTopologyFactory
- Enclosing class:
RandomGraphGenerator<V,
E>
public static interface RandomGraphGenerator.EdgeTopologyFactory<VV,EE>
This class is used to generate the edge topology for a graph.
- Since:
- Aug 6, 2005
- Author:
- Assaf
-
Method Summary
Modifier and TypeMethodDescriptionvoid
createEdges
(Graph<VV, EE> targetGraph, Map<Integer, VV> orderToVertexMap, int numberOfEdges, Random randomizer) Two different calls to the createEdges() with the same parameters must result in the generation of the same.boolean
isNumberOfEdgesValid
(Graph<VV, EE> targetGraph, int numberOfEdges) Checks if the graph can contain the givven numberOfEdges according to the graph type restrictions.
-
Method Details
-
createEdges
void createEdges(Graph<VV, EE> targetGraph, Map<Integer, VV> orderToVertexMap, int numberOfEdges, Random randomizer) Two different calls to the createEdges() with the same parameters must result in the generation of the same. But if the randomizer is different, it should, usually, create different edge topology.- Parameters:
targetGraph
- - guranteed to start with zero edges.orderToVertexMap
- - key=Integer of vertex order . between zero to numOfVertexes (exclusive). value = vertex from the graph. unique.numberOfEdges
- - to create in the graphrandomizer
-
-
isNumberOfEdgesValid
Checks if the graph can contain the givven numberOfEdges according to the graph type restrictions. For example: #V means number of vertexes in graph- a Simple Graph, can have max of #V*(#V-1)/2 edges. etc
- Parameters:
targetGraph
- guranteed to start with zero edges.numberOfEdges
-
-