Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!rutgers!columbia!eastend!agw From: agw@eastend.columbia.edu (Art Werschulz) Newsgroups: comp.misc Subject: Re: The Ackermann function Message-ID: <5180@columbia.edu> Date: Tue, 8-Dec-87 10:41:32 EST Article-I.D.: columbia.5180 Posted: Tue Dec 8 10:41:32 1987 Date-Received: Sun, 13-Dec-87 06:07:10 EST References: <2093@umd5.umd.edu> Sender: nobody@columbia.edu Reply-To: agw@columbia.edu (Art Werschulz) Followup-To: comp.misc Organization: Columbia University Computer Science Dept. Lines: 48 Keywords: Union-find algorithm Summary: Here's a use of same Hi. Pardon me, but this is a little sketchy. I have part of a photocopied version of Aho, Hopcroft and Ullman's book "The Design and Analysis of Computer Algorithms" easily accessible, and I don't really have time to look this all up properly. Consider the problem of doing n operations of the form (*) UNION(S,T,V): replace the sets S and T by a new set V, which is the union of the old sets S and T (*) FIND(x): determine the set to which some element x belongs. (Motivation? Think about FORTRAN EQUIVALENCE statements.) The catch is that UNION and FIND operations could conceivably be in any order. In the Bibliographic Notes of Chapter 4, Aho et al. state that a fast algorithm using path compression on binary trees used to represent the sets was "apparently" first used by McIlroy and Morris. In a 1974 [?] article in J. ACM, Robert Endre Tarjan showed that this algorithm had running time Theta(n*G(n)) where G(n) is an "inverse Ackermann function". If memory serves me correctly (and it probably doesn't), G(n) = inf {m: A(m, m DIV 4) >= n } or some such. Now, since A(m, m DIV 4) grows like crazy with m (as pointed out, faster than any primitive recursive function), it's clear that its inverse function G grows *extremely* slowly. In fact, one could almost say that G(n) is a constant for all reasonable values of n . Hence, Tarjan showed that the running time of this algorithm is almost linear. Furthermore, this is a "Theta" result, and not a "big-Oh" result, meaning that he derived both upper and lower bounds of the form constant*n*G(n) for this algorithm. I don't recall whether or not anybody's beaten Trajan's result. Art Werschulz ARPAnet: agw@columbia.edu USEnet: ... seismo!columbia!agw BITnet: agw@columbia.edu CCNET: agw@garfield ATTnet: Columbia University (212) 280-3610 280-2736 Fordham University (212) 841-5323 841-5396