<AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true"title="class or interface in java.lang">java.lang.Object</A>
<IMGSRC="../../../resources/inherit.gif"ALT="extended by "><B>com.mxgraph.analysis.mxUnionFind</B>
</PRE>
<HR>
<DL>
<DT><PRE>public class <B>mxUnionFind</B><DT>extends <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true"title="class or interface in java.lang">Object</A></DL>
</PRE>
<P>
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:
<code>alpha(m,n) = min{i >= 1 | A(i, floor(m/n)) > log n} for m >= n >= 1</code>
Which yields almost constant time for each individual operation.
<CODE>protected <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/util/Map.html?is-external=true"title="class or interface in java.util">Map</A><<AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true"title="class or interface in java.lang">Object</A>,<AHREF="../../../com/mxgraph/analysis/mxUnionFind.Node.html"title="class in com.mxgraph.analysis">mxUnionFind.Node</A>></CODE></FONT></TD>
<TD><CODE><B><AHREF="../../../com/mxgraph/analysis/mxUnionFind.html#mxUnionFind(java.lang.Object[])">mxUnionFind</A></B>(<AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true"title="class or interface in java.lang">Object</A>[] elements)</CODE>
<BR>
Constructs a union find structure and initializes it with the specified
<TD><CODE><B><AHREF="../../../com/mxgraph/analysis/mxUnionFind.html#differ(java.lang.Object, java.lang.Object)">differ</A></B>(<AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true"title="class or interface in java.lang">Object</A> a,
<AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true"title="class or interface in java.lang">Object</A> b)</CODE>
<BR>
Returns true if element a and element b are not in the same set.</TD>
<CODE> <AHREF="../../../com/mxgraph/analysis/mxUnionFind.Node.html"title="class in com.mxgraph.analysis">mxUnionFind.Node</A></CODE></FONT></TD>
<TD><CODE><B><AHREF="../../../com/mxgraph/analysis/mxUnionFind.html#find(com.mxgraph.analysis.mxUnionFind.Node)">find</A></B>(<AHREF="../../../com/mxgraph/analysis/mxUnionFind.Node.html"title="class in com.mxgraph.analysis">mxUnionFind.Node</A> node)</CODE>
<BR>
Returns the set that contains <code>node</code>.</TD>
<CODE> <AHREF="../../../com/mxgraph/analysis/mxUnionFind.Node.html"title="class in com.mxgraph.analysis">mxUnionFind.Node</A></CODE></FONT></TD>
<TD><CODE><B><AHREF="../../../com/mxgraph/analysis/mxUnionFind.html#getNode(java.lang.Object)">getNode</A></B>(<AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true"title="class or interface in java.lang">Object</A> element)</CODE>
<BR>
Returns the node that represents element.</TD>
<TD><CODE><B><AHREF="../../../com/mxgraph/analysis/mxUnionFind.html#union(com.mxgraph.analysis.mxUnionFind.Node, com.mxgraph.analysis.mxUnionFind.Node)">union</A></B>(<AHREF="../../../com/mxgraph/analysis/mxUnionFind.Node.html"title="class in com.mxgraph.analysis">mxUnionFind.Node</A> a,
<AHREF="../../../com/mxgraph/analysis/mxUnionFind.Node.html"title="class in com.mxgraph.analysis">mxUnionFind.Node</A> b)</CODE>
<BR>
Unifies the sets <code>a</code> and <code>b</code> in constant time
<THALIGN="left"><B>Methods inherited from class java.lang.<AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true"title="class or interface in java.lang">Object</A></B></TH>
</TR>
<TRBGCOLOR="white"CLASS="TableRowColor">
<TD><CODE><AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#clone()"title="class or interface in java.lang">clone</A>, <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)"title="class or interface in java.lang">equals</A>, <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#finalize()"title="class or interface in java.lang">finalize</A>, <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#getClass()"title="class or interface in java.lang">getClass</A>, <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#hashCode()"title="class or interface in java.lang">hashCode</A>, <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#notify()"title="class or interface in java.lang">notify</A>, <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#notifyAll()"title="class or interface in java.lang">notifyAll</A>, <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#toString()"title="class or interface in java.lang">toString</A>, <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait()"title="class or interface in java.lang">wait</A>, <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait(long)"title="class or interface in java.lang">wait</A>, <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait(long, int)"title="class or interface in java.lang">wait</A></CODE></TD>
protected <AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/util/Map.html?is-external=true"title="class or interface in java.util">Map</A><<AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true"title="class or interface in java.lang">Object</A>,<AHREF="../../../com/mxgraph/analysis/mxUnionFind.Node.html"title="class in com.mxgraph.analysis">mxUnionFind.Node</A>><B>nodes</B></PRE>
public <B>mxUnionFind</B>(<AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true"title="class or interface in java.lang">Object</A>[] elements)</PRE>
<DL>
<DD>Constructs a union find structure and initializes it with the specified
public <AHREF="../../../com/mxgraph/analysis/mxUnionFind.Node.html"title="class in com.mxgraph.analysis">mxUnionFind.Node</A><B>getNode</B>(<AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true"title="class or interface in java.lang">Object</A> element)</PRE>
public <AHREF="../../../com/mxgraph/analysis/mxUnionFind.Node.html"title="class in com.mxgraph.analysis">mxUnionFind.Node</A><B>find</B>(<AHREF="../../../com/mxgraph/analysis/mxUnionFind.Node.html"title="class in com.mxgraph.analysis">mxUnionFind.Node</A> node)</PRE>
<DL>
<DD>Returns the set that contains <code>node</code>. This implementation
public void <B>union</B>(<AHREF="../../../com/mxgraph/analysis/mxUnionFind.Node.html"title="class in com.mxgraph.analysis">mxUnionFind.Node</A> a,
<AHREF="../../../com/mxgraph/analysis/mxUnionFind.Node.html"title="class in com.mxgraph.analysis">mxUnionFind.Node</A> b)</PRE>
<DL>
<DD>Unifies the sets <code>a</code> and <code>b</code> in constant time
public boolean <B>differ</B>(<AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true"title="class or interface in java.lang">Object</A> a,
<AHREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true"title="class or interface in java.lang">Object</A> b)</PRE>
<DL>
<DD>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.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>a</CODE> - The first element to compare.<DD><CODE>b</CODE> - The second element to compare.
<DT><B>Returns:</B><DD>Returns true if a and b are in the same set.<DT><B>See Also:</B><DD><AHREF="../../../com/mxgraph/analysis/mxUnionFind.html#getNode(java.lang.Object)"><CODE>getNode(Object)</CODE></A></DL>