Graph theory - Introduction

download Graph theory - Introduction

of 48

description

Selected topics from Graph theory - Ralph Grimaldi, Chapter 11

Transcript of Graph theory - Introduction

  • An Introduction to Graph TheoryChapter 11

  • Chapter 11 An Introduction to Graph Theory11.1 Definitions and ExamplesUndirected graphDirected graphisolated vertexadjacentloopmultipleedgessimple graph: an undirected graph without loop or multiple edgesdegree of a vertex: number of edges connected(indegree, outdegree)G=(V,E)

  • Chapter 11 An Introduction to Graph Theory11.1 Definitions and Examplesxypath: no vertex can be repeated a-b-c-d-etrail: no edge can be repeat a-b-c-d-e-b-dwalk: no restriction a-b-d-a-b-cclosed if x=yclosed trail: circuit (a-b-c-d-b-e-d-a, one draw without lifting pen)closed path: cycle (a-b-c-d-a)abcdelength: number of edges inthis (path,trail,walk)

  • Chapter 11 An Introduction to Graph Theory11.1 Definitions and Examplesaxbremove any cycle on the repeatedverticesDef 11.4 Let G=(V,E) be an undirected graph. We call G connected if there is a path between any two distinct vertices of G.abcdeabcdedisconnected withtwo components

  • Chapter 11 An Introduction to Graph Theory11.1 Definitions and ExamplesDef. 11.6multigraph of multiplicity 3multigraphs

  • Chapter 11 An Introduction to Graph Theory11.2 Subgraphs, Complements, and Graph Isomorphismabcdeabcdebcdeacdspanning subgraph V1=Vinduced subgraphinclude all edges of E in V1

  • Chapter 11 An Introduction to Graph Theory11.2 Subgraphs, Complements, and Graph IsomorphismDef. 11.11 complete graph: KnabcdeK5Def. 11.12 complement of a graphG Gabcdeabcde

  • Chapter 11 An Introduction to Graph Theory11.2 Subgraphs, Complements, and Graph IsomorphismTheorem: Any graph of six vertices contains a K3 or K3.(In a party of six, There exists 3 people who are eithermutually acquainted or mutually inacquainted.)5 is not enough.abcdeFor 6 people, let's look from the point ofview of a:From the pigeonhole principle, there are3 who know a or 3 who does not know a. ab c dab c dK3 or K3.K3 or K3.

  • Chapter 11 An Introduction to Graph Theory11.2 Subgraphs, Complements, and Graph IsomorphismEx. 11.7 Instant Insanity, 4 cubes, each of the six faces on acube is painted with one of the colors, red (R), white (W),blue (B), or Yellow (Y). The object is to place the cubes in acolumn of four such that all four colors appear on each of thefour sides of the column.W R Y WYB(1)B B W YRY(2)R B Y BRW(3)W R B YWW(4)There are (3)(24)(24)(24)=41472 possibilities to consider.the bottom cube6 faces with 4 rotations

  • Chapter 11 An Introduction to Graph Theory11.2 Subgraphs, Complements, and Graph IsomorphismW R Y WYB(1)B B W YRY(2)R B Y BRW(3)W R B YWW(4)RWYB131124234432Each edge correspondsto a pair of opposite faces.RWYB1234RWYB2413YBRWBWBYWRYRRYWB(1)(2)(3)(4)Consider the subgraph of opposite column.

  • Chapter 11 An Introduction to Graph Theory11.2 Subgraphs, Complements, and Graph IsomorphismGraph Isomorphism1234abcdw x y z

  • Chapter 11 An Introduction to Graph Theory11.2 Subgraphs, Complements, and Graph IsomorphismEx. 11.8qrwzxyutvabcdefghija-q c-u e-r g-x i-z b-v d-y f-w h-t j-s, isomorphicEx. 11.9degree 2 vertices=2degree 2vertices=3Can you think of an algorithm for testing isomorphism?

  • Chapter 11 An Introduction to Graph Theory11.3 Vertex Degree: Euler Trails and Circuitsdegree 1 vertex: pendant vertexTheorem 11.2Corollary 11.1 The number of vertices of odd degree must be even.Ex. 11.11 a regular graph: each vertex has the same degreeIs it possible to have a 4-regular graph with 10 edges?2|E|=4|V|=20, |V|=5 possible (K5)with 15 edges?2|E|=4|V|=30 not possible

  • 11.3 Vertex Degree: Euler Trails and CircuitsChapter 11 An Introduction to Graph TheoryEx. 11.12 The Seven Bridge of Konigsbergarea aarea barea darea cabcdFind a way to walk about the city so as to crosseach bridge exactly once and then return to thestarting point.

  • 11.3 Vertex Degree: Euler Trails and CircuitsChapter 11 An Introduction to Graph TheoryDef. 11.15 Let G=(V,E) be an undirected graph or multigraphwith no isolated vertices. Then G is said to have an Euler circuitif there is a circuit in G that traverses every edge of the graph exactly once. If there is an open trail from a to b in G and thistrail traverses each edge in G exactly once, the trail is called anEuler trail.Theorem 11.3 Let G=(V,E) be an undirected graph or multigraphwith no isolated vertices. Then G has an Euler circuit if and onlyif G is connected and every vertex in G has even degree.abcdAll degrees are odd. Hence no Euler circuitfor the Konigsberg bridges problem.

  • 11.3 Vertex Degree: Euler Trails and CircuitsChapter 11 An Introduction to Graph Theoryproof of Euler circuit theorem:Euler circult connected and even degreevfor other verticessfor starting vertexobviousconnected and even degree Euler circuitby induction on the number of edges. e=1 or 2e=nfind any circuit containing ss

  • 11.3 Vertex Degree: Euler Trails and CircuitsChapter 11 An Introduction to Graph TheoryCorollary 11.2 An Euler trail exists in G if and only if G isconnected and has exactly two vertices of odd degree.two odd degree verticesa badd an edgeTheorem 11.4 A directed Euler circuit exists in G if and only ifG is connected and in-degree(v)=out-degree(v) for all vertices v.one in, one outCan you think of an algorithm to construct an Euler circuit?

  • 11.3 Vertex Degree: Euler Trails and CircuitsChapter 11 An Introduction to Graph TheoryEx. 11.13 Complete Cycles (DeBruijn Sequences)If n is a positive integer and N=2n, a cycle of length N of 0's and 1's is called a complete cycle if all possible subsequences of 0's and 1's oflength n appear in this cycle.n=1 01,n=2 0011,n=3 00010111,00011101n=4 16 complete cyclesIn generalFor n=3:00011011vertex set={00,01,10,11}a directed edge from x1x2 to x2 x3abcdefghFind an Euler circuit:00111010abgfcdeh 00101110abcdefgh

  • Chapter 11 An Introduction to Graph Theory11.4 Planar GraphsDef. 11.17 A graph (or multigraph) G is called planar if G can bedrawn in the plane with its edges intersecting only at vertices of G.Such a drawing of G is called an embedding of G in the plane.Ex. 11.14,11.15 K1,K2,K3,K4 are planar, Kn for n>4 are nonplanar.K4K5applications: VLSI routing, plumbing,...

  • 11.4 Planar GraphsChapter 11 An Introduction to Graph TheoryDef. 11.18 bipartite graph and complete bipartite graphs (Km,n)K4,4K3,3 is not planar.Therefore, any graph containing K5or K4,4 is nonplanar.

  • 11.4 Planar GraphsChapter 11 An Introduction to Graph TheoryDef. 11.19 elementary subdivision (homeomorphic operation)uwuvwG1 and G2 are called homeomorphic if they are isomorphicor if they can both be obtained from the same loop-free undirected graph H by a sequence of elementary subdivisions.abcdeabcdeabcdeabcdeTwo homeomorphic graphs are simultaneously planar or nonplanar.

  • 11.4 Planar GraphsChapter 11 An Introduction to Graph TheoryTheorem 11.5 (Kuratowski's Theorem) A graph is planar ifand only if it contains a subgraph that is homeomorphic toeither K5 or K3,3.Ex. 11.17 Petersen graphabcdefghija subgraph homeomorphic to K3,3jadefbghciPetersen graph is nonplanar.

  • 11.4 Planar GraphsChapter 11 An Introduction to Graph TheoryK4R1R2R3R4A planar graph divides the planeinto several regions (faces), one of them is the infinite region.Theorem 11.6 (Euler's planar graph theorem)For a connected planar graph or multigraph: v-e+r=2numberof verticesnumberof edgesnumberof regionsv=4,e=6,r=4, v-e+r=2

  • 11.4 Planar GraphsChapter 11 An Introduction to Graph Theoryproof: The proof is by induction on e.e=0 or 1v=1r=1e=0v=1r=2e=1v=2r=1e=1v-e+r=2Assume that the result is true for any connected planar graph ormultigraph with e edges, whereNow for G=(V,E) with |E|=k+1 edges, let H=G-(a,b) for a,b in V.Since H has k edges, And, Now consider the situation about regions.

  • 11.4 Planar GraphsChapter 11 An Introduction to Graph Theorycase 1: H is connecteda(=b)a(=b)abab

  • 11.4 Planar GraphsChapter 11 An Introduction to Graph Theorycase 2: H is disconnectedabababH1H2abH1H2

  • 11.4 Planar GraphsChapter 11 An Introduction to Graph Theorydegree of a region (deg(R)): the number of edges traversed in a shortest closed walk about the boundary of R.R1R2R3R4R5R6R7R8two different embeddingsdeg(R1)=5,deg(R2)=3deg(R3)=3,deg(R4)=7deg(R5)=4,deg(R6)=3deg(R7)=5,deg(R8)=6abghgfdaabcdfgh

  • 11.4 Planar GraphsChapter 11 An Introduction to Graph TheoryOnly a necessary condition, not sufficient.

  • 11.4 Planar GraphsChapter 11 An Introduction to Graph TheoryEx. 11.18 For K5, e=10,v=5, 3v-6=9
  • 11.4 Planar GraphsChapter 11 An Introduction to Graph TheoryA dual graph of a planar graphabcdefg123456165423An edge in G corresponds with an edge in Gd.It is possible to have isomorphic graphs with respective duals thatare not isomorphic.

  • 11.4 Planar GraphsChapter 11 An Introduction to Graph TheoryDef. 11.20 cut-set: a subset of edges whose removal increasethe number of componentsEx. 11.21abcdefghcut-sets: {(a,b),(a,c)},{(b,d),(c,d)},{(d,f)},...a bridgeFor planar graphs, cycles in one graph correspond to cut-setsin a dual graphs and vice versa.

  • Chapter 11 An Introduction to Graph Theory11.5 Hamilton Paths and Cyclesa path or cycle that contain every vertexUnlike Euler circuit, there is no knownnecessary and sufficient condition for a graph to be Hamiltonian.Ex. 11.24 abcdefghiThere is a Hamilton path, but no Hamilton cycle.an NP-complete problem

  • Chapter 11 An Introduction to Graph Theory11.5 Hamilton Paths and CyclesEx. 11.25xyyyyxxxyystart labeling from here4x's and 6y's, since x and y mustinterleave in a Hamilton path (or cycle),the graph is not HamiltonianThe method works only for bipartite graphs.The Hamilton path problem is still NP-complete when restrictedto bipartite graphs.

  • Chapter 11 An Introduction to Graph Theory11.5 Hamilton Paths and CyclesEx. 11.26 17 students sit at a circular table, how many sittings arethere such that one has two different neighbors each time?Consider K17, a Hamilton cycle in K17 corresponds to a seatingarrangements. Each cycle has 17 edges, so we can have (1/17)17(17-1)/2=8 different sittings.1234561716151,2,3,4,5,6,...,17,11234561716151,3,5,2,7,4,...,17,14,16,11234561716151,5,7,3,9,2,...,16,12,14,114

  • Chapter 11 An Introduction to Graph Theory11.5 Hamilton Paths and Cyclescase 1.v v1 v2 ...vmcase 2. v1 v2 ...vk v vk+1 ...vmcase 3. v1 v2 ...vm v

  • Chapter 11 An Introduction to Graph Theory11.5 Hamilton Paths and CyclesEx. 11.27 In a round-robin tournament each player plays everyother player exactly once. We want to somehow rank the playersaccording to the result of the tournament. not always possible to have a ranking where a player in a certainposition has beaten all of the opponents in later positionsa b cbut by Theorem 11.7, it is possible to list the players such thateach has beaten the next player on the list

  • Chapter 11 An Introduction to Graph Theory11.5 Hamilton Paths and CyclesProof: First prove that G is connected. If not,xyn1 verticesn2 verticesa contradiction

  • Chapter 11 An Introduction to Graph Theory11.5 Hamilton Paths and CyclesAssume a path pm with m verticesv1 v2 v3 ... vmcase 1. either v v1 or vm vcase 2. v1,v2,...,vm construct a cycleeither v1 v2 v3 ... vmor v1 v2 v3 ...vt-1 vt ... vmotherwise assume deg(v1)=k, then deg(vm)
  • Chapter 11 An Introduction to Graph Theory11.5 Hamilton Paths and CyclesProof: Assume G does not contain a Hamilton cycle. We add edges to G until we arrive a subgraph H of Kn where H has no Hamiltoncycle, but for any edge e not in H, H+e has a Hamilton cycle.For vertices a,b wher (a,b) is not an edge of H. H+(a,b) has aHamilton cycle and (a,b) is part of it.

  • Chapter 11 An Introduction to Graph Theory11.5 Hamilton Paths and Cyclesa(=v1) b(=v2) v3 ... vnIf (b,vi) is in H, then (a,vi-1) cannot be in H. Otherwise,b vi vn a vi-1 vi-2 v3 is a Hamilton cycle in H.

  • Chapter 11 An Introduction to Graph Theory11.5 Hamilton Paths and Cycles

  • Chapter 11 An Introduction to Graph Theory11.5 Hamilton Paths and CyclesA related problem: the traveling salesman problemabcde34135432Find a Hamilton cycle of shortest total distance.2graph problem vs. Euclidean plane problem (computational geometry)Certain geometry properties (for example, the triangle inequality) sometimes (but not always) make it simpler.For example, a-b-e-c-d-a with total cost=1+3+4+2+2=12.

  • Chapter 11 An Introduction to Graph Theory11.5 Hamilton Paths and CyclesTwo famous computational geometry problems.1. closest pair problem: which two points are nearest2. convex hull problemthe convex hull

  • Chapter 11 An Introduction to Graph Theory11.6 Graph Coloring and Chromatic PolynomialsDef. 11.22 If G=(V,E) is an undirected graph, a proper coloringof G occurs when we color the vertices of G so that if (a,b) is anedge in G, then a and b are colored with different colors. Theminimum number of colors needed to properly color G is calledthe chromatic number of G and is written (G).bcdea3 colors are needed.a: Redb: Greenc: Redd: Bluee: RedIn general, it's a very difficult problem (NP-complete).(Kn)=n(bipartite graph)=2

  • Chapter 11 An Introduction to Graph Theory11.6 Graph Coloring and Chromatic PolynomialsA related problem: color the map where two regions arecolored with different colors if they have same boundaries.GR eBBRYFour colors are enough for any map. Remaina mystery for a century. Proved with the aid of computer analysis in 1976.abcdfabcdef

  • Chapter 11 An Introduction to Graph Theory11.6 Graph Coloring and Chromatic PolynomialsP(G,): the chromatic polynomial of G=the number of waysto color G with colors.Ex. 11.31 (a) G=n isolated points, P(G,)=n.(b) G=Kn, P(G,)=(-1)(-2)...(-n+1)=(n)(c) G=a path of n vertices, P(G,)=(-1)n-1.(d) If G is made up of components G1, G2, ..., Gk, then P(G,)=P(G1,)P(G2,)...P(Gk,).Ex. 11.32eGeGeG'coalescing the vertices

  • Chapter 11 An Introduction to Graph Theory11.6 Graph Coloring and Chromatic PolynomialsTheorem 11.10 Decomposition Theorem for Chromatic Polynomials.If G=(V,E) is a connected graph and e is an edge, then P(Ge,)=P(G,)+P(G'e,).eGeGeG'coalescing the verticesabIn a proper coloring of Ge:case 1. a and b have the same color: a proper coloring of G'e case 2. a and b have different colors: a proper coloring of G.Hence, P(Ge,)=P(G,)+P(G'e,).

  • Chapter 11 An Introduction to Graph Theory11.6 Graph Coloring and Chromatic PolynomialsEx. 11.33 e=-P(Ge,)P(G,)P(G'e,)P(G,)=(-1)3-(-1)(-2)=4-43+62-3Since P(G,1)=0 while P(G,2)=2>0, we know that (G)=2.Ex. 11.34 =-=-2eeP(G,)=(4)-2(4)= (-1)(-2)2(-3)(G)=4