Class WindmillGraphsGenerator<V,​E>

  • Type Parameters:
    V - graph vertex type
    E - graph edge type
    All Implemented Interfaces:

    public class WindmillGraphsGenerator<V,​E>
    extends java.lang.Object
    implements GraphGenerator<V,​E,​V>
    Generator for Windmill Graphs, Dutch Windmill Graphs and Friendship Graphs.

    The windmill graph $W_n^{(m)}$ is the graph obtained by taking $m$ copies of the complete graph $K_n$ with a vertex in common. The Dutch windmill graph $D_n^{(m)}$, is the graph obtained by taking $m$ copies of the cycle graph $C_3$ with a vertex in common. For the special case where $n=3$, $D_n^{(m)}$ and $W_n^{(m)}$ are identical. The class of graphs $D_3^{(m)}$ is sometimes referred to as the Friendship graph, denoted by $F_m$.

    Joris Kinable
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  WindmillGraphsGenerator.Mode
      WINDMILL and DUTCHWINDMILL Modes for the Constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void generateGraph​(Graph<V,​E> target, java.util.Map<java.lang.String,​V> resultMap)
      Generate a graph structure.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • WindmillGraphsGenerator

        public WindmillGraphsGenerator​(WindmillGraphsGenerator.Mode mode,
                                       int m,
                                       int n)
        Constructs a GeneralizedPetersenGraphGenerator used to generate a Generalized Petersen graphs $GP(n,k)$.
        mode - indicate whether the generator should generate Windmill graphs or Dutch Windmill graphs
        m - number of copies of $C_n$ (Dutch Windmill graph) or $K_n$ (Windmill graph)
        n - size of $C_n$ (Dutch Windmill graph) or $K_n$ (Windmill graph). To generate friendship graphs, set $n=3$ (the mode is irrelevant).
    • Method Detail

      • generateGraph

        public void generateGraph​(Graph<V,​E> target,
                                  java.util.Map<java.lang.String,​V> resultMap)
        Description copied from interface: GraphGenerator
        Generate a graph structure. The topology of the generated graph is dependent on the implementation. For graphs in which not all vertices share the same automorphism equivalence class, the generator may produce a labeling indicating the roles played by generated elements. This is the purpose of the resultMap parameter. For example, a generator for a wheel graph would designate a hub vertex. Role names used as keys in resultMap should be declared as public static final Strings by implementation classes.
        Specified by:
        generateGraph in interface GraphGenerator<V,​E,​V>
        target - receives the generated edges and vertices; if this is non-empty on entry, the result will be a disconnected graph since generated elements will not be connected to existing elements
        resultMap - if non-null, receives implementation-specific mappings from String roles to graph elements (or collections of graph elements)