当前位置:文档之家› 哥伦比亚大学-离散数学-笔记-第9-12章-3

哥伦比亚大学-离散数学-笔记-第9-12章-3

Discrete Mathematics Lecture NotesChapter11:Graph TheoryScribe:Denis TchaouchevDecember11,20171Definitions•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)12Konigsberg Bridge ProblemFigure2:The Konigsberg Bridge ProblemThe 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 ProblemFigure3: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.2Theorem: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)!2Hamiltonian 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 =NPWe 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 time3by checking that the value of x satisfies Ax=b.What is unclear is whether there exists a polynomial time solution to the travelling salesman problem that avoids enumerating all Hamiltonian circuits.4Trees and Cayley’s Formula•A tree is an undirected graph in which any2vertices are connected by exactly one edge.Figure5:A tree•A spanning tree is a subgraph that includes all vertices with the mini-mum number of edges.Can be found using Djikstra’s algorithm.Figure6:A spanning tree(Wikimedia Commons Cayley’s Formula:For every positive integer n,the number of trees on n labeled vertices is n n 2Proof(Summary of Prufer):Let N={1,2,...,n}be the set of nodes in a tree.The number of paths of length n 2in N is n n 2,so we mustfind a bijection between this set and the set of trees on n labeled vertices to show that there are n n 2trees.To map a labeled tree into a sequence of length n 2,continuously remove the lowest vertex until only two are left,while adding each vertex to a list as it is removed.4To map a sequence to a labelled tree,find the smallest number in N that is not in the sequence and attach its vertex it to the vertex of thefirst number in the sequence,then remove thefirst number in the sequence.Repeat until there are no numbers left in the sequence.This will reconstruct a tree from the sequenceSince each sequence can be mapped to a labelled tree and vice versa,there is a bijection between the set of sequences of length n 2and the number of trees on n labelled vertices.5Planar GraphsFigure7:A planar graphIs there a way to draw a same graph(same vertices)without any edges cross-ing?A simple connected graph is planar if it can be drawn without any edges crossing.The drawing is called an embedding.A graph is bipartite if it can be partitioned into two disjoint sets S1,S2 such that for every edge,the endpoint e1is in S1and e2is in S2.Figure8:Bipartite graphs(Wolfram MathWorld) Euler’s Theorem of Graphs:If G is a connected planar graph with r regions,v vertices,and e edges,then v+r=e+2.Proof:By induction.Base case v=1,r=1,e=0.So1+1=0+2!2=2. Inductive Step:e=k edges,assume v+r=e+2holds.Show for k+1edge. Two cases:51.Both vertices that the new edge is incident to are already on graph,so anew region is formed.v+(r+1)=(e+1)+2.Since we assume v+r=e+2 true,this holds.2.A new pendant vertex(by itself)is formed,with a new edge,but no newregion.(v+1)+r=(e+1)+2.Since we assume v+r=e+2true,this holds as well.6。

相关主题