edu.claflin.finder.algo

## Class Algorithm

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

- All Implemented Interfaces:
    Processable<Graph,Graph>
  Direct Known Subclasses:
    BreadthFirstTraversalSearch, Bundle, DepthFirstTraversalSearch, MatrixPatternAnalyzer

      public abstract class Algorithm
      extends java.lang.Object
      implements Processable<Graph,Graph>

  Abstraction of the algorithm classes used for finding subgraphs.
  Version:
    3.3 February 2. 2015
  Author:
    Charles Allen Schultz II

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `ArgumentsBundle` | `args` The ArgumentsBundle object holding arguments for the algorithm.
    `(package private) int` | `counter`
    `(package private) CommunicationListener` | `listener`
    `private java.beans.PropertyChangeSupport` | `mPCS` Adds Property Change support to track the progress of algorithms.
    `private double` | `progress` The current progress of the algorithm.
    `static java.lang.String` | `PROP_PROGRESS` Constant for indicating the progress property.

  - ### Constructor Summary

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

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addPropertyChangeListener(java.beans.PropertyChangeListener pcl)` Adds a PropertyChangeListener.
    `private boolean` | `compare(Graph base, Graph match)` Compares the two graphs based on edges.
    `protected java.util.ArrayList<Graph>` | `cull(java.util.ArrayList<Graph> subGraphs)` Removes duplicate subGraphs from the provided ArrayList.
    `void` | `removePropertyChangeListener(java.beans.PropertyChangeListener pcl)` Removes a PropertyChangeListener.
    `private boolean` | `reorder(Graph base, Graph match)` Deprecated. No replacement. There is no longer a need to reorder graphs to test equality.
    `protected void` | `setProgress(double progress)`

    - ### 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 Detail

    - #### listener

          CommunicationListener listener

    - #### counter

          int counter

    - #### args

          public final ArgumentsBundle args

      The ArgumentsBundle object holding arguments for the algorithm.

    - #### mPCS

          private java.beans.PropertyChangeSupport mPCS

      Adds Property Change support to track the progress of algorithms.

    - #### progress

          private double progress

      The current progress of the algorithm.

    - #### PROP_PROGRESS

          public static final java.lang.String PROP_PROGRESS

      Constant for indicating the progress property.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### Algorithm

          public Algorithm(ArgumentsBundle args)

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

  - ### Method Detail

    - #### cull

          protected final java.util.ArrayList<Graph> cull(java.util.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.

    - #### reorder

          private boolean reorder(Graph base,
                                  Graph match)

      Deprecated. No replacement. There is no longer a need to reorder graphs to test equality.
      Reorders the supplied graphs so that the matrices match. The larger graph (in terms of node count) is reordered so that the order of its nodes mirrors that of the smaller. I.e. if the larger graph shares in common three nodes with the smaller, those three nodes are put into the same positions in the larger graph as they are in the smaller graph.
      Parameters:
        `base` - the Graph object (smaller) to base ordering on.
        `match` - the Graph object (larger) to reorder.
      Returns:
        a boolean primitive indicating if the graphs are comparable.

    - #### 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(java.beans.PropertyChangeListener pcl)

      Adds a PropertyChangeListener.
      Parameters:
        `pcl` - the PropertyChangeListener.

    - #### removePropertyChangeListener

          public void removePropertyChangeListener(java.beans.PropertyChangeListener pcl)

      Removes a PropertyChangeListener.
      Parameters:
        `pcl` - the PropertyChangeListener.