]> mj.ucw.cz Git - saga.git/commitdiff
Corrections to Sections 5.1--5.2.
authorMartin Mares <mj@ucw.cz>
Sat, 3 May 2008 13:56:44 +0000 (15:56 +0200)
committerMartin Mares <mj@ucw.cz>
Sat, 3 May 2008 13:56:44 +0000 (15:56 +0200)
dyn.tex

diff --git a/dyn.tex b/dyn.tex
index c31c63e393c7550bb416b0b6f6c1e0d04975dd4a..9f4cc7aa5fcc41d41e2359e1600a45b09ad7b17b 100644 (file)
--- a/dyn.tex
+++ b/dyn.tex
@@ -32,7 +32,7 @@ We have already encountered a~special case of dynamic connectivity when implemen
 Kruskal's algorithm in Section \ref{classalg}. At that time, we did not need to delete
 any edges from the graph, which makes the problem substantially easier. This special
 case is customarily called an~\df{incremental} or \df{semidynamic} graph algorithm.
-We mentioned the Disjoint Set Union data structure of Tarjan and van Leeuwen (Theorem \ref{dfu})
+We mentioned the Disjoint Set Union data structure of Tarjan (Theorem \ref{dfu})
 which can be used for that: Connected components are represented by equivalence classes.
 Queries on connectedness translate to \<Find>, edge insertions to \<Find>
 followed by \<Union> if the new edge joins two different components. This way,
@@ -42,12 +42,13 @@ Machine. Fredman and Saks \cite{fredman:cellprobe} have proven a~matching lower
 bound in the cell-probe model which is stronger than RAM with $\O(\log n)$-bit
 words.
 
+\paran{Dynamic MSF}%
 In this chapter, we will focus on the dynamic version of the minimum spanning forest.
 This problem seems to be intimately related to the dynamic connectivity. Indeed, all known
 algorithms for dynamic connectivity maintain some sort of a~spanning forest. For example, in the
 incremental algorithm we have just mentioned, this forest is formed by the edges that have
 triggered the \<Union>s. This suggests that a~dynamic MSF algorithm could be obtained by modifying
-the mechanism to keep the forest minimum. This will indeed turn out to be true, although we cannot
+the mechanics of the data structure to keep the forest minimum. This will really turn out to be true, although we cannot
 be sure that it will lead to the most efficient solution possible --- as of now, the known lower
 bounds are very far.
 
@@ -56,8 +57,8 @@ dynamic will require more effort, so we will review some of the required buildin
 going into that.
 
 We however have to answer one important question first: What should be the output of
-our MSF data structure? Adding an~operation that would return the MSF of the current
-graph is of course possible, but somewhat impractical as this operation has to
+our MSF data structure? Adding an~operation that returns the MSF of the current
+graph would be of course possible, but somewhat impractical as this operation would have to
 spend $\Omega(n)$ time on the mere writing of its output. A~better way seems to
 be making the \<Insert> and \<Delete> operations report the list of modifications
 of the MSF implied by the change in the graph.
@@ -65,7 +66,7 @@ of the MSF implied by the change in the graph.
 Let us see what happens when we \<Insert> an~edge~$e$ to a~graph~$G$ with its minimum spanning
 forest~$F$, obtaining a~new graph~$G'$ with its MSF~$F'$. If $e$~connects two components of~$G$ (and
 therefore also of~$F$), we have to add~$e$ to~$F$. Otherwise, one of the following cases happens:
-Either $e$~is $F$-heavy and so the forest~$F$ is also the MSF of the new graph. Or it is $F$-light
+Either $e$~is $F$-heavy and thus the forest~$F$ is also the MSF of the new graph. Or it is $F$-light
 and we have to modify~$F$ by exchanging the heaviest edge~$f$ of the path $F[e]$ with~$e$.
 
 Correctness of the former case follows immediately from the Minimality Theorem (\ref{mstthm}),
@@ -84,7 +85,7 @@ replacement edge, we have deleted a~bridge, so the MSF has to remain
 disconnected.
 
 The idea of reporting differences in the MSF indeed works very well. We can summarize
-what we have shown in the following lemma and use it to define the dynamic MSF.
+what we have shown by the following lemma and use it to define the dynamic MSF.
 
 \lemma
 An~\<Insert> or \<Delete> of an~edge in~$G$ causes at most one edge addition, edge
@@ -95,7 +96,7 @@ Maintain an~undirected graph with distinct weights on edges (drawn from a~totall
 and its minimum spanning forest under a~sequence of the following operations:
 \itemize\ibull
 \:$\<Init>(n)$ --- Create a~graph with $n$~isolated vertices $\{1,\ldots,n\}$.
-\:$\<Insert>(G,u,v)$ --- Insert an~edge $uv$ to~$G$. Return its unique
+\:$\<Insert>(G,u,v,w)$ --- Insert an~edge $uv$ of weight~$w$ to~$G$. Return its unique
        identifier and the list of additions and deletions of edges in $\msf(G)$.
 \:$\<Delete>(G,e)$ --- Delete an~edge specified by its identifier from~$G$.
        Return the list of additions and deletions of edges in $\msf(G)$.
@@ -111,17 +112,17 @@ There is a~data structure that represents a~forest of rooted trees on~$n$ vertic
 Each edge of the forest has a~weight drawn from a~totally ordered set. The structure
 supports the following operations in time $\O(\log n)$ amortized:\foot{%
 The Link-Cut trees can offer a~plethora of other operations, but we do not mention them
-as they are not needed in our application.}
+as they are not needed for our problem.}
 \itemize\ibull
 \:$\<Parent>(v)$ --- Return the parent of~$v$ in its tree or \<null> if $v$~is a~root.
 \:$\<Root>(v)$ --- Return the root of the tree containing~$v$.
 \:$\<Weight>(v)$ --- Return the weight of the edge $(\<Parent(v)>,v)$.
-\:$\<PathMax>(v)$ --- Return the vertex~$w$ closest to $\<Root>(v)$ such that the edge
-       $(\<Parent>(w),w)$ is the heaviest of those on the path from the root to~$v$.
+\:$\<PathMax>(v)$ --- Return the vertex~$u$ closest to $\<Root>(v)$ such that the edge
+       $(\<Parent>(u),u)$ is the heaviest of those on the path from the root to~$v$.
        If more edges have the maximum weight, break the tie arbitrarily.
        If there is no such edge ($v$~is the root itself), return \<null>.
-\:$\<Link>(u,v,x)$ --- Connect the trees containing $u$ and~$v$ by an~edge $(u,v)$ of
-       weight~$x$. Assumes that $v~$is a tree root and $u$~lies in a~different tree.
+\:$\<Link>(u,v,w)$ --- Connect the trees containing $u$ and~$v$ by an~edge $(u,v)$ of
+       weight~$w$. Assumes that $v~$is a tree root and $u$~lies in a~different tree.
 \:$\<Cut>(v)$ --- Split the tree containing the non-root vertex $v$ to two trees by
        removing the edge $(\<Parent>(v),v)$. Returns the weight of this edge.
 \:$\<Evert>(v)$ --- Modify the orientations of edges to make~$v$ the root of its tree.
@@ -211,14 +212,14 @@ when it is invoked on the root of the tree:
 \>A~single tree can have multiple ET-sequences, corresponding to different orders in which the
 sons can be enumerated in step~2.
 
-In every ET-tree, one of the occurrences of each vertex is defined as its \df{active occurrence} and
+In every ET-sequence, one of the occurrences of each vertex is defined as its \df{active occurrence} and
 it will be used to store auxiliary data associated with that vertex.
 
 \obs
 An~ET-sequence contains a~vertex of degree~$d$ exactly $d$~times except for the root which
 occurs $d+1$ times. The whole sequence therefore contains $2n-1$ elements. It indeed describes the
-order vertices on an~Eulerian tour in the tree with all edges doubled. Let us observe what happens
-to an~ET-sequence when we modify the tree.
+order of vertices on an~Eulerian tour in the tree with all edges doubled. Let us observe what happens
+to an~ET-sequence when we modify the tree. (See the picture.)
 
 When we \em{delete} an~edge $uv$ from the tree~$T$ (let $u$~be the parent of~$v$), the sequence
 $AuvBvuC$ (with no~$u$ nor~$v$ in~$B$) splits to two sequences $AuC$ and $vBv$.
@@ -247,6 +248,7 @@ $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 active, there is always
 a~new occurrence of the same vertex that can stand in its place and inherit the auxiliary data.
 
+\para
 The ET-trees will store the ET-sequences as $(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)$
@@ -315,7 +317,7 @@ which we remember. Linking of the roots is translated to joining of the $(a,b)$-
 \<Connected> follows parent pointers from both $u$ and~$v$ to the roots of their trees.
 Then it checks if the roots are equal.
 
-\<Size> finds the root and returns its counter.
+\<Size> finds the root~$r$ and returns $\<leaves>(r)$.
 
 \<InsertNontree> finds the leaf $\<act>(v)$ containing the list of $v$'s non-tree edges
 and inserts the new edge there. The returned identifier will consist from the pointer to
@@ -371,7 +373,9 @@ call to \<InsertNontree> or \<DeleteNontree>, which takes $\O(a\log_a n)$ time o
 We can therefore conclude:
 
 \corn{Weighted ET-trees}\id{wtet}%
-The time bounds in Theorem \ref{etthm} hold for the weighted ET-trees, too.
+In weighted ET-trees, the operations \<InsertNontree> and \<DeleteNontree> have time
+complexity $\O(a\log_a n)$. All other operations take the same time as in Theorem
+\ref{etthm}.
 
 
 %--------------------------------------------------------------------------------