Class WheelGenerator


public class WheelGenerator extends AbstractGraphGenerator
Generator for wheel graphs. A wheel is a graph formed by connecting a single universal vertex, called center (or hub), to all vertices of a cycle.
Author:
Cristian Frăsinaru
  • Constructor Details

    • WheelGenerator

      public WheelGenerator(int numVertices)
    • WheelGenerator

      public WheelGenerator(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()
      Creates a wheel graph.
      Returns:
      a wheel graph.
    • createDigraph

      public Digraph createDigraph(boolean clockwise, boolean outward)
      Creates a directed wheel graph.
      Parameters:
      clockwise - the orientation of the cycle
      outward - the orientation of the edges connecting the center
      Returns:
      a directed wheel graph.