Package org.graph4j.generators
Class RandomTreeGenerator
java.lang.Object
org.graph4j.generators.AbstractGraphGenerator
org.graph4j.generators.RandomTreeGenerator
Generates a random tree or arborescence. A tree is a connected
acyclic graph. An arborescence is a directed rooted tree where there
is exactly one path from the root to every other vertex.
- Author:
- Cristian Frăsinaru
-
Field Summary
Fields inherited from class org.graph4j.generators.AbstractGraphGenerator
vertices -
Constructor Summary
ConstructorsConstructorDescriptionRandomTreeGenerator(int numVertices) RandomTreeGenerator(int[] vertices) RandomTreeGenerator(int firstVertex, int lastVertex) -
Method Summary
Modifier and TypeMethodDescriptionCreates a random arborescence.Creates a random tree.Methods inherited from class org.graph4j.generators.AbstractGraphGenerator
addRandomEdges
-
Constructor Details
-
RandomTreeGenerator
public RandomTreeGenerator(int numVertices) -
RandomTreeGenerator
public RandomTreeGenerator(int firstVertex, int lastVertex) -
RandomTreeGenerator
public RandomTreeGenerator(int[] vertices)
-
-
Method Details
-
createTree
Creates a random tree.- Returns:
- a random tree.
-
createArborescence
Creates a random arborescence.- Returns:
- a random arborescence.
-