Class RandomGnmGraphGenerator

java.lang.Object
org.graph4j.generators.AbstractGraphGenerator
org.graph4j.generators.RandomGnmGraphGenerator

public class RandomGnmGraphGenerator extends AbstractGraphGenerator
Erdős–Rényi G(n,m) model. The graph is chosen uniformly at random from the collection of all graphs which have n nodes and m edges. The graph is guaranteed to have m edges.
Author:
Cristian Frăsinaru
See Also:
  • Constructor Details

    • RandomGnmGraphGenerator

      public RandomGnmGraphGenerator(int numVertices, long numEdges)
      Parameters:
      numVertices - the number of vertices.
      numEdges - the number of edges.
    • RandomGnmGraphGenerator

      public RandomGnmGraphGenerator(int firstVertex, int lastVertex, long numEdges)
      Parameters:
      firstVertex - the first vertex number of the graph.
      lastVertex - the last vertex number of the graph.
      numEdges - the number of edges.
  • Method Details

    • createGraph

      public Graph createGraph()
      Returns:
      a random graph.
    • createConnectedGraph

      public Graph createConnectedGraph()
      Returns:
      a random connected graph.
    • createDigraph

      public Digraph createDigraph()
      Returns:
      a random digraph.
    • createMultiGraph

      public Multigraph createMultiGraph()
      Returns:
      a random multigraph.
    • createDirectedMultigraph

      public DirectedMultigraph createDirectedMultigraph()
      Returns:
      a random directed multigraph.
    • createPseudograph

      public Pseudograph createPseudograph()
      Returns:
      a random pseudograph.
    • createDirectedPseudograph

      public DirectedPseudograph createDirectedPseudograph()
      Returns:
      a random directed pseudograph.