Package org.graph4j.generators
Class CompleteBipartiteGenerator
java.lang.Object
org.graph4j.generators.AbstractGraphGenerator
org.graph4j.generators.AbstractBipartiteGenerator
org.graph4j.generators.CompleteBipartiteGenerator
Generator for complete bipartite graphs.
A complete bipartite graph is a graph whose vertices can be
decomposed into two disjoint stable sets (no two vertices within the same set
are adjacent) and every pair of vertices, one in the left side and one in the
right side of the partition, are adjacent.
This class allows the creation of both directed and undirected bipartite
graphs. In case of directed graphs, the edges may be oriented left to right,
right to left, or in both directions.
- Author:
- Cristian Frăsinaru
-
Field Summary
Fields inherited from class org.graph4j.generators.AbstractBipartiteGenerator
first1, first2, last1, last2Fields inherited from class org.graph4j.generators.AbstractGraphGenerator
vertices -
Constructor Summary
ConstructorsConstructorDescriptionCompleteBipartiteGenerator(int n1, int n2) CompleteBipartiteGenerator(int first1, int last1, int first2, int last2) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidMethods inherited from class org.graph4j.generators.AbstractBipartiteGenerator
createDigraphMethods inherited from class org.graph4j.generators.AbstractGraphGenerator
addRandomEdges
-
Constructor Details
-
CompleteBipartiteGenerator
public CompleteBipartiteGenerator(int n1, int n2) -
CompleteBipartiteGenerator
public CompleteBipartiteGenerator(int first1, int last1, int first2, int last2)
-
-
Method Details
-
createGraph
- Overrides:
createGraphin classAbstractBipartiteGenerator- Returns:
- a complete bipartite graph
-
addEdges
- Specified by:
addEdgesin classAbstractBipartiteGenerator
-