Package org.graph4j.generators
Class RegularGraphGenerator
java.lang.Object
org.graph4j.generators.AbstractGraphGenerator
org.graph4j.generators.RegularGraphGenerator
Generates a regular graph. An undirected graph id regular if every
vertex has the same degree. A directed graph is regular if the vertices
indegrees and outdegrees are all equal.
- Author:
- Cristian Frăsinaru
-
Field Summary
Fields inherited from class org.graph4j.generators.AbstractGraphGenerator
vertices -
Constructor Summary
ConstructorsConstructorDescriptionRegularGraphGenerator(int numVertices, int degree) RegularGraphGenerator(int firstVertex, int lastVertex, int degree) -
Method Summary
Methods inherited from class org.graph4j.generators.AbstractGraphGenerator
addRandomEdges
-
Constructor Details
-
RegularGraphGenerator
public RegularGraphGenerator(int numVertices, int degree) - Parameters:
numVertices- the number of vertices.degree- the degree of all vertices.
-
RegularGraphGenerator
public RegularGraphGenerator(int firstVertex, int lastVertex, int degree) - Parameters:
firstVertex- the number of the first vertex in the generated graph.lastVertex- the number of the last vertex in the generated graph.degree- the degree of all vertices.
-
-
Method Details
-
createGraph
- Returns:
- a regular graph.
-
createDigraph
- Returns:
- a regular directed graph.
-