From: Martin Mares Date: Wed, 16 Jan 2008 16:53:59 +0000 (+0100) Subject: Further exchange theorems. X-Git-Tag: printed~303 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=3eb9eee489f8728e36d1c45b0c23bb083edb04d9;p=saga.git Further exchange theorems. --- diff --git a/Makefile b/Makefile index 7d9d0a3..0d0ac1d 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ saga.dvi: $(addsuffix .tex,$(CHAPTERS)) dvipdfm -o $@ -p a4 -r 600 -z 9 $< mostlyclean: - rm -f *.dvi *.log *~ core *.o *.aux *.bbl *.blg + rm -f *.dvi *.log *~ core *.o *.aux *.bbl *.blg *.ids clean:: mostlyclean rm -f *.ps *.pdf diff --git a/macros.tex b/macros.tex index 5834507..8af08f2 100644 --- a/macros.tex +++ b/macros.tex @@ -33,6 +33,7 @@ \let\>=\noindent \def\qed{{\parfillskip=0pt\allowbreak\hfill\nobreak $\spadesuit$\par}} \def\FIXME#1{\>{\bo FIXME:} #1} +\def\symdiff{\mathbin{\Delta}} % Footnotes \newcount\footcnt @@ -294,23 +295,27 @@ \def\defn{\proclaim{Definition}} \def\problem{\proclaim{Problem}} \def\obs{\proclaim{Observation}} +\def\rem{\proclaim{Remark}} -\def\lemman#1{\proclaim{Lemma}{\sl (#1)\/}} +\def\label#1{{\sl (#1)\/}\enspace} -\def\proof{\noindent {\sl Proof.} } +\def\lemman{\lemma\label} +\def\defnn{\defn\label} + +\def\proof{\noindent {\sl Proof.}\enspace} %%% References %%% \newwrite\ids \def\writeid#1#2{\immediate\write\ids{\string\def\expandafter\string\csname id#1\endcsname{#2}}} -\immediate\openin\ids=\jobname.aux +\immediate\openin\ids=\jobname.ids \ifeof\ids \else -\input \jobname.aux +\input \jobname.ids \fi \immediate\closein\ids -\immediate\openout\ids=\jobname.aux +\immediate\openout\ids=\jobname.ids \def\ref#1{\expandafter\ifx\csname id#1\endcsname\relax {\bo ??}% diff --git a/mst.tex b/mst.tex index ee53099..d6b3af9 100644 --- a/mst.tex +++ b/mst.tex @@ -51,50 +51,101 @@ In this section, we will examine the basic properties of spanning trees and prov several important theorems to base the algorithms upon. We will follow the theory developed by Tarjan in~\cite{tarjan:dsna}. +For the whole section, we will fix a graph~$G$ with edge weights~$w$ and all other +graphs will be subgraphs of~$G$ containing all of its vertices. We will use the +same notation for the subgraph and for the corresponding set of edges. + First of all, let us show that the weights on edges are not necessary for the definition of the MST. We can formulate an equivalent characterization using an ordering of edges instead. -\defn For a graph~$G$ and its tree subgraph~$T$, we define: +\defnn{Heavy and light edges} +Let~$T$ be a~spanning tree. Then: \itemize\ibull \:For vertices $x$ and $y$, let $T[x,y]$ denote the (unique) path in~$T$ joining $x$ and~$y$. -\:For an edge $e=xy$ outside~$T$, we will call $T[e]:=T[x,y]$ the \df{path covered by~$e$} and +\:For an edge $e=xy$ we will call $T[e]:=T[x,y]$ the \df{path covered by~$e$} and the edges of this path \df{edges covered by~$e$}. -\:An edge~$e=xy$ outside~$T$ is called \df{$T$-light} if it covers a heavier edge, i.e., if there +\:An edge~$e$ is called \df{$T$-light} if it covers a heavier edge, i.e., if there is an edge $f\in T[e]$ such that $w(f) > w(e)$. -\:An edge~$e$ outside~$T$ is called \df{$T$-heavy} if it is not light. +\:An edge~$e$ is called \df{$T$-heavy} if it is not $T$-light. \endlist -\theorem A~spanning tree~$T$ of a graph~$G$ is minimal iff there is no $T$-light edge in~$G$. - -To prove this theorem, we will use a notion of edge exchanges, similar to Steinitz theorem -in linear algebra or the exchanges in matroid theory. -\FIXME{reference} - -\defn For a tree~$T$ and edges $e\in T$ and $f\not\in T$, the \df{exchange} -XXXXXX - -For the other implication, we will make use of the following lemmata, again -based on exchange of edges: - -{\narrower -\lemman{Exchange property of spanning trees} -Let $T$ and $T'$ be spanning trees of a common graph~$G$. Then there exists -a sequence - -} - -Back to the proof of the theorem: - -The implication $\Rightarrow$ is straightforward: If there is a $T$-light edge~$e$, there -exists an edge $f\in T[e]$ such that $w(f)>w(e)$. Now $T-f$ is a forest of two trees -with endpoints of~$e$ located in different components, so adding $e$ to this forest -must restore connectivity and $T'=T-f+e$ is another spanning tree with weight $w(T') = w(T)-w(f)+w(e) < w(T)$. -Hence $T$ could not have been minimal. - - -%\:For a disconnected graph~$G$, we define the \df{(minimal) spanning forest (or MSF)} -% as an union of (minimal) spanning trees of its connected components. +\rem +Please note that the above properties also apply to tree edges +which by definition cover only themselves and therefore they are always heavy. + +\lemma\thmid{lightlemma}% +Let $T$ be a spanning tree. If there exists a $T$-light edge, then~$T$ +is not minimal. + +\proof +If there is a $T$-light edge~$e$, then there exists an edge $f\in T[e]$ such +that $w(f)>w(e)$. Now $T-f$ is a forest of two trees with endpoints of~$e$ +located in different components, so adding $e$ to this forest must restore +connectivity and $T':=T-f+e$ is another spanning tree with weight $w(T') += w(T)-w(f)+w(e) < w(T)$. Hence $T$ could not have been minimal. +\qed + +The converse of this lemma is also true and to prove it, we will once again use +technique of transforming trees by \df{exchanges} of edges. In the proof of the +lemma, we have made use of the fact that whenever we exchange an edge~$e$ of +a spanning tree for another edge~$f$ covered by~$e$, the result is again +a spanning tree. In fact, it is possible to transform any spanning tree +to any other spanning tree by a sequence of exchanges. + +\lemman{Exchange property for trees} +Let $T$ and $T'$ be spanning trees of a common graph. Then there exists +a sequence of edge exchanges which transforms $T$ to~$T'$. More formally, +there exists a sequence of spanning trees $T=T_0,T_1,\ldots,T_k=T'$ such that +$T_{i+1}=T_i - e_i + e_i^\prime$ where $e_i\in T_i$ and $e_i^\prime\in T'$. + +\proof +By induction on $d(T,T'):=\vert T\symdiff T'\vert$. When $d(T,T')=0$, then +both trees are identical and an empty sequence suffices. Otherwise, the trees are different, +but they are of the same size, so there must exist an edge $e'\in T'\setminus T$. +The cycle $T[e']+e'$ cannot be wholly contained in~$T'$, so there also must +exist an edge $e\in T[e']\setminus T'$. Exchanging $e$ for~$e'$ yields a spanning +tree $T^*:=T-e+e'$ such that $d(T^*,T')=d(T,T')-2$ and we can apply the induction +hypothesis to $T^*$ and $T'$ to get the rest of the exchange sequence. +\qed + +\lemman{Monotone exchanges} +\thmid{monoex} +Let $T$ be a spanning tree such that there are no $T$-light edges and $T$ +be an arbitrary spanning tree. Then there exists a sequence of edge exchanges +transforming $T$ to~$T'$ such that the weight does not increase in any step. + +\proof +We improve the argument from the previous proof, refining the induction step. +When we exchange $e\in T$ for $e'\in T'\setminus T$ such that $e\in T[e']$, +the weight never drops, since $e'$ is not a $T$-light edge and therefore +$w(e') \ge w(e)$, so $w(T^*)=w(T)-w(e)+w(e')\le w(T)$. + +To allow the induction to proceed, we have to make sure that there are still +no light edges with respect to~$T^*$. In fact, it is enough to avoid $T^*$-light +edges in $T'\setminus T^*$, since these are the only edges considered by the +induction step. Instead of picking $e'$ arbitrarily, we will pick the lightest +edge available. Now consider an edge $f\in T'\setminus T^*$. We want to show +that $f$ is heavier than all edges on $T^*[f]$. + +The path $T^*[f]$ is either the original path $T[f]$ (if $e\not\in T[f]$) +or $T[f] \symdiff C$, where $C$ is the cycle $T[e']+e$. The first case is +trivial, in the second case $w(f)\ge w(e')$ and all other edges on~$C$ +are lighter than~$e'$. +\qed + +\theorem +A~spanning tree~$T$ is minimal iff there is no $T$-light edge. + +\proof +If~$T$ is minimal, then by Lemma~\thmref{lightlemma} there are no $T$-light +edges. +Conversely, when $T$ is a spanning tree without $T$-light edges +and $T_{min}$ is an arbitrary minimal spanning tree, then according to the Monotone +exchange lemma~\thmref{monoex} there exists a non-decreasing sequence +of exchanges transforming $T$ to $T_{min}$, so $w(T)\le w(T_{min})$ +and thus $T$~is also minimal. +\qed % mention Steiner trees % mention matroids