Package org.graph4j.generators
Class PathGenerator
java.lang.Object
org.graph4j.generators.AbstractGraphGenerator
org.graph4j.generators.PathGenerator
A path graph consists of a single path. If the vertices of the graph
are
0,1,...,n-1 then its edges are (i, i+1), for
i=0,...,n-2
The cycle graph with n vertices is denoted by Pn. The number of
edges of Pn is n-1 and every vertex has degree 2,
except the extremities which have degree 1.- Author:
- Cristian Frăsinaru
-
Field Summary
Fields inherited from class org.graph4j.generators.AbstractGraphGenerator
vertices -
Constructor Summary
ConstructorsConstructorDescriptionPathGenerator(int numVertices) PathGenerator(int firstVertex, int lastVertex) -
Method Summary
Methods inherited from class org.graph4j.generators.AbstractGraphGenerator
addRandomEdges
-
Constructor Details
-
PathGenerator
public PathGenerator(int numVertices) -
PathGenerator
public PathGenerator(int firstVertex, int lastVertex)
-
-
Method Details
-
createGraph
- Returns:
- a path graph.
-
createDigraph
- Parameters:
leftToRight- the orientation of the path.- Returns:
- a directed path graph.
-