whose time complexity is provably optimal.
In the upcoming chapters, we will explore this colorful universe of MST algorithms.
-We will meet the standard works of the classics, the clever ideas of their successors,
+We will meet the canonical works of the classics, the clever ideas of their successors,
various approaches to the problem including randomization and solving of important
special cases. At several places, we will try to contribute our little stones to this
mosaic.
When $G$ is a graph with distinct edge weights, we will use $\mst(G)$ to denote
its unique minimum spanning tree.
-\rem\id{edgeoracle}%
-To simplify the description of MST algorithms, we will expect that the weights
-of all edges are distinct and that instead of numeric weights (usually accompanied
-by problems with representation of real numbers in algorithms) we will be given
-a comparison oracle, that is a function which answers questions ``$w(e)<w(f)$?'' in
-constant time. In case the weights are not distinct, we can easily break ties by
-comparing some unique edge identifiers and according to our characterization of
-minimum spanning trees, the unique MST of the new graph will still be a MST of the
-original graph. In the few cases where we need a more concrete input, we will
-explicitly state so.
+\paran{Comparison oracles}\id{edgeoracle}%
+To simplify the description of MST algorithms, we will assume that the weights
+of all edges are distinct and that instead of numeric weights we are given a~comparison oracle.
+The oracle is a~function that answers questions of type ``Is $w(e)<w(f)$?'' in
+constant time. This will conveniently shield us from problems with representation
+of real numbers in algorithms and in the few cases where we need a more concrete
+input, we will explicitly state so.
+In case the weights are not distinct, we can easily break ties by comparing some
+unique identifiers of edges. According to our characterization of minimum spanning
+trees, the unique MST of the new graph will still be a~MST of the original graph.
+
+\obs
+If all edge weights are distinct and $T$~is an~arbitrary tree, then for every tree~$T$ all edges are
+either $T$-heavy, or $T$-light, or contained in~$T$.
+
+\paran{Monotone isomorphism}%
Another useful consequence is that whenever two graphs are isomorphic and the
isomorphism preserves the relative order of weights, the isomorphism applies to their MST's as well:
\section{The Red-Blue meta-algorithm}
Most MST algorithms can be described as special cases of the following procedure
-(again following \cite{tarjan:dsna}):
+(again following Tarjan \cite{tarjan:dsna}):
\algn{Red-Blue Meta-Algorithm}\id{rbma}%
\algo
\algout Minimum spanning tree of~$G$ consisting of edges colored blue.
\endalgo
-\rem
+\para
This procedure is not a proper algorithm, since it does not specify how to choose
the rule to apply. We will however prove that no matter how the rules are applied,
the procedure always stops and gives the correct result. Also, it will turn out
We will denote the unique minimum spanning tree of the input graph by~$T_{min}$.
We intend to prove that this is also the output of the procedure.
-\lemman{Blue lemma}\id{bluelemma}%
-When an edge is colored blue in any step of the procedure, it is contained in the minimum spanning tree.
+\paran{Correctness}%
+Let us prove that the meta-algorithm is correct. First we show that the edges colored
+blue in any step of the procedure always belong to~$T_{min}$ and that edges colored
+red are guaranteed to be outside~$T_{min}$. Then we demonstrate that the procedure
+always stops. We will prefer a~slightly more general formulation of the lemmata, which will turn out
+to be useful in the future chapters.
+
+\lemman{Blue lemma, also known as the Cut rule}\id{bluelemma}%
+The lightest edge of every cut is contained in the MST.
\proof
-By contradiction. Let $e$ be an edge painted blue as the lightest edge of a cut~$C$.
+By contradiction. Let $e$ be the lightest edge of a cut~$C$.
If $e\not\in T_{min}$, then there must exist an edge $e'\in T_{min}$ that is
-contained in~$C$ (take any pair of vertices separated by~$C$, the path
+contained in~$C$ (take any pair of vertices separated by~$C$: the path
in~$T_{min}$ joining these vertices must cross~$C$ at least once). Exchanging
$e$ for $e'$ in $T_{min}$ yields an even lighter spanning tree since
-$w(e)<w(e')$. \qed
+$w(e)<w(e')$.
+\qed
-\lemman{Red lemma}\id{redlemma}%
-When an edge is colored red in any step of the procedure, it is not contained in the minimum spanning tree.
+\lemman{Red lemma, also known as the Cycle rule}\id{redlemma}%
+An~edge~$e$ is not contained in the MST iff it is the heaviest on some cycle.
\proof
-Again by contradiction. Suppose that $e$ is an edge painted red as the heaviest edge
-of a cycle~$C$ and that $e\in T_{min}$. Removing $e$ causes $T_{min}$ to split to two
-components, let us call them $T_x$ and $T_y$. Some vertices of~$C$ now lie in $T_x$,
-the others in $T_y$, so there must exist in edge $e'\ne e$ such that its endpoints
-lie in different components. Since $w(e')<w(e)$, exchanging $e$ for~$e'$ yields
-a lighter spanning tree than $T_{min}$.
+The implication from the left to the right follows directly from the Minimality
+theorem: if~$e\not\in T_{min}$, then $e$~is $T_{min}$-heavy and so it is the heaviest
+edge on the cycle $T_{min}[e]+e$.
+
+We will prove the other implication again by contradiction. Suppose that $e$ is the heaviest edge of
+a cycle~$C$ and that $e\in T_{min}$. Removing $e$ causes $T_{min}$ to split
+to two components, let us call them $T_x$ and~$T_y$. Some vertices of~$C$ now lie in~$T_x$, the
+others in~$T_y$, so there must exist in edge $e'\ne e$ such that its endpoints lie in different
+components. Since $w(e')<w(e)$, exchanging $e$ for~$e'$ yields a~spanning tree lighter than
+$T_{min}$.
\qed
\figure{mst-rb.eps}{289pt}{Proof of the Blue (left) and Red (right) lemma}
with some blue path between $x$ and $y$ forms a cycle and it must be the heaviest
edge on this cycle. This holds because all blue edges have been already proven
to be in $T_{min}$ and there can be no $T_{min}$-light edges (see Theorem~\ref{mstthm}).
-In this case we can apply the red rule.
+In this case we can apply the Red rule.
On the other hand, if $y\not\in M$, then the cut formed by all edges between $M$
-and $V(G)\setminus M$ contains no blue edges, therefore we can use the blue rule.
+and $V(G)\setminus M$ contains no blue edges, therefore we can use the Blue rule.
\qed
\figure{mst-bez.eps}{295pt}{Configurations in the proof of the Black lemma}
lemma all other (red) edges are outside~$T_{min}$, so the blue edges are exactly~$T_{min}$.
\qed
-\para
-The Red lemma actually works in both directions and it can be used to characterize
-all non-MST edges, which will turn out to be useful in the latter chapters.
-
-\corn{Cycle rule}\id{cyclerule}%
-An~edge~$e$ is not contained in the MST iff it is the heaviest on some cycle.
-
-\proof
-The implication from the right to the left is the Red lemma. In the other
-direction, when~$e$ is not contained in~$T_{min}$, it is $T_{min}$-heavy (by
-Theorem \ref{mstthm}), so it is the heaviest edge on the cycle $T_{min}[e]+e$.
-\qed
-
\rem
The MST problem is a~special case of the problem of finding the minimum basis
of a~weighted matroid. Surprisingly, when we modify the Red-Blue procedure to
vertices. In each iteration, we let each tree of the forest select the lightest
edge of those having exactly one endpoint in the tree (we will call such edges
the \df{neighboring edges} of the tree). We add all such edges to the forest and
-pAroceed with the next iteration.
+proceed with the next iteration.
\algn{Bor\o{u}vka \cite{boruvka:ojistem}, Choquet \cite{choquet:mst}, Sollin \cite{sollin:mst} and others}
\algo