From: Martin Mares Date: Thu, 10 Apr 2008 08:55:31 +0000 (+0200) Subject: More bits of ET trees. X-Git-Tag: printed~106 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=ceeba7b48170863df4d9d52d49a3e51cf84337f8;p=saga.git More bits of ET trees. --- diff --git a/dyn.tex b/dyn.tex index 666da7d..59362a6 100644 --- a/dyn.tex +++ b/dyn.tex @@ -214,17 +214,32 @@ order vertices on an~Eulerian tour in the tree with all edges doubled. Let us ob to the ET sequence when we modify the tree. When we \em{delete} an~edge $uv$ from the tree~$T$ (let $u$~be the parent of~$v$), the sequence -$\Eul(T) = Au_iv_1Bv_du_{i+1}C$ splits to two ET sequences $AuC$ and $v_1Bv_d$, Here $v_1$~is -the first occurrence of~$v$ in $\Eul(T)$ and $v_d$~is the last one. If there was only a~single -occurrence, $v$~was a~leaf and thus the second sequence will consists of $v$~alone. If $v_1$~or~$v_d$ -was the designated occurrence of~$v$, we redirect it to the new occurrence. +$\Eul(T) = AuvBvuC$ (with no~$u$ nor~$v$ in~$B$) splits to two ET sequences $AuC$ and $vBv$. +If there was only a~single occurrence of~$v$, it corresponded to a~leaf and thus the second +sequence should consist of $v$~alone. -\em{Changing the root} of the tree~$T$ from~$v$ to~$w$ changes $\Eul(T) = vAw_1Bw_dCv$ -to $w_1Bw_dCvAw_{d+1}$. +\em{Changing the root} of the tree~$T$ from~$v$ to~$w$ changes $\Eul(T) = vAwBwCv$ (no~$w$ in~$B$) +to $wBwCvAw$. If $w$~was a~leaf, the sequence changes from $vAwCv$ to $wCvAw$. If $vw$ was the only +edge of~$T$, the sequence $vw$ becomes $wv$. -\em{Joining} the roots of two trees by a~new edge, their ET sequences -$vAv$ and~$wBw$ combine to $vAvwBwv$. +\em{Joining} the roots of two trees by a~new edge makes their ET sequences $vAv$ and~$wBw$ +combine to $vAvwBwv$. Again, we have to handle the cases when $v$ or~$w$ has degree~1 separately: +$v$~and~$wBw$ combine to $vwBwv$, and $v$~with~$w$ makes $vwv$. +If any of the occurrences that we have removed from the sequence was designated, there is always +a~new occurrence of the same vertex that can stand in its place and inherit the auxiliary data. + +The ET trees will represent the ET sequences by $(a,b)$-trees with the parameter~$a$ set upon +initialization of the structure and with $b=2a$. We know from the standard theorems of $(a,b)$-trees +(see for example \cite{clrs}) that the depth of a~tree with $n$~leaves is always $\O(\log_a n)$ +and that all basic operations including insertion, deletion, search, splitting and joining the trees +run in time $\O(a\log_a n)$ in the worst case. + +We will use the ET trees to maintain a~spanning forest of the current graph. The auxiliary data of +each vertex will hold a~list of edges incident with the given vertex, which do not lie in the +forest. Such edges are usually called the \df{non-tree edges.} + +\defnn{Eulerial Tour trees}