PDF 文件下载
【离散数学】MIT 6.042J - Fall 2010 - Note for Lecture 6
图片效果
这次图片是直接在 Acrobat 导出为 png 的。以前截图处理确实太麻烦了。😂
English | 中文 |
---|---|
vertex/node | 顶点 |
edge | 边 |
adjacent | 邻接(顶点与顶点的关系) |
incidence | 关联(顶点与边的关系) |
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 6}
\author{\Large Teddy van Jerry}
\date{\today}
\pagestyle{fancy}
\fancyhf{}
\cfoot{\thepage}
\chead{MIT 6.042J Lecture 6 - Graph Theory and Coloring}
\begin{document}
\maketitle
{\Large Lecture 6: Graph Theory and Coloring}
\section{Issue}
Men have more opposite-gender partners than women in America or not?
One book claimed (University of Chicago) on average in US, men have 74\% more opposite-gender partners then women from a survey.
A report (ABC News) said it is 233\% from a small survey.
So which one is closer to the actual situation?
\section{Graphs}
\begin{definition}
A \textbf{graph} G is a pair of sets (V, E) where V is a nonempty set of items called vertices or nodes and E is a set of 2-item subset of V called edges.
\end{definition}
\begin{definition}
Two nodes $x_i$ and $x_j$ is \textbf{adjacent} if $\{x_i,x_j\}\in E$.
\end{definition}
\begin{definition}
An edge $e\in \{x_i,x_j\}$ is \textbf{incident} to $x_i$ and $x_j$.
\end{definition}
\begin{definition}
The number of edges incident to a node is called the \textbf{degree} of a node.
\end{definition}
\begin{definition}
A graph is \textbf{simple} if it has no loops or multiple edges.
\end{definition}
\section{Solve of the issue}
Nodes represent people and edges represent the opposite-gender relationship.
The average edge is the average opposite-gender partners one gender has.
\begin{itemize}
\item In America, $|V|\approx 300m$.
\item Men nodes $|V_m|\approx 147.6m$,
\item Women nodes $ |V_w|\approx 152.4m $.
\item $E =\ ??$
\end{itemize}
Let $A_m = $ average \# of opposite-gender partners for men,
let $A_w = $ average \# of opposite-gender partners for women,
what is $A_m / A_w$?
$$A_m = \frac{\sum^{x\in V_m}deg(x)}{|V_m|} = \frac{|E|}{|V_m|}$$
$$A_w = \frac{\sum^{x\in V_w}deg(x)}{|V_w|} = \frac{|E|}{|V_w|}$$
$$\therefore \frac{A_m}{A_w} = \frac{\dfrac{|E|}{|V_m|}}{\dfrac{|E|}{|V_w|}} = \frac{|V_w|}{|V_m|} = 1.0325$$
\section{A graph coloring problem}
\begin{definition}
Given a graph G and K colors, assign a color to each node so adjacent nodes get different colors.
\end{definition}
\begin{definition}
The minimum of K for which such a coloring exists is the \textbf{chromatic number} of the G $(\chi(a))$.
\end{definition}
In computer science, we don't want to run into such NP-complete problems which are easy to check but difficult to figure out a fast algorithm so far.
\subsection{Basic Coloring Algorithm}
For $G:(V,E)$
\begin{enumerate}
\item Order the nodes $V_1,V_2,\cdots ,V_n$
\item Order the colors $C_1,C_2,\cdots,C_n$
\item For $i=1,2,\cdots,n$,\\
Assign the lowest legend color to $V_i$.
\end{enumerate}
Different orderings result in different numbers.
\subsection{Greedy Algorithm}
\begin{theorem}
If every node in G has degree $\leqslant$ d, the basic algorithm uses at most $d+1$ colors for G.
\end{theorem}
\begin{proof}
(By induction)
I.H. $P(n)$ ($n$ is the node number)
Base Case: $n=1 \Rightarrow 0$ edge, $d=1$
Inductive Step: Assume $P(n)$ is true for induction.
Let $G$ be any $(n+1)$-nodes graph. Let $d$ be the max number in $G$.
Order of the nodes $V_1,V_2,\cdots ,V_n,V_{n+1}$.
Remove $V_{n+1}$ from $G$ to create $G'=(V',E')$.
$G'$ has max degree $\leqslant d$ and $n$ nodes so $P(n)$ says Basic Alg uses $\leqslant d+1$ colors for $V_1,V_2,\cdots ,V_n$.
Let's call its neighbors in $G$ $u_1,u_2,\cdots, u_d$,
with $\leqslant d$ neighbors.
$$V_{n+1} \text{ has } \leqslant d\text{ neighbors} \Rightarrow \exists \text{ color in} \{C_1,C_2,\cdots,C_{n+1}\} \text{not used by any neighbor. Give }V_{n+1}\text{ that color.}$$
$$\Rightarrow \text{Basic Alg uses } \leqslant d+1\text{ colors on } G \Rightarrow P(n+1)$$
\end{proof}
\begin{definition}
A graph $G:(V,e)$ is \textbf{bipartite} if the V can be split into $V_L, V_R$ so that all the edges connect a node in $V_L$ to a node in $V_R$.
\end{definition}
\section*{Appendix}
~
This note is written in \LaTeX.
\LaTeX\ code in my blog: \url{https://blog.csdn.net/weixin_50012998/article/details/113814493}\\
The webpage of the video: \url{https://www.bilibili.com/video/BV1zt411M7D2?p=6}
\end{document}
% Copyright 2021 Teddy van Jerry
ALL RIGHTS RESERVED © 2021 Teddy van Jerry
欢迎转载,转载请注明出处。