Package org.graph4j.generators
Class StarGenerator
java.lang.Object
org.graph4j.generators.AbstractGraphGenerator
org.graph4j.generators.StarGenerator
A star is a graph formed by connecting a single universal vertex,
called center, to an independent set of vertices.
A star graph with n vertices is actually the complete bipartite graph
K(1,n-1). A star with 3 edges is called a claw.
- Author:
- Cristian Frăsinaru
-
Field Summary
Fields inherited from class org.graph4j.generators.AbstractGraphGenerator
vertices -
Constructor Summary
ConstructorsConstructorDescriptionStarGenerator(int numVertices) StarGenerator(int firstVertex, int lastVertex, int center) -
Method Summary
Methods inherited from class org.graph4j.generators.AbstractGraphGenerator
addRandomEdges
-
Constructor Details
-
StarGenerator
public StarGenerator(int numVertices) -
StarGenerator
public StarGenerator(int firstVertex, int lastVertex, int center) - Parameters:
firstVertex- the first vertex number.lastVertex- the last vertex number.center- the number of the center vertex.
-
-
Method Details
-
createGraph
- Returns:
- a star graph.
-
createDigraph
- Parameters:
outward- the orientation of the edges connecting the center.- Returns:
- a directed star graph.
-