Package org.graph4j.generators
Class FanGenerator
java.lang.Object
org.graph4j.generators.AbstractGraphGenerator
org.graph4j.generators.FanGenerator
Generates fan graphs. A fan graph
F(m,n)
is defined as the graph join Nm + Pn ,
where Nm is the null graph on m nodes and
Pn is the path graph on n nodes.
The fan graph F(4,1) is known as the gem graph.- Author:
- Cristian Frăsinaru
-
Field Summary
Fields inherited from class org.graph4j.generators.AbstractGraphGenerator
vertices -
Constructor Summary
ConstructorsConstructorDescriptionFanGenerator(int emptyGraphNumVertices, int pathGraphNumVertices) Creates a generator for fan graphs. -
Method Summary
Modifier and TypeMethodDescriptioncreate()Creates a fan graph by performing the union of the empty graph and the path graph.Returns the empty graph used to create the fan.Returns the path graph used to create the fan.Methods inherited from class org.graph4j.generators.AbstractGraphGenerator
addRandomEdges
-
Constructor Details
-
FanGenerator
public FanGenerator(int emptyGraphNumVertices, int pathGraphNumVertices) Creates a generator for fan graphs. FirstemptyGraphNumVerticesvertex numbers will form the empty graph, while then nextpathGraphNumVerticeswill represent the path graph.- Parameters:
emptyGraphNumVertices- the number of vertices in the empty graph.pathGraphNumVertices- the number of vertices in the path graph.
-
-
Method Details
-
create
Creates a fan graph by performing the union of the empty graph and the path graph.- Returns:
- a fan graph.
-
getEmptyGraph
Returns the empty graph used to create the fan.- Returns:
- the empty graph used to create the fan.
-
getPathGraph
Returns the path graph used to create the fan.- Returns:
- the path graph used to create the fan.
-