Class RandomMultipartiteGenerator

java.lang.Object
org.graph4j.generators.AbstractGraphGenerator
org.graph4j.generators.RandomMultipartiteGenerator
Direct Known Subclasses:
CompleteMultipartiteGenerator

public class RandomMultipartiteGenerator extends AbstractGraphGenerator
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 Details

    • edgeProbability

      protected final double edgeProbability
    • numVertices

      protected final int[] numVertices
    • stableSets

      protected StableSet[] 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

      public Graph create()
      Creates a random multipartite graph.
      Returns:
      a random multipartite graph
    • getStableSets

      public StableSet[] getStableSets()
      Returns the stable sets of the multipartite graph.
      Returns:
      the stable sets of the multipartite graph.