PDF 文件下载
【离散数学】MIT 6.042J - Fall 2010 - Note for Lecture 8
图片效果
LaTeX \LaTeX LATEX 代码
% !TeX spellcheck = en_EN-EnglishUnitedKingdom
\documentclass{article}
\usepackage{fancyhdr}
\usepackage{graphicx}
\usepackage{titlesec}
\usepackage{titletoc}
\usepackage{listings}
\usepackage{appendix}
\usepackage{bm}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{multirow}
\usepackage{hyperref}
\usepackage{subfig}
\usepackage{url}
\usepackage{cite}
\usepackage{array}
\usepackage[a4paper, left=2.5cm, right=2.5cm, top=2.65cm, bottom=2.54cm]{geometry}
\newtheorem{definition}{Definition}
\newtheorem{theorem}{Theorem}
\newtheorem{lemma}{Lemma}
\newtheorem{example}{Example}
\newcommand\rem{{\rm rem}}
% set the code style
\RequirePackage{listings}
\RequirePackage{xcolor}
\definecolor{dkgreen}{rgb}{0,0.6,0}
\definecolor{gray}{rgb}{0.5,0.5,0.5}
\definecolor{mauve}{rgb}{0.58,0,0.82}
\lstset{
numbers=left,
frame=tb,
aboveskip=3mm,
belowskip=3mm,
showstringspaces=false,
columns=flexible,
framerule=1pt,
rulecolor=\color{gray!35},
backgroundcolor=\color{gray!5},
basicstyle={\ttfamily},
numberstyle=\tiny\color{gray},
morekeywords={},
keywordstyle=\color{blue},
commentstyle=\color{dkgreen},
stringstyle=\color{mauve},
breaklines=true,
breakatwhitespace=true,
tabsize=4
}
\title{\huge \bfseries Mathematics for Computer Science, MIT 6.042J - Fall 2010 - Note for Lecture 8}
\author{\Large Teddy van Jerry}
\date{\today}
\pagestyle{fancy}
\fancyhf{}
\cfoot{\thepage}
\chead{MIT 6.042J Lecture 8 - Graph Theory II: Minimum Spanning Tree}
\begin{document}
\maketitle
{\Large Lecture 8: Graph Theory II: Minimum Spanning Tree}
\section{Walks \& Paths}
\begin{definition}
A \textbf{walk} is a sequence of vertices that are connected by edges.
\end{definition}
$$v_0\rightarrow v_1\rightarrow v_2\rightarrow \cdots \rightarrow v_k$$
$v_0$ is the start, and $v_k$ is the end. The length is $k$.
\begin{definition}
A \textbf{path} is a walk where all vertices are different.
\end{definition}
\begin{lemma}
If there exists walk from $u$ to $v$, then there also exists a path from $u$ to $v$.
\end{lemma}
\begin{proof}
(By contradiction)
Suppose there exists walk from $u$ to $v$. By well ordering principle: walk of minimum length.
$u=v_0\rightarrow v_1\rightarrow\cdots\rightarrow v_k=v$
If $k=0$ or $k=1$, it is obviously true.
If $k\geqslant 2$,
If it is not a path, then there exists $i\neq j$ but $v_i=v_j$,
$u=v_0\rightarrow\cdots\rightarrow v_i = v_j \rightarrow \cdots\rightarrow v_k=v$, but it is a shorter path.
\end{proof}
\section{Connectivity}
\begin{definition}
$u$ and $v$ are \textbf{connected} if there is path from $u$ to $v$.
\end{definition}
\begin{definition}
A graph is \textbf{connected} when every pair of vertices is connected.
\end{definition}
\section{Cycles and Closed Walks}
\begin{definition}
A \textbf{close walk} is a walk which starts and ends at the same vertex.
\end{definition}
\begin{definition}
If $k\geqslant 3$ and $v_0,v_1,\cdots,v_{k-1}$ are all different, then it is called a cycle.
\end{definition}
\section{Tree}
\begin{definition}
A connected and acyclic graph is a \textbf{tree}.
\end{definition}
\begin{definition}
A \textbf{leaf} is a node with degree 1.
\end{definition}
\begin{lemma}
Any connected subgraph of a tree is a tree.
\end{lemma}
\begin{proof}
(By contradiction)
Suppose the connected subgraph is not a tree, so it has cycles. Then the whole graph has the particular cycle, However, the whole graph is a tree without cycles.
\end{proof}
\begin{lemma}
A tree with $n$ vertices has $n-1$ edges.
\end{lemma}
\begin{proof}
(By induction)
$P(n) = $ ``There are $n-1$ edges in a $n$-vertex tree."
Base Case: $P(1)$ is definitely correct.
Inductive Step: Suppose $P(n)$.
Let $T$ be a tree with $n+1$ vertices.
Let $v$ be a leaf of $T$.
Remove $v$, and this creates a connected subgraph without cycles so it is a tree. By $P(n)$, it has $n-1$ leafs.
Reattach $v$, and $T$ has $(n-1)+1=n$ edges.
\end{proof}
\section{Spanning Tree}
\begin{definition}
A \textbf{spanning tree(ST)} of a connected graph is a subgraph that is tree with the same vertices of the graph.
\end{definition}
\begin{theorem}
Every connected graph has a spanning tree.
\end{theorem}
\begin{proof}
(By contradiction)
Assume that a connected graph $G$ that has no spanning tree.
Let $T$ be a connected subgraph of $G$ with the same vertices as $G$ and with the smallest number of edges as possible.
We know $T$ is not a connected tree, so it has at least a cycle.
Suppose $T$ does not contain edge $e$ in one cycle, then the same path still exists between the two vertices of $e$.
So all vertices in $G$ are still connected after removing $e$ from $T$.
\end{proof}
\section{Weighed Minimum Spanning Tree}
\begin{definition}
The \textbf{minimum spanning tree(MST)} of an edge-weighed graph G is the ST with the smallest possible sum of edge weight.
\end{definition}
Algorithm:
Grow a subgraph one edge at a time, at each step: Add a minimum weight edge that keeps the subgraph acyclic.
\begin{lemma}
Let S consists of the first edges selected by the Algorithm. Then there exists MST $T=(V,E)$ for G such that $S\subseteq E$.
\end{lemma}
\begin{proof}
(By induction)
$P(m) = $ ``$\forall G, \forall S$ consisting of the selected edges, $\exists$ MST $T=(V,E)$ of $S$ such that $S\subseteq E$".
Base case: $m=0$, so $S = \varnothing$ obviously true.
Inductive Step: Assume that $P(m)$.
Let $e$ denote the $(m+1)$st selected edge.
Let $S$ denote the first $m$ selected edges.
By $P(m)$: Let $T^* = (V,E^*)$ be a MST such that $S\subseteq E^*$.
Case $e\in E^*$: $S\cup \{e\}\subseteq E^* \Rightarrow P(m+1)$
Case $e\notin E^*$:
Alg $\Rightarrow S\cup \{e\}$ has no cycle.
$T^*$ is a MST $\Rightarrow (V, E^*\cup \{e\})$ has a cycle.
So this cycle must has an edge $e' \in E^*-S$.
Alg could have selected $e$ or $e' \Rightarrow$ weight of $e \leqslant$ weight of $e'$.
Swap $e$ and $e'$ in $T$. Let $T^{**} = (V,E^{**}), E^{**}=(E^*-\{e\})\cup \{e'\}$
$T^{**}$ is acyclic because removed $e'$ from the only cycle in $T^*\cup \{e\}$.
$T^{**}$ is connected because $e'$ was removed but it was in a cycle.
$T^{**}$ combines all vertices in $G$.
Weight $T^{**} \leqslant$ Weight of $T^*$, and $T^*$ is a MST.
$\therefore$ $T^{**}$ is a MST.
\end{proof}
\begin{theorem}
For any connected weighed graph G, the algorithm produces a minimum spanning tree.
\end{theorem}
\begin{proof}
$\#V=n$
1) If $<n-1$ edges are picked, then exists edge in $E - S$ $v$ that can be added without creating a cycle such that $S\subseteq E$.
2) Once $m=n-1$, we know $S$ is an MST.
\end{proof}
\section*{Appendix}
~
This note is written in \LaTeX.
\LaTeX\ code in my blog: \url{https://blog.csdn.net/weixin_50012998/article/details/113844810}\\
The webpage of the video: \url{https://www.bilibili.com/video/BV1zt411M7D2?p=8}
\end{document}
% Copyright 2021 Teddy van Jerry
ALL RIGHTS RESERVED © 2021 Teddy van Jerry
欢迎转载,转载请注明出处。