CS311H: Discrete Mthemtics Grph Theory IV Instructor: Işıl Dillig Instructor: Işıl Dillig, CS311H: Discrete Mthemtics Grph Theory IV 1/25 A Non-plnr Grph Regions of Plnr Grph The plnr representtion of grph splits the plne into regions (sometimes lso clled fces): The complete grph K 5 is not plnr: R4 (outer region) c R1 R3 R2 d Why cn K 5 not e drwn without ny edges crossing? Every plnr grph hs n outer region, which is unounded. Degree of region R, written deg(r), is the numer of edges djcent to R Wht is degree of R1, R2, R3, R4? Instructor: Işıl Dillig, CS311H: Discrete Mthemtics Grph Theory IV 3/25 Instructor: Işıl Dillig, CS311H: Discrete Mthemtics Grph Theory IV 4/25 Euler s Formul Euler s Formul: Let G = (V, E) e plnr connected grph with regions R. Then, the following formul lwys holds: R = E V + 2 A X W B C Y Z All plnr representtions of grph split the plne into the sme numer of regions! Instructor: Işıl Dillig, CS311H: Discrete Mthemtics Grph Theory IV 6/25 1
Proof of Euler s Formul Cse 2: G hs t lest one cycle. Cse 1: G does not hve cycles (i.e., tree) If G hs V nodes, how mny edges does it hve? The proof is y induction on the numer of edges. Bse cse: G hs 3 edges (i.e., tringle) How mny regions does it hve? R = 1 = ( V 1) V + 2 Induction: Suppose Euler s formul holds for plnr connected grphs with e edges nd t lest one cycle. We need to show it lso holds for plnr connected grphs with e + 1 edges nd t lest one cycle. Instructor: Işıl Dillig, CS311H: Discrete Mthemtics Grph Theory IV 7/25 Instructor: Işıl Dillig, CS311H: Discrete Mthemtics Grph Theory IV 8/25 An Appliction of Euler s Formul Crete G y removing one edge from the cycle hs e edges If G doesn t hve cycles, we know R = e V + 2 (cse 1) If G hs cycles, we know from IH tht R = e V + 2 Now, dd edge ck in; G hs e + 1 edges nd V vertices How mny regions does G hve? R + 1 Suppose connected plnr simple grph G hs 6 vertices, ech with degree 4. How mny regions does plnr representtion of G hve? How mny edges? How mny regions? e + 1 V + 2 = R + 1 Instructor: Işıl Dillig, CS311H: Discrete Mthemtics Grph Theory IV 9/25 Instructor: Işıl Dillig, CS311H: Discrete Mthemtics Grph Theory IV 10/25 Seven Bridges of Königserg Euler Circuits nd Euler Pths Given grph G, n Euler circuit is simple circuit contining every edge of G. Town of Königserg in Germny divided into four prts y the Pregel river nd hd seven ridges Euler pth is simple pth contining every edge of G. Townspeople wondered if one cn strt t point A, cross ll ridges exctly once, nd come ck to A Mthemticin Euler herd out this puzzle nd solved it Instructor: Işıl Dillig, CS311H: Discrete Mthemtics Grph Theory IV 11/25 Instructor: Işıl Dillig, CS311H: Discrete Mthemtics Grph Theory IV 12/25 2
Theorem out Euler Circuits Theorem: A connected multigrph G with t lest two vertices contins n Euler circuit if nd only if ech vertex hs even degree. Let s first prove the only if prt. Euler circuit must enter nd leve ech vertex the sme numer of times. But we cn t use ny edge twice Hence, ech vertex must hve even numer of djcent edges. Instructor: Işıl Dillig, CS311H: Discrete Mthemtics Grph Theory IV 14/25 Proof of Sufficiency Now, prove the if prt much more difficult! By strong induction on the numer of edges e Bse cse: e = 2 Induction: Suppose clim holds for every grph with e edges; show it holds for grph with e + 1 edges Consider grph G with e + 1 edges nd where every vertex hs even degree This mens G must contin cycle, sy C Now, remove ll edges in C from G to otin grph G G my not e connected, suppose it consists of connected components G 1,..., G n Ech vertex in cycle hs exctly two djcent edges tht re prt of the cycle Hence, if ll nodes in G hve even degree, then nodes in ech G i must lso hve even degree Oserve: G cnnot e tree why? Instructor: Işıl Dillig, CS311H: Discrete Mthemtics Grph Theory IV 15/25 Instructor: Işıl Dillig, CS311H: Discrete Mthemtics Grph Theory IV 16/25 Now, ech G i is connected nd every vertex hs even degree By IH, ech G i hs n Euler circuit, sy C i We cn now lso uild n Euler circuit for G using these C i s Strt t some vertex v in C, trverse long C until we rech vertex v i in connected component G i Now, trverse C i nd come ck to v i Continue until we re ck t v i This is n Euler circuit ecuse we ve trversed every edge nd hven t repeted ny edges Instructor: Işıl Dillig, CS311H: Discrete Mthemtics Grph Theory IV 17/25 3
Necessry nd Sufficient Conditions for Euler Pths Theorem: A connected multigrph G contins n Euler pth iff there re exctly 0 or 2 vertices of odd degree. Let s first prove necessity: Suppose G hs Euler pth P with strt nd end-points u nd v Cse 1: u, v re the sme then P is n Euler circuit, hence it must hve 0 vertices of degree Cse 2: u, v re distinct Except for u, v, we must enter nd leve ech vertex sme numer of times these must hve even degree Proof of Sufficiency Suppose G hs exctly 0 or 2 vertices with odd degree Cse 1: If no vertices with odd degree, must hve Euler circuit Cse 2: It hs exctly two vertices, sy u, v, with odd degree Now, dd n edge etween u, v to generte grph G All vertices in G hve even degree so G hs Euler circuit This mens G hs Euler pth with strt nd end-points u, v We must leve u one more time thn we enter it, nd we enter v one more time thn we leve it, so they hve odd degree Instructor: Işıl Dillig, CS311H: Discrete Mthemtics Grph Theory IV 19/25 Instructor: Işıl Dillig, CS311H: Discrete Mthemtics Grph Theory IV 20/25 Exmple Does this grph hve Euler pth? Hmilton Pths nd Circuits A Hmilton circuit in grph G is simple circuit tht visits every vertex in G exctly once (except the strt node). Grph with n Euler pth: Note tht ll Hmilton circuits re cycles! A Hmilton pth in grph G is simple pth tht visits every vertex in G exctly once. Instructor: Işıl Dillig, CS311H: Discrete Mthemtics Grph Theory IV 21/25 Instructor: Işıl Dillig, CS311H: Discrete Mthemtics Grph Theory IV 22/25 Are All Euler Circuits Also Hmilton Circuits? Not every Euler circuit is Hmilton circuit: Hmilton vs Euler Circuits Not every Hmilton circuit is n Euler circuit: c d e Does this grph hve Hmilton pth? Find grph tht hs n Euler circuit, ut no Hmilton circuit Instructor: Işıl Dillig, CS311H: Discrete Mthemtics Grph Theory IV 23/25 Instructor: Işıl Dillig, CS311H: Discrete Mthemtics Grph Theory IV 24/25 4
Necessry nd Sufficient Criteri for Hmilton Circuits Unlike Euler circuits, no necessry nd sufficient criteri for identifying Hmilton circuits or pths Exercise: Prove tht grph with vertex of degree 1 cnnot hve Hmilton circuit. Instructor: Işıl Dillig, CS311H: Discrete Mthemtics Grph Theory IV 25/25 5