-\section{Minor-closed graph classes}
-
-The contracting algorithm given in the previous section has been found to perform
-well on planar graphs, but in the general case its time complexity was not linear.
-Can we find any broader class of graphs where the algorithm is still efficient?
-The right context turns out to be the minor-closed graph classes, which are
-closed under contractions and have bounded density.
-
-\defn
-A~graph~$H$ is a \df{minor} of a~graph~$G$ iff it can be obtained
-from a subgraph of~$G$ by a sequence of simple graph contractions (see \ref{simpcont}).
-
-\defn
-A~class~$\cal C$ of graphs is \df{minor-closed}, when for every $G\in\cal C$ and
-its every minor~$H$, the graph~$H$ lies in~$\cal C$ as well. A~class~$\cal C$ is called
-\df{non-trivial} if at least one graph lies in~$\cal C$ and at least one lies outside~$\cal C$.
-
-\example
-Non-trivial minor-closed classes include planar graphs and more generally graphs
-embeddable in any fixed surface. Many nice properties of planar graphs extend
-to these classes, too, most notably the linearity of the number of edges.
-
-\defn\id{density}%
-Let $\cal C$ be a class of graphs. We define its \df{edge density} $\varrho(\cal C)$
-to be the infimum of all~$\varrho$'s such that $m(G) \le \varrho\cdot n(G)$
-holds for every $G\in\cal C$.
-
-\thmn{Density of minor-closed classes}
-A~minor-closed class of graphs has finite edge density if and only if it is
-a non-trivial class.
-
-\proof
-See Theorem 6.1 in \cite{nesetril:minors}, which also lists some other equivalent conditions.
-\qed
-
-\thmn{MST on minor-closed classes \cite{mm:mst}}\id{mstmcc}%
-For any fixed non-trivial minor-closed class~$\cal C$ of graphs, Algorithm \ref{contbor} finds
-the MST of any graph in this class in time $\O(n)$. (The constant hidden in the~$\O$
-depends on the class.)
-
-\proof
-Following the proof for planar graphs (\ref{planarbor}), we denote the graph considered
-by the algorithm at the beginning of the $i$-th iteration by~$G_i$ and its number of vertices
-and edges by $n_i$ and $m_i$ respectively. Again the $i$-th phase runs in time $\O(m_i)$
-and $n_i \le n/2^i$, so it remains to show a linear bound for the $m_i$'s.
-
-Since each $G_i$ is produced from~$G_{i-1}$ by a sequence of edge contractions,
-all $G_i$'s are minors of~$G$.\foot{Technically, these are multigraph contractions,
-but followed by flattening, so they are equivalent to contractions on simple graphs.}
-So they also belong to~$\cal C$ and by the previous theorem $m_i\le \varrho({\cal C})\cdot n_i$.
-\qed
-
-\rem\id{nobatch}%
-The contractive algorithm uses ``batch processing'' to perform many contractions
-in a single step. It is also possible to perform contractions one edge at a~time,
-batching only the flattenings. A~contraction of an edge~$uv$ can be done
-in time~$\O(\deg(u))$ by removing all edges incident with~$u$ and inserting them back
-with $u$ replaced by~$v$. Therefore we need to find a lot of vertices with small
-degrees. The following lemma shows that this is always the case in minor-closed
-classes.
-
-\lemman{Low-degree vertices}\id{lowdeg}%
-Let $\cal C$ be a graph class with density~$\varrho$ and $G\in\cal C$ a~graph
-with $n$~vertices. Then at least $n/2$ vertices of~$G$ have degree at most~$4\varrho$.
-
-\proof
-Assume the contrary: Let there be at least $n/2$ vertices with degree
-greater than~$4\varrho$. Then $\sum_v \deg(v) > n/2
-\cdot 4\varrho = 2\varrho n$, which is in contradiction with the number
-of edges being at most $\varrho n$.
-\qed
-
-\rem
-The proof can be also viewed
-probabilistically: let $X$ be the degree of a vertex of~$G$ chosen uniformly at
-random. Then ${\bb E}X \le 2\varrho$, hence by the Markov's inequality
-${\rm Pr}[X > 4\varrho] < 1/2$, so for at least $n/2$ vertices~$v$ we have
-$\deg(v)\le 4\varrho$.
-
-\algn{Local Bor\o{u}vka's Algorithm \cite{mm:mst}}%
-\algo
-\algin A~graph~$G$ with an edge comparison oracle and a~parameter~$t\in{\bb N}$.
-\:$T\=\emptyset$.
-\:$\ell(e)\=e$ for all edges~$e$.
-\:While $n(G)>1$:
-\::While there exists a~vertex~$v$ such that $\deg(v)\le t$:
-\:::Select the lightest edge~$e$ incident with~$v$.
-\:::Contract~$G$ along~$e$.
-\:::$T\=T + \ell(e)$.
-\::Flatten $G$, removing parallel edges and loops.
-\algout Minimum spanning tree~$T$.
-\endalgo
-
-\thm
-When $\cal C$ is a minor-closed class of graphs with density~$\varrho$, the
-Local Bor\o{u}vka's Algorithm with the parameter~$t$ set to~$4\varrho$
-finds the MST of any graph from this class in time $\O(n)$. (The constant
-in the~$\O$ depends on~the class.)
-
-\proof
-Let us denote by $G_i$, $n_i$ and $m_i$ the graph considered by the
-algorithm at the beginning of the $i$-th iteration of the outer loop,
-and the number of its vertices and edges respectively. As in the proof
-of the previous algorithm (\ref{mstmcc}), we observe that all the $G_i$'s
-are minors of the graph~$G$ given as the input.
-
-For the choice $t=4\varrho$, the Lemma on low-degree vertices (\ref{lowdeg})
-guarantees that at least $n_i/2$ edges get selected in the $i$-th iteration.
-Hence at least a half of the vertices participates in contractions, so
-$n_i\le 3/4\cdot n_{i-1}$. Therefore $n_i\le n\cdot (3/4)^i$ and the algorithm terminates
-after $\O(\log n)$ iterations.
-
-Each selected edge belongs to $\mst(G)$, because it is the lightest edge of
-the trivial cut $\delta(v)$ (see the Blue Rule in \ref{rbma}).
-The steps 6 and~7 therefore correspond to the operation
-described by the Lemma on contraction of MST edges (\ref{contlemma}) and when
-the algorithm stops, $T$~is indeed the minimum spanning tree.
-
-It remains to analyse the time complexity of the algorithm. Since $G_i\in{\cal C}$, we have
-$m_i\le \varrho n_i \le \varrho n/2^i$.
-We will show that the $i$-th iteration is carried out in time $\O(m_i)$.
-Steps 5 and~6 run in time $\O(\deg(v))=\O(t)$ for each~$v$, so summed
-over all $v$'s they take $\O(tn_i)$, which is linear for a fixed class~$\cal C$.
-Flattening takes $\O(m_i)$, as already noted in the analysis of the Contracting
-Bor\o{u}vka's Algorithm (see \ref{contiter}).
-
-The whole algorithm therefore runs in time $\O(\sum_i m_i) = \O(\sum_i n/2^i) = \O(n)$.
-\qed
-
-\rem
-For planar graphs, we can get a sharper version of the low-degree lemma,
-showing that the algorithm works with $t=8$ as well (we had $t=12$ as
-$\varrho=3$). While this does not change the asymptotic time complexity
-of the algorithm, the constant-factor speedup can still delight the hearts of
-its practical users.
-
-\lemman{Low-degree vertices in planar graphs}%
-Let $G$ be a planar graph with $n$~vertices. Then at least $n/2$ vertices of~$v$
-have degree at most~8.
-
-\proof
-It suffices to show that the lemma holds for triangulations (if there
-are any edges missing, the situation can only get better) with at
-least 3 vertices. Since $G$ is planar, $\sum_v \deg(v) < 6n$.
-The numbers $d(v):=\deg(v)-3$ are non-negative and $\sum_v d(v) < 3n$,
-so by the same argument as in the proof of the general lemma, for at least $n/2$
-vertices~$v$ it holds that $d(v) < 6$, hence $\deg(v) \le 8$.
-\qed
-
-\rem\id{hexa}%
-The constant~8 in the previous lemma is the best we can have.
-Consider a $k\times k$ triangular grid. It has $n=k^2$ vertices, $\O(k)$ of them
-lie on the outer face and have degrees at most~6, the remaining $n-\O(k)$ interior
-vertices have degree exactly~6. Therefore the number of faces~$f$ is $6/3\cdot n=2n$,
-ignoring terms of order $\O(k)$. All interior triangles can be properly colored with
-two colors, black and white. Now add a~new vertex inside each white face and connect
-it to all three vertices on the boundary of that face. This adds $f/2 \approx n$
-vertices of degree~3 and it increases the degrees of the original $\approx n$ interior
-vertices to~9, therefore about a half of the vertices of the new planar graph
-has degree~9.
-
-\figure{hexangle.eps}{\epsfxsize}{The construction from Remark~\ref{hexa}}
-
-%--------------------------------------------------------------------------------
-
-\section{Using Fibonacci heaps}
-\id{fibonacci}
-
-We have seen that the Jarn\'\i{}k's Algorithm \ref{jarnik} runs in $\O(m\log n)$ time
-(and this bound can be easily shown to be tight). Fredman and Tarjan have shown a~faster
-implementation in~\cite{ft:fibonacci} using their Fibonacci heaps. In this section,
-we convey their results and we show several interesting consequences.
-
-The previous implementation of the algorithm used a binary heap to store all neighboring
-edges of the cut~$\delta(T)$. Instead of that, we will remember the vertices adjacent
-to~$T$ and for each such vertex~$v$ we will keep the lightest edge~$uv$ such that $u$~lies
-in~$T$. We will call these edges \df{active edges} and keep them in a~heap, ordered by weight.
-
-When we want to extend~$T$ by the lightest edge of~$\delta(T)$, it is sufficient to
-find the lightest active edge~$uv$ and add this edge to~$T$ together with a new vertex~$v$.
-Then we have to update the active edges as follows. The edge~$uv$ has just ceased to
-be active. We scan all neighbors~$w$ of the vertex~$v$. When $w$~is in~$T$, no action
-is needed. If $w$~is outside~$T$ and it was not adjacent to~$T$ (there is no active edge
-remembered for it so far), we set the edge~$vw$ as active. Otherwise we check the existing
-active edge for~$w$ and replace it by~$vw$ if the new edge is lighter.
-
-The following algorithm shows how these operations translate to insertions, decreases
-and deletions on the heap.
-
-\algn{Jarn\'\i{}k with active edges, Fredman and Tarjan \cite{ft:fibonacci}}\id{jarniktwo}%
-\algo
-\algin A~graph~$G$ with an edge comparison oracle.
-\:$v_0\=$ an~arbitrary vertex of~$G$.
-\:$T\=$ a tree containing just the vertex~$v_0$.
-\:$H\=$ a~heap of active edges stored as pairs $(u,v)$ where $u\in T,v\not\in T$, ordered by the weights $w(vw)$, initially empty.
-\:$A\=$ an~auxiliary array mapping vertices outside~$T$ to their active edges in the heap; initially all elements undefined.
-\:\<Insert> all edges incident with~$v_0$ to~$H$ and update~$A$ accordingly.
-\:While $H$ is not empty:
-\::$(u,v)\=\<DeleteMin>(H)$.
-\::$T\=T+uv$.
-\::For all edges $vw$ such that $w\not\in T$:
-\:::If there exists an~active edge~$A(w)$:
-\::::If $vw$ is lighter than~$A(w)$, \<Decrease> $A(w)$ to~$(v,w)$ in~$H$.
-\:::If there is no such edge, then \<Insert> $(v,w)$ to~$H$ and set~$A(w)$.
-\algout Minimum spanning tree~$T$.
-\endalgo
-
-\thmn{Fibonacci heaps} The~Fibonacci heap performs the following operations
-with the indicated amortized time complexity:
-\itemize\ibull
-\:\<Insert> (insertion of a~new element) in $\O(1)$,
-\:\<Decrease> (decreasing value of an~existing element) in $\O(1)$,
-\:\<Merge> (merging of two heaps into one) in $\O(1)$,
-\:\<DeleteMin> (deletion of the minimal element) in $\O(\log n)$,
-\:\<Delete> (deletion of an~arbitrary element) in $\O(\log n)$,
-\endlist
-\>where $n$ is the maximum number of elements present in the heap at the time of
-the operation.
-
-\proof
-See Fredman and Tarjan \cite{ft:fibonacci} for both the description of the Fibonacci
-heap and the proof of this theorem.
-\qed
-
-\thm
-Algorithm~\ref{jarniktwo} with a~Fibonacci heap finds the MST of the input graph in time~$\O(m+n\log n)$.
-
-\proof
-The algorithm always stops, because every edge enters the heap~$H$ at most once.
-As it selects exactly the same edges as the original Jarn\'\i{}k's algorithm,
-it gives the correct answer.
-
-The time complexity is $\O(m)$ plus the cost of the heap operations. The algorithm
-performs at most one \<Insert> or \<Decrease> per edge and exactly one \<DeleteMin>
-per vertex and there are at most $n$ elements in the heap at any given time,
-so by the previous theorem the operations take $\O(m+n\log n)$ time in total.
-\qed
-
-\cor
-For graphs with edge density at least $\log n$, this algorithm runs in linear time.
-
-\rem
-We can consider using other kinds of heaps which have the property that inserts
-and decreases are faster than deletes. Of course, the Fibonacci heaps are asymptotically
-optimal (by the standard $\Omega(n\log n)$ lower bound on sorting by comparisons, see
-for example \cite{clrs}), so the other data structures can improve only
-multiplicative constants or offer an~easier implementation.
-
-A~nice example is a~\df{$d$-regular heap} --- a~variant of the usual binary heap
-in the form of a~complete $d$-regular tree. \<Insert>, \<Decrease> and other operations
-involving bubbling the values up spend $\O(1)$ time at a~single level, so they run
-in~$\O(\log_d n)$ time. \<Delete> and \<DeleteMin> require bubbling down, which incurs
-comparison with all~$d$ sons at every level, so they run in~$\O(d\log_d n)$.
-With this structure, the time complexity of the whole algorithm
-is $\O(nd\log_d n + m\log_d n)$, which suggests setting $d=m/n$, giving $\O(m\log_{m/n}n)$.
-This is still linear for graphs with density at~least~$n^{1+\varepsilon}$.
-
-Another possibility is to use the 2-3-heaps \cite{takaoka:twothree} or Trinomial
-heaps \cite{takaoka:trinomial}. Both have the same asymptotic complexity as Fibonacci
-heaps (the latter even in worst case, but it does not matter here) and their
-authors claim implementation advantages.
-
-\FIXME{Mention Thorup's Fibonacci-like heaps for integers?}
-
-\rem
-For sparse graphs, we can cross-breed this algorithm with the contractive
-Bor\o{u}vka's algorithm: First perform $\log\log n$ steps of contractive
-Bor\o{u}vka, which takes $\O(m\log\log n)$ time and produces a~graph~$G'$
-with $m'\le m$ and $n'\le n/\log n$. Then run Algorithm~\ref{jarniktwo} on~$G'$
-and it finishes in time $\O(m'+n'\log n') = \O(m)$. Finally combine MST edges
-found by both algorithms to a~single tree as in~the Contraction lemma (\ref{contlemma}).
-
-\para Xyzzy.
-
-\FIXME{Describe the heap limitation trick and the $\O(m\beta(m,n))$ algorithm.}
-
-
-