]> mj.ucw.cz Git - saga.git/commitdiff
Classical ones.
authorMartin Mares <mj@ucw.cz>
Thu, 17 Jan 2008 21:20:36 +0000 (22:20 +0100)
committerMartin Mares <mj@ucw.cz>
Thu, 17 Jan 2008 21:20:36 +0000 (22:20 +0100)
biblio.bib
mst.tex

index 71b600951e02e4300acfbe125be4aba017bf03ea..446a32730768da4e320234ed5534f741e3484615 100644 (file)
   year={1889},
   pages={376--378}
 }
+
+@article{ dijkstra:mst,
+  title={{A note on two problems in connexion with graphs}},
+  author = "Dijkstra, E. W.",
+  journal={Numerische Mathematik},
+  volume={1},
+  number={1},
+  pages={269--271},
+  year={1959},
+  publisher={Springer}
+}
+
+@article{ prim:mst,
+  author = "Prim, R. C.",
+  title = "Shortest connection networks and some generalizations",
+  journal = "Bell System Technical Journal",
+  volume = "36",
+  year = "1957",
+  pages={567--574},
+}
+
+@article{ choquet:mst,
+  title={{Etude de certains r{\'e}seaux de routes (in French)}},
+  author={Choquet, Gustave},
+  journal={Comptes-rendus de l'Académie des Sciences},
+  volume={206},
+  pages={310},
+  year={1938}
+}
+
+@incollection { sollin:mst,
+  title={{Le trace de canalisation (in French)}},
+  author={Sollin, M.},
+  booktitle={Programming, Games, and Transportation Networks},
+  editor={Berge, C. and Ghouilla-Houri, A.},
+  publisher={Wiley, New York},
+  year={1965}
+}
diff --git a/mst.tex b/mst.tex
index 61ab3f892c1a4a88b37bd5fc6ff2b1b5b825a892..f5d935c51583889e7a60601f651d14eca9d3bfd9 100644 (file)
--- a/mst.tex
+++ b/mst.tex
@@ -271,8 +271,68 @@ are colored, so by the Blue lemma all blue edges are in~$T_{min}$ and by the Red
 lemma all other (red) edges are outside~$T_{min}$, so the blue edges are exactly~$T_{min}$.
 \qed
 
+\section{Classical algorithms}
 
+The three classical MST algorithms can be easily stated in terms of the Red-Blue meta-algorithm.
 
+\algn{Kruskal \cite{kruskal:mst}}
+\algo
+\algin A~graph~$G$ with an edge comparison oracle.
+\:Sort edges of~$G$ by their increasing weight.
+\:$T\=\emptyset$. \cmt{an empty spanning subgraph}
+\:For all edges $e$ in their sorted order:
+\::If $T+e$ is acyclic, add~$e$ to~$T$.
+\::Otherwise drop~$e$.
+\algout Minimum spanning tree~$T$.
+\endalgo
+
+\proof
+During the course of the algorithm, $T$ is a forest with all edges blue. Adding~$e$ to~$T$
+in step~4 applies the Blue rule on the cut separating two components of~$T$ ($e$ is the lightest,
+because all other edges of the cut have not been considered yet). Dropping~$e$ in step~5 corresponds
+to the red rule on the cycle found ($e$~must be the heaviest, since all other edges of the
+cycle have been already processed). At the end of the algorithm, all edges have been colored,
+so~$T$ must be the~MST.
+\qed
+
+\algn{Jarn\'\i{}k \cite{jarnik:ojistem}, Prim \cite{prim:mst}, Dijkstra \cite{dijkstra:mst}}
+\algo
+\algin A~graph~$G$ with an edge comparison oracle.
+\:$T\=$ a single-vertex tree containing any vertex of~$G$.
+\:While there are vertices outside $T$:
+\::Pick the lightest edge $uv$ such that $u\in V(T)$ and $v\not\in V(T)$.
+\::$T\=T+uv$.
+\algout Minimum spanning tree~$T$.
+\endalgo
+
+\proof
+In every step of the algorithm, $T$ is always a blue tree. Step~4 corresponds to applying
+the Blue rule to a cut between~$T$ and the rest of the given graph. We need not care about
+the remaining edges, since for a connected graph the algorithm always stops with the right
+number of blue edges.
+\qed
+
+\algn{Bor\accent23uvka \cite{boruvka:ojistem}, Choquet \cite{choquet:mst}, Sollin \cite{sollin:mst} and others}
+\algo
+\algin A~graph~$G$ with an edge comparison oracle.
+\:$T\=$ a forest consisting of vertices of~$G$ and no edges.
+\:While $T$ is not connected:
+\::For each component $T_i$ of~$T$, choose the lightest edge $e_i$ from the cut
+   separating $T_i$ from the rest of~$T$.
+\::Add all $e_i$'s to~$T$.
+\algout Minimum spanning tree~$T$.
+\endalgo
+
+\proof
+Again $T$ is a blue forest, because every addition of some edge~$e_i$ to~$T$ is a straightforward
+application of the Blue rule. It remains to show that adding the edges simultaneously does not
+produce a cycle.
+\FIXME{Finish}
+\qed
+
+\algn{Contracting version of Bor\accent23uvka's algorithm}
+
+% G has to be connected
 % mention Steiner trees
 % mention matroids
 % sorted weights