Package edu.claflin.finder.algo

# Class Algorithm

java.lang.Object
edu.claflin.finder.algo.Algorithm

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

Direct Known Subclasses:
  `BreadthFirstTraversalSearch`, `BronKerbosch`, `Bundle`, `ClusteringAlgorithm`, `ConnectedComponentsDFS`, `DepthFirstTraversalSearch`, `DijkstraShortestPath`, `ExtremumSpanningTree`, `MatrixPatternAnalyzer`, `ShortestPath`

public abstract class Algorithm extends Object implements Processable<Graph,Graph>
Abstraction of the algorithm classes used for finding subgraphs.

Version:
  3.4 February 2. 2015
Author:
  Charles Allen Schultz II

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static enum`
  `Algorithm.GraphSortOrder`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `final ArgumentsBundle`
  `args`
  The ArgumentsBundle object holding arguments for the algorithm.
  `private int`
  `minNodeCount`
  `private PropertyChangeSupport`
  `mPCS`
  Adds Property Change support to track the progress of algorithms.
  `private int`
  `partiteNumber`
  Number passed in using partite number.
  `private double`
  `progress`
  The current progress of the algorithm.
  `static final String`
  `PROP_PROGRESS`
  Constant for indicating the progress property.
  `private Algorithm.GraphSortOrder`
  `sortOrder`
  `private String`
  `weightName`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Algorithm(ArgumentsBundle args)`
  Public Constructor for creating an Algorithm.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addPropertyChangeListener(PropertyChangeListener pcl)`
  Adds a PropertyChangeListener.
  `private boolean`
  `compare(Graph base, Graph match)`
  Compares the two graphs based on edges.
  `protected final ArrayList<Graph>`
  `cull(ArrayList<Graph> subGraphs)`
  Removes duplicate subGraphs from the provided ArrayList.
  `Algorithm.GraphSortOrder`
  `getGraphSortOrder()`
  `int`
  `getMinNodeCount()`
  `int`
  `getPartiteNumber()`
  `String`
  `getWeightName()`
  `void`
  `removePropertyChangeListener(PropertyChangeListener pcl)`
  Removes a PropertyChangeListener.
  `void`
  `setGraphSortOrder(Algorithm.GraphSortOrder gso)`
  `void`
  `setMinNodeCount(int minNodeCount)`
  `void`
  `setPartiteNumber(int partiteNumber)`
  `protected void`
  `setProgress(double progress)`
  `void`
  `setWeightName(String weightName)`
  `protected static String`
  `zeropad(int number, int size)`
  A utility method to zeropad subgraph numbers (001, 002, ..., 050, ..., 150, ...)

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

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

  ### Methods inherited from interface edu.claflin.finder.logic.processor.Processable

  `process`

- ## Field Details

  - ### minNodeCount

    private int minNodeCount

  - ### weightName

    private String weightName

  - ### args

    public final ArgumentsBundle args
    The ArgumentsBundle object holding arguments for the algorithm.

  - ### mPCS

    private PropertyChangeSupport mPCS
    Adds Property Change support to track the progress of algorithms.

  - ### progress

    private double progress
    The current progress of the algorithm.

  - ### partiteNumber

    private int partiteNumber
    Number passed in using partite number. Somewhat of a bandaid fix because haven't figured out the arguments bundle yet - kpuli

  - ### PROP_PROGRESS

    public static final String PROP_PROGRESS
    Constant for indicating the progress property.
    See Also:
      - Constant Field Values

  - ### sortOrder

    private Algorithm.GraphSortOrder sortOrder

- ## Constructor Details

  - ### Algorithm

    public Algorithm(ArgumentsBundle args)
    Public Constructor for creating an Algorithm.
    Parameters:
      `args` - the ArgumentsBundle containing the arguments for the Algorithm object.

- ## Method Details

  - ### getGraphSortOrder

    public Algorithm.GraphSortOrder getGraphSortOrder()

  - ### setGraphSortOrder

    public void setGraphSortOrder(Algorithm.GraphSortOrder gso)

  - ### getMinNodeCount

    public int getMinNodeCount()

  - ### setMinNodeCount

    public void setMinNodeCount(int minNodeCount)

  - ### getWeightName

    public String getWeightName()

  - ### setWeightName

    public void setWeightName(String weightName)

  - ### getPartiteNumber

    public int getPartiteNumber()

  - ### setPartiteNumber

    public void setPartiteNumber(int partiteNumber)

  - ### cull

    protected final ArrayList<Graph> cull(ArrayList<Graph> subGraphs)
    Removes duplicate subGraphs from the provided ArrayList. This ensures that all found Graphs are unique.
    Parameters:
      `subGraphs` - the ArrayList containing the subGraphs to remove duplicates from.
    Returns:
      the ArrayList of Graph objects containing only unique subgraphs.

  - ### zeropad

    protected static String zeropad(int number, int size)
    A utility method to zeropad subgraph numbers (001, 002, ..., 050, ..., 150, ...)
    Parameters:
      `number` - the number to zeropad
      `size` - the total number of subgraphs (needed to know how many 0s to pad)
    Returns:
      the zeropaded subgraph number

  - ### compare

    private boolean compare(Graph base, Graph match)
    Compares the two graphs based on edges. Tests to see that the smaller graph is essentially a subGraph of the larger.
    Parameters:
      `base` - the Graph object (smaller) to match.
      `match` - the Graph object (larger) to test against.
    Returns:
      a boolean primitive indicating if the smaller Graph is a subgraph of the larger.

  - ### setProgress

    protected void setProgress(double progress)

  - ### addPropertyChangeListener

    public void addPropertyChangeListener(PropertyChangeListener pcl)
    Adds a PropertyChangeListener.
    Parameters:
      `pcl` - the PropertyChangeListener.

  - ### removePropertyChangeListener

    public void removePropertyChangeListener(PropertyChangeListener pcl)
    Removes a PropertyChangeListener.
    Parameters:
      `pcl` - the PropertyChangeListener.