Class AbstractBipartiteGenerator

java.lang.Object
org.graph4j.generators.AbstractGraphGenerator
org.graph4j.generators.AbstractBipartiteGenerator
Direct Known Subclasses:
CompleteBipartiteGenerator, RandomGnmBipartiteGenerator, RandomGnpBipartiteGenerator

public abstract class AbstractBipartiteGenerator extends AbstractGraphGenerator
Author:
Cristian Frăsinaru
  • Field Details

    • first1

      protected final int first1
    • last1

      protected final int last1
    • first2

      protected final int first2
    • last2

      protected final int last2
  • Constructor Details

    • AbstractBipartiteGenerator

      public AbstractBipartiteGenerator(int n1, int n2)
      Parameters:
      n1 - the number of vertices in the left side.
      n2 - the number of vertices in the right side.
    • AbstractBipartiteGenerator

      public AbstractBipartiteGenerator(int first1, int last1, int first2, int last2)
      Parameters:
      first1 - the number of first vertex in the left side.
      last1 - the number of last vertex in the left side.
      first2 - the number of first vertex in the right side.
      last2 - the number of last vertex in the right side.
  • Method Details

    • createGraph

      public Graph createGraph()
      Returns:
      a bipartite graph.
    • createDigraph

      public Digraph createDigraph(Boolean leftToRight)
      Parameters:
      leftToRight - true it the edges are to be oriented from left to right, false for right to left or null for a random orientation.
      Returns:
      a bipartite digraph, with the given edge orientation.
    • addEdges

      protected abstract void addEdges(Graph g, Boolean leftToRight)