From ca91408ea01b0d46b6fcbac2a7adbb407bd10a1d Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Tue, 8 Apr 2008 16:59:08 +0200 Subject: [PATCH] More on the Ackermann's function and its inverses. --- mst.tex | 3 ++- notation.tex | 54 ++++++++++++++++++++++++++++++++++++++++------------ opt.tex | 10 ++++++++++ 3 files changed, 54 insertions(+), 13 deletions(-) diff --git a/mst.tex b/mst.tex index 5fef32f..9f8a741 100644 --- a/mst.tex +++ b/mst.tex @@ -494,7 +494,8 @@ with surprising efficiency: \thmn{Disjoint Set Union, Tarjan and van Leeuwen \cite{tarjan:setunion}}% Starting with a~trivial equivalence with single-element classes, a~sequence of operations comprising of $n$~\s intermixed with $m\ge n$~\s can be processed in time -$\O(m\timesalpha(m,n))$, where $\alpha(m,n)$ is the inverse Ackermann's function.\foot{See Section \ref{ackersec} for a~precise definition.} +$\O(m\timesalpha(m,n))$, where $\alpha(m,n)$ is a~certain inverse of the Ackermann's function +(see Definition \ref{ackerinv}). \proof See \cite{tarjan:setunion}. diff --git a/notation.tex b/notation.tex index efc4014..5d6933c 100644 --- a/notation.tex +++ b/notation.tex @@ -37,7 +37,6 @@ \n{$G/e$}{multigraph contraction \[contract]} \n{$G.e$}{simple graph contraction \[simpcont]} \n{$G/X$, $G.X$}{contraction by a~set $X$ of vertices or edges \[setcont]} -\n{$\alpha(n)$}{the inverse Ackermann's function} \n{$f[X]$}{function applied to a set: $f[X]:=\{ f(x) ; x\in X \}$} \n{$f[e]$}{as edges are two-element sets, $f[e]$ maps both endpoints of an edge~$e$} \n{$\varrho({\cal C})$}{edge density of a graph class~$\cal C$ \[density]} @@ -88,6 +87,11 @@ \n{${\cal D}(G)$}{The optimal MSF decision tree for a~graph~$G$ \[decdef]} \n{$D(G)$}{The depth of ${\cal D}(G)$ \[decdef]} \n{$D(m,n)$}{Decision tree complexity of MSF \[decdef]} +\n{$A(x,y)$}{The Ackermann's function \[ackerdef]} +\n{$A(x)$}{The diagonal Ackermann's function \[ackerdef]} +\n{$a(x,n)$}{The inverse of the $x$-th row of the Ackermann's function \[ackerinv]} +\n{$a(n)$}{The diagonal inverse of the Ackermann's function \[ackerinv]} +\n{$\alpha(m,n)$}{$\alpha(m,n) := \min\{ x\ge 1 \mid A(x,4\lceil m/n\rceil) > \log n \}$ \[ackerinv]} } %-------------------------------------------------------------------------------- @@ -148,13 +152,13 @@ The Ackermann's function is an~extremely quickly growing function that has been originally introduced by Ackermann \cite{ackermann:function} in the context of computability theory. Its original purpose was to demonstrate that a~function can be recursive, but not primitive recursive. At the first sight, it does not -seem related to efficient algorithms at all. Its inverse however occurs in +seem related to efficient algorithms at all. Its various inverses however occur in analysis of various algorithms and mathematical structures surprisingly often: -We meet it in Section \ref{classalg} in the time complexity of the Disjoint Set Union +We meet them in Section \ref{classalg} in the time complexity of the Disjoint Set Union data structure and also in the best known upper bound on the decision tree complexity of minimum spanning trees in Section \ref{optalgsect}. Another important application is the complexity of Davenport-Schinzel sequences (see -Klazar's survey \cite{klazar:gdss}), but as far as we know, it is not otherwise +Klazar's survey \cite{klazar:gdss}), but as far as we know, there are not otherwise related to the topic of our study. Various sources tend to differ in the exact definition of both the Ackermann's @@ -163,7 +167,7 @@ are negligible when compared with the asymptotic growth of the function. We will use the definition by double induction given by Tarjan \cite{tarjan:setunion}, which is predominant in the literature on graph algorithms: -\defn +\defn\id{ackerdef}% The \df{Ackermann's function} $A(x,y)$ is a~function on non-negative integers defined as: $$\eqalign{ A(0,y) &:= 2y, \cr @@ -185,20 +189,46 @@ A(4,3) &= A(3,A(4,2)) = A(3,4) = A(2,A(3,3)) = A(2,A(2,A(3,2))) = \cr &= A(2,A(2,4)) = 2\tower(2\tower 4) = 2\tower 65536. \cr }$$ -\defn -The \df{Inverse Ackermann's function} $\alpha(x,y)$ is defined as: +\para +Three functions related to the inverse of the function~$A$ are usually considered: + +\defn\id{ackerinv}% +The \df{row inverse} $a(x,y)$ of the Ackermann's function is defined as: +$$ +a(x,n) := \min\{ y \mid A(x,y) > \log n \}. $$ -\alpha(x,n) := \min\{ y \mid A(x,y) > \log n \}. +The \df{diagonal inverse} $a(n)$ is defined as: $$ -Again, a~single-parameter version is occasionally considered: +a(n) := \min\{ x \mid A(x,x) > \log n \}. $$ -\alpha(n) := \min\{ x \mid A(x,x) > \log n \}. +The \df{alpha function} $\alpha(m,n)$ is defined for $m\ge n$ as: +$$ +\alpha(m,n) := \min\{ x\ge 1 \mid A(x,4\lceil m/n\rceil) > \log n \}. $$ \example -$\alpha(1,n) = \O(\log\log n)$, $\alpha(2,n) = \O(\log^* n)$, $\alpha(3,n)$ grows even slower. +$a(1,n) = \O(\log\log n)$, $a(2,n) = \O(\log^* n)$, $a(3,n)$ grows even slower +and $a(n)$ is asymptotically smaller than $a(x,n)$ for any fixed~$x$. \obs -As the rows of the function~$A$ are increasing, we have $A(x,y) \ge A(x,x) = A(x)$ for $y\ge x$ +The rows of $A(x,y)$ are non-decreasing and so are the columns, so $\alpha(m,n)$ +is maximized when $m=n$. Thus $\alpha(m,n) \le 3$ whenever $\log n < A(3,4)$, +which happens for all ``practical'' values of~$m$. + +\lemma +$\alpha(m,n) \le a(n)+1$. + +\proof +$A(x,4\lceil m/n\rceil) \ge A(x,4) = A(x-1,A(x,3)) \ge A(x-1,x-1)$, so $A(x,4\lceil m/n\rceil)$ +rises above $\log n$ no later than $A(x-1,x-1)$ does so. +\qed + +\lemma\id{alphaconst}% +When $k$~is a~fixed constant and $m\ge n\cdot a(k,n)$, then $\alpha(m,n) \le k$. + +\proof +The choice of~$m$ guarantees that $A(x,4\lceil m/n\rceil) \ge A(x,a(k,n))$, which +is greater than $\log n$ for all $x \ge k$. +\qed \endpart diff --git a/opt.tex b/opt.tex index 9de4d64..15b97d5 100644 --- a/opt.tex +++ b/opt.tex @@ -1123,6 +1123,16 @@ We bound $D(m,n)$ by the number of comparisons performed by the algorithm of Cha or Pettie \cite{pettie:ackermann}. \qed +Similarly to the Iterated Jarn\'\i{}k's algorithm, this bound is actually linear for classes of graphs +that do not have density extremely close to constant: + +\cor +The Optimal MST algorithm runs in linear time whenever $m\ge n\cdot a(k,n)$ for any fixed~$k$. + +\proof +Combine the previous theorem with Lemma \ref{alphaconst}. +\qed + \rem It is also known from \cite{pettie:optimal} that when we run the Optimal algorithm on a~random graph drawn from either $G_{n,p}$ (random graphs on~$n$ vertices, each edge is included with probability~$p$ -- 2.39.2