com.mxgraph.analysis.mxUnionFind Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of AptSpringProcessor Show documentation
Show all versions of AptSpringProcessor Show documentation
This project contains the apt processor that implements all the checks enumerated in @Verify. It is a self contained, and
shaded jar.
The newest version!
/**
* Copyright (c) 2007, Gaudenz Alder
*/
package com.mxgraph.analysis;
import java.util.Hashtable;
import java.util.Map;
/**
* 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.
*/
public class mxUnionFind
{
/**
* Maps from elements to nodes
*/
protected Map
© 2015 - 2025 Weber Informatics LLC | Privacy Policy