Documentation of 'com.mxgraph.analysis.mxUnionFind' Java class
mxUnionFind
com.mxgraph.analysis

Class mxUnionFind



  • public class mxUnionFind
    extends java.lang.Object
    Implements a union find structure that uses union by rank and path compression. The union by rank guarantees worst case find time of O(log N), while Tarjan shows that in combination with path compression (halving) the average time for an arbitrary sequence of m >= n operations is O(m*alpha(m,n)), where alpha is the inverse of the Ackermann function, defined as follows: alpha(m,n) = min{i >= 1 | A(i, floor(m/n)) > log n} for m >= n >= 1 Which yields almost constant time for each individual operation.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class and Description
      class  mxUnionFind.Node
      A class that defines the identity of a set.
    • Constructor Summary

      Constructors 
      Constructor and Description
      mxUnionFind(java.lang.Object[] elements)
      Constructs a union find structure and initializes it with the specified elements.
    • Constructor Detail

      • mxUnionFind

        public mxUnionFind(java.lang.Object[] elements)
        Constructs a union find structure and initializes it with the specified elements.
        Parameters:
        elements -
    • Method Detail

      • getNode

        public mxUnionFind.Node getNode(java.lang.Object element)
        Returns the node that represents element.
      • differ

        public boolean differ(java.lang.Object a,
                              java.lang.Object b)
        Returns true if element a and element b are not in the same set. This uses getNode and then find to determine the elements set.
        Parameters:
        a - The first element to compare.
        b - The second element to compare.
        Returns:
        Returns true if a and b are in the same set.
        See Also:
        getNode(Object)

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.