public class RandomGraphGenerator.DefaultEdgeTopologyFactory<VV,EE> extends java.lang.Object implements RandomGraphGenerator.EdgeTopologyFactory<VV,EE>
Constructor and Description |
---|
DefaultEdgeTopologyFactory() |
Modifier and Type | Method and Description |
---|---|
void |
createEdges(Graph<VV,EE> targetGraph,
java.util.Map<java.lang.Integer,VV> orderToVertexMap,
int numberOfEdges,
java.util.Random randomizer)
Two different calls to the createEdges() with the same parameters
must result in the generation of the same.
|
int |
getMaxEdgesForVertexNum(Graph<VV,EE> targetGraph)
Return max edges for that graph.
|
boolean |
isNumberOfEdgesValid(Graph<VV,EE> targetGraph,
int numberOfEdges)
checks if the numOfEdges is smaller than the Max edges according to
the following table:
|
public void createEdges(Graph<VV,EE> targetGraph, java.util.Map<java.lang.Integer,VV> orderToVertexMap, int numberOfEdges, java.util.Random randomizer)
RandomGraphGenerator.EdgeTopologyFactory
createEdges
in interface RandomGraphGenerator.EdgeTopologyFactory<VV,EE>
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 graphpublic boolean isNumberOfEdgesValid(Graph<VV,EE> targetGraph, int numberOfEdges)
Graph Type | Directed / UnDirected | multiple edges | loops | Max Edges |
---|---|---|---|---|
SimpleGraph | UnDirected | - | - | N(N-1)/2 |
Multigraph | UnDirected | + | - | Infinite |
Pseudograph | UnDirected | + | + | Infinite |
SimpleDirectedGraph | Directed | - | - | N (N-1) |
DefaultDirectedGraph | Directed | - | + | N*(N-1)+ N = N^2 |
DirectedMultigraph | Directed | + | + | Infinite |
isNumberOfEdgesValid
in interface RandomGraphGenerator.EdgeTopologyFactory<VV,EE>
targetGraph
- guranteed to start with zero edges.RandomGraphGenerator.EdgeTopologyFactory.isNumberOfEdgesValid(Graph,
int)