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

     
Finding a Happy Clique

Theorem 11.14   The oriented neighborhood of every oriented vertex contains a happy clique.

Let $v_1,\ldots,v_k$ be the oriented vertices in $OV(\pi )$ in increasing left endpoint order (we ignore unoriented vertices in this stage). To locate a happy clique in $OV(\pi )$, The algorithm traverses the oriented vertices 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 vertex e in the realization of $OV(\pi )$. After traversing $v_1,\ldots,v_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 $e_{i_1},\ldots,e_{i_j}$ be the vertices in Ci where $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 vertex ti (if exists) satisfy the following invariant:

Invariant 11.4.1   $\;$
1) Every vertex $v_l\not\in C_i$, $l \le i$, such that L(vi1) < L(vl) must be adjacent to ti.
2) Every vertex $v_l\not\in C_i$, L(vl) < L(vi1) that is adjacent to a vertex in Ci is either adjacent to an interval vp such that R(vp) < L(vi1) or adjacent to ti.

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



  
Figure 11.11: 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 vi+1.
\begin{figure}
\hspace{0.65cm} \psfig{figure=lec11_fig/lec11_happy.eps}
\end{figure}

The fact that Ci is happy in the subgraph induced by $v_1,\ldots,v_i$ follows from this invariant. It is straightforward to see that the clique Cl that the algorithm stops with, is happy. The running time of the algorithm is proportional to the number of oriented vertices traversed since a constant amount of work is performed for each such vertex.
next up previous
Next: Computing the Unoriented Degrees Up: An Algorithm for Sorting Previous: Implicit Representation of the
Itshack Pe`er
1999-03-16