org.apache.tinkerpop.gremlin.algorithm.generator

## Class CommunityGenerator

- java.lang.Object
- - org.apache.tinkerpop.gremlin.algorithm.generator.AbstractGenerator
  - - org.apache.tinkerpop.gremlin.algorithm.generator.CommunityGenerator

- All Implemented Interfaces:
    Generator

      public class CommunityGenerator
      extends AbstractGenerator

  Generates a synthetic network with a community structure, that is, several densely connected sub-networks that are loosely connected with one another.
  Author:
    Matthias Broecheler (me@matthiasb.com), Stephen Mallette (http://stephen.genoprime.com)

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `CommunityGenerator.Builder`

    - ### Nested classes/interfaces inherited from class org.apache.tinkerpop.gremlin.algorithm.generator.AbstractGenerator

      `AbstractGenerator.AbstractGeneratorBuilder<T extends AbstractGenerator.AbstractGeneratorBuilder>`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static double` | `DEFAULT_CROSS_COMMUNITY_PERCENTAGE`
    `static int` | `DEFAULT_NUMBER_OF_COMMUNITIES`

    - ### Fields inherited from class org.apache.tinkerpop.gremlin.algorithm.generator.AbstractGenerator

      `g, seedSupplier`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static CommunityGenerator.Builder` | `build(Graph g)`
    `int` | `generate()` Generates a synthetic network for provided vertices in the given graph such that the provided expected number of communities are generated with the specified expected number of edges.

    - ### Methods inherited from class org.apache.tinkerpop.gremlin.algorithm.generator.AbstractGenerator

      `addEdge, processVertex`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### DEFAULT_CROSS_COMMUNITY_PERCENTAGE

          public static final double DEFAULT_CROSS_COMMUNITY_PERCENTAGE

      See Also:
        Constant Field Values

    - #### DEFAULT_NUMBER_OF_COMMUNITIES

          public static final int DEFAULT_NUMBER_OF_COMMUNITIES

      See Also:
        Constant Field Values

  - ### Method Detail

    - #### generate

          public int generate()

      Generates a synthetic network for provided vertices in the given graph such that the provided expected number of communities are generated with the specified expected number of edges.
      Returns:
        The actual number of edges generated. May be different from the expected number.

    - #### build

          public static CommunityGenerator.Builder build(Graph g)

Copyright © 2013–2020 Apache Software Foundation. All rights reserved.