18.04.2013 Views

The.Algorithm.Design.Manual.Springer-Verlag.1998

The.Algorithm.Design.Manual.Springer-Verlag.1998

The.Algorithm.Design.Manual.Springer-Verlag.1998

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Set Data Structures<br />

parent pointers until we hit the root. Unioning two subsets is also easy. Just make the root of one<br />

of two trees point to the other, so now all elements have the same root and thus the same subset<br />

name.<br />

Certain details remain, such as which subset should be the ultimate root of a union, but these are<br />

described in most every algorithms text. Union-Find is a fast, extremely simple data structure that<br />

every programmer should know about. It does not support breaking up subsets created by unions,<br />

but usually this is not an issue.<br />

Neither of these options provides access to all of the items in a particular subset without traversing all the<br />

items in the set. However, both can be appropriately augmented with extra pointers if it is important that<br />

this operation be fast.<br />

Implementations: LEDA (see Section ) provides dictionary data structures to maintain sets and the<br />

union-find data structure to maintain set partitions, all in C++.<br />

LINK is an environment for combinatorial computing that provides special support for hypergraphs,<br />

including visualization of hypergraphs. Although written in C++, it provides an additional Scheme<br />

language interface for interacting with the graphs. LINK is available from<br />

http://dimacs.rutgers.edu/Projects/LINK.html.<br />

Many textbooks contain implementations of the union-find data structure, including [MS91] (see Section<br />

). An implementation of union-find underlies any implementation of Kruskal's minimum spanning<br />

tree algorithm. Section contains a selection of minimum spanning tree codes.<br />

Notes: Optimal algorithms for such set operations as intersection and union were presented in [Rei72].<br />

Good expositions on set data structures include [AHU83].<br />

Galil and Italiano [GI91] survey data structures for disjoint set union. Expositions on the union-find<br />

data structure appear in most algorithm texts, including [CLR90, MS91]. <strong>The</strong> upper bound of<br />

on m union-find operations on an n-element set is due to Tarjan [Tar75], as is a matching<br />

lower bound on a restricted model of computation [Tar79]. <strong>The</strong> inverse Ackerman function<br />

grows notoriously slowly, so this performance is close to linear. Expositions on the Ackerman bound<br />

include [AHU74]. An interesting connection between the worst-case of union-find and the length of<br />

Davenport-Schintzl sequences, a combinatorial structure that arises in computational geometry, is<br />

established in [SA95].<br />

<strong>The</strong> power set of a set S is the collection of all subsets of S. Explicit manipulation of power sets<br />

quickly becomes intractable due to their size. Implicit representations of power sets in symbolic form<br />

becomes necessary for nontrivial computations. See [BCGR92] for algorithms for and computational<br />

file:///E|/BOOK/BOOK3/NODE133.HTM (3 of 4) [19/1/2003 1:30:10]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!