Class FanGenerator


public class FanGenerator extends AbstractGraphGenerator
Generates fan graphs. A fan graph F(m,n) is defined as the graph join Nm + Pn , where Nm is the null graph on m nodes and Pn is the path graph on n nodes. The fan graph F(4,1) is known as the gem graph.
Author:
Cristian Frăsinaru
  • Constructor Details

    • FanGenerator

      public FanGenerator(int emptyGraphNumVertices, int pathGraphNumVertices)
      Creates a generator for fan graphs. First emptyGraphNumVertices vertex numbers will form the empty graph, while then next pathGraphNumVertices will represent the path graph.
      Parameters:
      emptyGraphNumVertices - the number of vertices in the empty graph.
      pathGraphNumVertices - the number of vertices in the path graph.
  • Method Details

    • create

      public Graph create()
      Creates a fan graph by performing the union of the empty graph and the path graph.
      Returns:
      a fan graph.
    • getEmptyGraph

      public Graph getEmptyGraph()
      Returns the empty graph used to create the fan.
      Returns:
      the empty graph used to create the fan.
    • getPathGraph

      public Graph getPathGraph()
      Returns the path graph used to create the fan.
      Returns:
      the path graph used to create the fan.