public class RandomGraphGenerator.DefaultEdgeTopologyFactory<VV,EE> extends Object implements RandomGraphGenerator.EdgeTopologyFactory<VV,EE>
Constructor and Description |
---|
RandomGraphGenerator.DefaultEdgeTopologyFactory() |
Modifier and Type | Method and Description |
---|---|
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.
|
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 RandomGraphGenerator.DefaultEdgeTopologyFactory()
public void createEdges(Graph<VV,EE> targetGraph, Map<Integer,VV> orderToVertexMap, int numberOfEdges, 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)
Copyright © 2016. All rights reserved.