Class WindmillGraphsGenerator<V,E>

java.lang.Object
org.jgrapht.generate.WindmillGraphsGenerator<V,E>
Type Parameters:
V - graph vertex type
E - graph edge type
All Implemented Interfaces:
GraphGenerator<V,E,V>

public class WindmillGraphsGenerator<V,E> extends 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$.

Author:
Joris Kinable
  • Constructor Details

    • WindmillGraphsGenerator

      public WindmillGraphsGenerator(WindmillGraphsGenerator.Mode mode, int m, int n)
      Constructs a GeneralizedPetersenGraphGenerator used to generate a Generalized Petersen graphs $GP(n,k)$.
      Parameters:
      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 Details

    • generateGraph

      public void generateGraph(Graph<V,E> target, Map<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>
      Parameters:
      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)