Updated proof of Lem 3.5

master
Atri Rudra 2021-09-20 20:55:00 -04:00
parent c17d3e468e
commit 64ee16c4ff
1 changed files with 3 additions and 3 deletions

View File

@ -17,10 +17,10 @@ and this yields the claimed runtime.
\begin{proof}
By the recursive defintion of $\qruntime{\cdot, \cdot}$ (see \Cref{sec:gen}), we have the following equation for our hard query $\query$ when $k = 1$, (we denote this as $\query^1$).
\begin{equation*}
\qruntime{\query^1, \dbbase} = \abs{\dbbase.\vset} + \abs{\dbbase.\edgeSet} + \abs{\dbbase.\vset} + \abs{\dbbase.\vset \join \dbbase.\edgeSet \join \dbbase.\vset}
\qruntime{\query^1, \dbbase} = \abs{\dbbase.\vset} + \abs{\dbbase.\edgeSet} + \abs{\dbbase.\vset} + \jointime{\dbbase.\vset , \dbbase.\edgeSet , \dbbase.\vset}.
\end{equation*}
The quantity $\abs{\dbbase.\vset \join \dbbase.\edgeSet \join \dbbase.\vset}$ is at most $\numedge$ by definition of $\query^1$. Then by the assumption of \Cref{lem:pdb-for-def-qk} (each $v \in \vset$ has degree $\geq 1$), the sum of the first three terms is $\bigO{\numedge}$. We then obtain that $\qruntime{\query^1, \dbbase} = \bigO{\numedge} + \bigO{\numedge} = \bigO{\numedge}$. For $\query^k = \query_1^1 \times\cdots\times\query_k^1$, we have the recurrence $\qruntime{\query^k, \dbbase} = \qruntime{\query_1^1, \dbbase} + \cdots +\qruntime{\query_k^1, \dbbase} + \abs{\query_1^1\join\cdots\join\query_k^1}$. Since $\query^\kElem$ outputs a count, we have $\abs{\query_1^1\join\cdots\join\query_k^1}=1$. Thus, we have
\[\qruntime{\query^k, \dbbase} \le k\cdot O(m)+1\le O(km),\]
We argue that $\jointime{\dbbase.\vset , \dbbase.\edgeSet , \dbbase.\vset}$ is at most $O(\numedge)$ by noting that there exists an algorithm that computes $\dbbase.\vset\join\dbbase.\edgeSet\join\dbbase.\vset$ in the same runtime\footnote{Indeed the trivial algorithm that computes the obvious pair-wise joins has the claimed runtime. That is, we first compute $\dbbase.\vset\join\dbbase.\edgeSet$, which takes $O(m)$ (assuming $\dbbase.\vset$ is stored in hash map) since tuples in $\dbbase.\vset$ can only filter tuples in $\dbbase.\edgeSet$. The resulting subset of tuples in $\dbbase.\edgeSet$ are then again joined (on the right) with $\dbbase.\vset$, which by the same argument as before also takes $O(m)$ time, as desried.}. Then by the assumption of \Cref{lem:pdb-for-def-qk} (each $v \in \vset$ has degree $\geq 1$), the sum of the first three terms is $\bigO{\numedge}$. We then obtain that $\qruntime{\query^1, \dbbase} = \bigO{\numedge} + \bigO{\numedge} = \bigO{\numedge}$. For $\query^k = \query_1^1 \times\cdots\times\query_k^1$, we have the recurrence $\qruntime{\query^k, \dbbase} = \qruntime{\query_1^1, \dbbase} + \cdots +\qruntime{\query_k^1, \dbbase} + \jointime{\query_1^1,\cdots,\query_k^1}$. Since $\query^1$ outputs a count, computing the join $\query_1^1\join\cdots\join\query_k^1$ is just multiplying $k$ numbers, which takes $O(k)$ time. Thus, we have
\[\qruntime{\query^k, \dbbase} \le k\cdot O(m)+O(k)\le O(km),\]
as desired.
\qed
%The dominating term in the sum of the recursive definition is $\abs{\query_1^1\join\cdots\join\query_k^1} = \bigO{\numedge^k} = O_k(\numedge)$.