Package org.graph4j.generators
Class RandomMultipartiteGenerator
java.lang.Object
org.graph4j.generators.AbstractGraphGenerator
org.graph4j.generators.RandomMultipartiteGenerator
- Direct Known Subclasses:
CompleteMultipartiteGenerator
Generator for random multipartite graphs.
A k-partite graph is a graph whose vertices can be
decomposed into k disjoint stable sets (no two vertices within the same set
are adjacent).
- Author:
- Cristian Frăsinaru
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final doubleprotected final int[]protected StableSet[]Fields inherited from class org.graph4j.generators.AbstractGraphGenerator
vertices -
Constructor Summary
ConstructorsConstructorDescriptionRandomMultipartiteGenerator(double edgeProbability, int... numVertices) Creates a generator for a random multipartite graph, where the number of vertices of each stable set and the edge probability are specified. -
Method Summary
Modifier and TypeMethodDescriptioncreate()Creates a random multipartite graph.Returns the stable sets of the multipartite graph.Methods inherited from class org.graph4j.generators.AbstractGraphGenerator
addRandomEdges
-
Field Details
-
edgeProbability
protected final double edgeProbability -
numVertices
protected final int[] numVertices -
stableSets
-
-
Constructor Details
-
RandomMultipartiteGenerator
public RandomMultipartiteGenerator(double edgeProbability, int... numVertices) Creates a generator for a random multipartite graph, where the number of vertices of each stable set and the edge probability are specified.- Parameters:
edgeProbability- the edge probability.numVertices- the number of vertices in each stable set.
-
-
Method Details
-
create
Creates a random multipartite graph.- Returns:
- a random multipartite graph
-
getStableSets
Returns the stable sets of the multipartite graph.- Returns:
- the stable sets of the multipartite graph.
-