paper-BagRelationalPDBsAreHard/hash_const.tex

33 lines
1.6 KiB
TeX

% -*- root: main.tex -*-
\section{Hash Function Construction}
As with world identification, bucket identification can be viewed as a binary vector. This vector is of length $\lenB = \log\sketchCols$, where $\buck \in \{0, 1\}^\lenB$. Similarly, we can define a set of hash vectors $\matrixH$ as a matrix of $\lenB$ precomputed vectors $\hVec$ where each $\hVec \in \{0, 1\}^\numTup$, formally
\begin{equation*}
\begin{pmatrix*}[l]
h_{i, 0, 0}&\cdots &h_{0, \numTup} \\
\vdots \\
h_{i, \lenB, 0} &\cdots &h_{\lenB, \numTup}\\
\end{pmatrix*}.
\end{equation*}
The row hash function $\sketchHash$ that maps input to buckets is defined as the multiplication of the matrix $\matrixH \cdot \wVec = \jVec$ , as
\begin{equation*}
\hVecMatrix \cdot \vecCol{w} = \vecCol{j},
\end{equation*}
or equivalently
\begin{equation*}
\sketchHash = \buck = \forall i \in [\lenB], \buck_i = \langle\textbf{h}_i, \wVec\rangle
\end{equation*}
Polarity function $\sketchPolar$ is analogously defined as the inner product of a precomputed vector (abusing notation) $\mathbf{\sketchPolar}$ and $\wVec$,
\begin{equation*}
\sketchPolar = \langle\mathbf{\sketchPolar}, \wVec\rangle
\end{equation*}
Finally, we augment $\matrixH$ to $\matrixH$' by adding $\mathbf{\sketchPolar}$ as an additional row in $\matrixH$
\begin{equation*}
\matrixH' = \begin{pmatrix*}[l]
h_{i, 0, 0}&\cdots &h_{0, \numTup} \\
\vdots \\
h_{i, \lenB, 0} &\cdots &h_{\lenB, \numTup}\\
s_{i, 0} &\cdots &s_{i, \numTup}
\end{pmatrix*}.
\end{equation*}
Note that this also turns $\buck$ into a $b + 1$ size column vector, with the last element being the polarity of the hashed world vector.