edu.claflin.finder.logic.cond

## Class BipartiteCondition

- java.lang.Object
- - edu.claflin.finder.logic.Condition
  - - edu.claflin.finder.logic.cond.BipartiteCondition

-     public class BipartiteCondition
      extends Condition

  Represents a bipartite graph as a Condition object. Used to test for bipartiteness.
  Version:
    1.1.1 May 26, 2015
  Author:
    Charles Allen Schultz II

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BipartiteCondition()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `satisfies(Graph existingGraph)` Used to test if the supplied graph is within the bounds of the condition's implementation.
    `private boolean` | `satisfies(Graph existingGraph, java.util.Set<Node> addSet, java.util.Set<Node> compareSet, Node current)` Private method for stepping through the adjacency lists and determining if the graph is bipartite.

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

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

- - ### Constructor Detail

    - #### BipartiteCondition

          public BipartiteCondition()

      Checks to determine if the supplied graph is Bipartite.

  - ### Method Detail

    - #### satisfies

          public boolean satisfies(Graph existingGraph)

      Description copied from class: `Condition`
      Used to test if the supplied graph is within the bounds of the condition's implementation.
      Specified by:
        `satisfies` in class `Condition`
      Parameters:
        `existingGraph` - the Graph to test if the Condition applies.
      Returns:
        a boolean indicating if the requirements satisfy the condition.

    - #### satisfies

          private boolean satisfies(Graph existingGraph,
                                    java.util.Set<Node> addSet,
                                    java.util.Set<Node> compareSet,
                                    Node current)

      Private method for stepping through the adjacency lists and determining if the graph is bipartite. Specifically, it uses a Depth-First model for exploring the node tree and sorting the nodes into two groups. If it successfully sorts the nodes into two groups with no invalidating edges, it returns true.
      Parameters:
        `existingGraph` - the Graph object to test against.
        `addSet` - the current set to add a node to based on the previous.
        `compareSet` - the current set to add adjacent nodes to.
        `current` - the current Node being compared.
      Returns:
        true if the structure could be bipartite.