edu.uci.ics.jung.algorithms.generators.random
Class MixedRandomGraphGenerator
- java.lang.Object
-
- edu.uci.ics.jung.algorithms.generators.random.MixedRandomGraphGenerator
-
public class MixedRandomGraphGenerator extends java.lang.ObjectGenerates a mixed-mode random graph (with random edge weights) based on the output ofBarabasiAlbertGenerator. Primarily intended for providing a heterogeneous sample graph for visualization testing, etc.
-
-
Constructor Summary
Constructors Constructor and Description MixedRandomGraphGenerator()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static <V,E> Graph<V,E>generateMixedRandomGraph(com.google.common.base.Supplier<Graph<V,E>> graphFactory, com.google.common.base.Supplier<V> vertexFactory, com.google.common.base.Supplier<E> edgeFactory, java.util.Map<E,java.lang.Number> edge_weights, int num_vertices, java.util.Set<V> seedVertices)Returns a random mixed-mode graph.
-
-
-
Method Detail
-
generateMixedRandomGraph
public static <V,E> Graph<V,E> generateMixedRandomGraph(com.google.common.base.Supplier<Graph<V,E>> graphFactory, com.google.common.base.Supplier<V> vertexFactory, com.google.common.base.Supplier<E> edgeFactory, java.util.Map<E,java.lang.Number> edge_weights, int num_vertices, java.util.Set<V> seedVertices)
Returns a random mixed-mode graph. Starts with a randomly generated Barabasi-Albert (preferential attachment) generator (4 initial vertices, 3 edges added at each step, and num_vertices - 4 evolution steps). Then takes the resultant graph, replaces random undirected edges with directed edges, and assigns random weights to each edge.- Type Parameters:
V- the vertex typeE- the edge type- Parameters:
graphFactory- factory for graphs of the appropriate typevertexFactory- factory for vertices of the appropriate typeedgeFactory- factory for edges of the appropriate typeedge_weights- storage for the edge weights that this generator createsnum_vertices- number of vertices to generateseedVertices- storage for the seed vertices that this generator creates- Returns:
- the generated graph
-
-
DataMelt 3.0 © DataMelt by jWork.ORG