哥伦比亚大学-离散数学-笔记-第9-12章-3
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Discrete Mathematics Lecture Notes
Chapter11:Graph Theory
Scribe:Denis Tchaouchev
December11,2017
1Definitions
•A graph is a collection of nodes,vertices,and edges.
–In a directed graph(digraph)↵={a,b}={b,a}= •A walk is a sequence of alternating vertices and edges.
•A trail is a walk with no repeated vertices.
•A circuit is a closed trail(starts and stops at the same place).•A Eulerian circuit is a circuit containing every edge.
•A Eulerian trail is a trail containing every edge.
•A Eulerian graph is a graph containing a Eulerian circuit.
Figure1:Examples of Eulerian Circuits(Wendy Sparks)
1
2Konigsberg Bridge Problem
Figure2:The Konigsberg Bridge Problem
The Konigsberg Bridge Problem asks if it is possible tofind a route,be-ginning at any location,that crosses every bridge and returns to its original starting point.Think of the bridges as edges and the land as vertices.
Euler’s Theorem:A connected(9a path between every vertex)undirected graph G has a Eulerian circuit if and only if every vertex in G has an even degree.
G has a Eulerian trail if and only if G has exactly two vertices of odd degree. 3Travelling Salesman Problem
Figure3:Examples of Hamiltonian cirucit/path(Robert Almazan)•A Hamiltonian circuit is a circuit that visits each vertex at least once.•A Hamiltonian trail is a trail that visits each vertex at least once.
2
Theorem:If G is a simple connected graph with n 3vertices and if the degree of each vertex is greater than n 2,then G has a Hamiltonian circuit.
It is more di cult to find Hamiltonian circuits/trails than Euler circuits/trails.•A weighted graph is a graph G (v,E,w )such that w ⇤E !R where w (e )is the weight.The weight is the ”cost”to travel from one vertex to another.
Figure 4:Sample TSP (Wikimedia Commons)
The Travelling Salesman Problem:A travelling salesperson wants to find the quickest way to visit n di ↵erent cities and return to the starting city.In other words,how can the minimum cost Hamiltonian circuit be found?Look at cycles.
How many Hamiltonian circuits exist for a connected graph k n ?There are P (n,n )=n !ways to pick starting node and choose paths back-to back.How-ever,we must divide this by n because the path contains n cycles.So there are n !n =(n 1)!2
Hamiltonian circuits on k n .As of now there is no e cient solution,every possible path needs to be enumerated to guarantee that a path is the fastest.This is an example of an NP-hard problem,or a problem whose solution can be verified in polynomial time.It is unknown whether the problem is in P ,or the set of problems that can be solved in polynomial time.If the problem were not in P it would imply that P =NP .If one were to find a polynomial time solution to TSP it would imply that P =NP
We saw one example of a polynomial time algorithm and solution that can be verified in polynomial time with the method of computing a determinant via Gaussian elimination.This can be done in cubic time using two subroutines,elimination,and backsubstitution since the determinant of an upper triangular matrix is the same as the determinant of the original matrix.Leibniz’s formula sums over all permutations in S n but the problem can be solved in polynomial time,not factorial time.The solution can also be verified in polynomial time
3