\begin{algorithm}[htb]
\small

\KwIn{$Q$: a snapshot of the sufficient statistics from the preference stream $S$ at the time instant $time$; $(X,Y)$: a pair of attributes; two thresholds $\alpha_1 > 0$  and $\alpha_2 > 0$.
}
\KwOut{the degree of dependence of $(X,Y)$ with respect to $Q$ at the time instant $time$}
\BlankLine

\For{each pair $(y,y') \in$ \textbf{general counters} over $Y$ from $Q$, $y \neq y'$ and $(y,y')$ comparable}
{
    \For{each $x \in$ \textbf{dom}$(X)$ where $x$ is a  cause for $(y,y')$ being comparable}
    {
        Let $f_1(S_{x|(y,y')}^{time}) = \max\{ N, 1-N \}$, where $N = \dfrac{|\{(u_1,u_2,t) \in S_{x|(y,y')}^{time}: u_1 >_t u_2 \wedge (u_1[Y]=y \wedge u_2[Y]=y')\}|}{|S_{x|(y,y')}^{time}|}$
       % \tcp*{$f_1(S_{x|(y,y')})$ is called the \textit{confidence} of $S_{x|(y,y')}$}
       }
       Let $f_2(T_{yy'}^{time}) = \max$ $\{f_1(S_{x|(y,y')}^{time}): x \in $ \textbf{dom}$(X)$\}
    %\tcp*{$f_2(T_{yy'})$ is called \textit{the confidence} of $T_{yy'}$}
    }
Let $f_3((X,Y),Q) = \max \{f_2(T_{yy'}^{time}): (y,y') \in$ \textbf{general counters} over $Y$ from $Q$, $y \not = y'$, ($y,y'$) comparable\}
%\tcp*{$f_3((X,Y),{\cal P})$ is called the \textit{degree of dependence} of attribute $Y$ with respect to its parent $X$}

\Return {$f_3((X,Y),Q)$}

\caption{The degree of dependence of a pair of attributes} \label{alg1}
\end{algorithm}
\normalsize