Yate’s Algorithm for the Zeta Transform

This is my first post in the folklore knowledge category about an algorithm first used by Yate. I stumbled over this technique while reading the beautiful paper “Determinant Sums for Undirected Hamiltonicity” by A. Björklund (more on this in a few days). Since I did not found an easy to understand presentation of this technique, I decided to write my own one.

When designing algorithms one is sometimes faced with the problem of computing the so-called Zeta Transform \hat{f} of a function f:2^N\rightarrow R, i.e. f maps subsets of a given superset N onto elements in a fixed computation ring R. The Zeta Transform is defined as

\hat{f}(Y):=\sum_{X\subset Y}f(X)\hspace{1cm}\forall Y\subset N\enspace.

Hence, the Zeta Transform is an operator mapping a function f:2^N\rightarrow R onto another function \hat{f}:2^N\rightarrow R. The naive way of computing \hat{f} for all Y\subset N would be to simply compute \hat{f}(Y) from scratch for every Y. In terms of ring additions, this yields a complexity of

\sum_{Y\subset N}2^{|Y|}=\mathcal{O}(3^{|N|})

assuming that the evaluation of the function f itself can be done in unit time.

Yeta’s algorithm gives a more efficient way to do so. Clearly, the naive computation contains a lot of double calculations which should be avoided. Essentially the trick is to derive a simple recursion formula that allows to apply dynamic programming. This allows to prove the following result.

Theorem (Yate’s Fast Zeta Transform). For every function f:2^N\rightarrow R, the Zeta Transform \hat{f}(Y) can be computed for all Y\subset N with \mathcal{O}(N2^N) ring additions.

Proof. For convenience we write N=\{1,\ldots,n\}. For every Y\subset N and i=0,\ldots,n we define

g_i(Y):=\sum_{Y\setminus\{1,\ldots,i\}\subset X\subset Y}f(Y)

describing partial sums over all subsets X\subset Y covering all elements in Y\setminus\{1,\ldots,i\}. Obviously we obtain g_0(Y)=f(Y) for every Y and g_n(Y)=\hat{f}(Y). Now the important observation is the following recursion formula for g_i(Y) given by

g_i(Y)=\begin{cases}g_{i-1}(Y)&\text{ for} i\notin Y\\g_{i-1}(Y)+g_{i-1}(Y\setminus\{i\})&\text{ else}\end{cases}\enspace.

Clearly, for i\notin Y it holds g_i(Y)=g_{i-1}(Y). For the other case, observe that every subset X\subset Y that occurs in g_i(Y) either contains i or not and covers all of Y\setminus\{1,\ldots,i-1\} which explains the second equation in the above recursion formula. Now, the following dynamic programming algorithm allows to finally prove the theorem.

Algorithm.
Input: f,N
Output: \hat{f}(Y) for all Y\subset N

  • For all Y\subset N set g_0(Y)=f(Y)
  • For all i=1,\ldots n do
    • For all Y\subset N update g_i(Y) using the above recursion formula
  • Output g_n(Y) for all Y\subset N.

The first step takes 2^N evaluations of f and the second step yields a total number of N2^N ring additions.

Posted in Folklore | Tagged , , | Leave a comment

Hi folks…

…this is me writing my first post on this brandnew blog! So what is this all about? Mainly I decided to create this blog as my personal aid to memory for all the cool stuff in crypto, computer science and sometimes pure (but useful) math that crosses my way in everyday’s PhD life. At the best, depending on my personal motivation and discipline, this blog will become a diversified collection containing both interesting results in cryptography and more general useful tools from computer science or mathmatics. On that score, my first (contentual interesting) post is going to be about some basic observations on signature schemes based on the full domain hash principle (although the main references regarding this post are quite old, there is a nice generic idea which is worth to be known).

Another great deal of this blog will cover the nebulous world of so-called folklore knowledge, something you are faced with in almost all scientific papers you read. Every once in a while it’s annoying me reading a proof in a paper where the author justifies a certain statement by refering to a folklore argument. Especially for newbie PhD’s like me it can take a remarkable amount of time to find out how this folklore argument works in the end. A good example is the so-called Zeta-Transform (probably invented by Yate’s). Basically, the Zeta-Transform gives a clever way of computing the following combinatorial sum

g(Y)=\sum_{X\subset Y}f(X)

for all subsets Y\subset N of a given superset N where f:\mathcal{P}(N)\rightarrow R maps subsets of N to a specified computation ring. I’m going to explain the Zeta-Transform in my first post of the folklore category soon!

By the way, I stumbled over this general algorithmic technique while reading one of the most beautiful papers I’ve read in the last two years (the paper is called “Determinant Sums for Undirected Hamiltonicity” by Andreas Björklund…don’t worry there will be a post about this paper in the near future, too!).

For now, I’m done! Cheers, theo.

Posted in Miscellaneous | Leave a comment