离散数学总结之图论

又到一年期末周,还是好好总结一下吧。
复习材料主要为老师的PPT,可能会参考书上,本文的PPT特指SUSTech CS201 Ming TANG老师于2022春的课件。似乎暴露了自己是哪个学校了呜呜欢迎来找我玩
由于是总结的主要目的是自己复习,所以可能特异性很大。
整理到欧拉路径和欧拉环了。

图的话,

  1. 注意Hall's Marriage Theorem的证明;
  2. 分清楚Euler/hamilton的定义和他们各自的一些定理。

注意Euler path/circuit 是每条恰好通过一次,hamilton path/circuit是每个点恰好经过一次。

基本定义

simple?

simple graph:无重边,无自环
multigraph :有重边,无自环
pseudograph :有重边,有自环
simple path/circuit:不重复经过同一条边
注意:has a path 和 has a simple path 是两码事。 has a path \(\Rightarrow\) has a simple path

complete graph:\(K_n\) a simple graph, 且两两顶点之间均有连边。
cycle:环
wheel:环的基础上加一个点,且该点和所有环上的点均有连边。

bipartite graph: 一个图的所有节点能被分成两部分\(V_1, V_2\),使得每一条边都连接着\(V_1\)中的一个节点和\(V_2\)中的一个节点。
用涂色理论来理解就是可以用两种颜色染色。
complete bipartite graph;\(K_{m,n}\)

n-dimensional hypercube:\(Q_n\)\(2^n\)个点表示长度为n的所有01串。相邻的两点只在01串的一个位置上有不同。
\(Q_n\)的边数为\(E_n\),点数为\(V_n\),则\(E_{n+1} = 2 * E_n + V_n\)

neighborhood, degree

N(v): neighborhood of v. 注意如果v有自环,那自己也是自己的neighbor。
deg(v):degree of v. 注意自环对degree的贡献度是2。
\(deg^{-}(v)\):indegree of v
\(deg^{+}(v)\):outdegree of v

matching

matching: A matching is a subset of E s.t. no two edges are incident with the same vertex.
maximum matching: with maximum number of edges
complete matching: G(V,E), with bipartition\((V_1,V_2)\) matching的数量和二分图一个点集中点的数目相同。

isomorphism

isomorphism: 两个图之间存在one-to-one, onto function,使得边和点的相对关系不被改变。
即转换前a,b两点之间有边,转换后f(a),f(b)之间有边。 其实就是扯一下这两个图看能不能一样。

考点:是不是isomorphism

不是:(graph invariants)1)点数 2)边数 3)度数 4)环
是:画出对应的matrix,通过调整点的顺序,使得两个matrix相同。

connectivity

connectivity: 任意两点之间都有path
connected component:a connected subgraph of G that is not a proper subgraph of another connected subgraph of G.
strongly connected graph:有向图中的概念,任意两点双向联通。
weakly connected graph:有向图中的概念,去掉方向后任意两点联通即可。
cut vertices:去掉这个点,图就不连通了。
cut edges:去掉这些边,图就不连通了。
edge connectivity:\(\lamda(G)\) 最小要割的边数

Euler Paths and Circuit

Euler Path: a simple path containing every edge of G. 即从一个点出发回到另一个点。
Euler circuit: a simple circuit containing every edge of G.即从一个点出发回到同一点。

subgraph, union of graph

subgraph 就是点是点的子集,边是边的子集。
union of graph 就是点的并集,边的并集。

notation

adjacency list; (不能用于有重边的情况)
adjacent matrix;
incidence matrix \(M=[m_{ij}]\), \(m_{ij} = 1\) when edge \(e_j\) is incident with \(v_i\)

常见表达

an edge joins its endpoints.

the edge and its endpoint are incident to (connected to) each other.

一些很多定理

Theorem:(Handshaking Theorem) 无向图中所有点的度数之和等于边数的两倍。

Theorem:无向图中有偶数个顶点具有奇数度。证明考虑上面那个定理。

Theorem:(Hall's Marriage Theorem)二分图\((V_1,V_2)\)有complete matching 当且仅当对\(V_1\)任意子集,有\(|N(A)| \ge |A|\)

\(\Rightarrow\): 显然 (*)
\(\Leftarrow\): strong induction (Basic Step, Inductive hypothesis, Inductive Step)
Inductive step: Graph \(G(W,F)\), with bipartite\((W_1,W_2)\),\(|W_1| = k + 1\) 分两种情况:

(1)for every subset of j \((1 \leq j \leq k)\) elements in \(W_1\), are adjacent to at least j + 1 elements of \(W_2\)

We select a vertex \(v \in W_1\) and an element \(w \in N({v})\). 去掉这两个点后也满足条件。

(2) for some subset \(W_{1}^{\prime}\)of j elements in \(W_1\), are adjacent to exactly j elements of \(W_2\)
那么我们刨掉这j个点,两边剩下的点构成了图\(K = (W_1 - W_{1}^{\prime}, W_2 - W_{2}^{\prime})\)
我们证明对K而言,条件\(|N(A)| \ge |A|\)满足否则和inductive hypothesis矛盾,
则对K而言也存在一个complete matching,将这两个complete matching 合并,就得到了我们想要的complete matching。

The number of differenct paths of length r from \(v_i\) to \(v_j\) equals (i,j)-th entry of \(A^r\).

prove by induction;

Euler circuit iff every vertex has even degree. 前提是multigraph联通图。

Euler path iff exactly two vertices has odd degree. 前提是multigraph连通图。

definition. Hamilton Paths & circuit

hamilton path/circuit:通过每个节点恰好一次的path/circuit。

没有充要条件,目前仅发现了充分条件,有两个。

Dirac's Theorem:

If G is a simple graph with n \(\geq\) 3 vertices such that the degree of every vertex in G is \(\geq n/2\), then G has a Hamilton circuit.
只要每个顶点的度大于n/2.

Ore’s Theorem:

If G is a simple graph with n \(\geq\) 3 vertices such that
deg(u) + deg(v) \(\geq\) n for every pair of nonadjacent vertices, then G has a Hamilton circuit.

Traveling Salesperson Problem (TSP)

Traveling Salesperson Problem (TSP) asks for the shortest route a
traveling salesperson should take to visit a set of cities.
是NP-Complete的。

一些熟悉的算法

Dijkstra

proof by induction.
induction的部分是在第k次迭代,即找到第k近的点的时候。

时间复杂度:\(O(n^2)\)

posted @ 2022-05-27 20:12  爱吃番茄的玛丽亚  阅读(416)  评论(0)    收藏  举报