This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

UFx is a pure python library that implements the disjoint-set data structure which allows the union-find operations.

Two implementations are proposed.

  • uf_hash using python dictionary
  • uf_tree using nodes linked each to its ansestror

Those implementations are design for hashable types. However it is possible to use the UFNode class present in the uf_tree implementation with non-hashable types (see the API documentation part below).

UFx was only tested with python 2.7, python 3.5 and pypy but may work with other versions python virtual machines.


The uf_hash implementation is the recommanded one. It performs well with the classic python virtual machine. The uf_tree implementation is really slow due to the poor performances of python with pointer like based data structures. The use of another python virtual machine like pypy its recommanded when using the uf_tree implementation.

TODO: Table of computation speed and memory consumption

API documentation


You can import one of the implementation of the disjoint-set data structure

from ufx import uf_tree as ufx


from ufx import uf_hash as ufx

Quick Example

import sys
import random
uf = ufx.UnionFind()
az = "abcdefghijklmnopqrstuvwxyz"
az += az.upper()
for e in az:
i = 0
while i < 26:
    i += 1
    uf.union(random.choice(az), random.choice(az))

Hashable types


Non-hashable types

Look on the class UFNode

Release History

Release History


This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
UFx-1.0.0.tar.gz (4.6 kB) Copy SHA256 Checksum SHA256 Source Jun 15, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting