|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jgrapht.generate.RandomGraphGenerator.DefaultEdgeTopologyFactory<VV,EE>
public class RandomGraphGenerator.DefaultEdgeTopologyFactory<VV,EE>
Default implementation of the EdgeTopologyFactory interface. randomly chooses an edge and tries to add it. If the add fails from any reason (like: self edge / multiple edges in unpermitted graph type) it will just choose another and try again. Performance:
| Constructor Summary | |
|---|---|
RandomGraphGenerator.DefaultEdgeTopologyFactory()
|
|
| Method Summary | |
|---|---|
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: |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RandomGraphGenerator.DefaultEdgeTopologyFactory()
| Method Detail |
|---|
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)public int getMaxEdgesForVertexNum(Graph<VV,EE> targetGraph)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||