Class StarGenerator


public class StarGenerator extends AbstractGraphGenerator
A star is a graph formed by connecting a single universal vertex, called center, to an independent set of vertices. A star graph with n vertices is actually the complete bipartite graph K(1,n-1). A star with 3 edges is called a claw.
Author:
Cristian Frăsinaru
  • Constructor Details

    • StarGenerator

      public StarGenerator(int numVertices)
    • StarGenerator

      public StarGenerator(int firstVertex, int lastVertex, int center)
      Parameters:
      firstVertex - the first vertex number.
      lastVertex - the last vertex number.
      center - the number of the center vertex.
  • Method Details

    • createGraph

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

      public Digraph createDigraph(boolean outward)
      Parameters:
      outward - the orientation of the edges connecting the center.
      Returns:
      a directed star graph.