Package org.graph4j.generators
Class RandomGnmGraphGenerator
java.lang.Object
org.graph4j.generators.AbstractGraphGenerator
org.graph4j.generators.RandomGnmGraphGenerator
Erdős–Rényi G(n,m) model. The graph is chosen uniformly at random from the
collection of all graphs which have n nodes and m edges.
The graph is guaranteed to have m edges.
- Author:
- Cristian Frăsinaru
- See Also:
-
Field Summary
Fields inherited from class org.graph4j.generators.AbstractGraphGenerator
vertices -
Constructor Summary
ConstructorsConstructorDescriptionRandomGnmGraphGenerator(int firstVertex, int lastVertex, long numEdges) RandomGnmGraphGenerator(int numVertices, long numEdges) -
Method Summary
Modifier and TypeMethodDescriptionMethods inherited from class org.graph4j.generators.AbstractGraphGenerator
addRandomEdges
-
Constructor Details
-
RandomGnmGraphGenerator
public RandomGnmGraphGenerator(int numVertices, long numEdges) - Parameters:
numVertices- the number of vertices.numEdges- the number of edges.
-
RandomGnmGraphGenerator
public RandomGnmGraphGenerator(int firstVertex, int lastVertex, long numEdges) - Parameters:
firstVertex- the first vertex number of the graph.lastVertex- the last vertex number of the graph.numEdges- the number of edges.
-
-
Method Details
-
createGraph
- Returns:
- a random graph.
-
createConnectedGraph
- Returns:
- a random connected graph.
-
createDigraph
- Returns:
- a random digraph.
-
createMultiGraph
- Returns:
- a random multigraph.
-
createDirectedMultigraph
- Returns:
- a random directed multigraph.
-
createPseudograph
- Returns:
- a random pseudograph.
-
createDirectedPseudograph
- Returns:
- a random directed pseudograph.
-