]> mj.ucw.cz Git - saga.git/commitdiff
Red-Blue section started.
authorMartin Mares <mj@ucw.cz>
Wed, 16 Jan 2008 18:43:37 +0000 (19:43 +0100)
committerMartin Mares <mj@ucw.cz>
Wed, 16 Jan 2008 18:43:37 +0000 (19:43 +0100)
Makefile
biblio.bib
macros.tex
mst.tex
notation.tex

index 1a19b1ee80307ba785a4fdefaa6c119168d360f9..9802547b897473899e16f90ab0135d5ee4643931 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@ all: saga.ps
 
 CHAPTERS=cover mst notation
 
-%.dvi: %.tex macros.tex
+%.dvi: %.tex macros.tex biblio.bib
        tex $< && if grep -q citation $*.aux ; then bibtex $* && tex $< && tex $< ; fi
 
 saga.dvi: $(addsuffix .tex,$(CHAPTERS))
index 705c7ae408fa898d0b9bde6f2958ea3435086696..45d45953810dc097d7ce2a7bf45df25991720464 100644 (file)
   pages={43--57},
   year={1985}
 }
+
+@article{ cayley:trees,
+  title={{A theorem on trees}},
+  author={Cayley, Arthur},
+  journal={Quart. J. Math},
+  volume={23},
+  year={1889},
+  pages={376--378}
+}
index 149b875ecad3dd51b0393915f2e869ef6f978dac..270d095bf1cdcebb114ca5ce7c4cdc4ea608e6ab 100644 (file)
 %      \algout popis vystupu
 %      \endalgo
 
-\def\algo#1{
+\def\algo{
 \interlistskip
 \begingroup
 \let\:=\algoitem
 \parskip=1pt plus 1pt minus 0.3pt
 \rightskip=2em
 \itemcount=0
-{\bo Algoritmus\/} {\sc #1}
 }
 \def\endalgo{\interlistskip\endgroup}
 \def\algopar{\par
 \futurelet\next\algoitemh}
 \def\algoitemh{\ifx\next:\let\next=\algohang\else\let\next=\relax\fi\next}
 \def\algohang:{\advance\hangindent by 2em \hskip 2em\futurelet\next\algoitemh}
-\def\algin{\par{\it Vstup:\/} }
-\def\algout{\par{\it VĂ˝stup:\/} }
+\def\algin{\par{\sl Input:\/} }
+\def\algout{\par{\sl Output:\/} }
 
 %%% Constructs used in algorithms %%%
 
 \def\problem{\proclaim{Problem}}
 \def\obs{\proclaim{Observation}}
 \def\rem{\proclaim{Remark}}
+\def\alg{\proclaim{Algorithm}}
 
 \def\label#1{{\sl (#1)\/}\enspace}
 
+\def\theoremn{\theorem\label}
 \def\lemman{\lemma\label}
 \def\defnn{\defn\label}
+\def\algn{\alg\label}
 
 \def\proof{\noindent {\sl Proof.}\enspace}
 
diff --git a/mst.tex b/mst.tex
index baa178ea1e23987034acbb2acd5766320b6bde4c..ff08ec8ef5f4563aa6fa1336938e262236edf25d 100644 (file)
--- a/mst.tex
+++ b/mst.tex
@@ -21,11 +21,15 @@ in contemporary terminology:
 \proclaim{Problem}Given an undirected graph~$G$ with weights $w:E(G)\rightarrow {\bb R}$,
 find its minimum spanning tree, where:
 
-\defn For a given graph~$G$ with weights $w:E(G)\rightarrow {\bb R}$:
+\defn\thmid{mstdef}%
+For a given graph~$G$ with weights $w:E(G)\rightarrow {\bb R}$:
 \itemize\ibull
 \:A~tree $T$ is a \df{spanning tree} of~$G$ if and only if $V(T)=V(G)$ and $E(T)\subseteq E(G)$.
 \:For any subgraph $H\subseteq G$ we define its \df{weight} $w(H):=\sum_{e\in E(H)} w(e)$.
 \:A~spanning tree~$T$ is \df{minimal} iff $w(T)$ is the smallest possible of all spanning trees.
+  We use an abbreviation \df{MST} for such trees.
+\:For a disconnected graph, a \df{(minimal) spanning forest (MSF)} is defined as
+  a union of (minimal) spanning trees of its connected components.
 \endlist
 
 Bor\accent23uvka's work was further extended by Jarn\'\i{}k \cite{jarnik:ojistem}, again in
@@ -74,7 +78,7 @@ Let~$T$ be a~spanning tree. Then:
 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}%
+\lemman{Light edges}\thmid{lightlemma}%
 Let $T$ be a spanning tree. If there exists a $T$-light edge, then~$T$
 is not minimal.
 
@@ -145,11 +149,88 @@ 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{monoxchg} there exists a non-decreasing sequence
+exchange lemma (\thmref{monoxchg}) 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
 
+In general, a single graph can have many minimal spanning trees (for example
+a complete graph on~$n$ vertices and unit edge weights has $n^{n-2}$
+minimum spanning trees according to the Cayley's formula \cite{cayley:trees}).
+However, this is possible only if the weight function is not injective.
+
+\lemman{MST uniqueness}
+If all edge weights are distinct, then the minimum spanning tree is unique.
+
+\proof
+Consider two minimal spanning trees $T_1$ and~$T_2$. According to the previous
+theorem, there are no light edges with respect to neither of them, so by the
+Monotone exchange lemma (\thmref{monoxchg}) there exists a non-decreasing sequence
+of edge exchanges going from $T_1$ to $T_2$. Each exchange in this sequence is
+strictly increasing, because all edge weights all distinct. On the other hand,
+we know that $w(T_1)=w(T_2)$, so the exchange sequence must be empty and indeed
+$T_1$ and $T_2$ must be identical.
+\qed
+
+\rem\thmid{edgeoracle}%
+To simplify the description of MST algorithms, we will expect that the input
+graph has all edge weights distinct. We will also assume that instead of explicit
+edge weights we will be given a comparison oracle, that is a function which answers
+questions ``$w(e)<w(f)$?'' in constant time. Please note that this is without loss
+of generality, because when some edges have identical weights, we can determine their
+relative order by comparing some unique identifiers of these edges and every MST
+of the new graph will be also a MST of the original one.
+In the few cases where we need a more concrete input, we will explicitly say so.
+
+\section{The Red-Blue Meta-Algorithm}
+
+Most MST algorithms can be described as special cases of the following procedure
+(again following \cite{tarjan:dsna}):
+
+\algn{Red-Blue Meta-Algorithm}
+\algo
+\algin A~graph $G$ with an edge comparison oracle (see \thmref{edgeoracle})
+\:In the beginning, all edges are uncolored.
+\:While possible, use one of the following rules:
+\::Pick a cut~$C$ such that its lightest edge is not blue and color it blue. \cmt{Blue rule}
+\::Pick a cycle~$C$ such that its heaviest edge is not red and color it red. \cmt{Red rule}
+\algout Minimum spanning tree of~$G$ consisting of edges colored blue.
+\endalgo
+
+\rem
+This is not a proper algorithm, since the selection of rules to apply is not specified.
+We will however prove that for any such selection the procedure stops with the correct result.
+Also, it will turn out that each of the classical MST algorithms can be stated as a
+specific rule selection strategy of this procedure, which justifies the name
+meta-algorithm for it.
+
+\lemman{Blue lemma}
+When an edge is colored blue in any step of the procedure, it is contained in the minimum spanning tree.
+
+\proof
+\qed
+
+\lemman{Red lemma}
+When an edge is colored red in any step of the procedure, it is not contained in the minimum spanning tree.
+
+\proof
+\qed
+
+\lemman{Colorless lemma}
+When there exists an uncolored edge, then at least one rule can be applied.
+
+\proof
+\qed
+
+\theoremn{Red-Blue correctness}
+For any selection of rules, the Red-Blue procedure stops and the blue edges form
+the minimum spanning tree of the input graph.
+
+\proof
+\qed
+
+
+
 % mention Steiner trees
 % mention matroids
 % sorted weights
index 134ce9f87e3efe682d7c9f4ba3d676ac6f9f45d0..c3adef8886c39401135339d0c35b5a429cdb6deb 100644 (file)
@@ -15,6 +15,8 @@
 \n{$w(e)$}{weight of an edge $e$}
 \n{$V(G)$}{the set of vertices of a graph~$G$}
 \n{$E(G)$}{the set of edges of a graph~$G$}
+\n{MST}{minimal spanning tree \[mstdef]}
+\n{MSF}{minimal spanning forest \[mstdef]}
 }
 
 \endpart