next up previous
Next: Computing the Unoriented Degrees Up: An Algorithm for Sorting Previous: Implicit Representation of the

   
Finding a Happy Clique


 \begin{theorem}
The oriented neighborhood of every oriented node contains a
happy clique.
\end{theorem}

Let $n_1,\ldots,n_k$ be the oriented nodes in $OV(\pi )$ in increasing left endpoint order (we ignore unoriented nodes at this stage). To locate a happy clique in $OV(\pi )$, the algorithm traverses the oriented nodes in $OV(\pi )$ according to this order. Let L(e) and R(e) be the left and right endpoints, respectively, of the interval corresponding to a node e in the realization of $OV(\pi )$. After traversing $n_1,\ldots,n_i$ for $1\le i\le k$, the algorithm maintains a happy clique Ci in the subgraph of $OV(\pi )$ induced by these vertices. Assume |Ci|=j, $j\le i$ and let $n_{i_1},\ldots,n_{i_j}$ be the vertices in Ciwhere $i_1 < i_2 <\ldots < i_j$. The vertices of Ci are maintained in a linked list ordered in increasing left endpoint order. If there exists an interval that contains all the intervals in Ci then the algorithm maintains a minimal such interval ti. The clique Ci and the node ti (if exists) satisfy the following invariant:

Invariant   $\;$
1) Every node $n_l\not\in C_i$, $l \le i$, such that L(ni1) < L(nl)must be adjacent to ti.
2) Every node $n_l\not\in C_i$, L(nl) < L(ni1)that is adjacent to a node in Ci is either adjacent to an interval vp such that R(np) < L(ni1)or adjacent to ti.

We prove the correctness of this invariant by induction: Initially $C_1=\{n_1\}$ and t1 is undefined. If R(nij) < L(ni+1)then Ci is guaranteed to be happy in $OV(\pi )$ (see figure 10.12(a)), therefore we need to focus only on cases with $L(n_{i+1}) \le R(n_{i_j})$. The induction step: We assume correctness up until i and show how to obtain Ci+1 and ti+1 if $L(n_{i+1}) \le R(n_{i_j})$. We have to consider the following cases:
Case 1. The interval ti is defined and R(ti) <R(ni+1). Continue with Ci+1 = Ci and ti+1 = ti. See figure 10.12(b).
Case 2. The interval ti is not defined or $R(n_{i+1}) \le R(t_i)$.
a) R(nij) < R(ni+1) and $L(n_{i+1}) \le R(n_{i_1})$. Ci+1 is obtained by adding ni+1 to Ci and ti+1 = ti. See figure 10.12(c).
b) R(nij) < R(ni+1) and L(ni+1) > R(ni1). The clique Ci+1consists of vi+1 alone and ti+1 = ti. See figure 10.12(d).
c) R(ni+1) < R(nij). As in the previous case $C_{i+1} = \{ n_{i+1} \}$. In this case ti+1 is set to nij, the last interval in Ci. See figure 10.12(e).



  
Figure 10.12: The various cases of the algorithm for finding a happy clique. The topmost interval is always ti. The three thick intervals comprise Ci. The dotted interval corresponds to ni+1.
\includegraphics{lec10_fig/lec10_happy.eps}

The fact that Ci is happy in the subgraph induced by $n_1,\ldots,n_i$ follows from this invariant. It is straightforward to see that the clique Clthat the algorithm stops with, is happy.

The running time of the algorithm is proportional to the number of oriented nodes traversed since a constant amount of work is performed for each oriented node it encounters.


next up previous
Next: Computing the Unoriented Degrees Up: An Algorithm for Sorting Previous: Implicit Representation of the
Peer Itsik
2001-01-17