Package edu.claflin.finder.algo.clustering

# Class LabelPropagation

java.lang.Object
edu.claflin.finder.algo.Algorithm
edu.claflin.finder.algo.clustering.ClusteringAlgorithm
edu.claflin.finder.algo.clustering.LabelPropagation

All Implemented Interfaces:
  `Processable<Graph,Graph>`

public class LabelPropagation extends ClusteringAlgorithm
TODO: MAKE COMMENTS NICE abc

Author:
  Adam

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class edu.claflin.finder.algo.Algorithm

  `Algorithm.GraphSortOrder`

- ## Field Summary

  ### Fields inherited from class edu.claflin.finder.algo.Algorithm

  `args, PROP_PROGRESS`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `LabelPropagation(ArgumentsBundle args)`
  Label Propagation Algorithm (LPA) for Community Detection.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `private List<Node>`
  `generateCommunityFromLabel(int target, int[] labels, Graph graph)`
  Performs FastGreedy community detection on a given Graph, returning the clustering with the maximum modularity.
  `List<Node>`
  `generateRandomOrder(List<Node> allNodes)`
  Makes a random order for LPA algorithm.
  `ArrayList<Graph>`
  `process(Graph graph)`
  Performs Label Propagation (LPA) community detection on a given Graph, returning the significant communities present within a network.
  `String`
  `toString()`

  ### Methods inherited from class edu.claflin.finder.algo.clustering.ClusteringAlgorithm

  `buildCommunityGraphs, isWeighted`

  ### Methods inherited from class edu.claflin.finder.algo.Algorithm

  `addPropertyChangeListener, cull, getGraphSortOrder, getMinNodeCount, getPartiteNumber, getWeightName, removePropertyChangeListener, setGraphSortOrder, setMinNodeCount, setPartiteNumber, setProgress, setWeightName, zeropad`

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

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

- ## Constructor Details

  - ### LabelPropagation

    public LabelPropagation(ArgumentsBundle args)
    Label Propagation Algorithm (LPA) for Community Detection. Based on python's igraph library.
    Parameters:
      `args` - args
    See Also:
      - Original Paper
      - Original igraph implementation

- ## Method Details

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### generateRandomOrder

    public List<Node> generateRandomOrder(List<Node> allNodes)
    Makes a random order for LPA algorithm.
    Parameters:
      `allNodes` - is the list of nodes
    Returns:
      The a random order for node changing in the next iteration.

  - ### generateCommunityFromLabel

    private List<Node> generateCommunityFromLabel(int target, int[] labels, Graph graph)
    Performs FastGreedy community detection on a given Graph, returning the clustering with the maximum modularity.
    Parameters:
      `target` - the Graph to perform FastGreedy on
      `labels` - the Graph to perform FastGreedy on
      `graph` - the Graph to perform function on
    Returns:
      the list of Graphs representing the clustering with the maximum modularity

  - ### process

    public ArrayList<Graph> process(Graph graph)
    Performs Label Propagation (LPA) community detection on a given Graph, returning the significant communities present within a network.
    Parameters:
      `graph` - the Graph to perform LPA on
    Returns:
      the list of Graphs representing the significant partitioned clusters.