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.
|
boolean |
isNumberOfEdgesValid(Graph<VV,EE> targetGraph,
int numberOfEdges)
checks if the numOfEdges is smaller than the Max edges according to
the following table:
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
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
createEdges
public 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. But if the randomizer is
different, it should, usually, create different edge topology.
- Specified by:
createEdges in interface RandomGraphGenerator.EdgeTopologyFactory<VV,EE>
- 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 graph
-
getMaxEdgesForVertexNum
public int getMaxEdgesForVertexNum(Graph<VV,EE> targetGraph)
Return max edges for that graph. If it is infinite return -1 instead.
|