Package org.graph4j.generators
Class WheelGenerator
java.lang.Object
org.graph4j.generators.AbstractGraphGenerator
org.graph4j.generators.WheelGenerator
Generator for wheel graphs. A wheel is a graph formed by connecting
a single universal vertex, called center (or hub), to all vertices
of a cycle.
- Author:
- Cristian Frăsinaru
-
Field Summary
Fields inherited from class org.graph4j.generators.AbstractGraphGenerator
vertices -
Constructor Summary
ConstructorsConstructorDescriptionWheelGenerator(int numVertices) WheelGenerator(int firstVertex, int lastVertex, int center) -
Method Summary
Modifier and TypeMethodDescriptioncreateDigraph(boolean clockwise, boolean outward) Creates a directed wheel graph.Creates a wheel graph.Methods inherited from class org.graph4j.generators.AbstractGraphGenerator
addRandomEdges
-
Constructor Details
-
WheelGenerator
public WheelGenerator(int numVertices) -
WheelGenerator
public WheelGenerator(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
Creates a wheel graph.- Returns:
- a wheel graph.
-
createDigraph
Creates a directed wheel graph.- Parameters:
clockwise- the orientation of the cycleoutward- the orientation of the edges connecting the center- Returns:
- a directed wheel graph.
-