Mohamed G. Gouda CS 313K Fall 2012 Homework 3 1. A connected planar graph G has 20 vertices. What is the maximum number of edges that G can have? What is the maximum number of regions that G can have? Sol: Let n be the number of vertices in G, e be the number of edges in G, and r be the number of regions in G. From Euler's Corollary, e =< 3n - 6 = 3*20 - 6 = 54 Thus, emax = 54 From Euler's Formula, r = 2 - n + e =< 2 - n + emax = 2 - 20 + 54 = 36 Thus, rmax = 36 2. Let G be a planar graph that has n vertices, e edges, r regions, and k (connected) components. Show that the Euler's Formula for G can be written as: n-e+r = k+1. (Note that if G is connected, then k = 1 and Euler's Formula is degenerated to n-e+r = 2.) Sol: The i-th component in G, i = 1, ..., k, is a connected planar graph. And so it satisfies Euler's Formula: n.i - e.i + r.i = 2 where n.i is the number of vertices in the i-th component, e.i is the number of edges in the i-th component, and r.i is the number of edges in the i-th component. Summing these k formulas together, we get: (sum over i, n.i) - (sum over i, e.i) + (sum over i, r.i) = 2*k (1) But, we have: (sum over i, n.i) = n (2) (sum over i, e.i) = e (3) (sum over i, r.i) = r + (k-1) (4) Note that the (sum over i, r.i) counts the outside region k times whereas this region is counted only once in r. Therefore, (sum over i, r.i) = r + (k-1) in (4). Substituting (2), (3), and (4) in (1), we get: n - e + r = k+1 Another Sol: Let the k components of G be G.1, G.2, ..., G.k. Form a new connected planar graph G' by adding one edge between vertices in components G.i and G.(i+1) for every i, i = 1, 2, ..., k-1. Graph G' is connected and planar and has n vertices, (e+k-1) edges, and r regions, where r is also the number of regions in the original graph G. Euler's Formula for G' is as follows: n-(e+k-1)+r = 2 Then, n-e+r = k+1 This formula can be regarded as Euler's Formula for graph G. Third Sol: Prove the formula (n-e+r = k+1) by induction on k. Let P(k) be the predicate (n-e+r = k+1). Base Case: k=1: P(1) <=> n-e+r = 2 <=> {Euler's Formula} T Induction Step: For k >= 1, P(k) => P(k+1) T => {Let G be a graph that has n vertices, e edges, r regions, and k+1 components. This G can be viewed as composed of two subgraphs, G' and G''. Subgraph G' has n' vertices, e' edges, r' regions, and k components. Subgraph G'' has n'' vertices, e'' edges, r'' regions, and 1 component.} (n=n'+n'') and (e=e'+e'') and (r=r'+r''-1) and (n''-e''+r'' = 2) => {Induction Hypothesis: Applying P(k) on G'} (n=n'+n'') and (e=e'+e'') and (r=r'+r''-1) and (n''-e''+r'' = 2) and (n'-e'+r'= k+1) => {Arithmetics} (n-e+r = k+2) => {Definition of P(k+1)} P(k+1) 3. Let G be a connected planar graph with n vertices (where n >= 4), e edges (where e >= 4), r regions, and no cycle of length 3 or less. Show that (e =< 2n - 4) Sol: Because e >= 4 and G has no cycle of length 3 or less, the rdegree of each region in G is at least 4. From the Region Handshake Theorem, 2e >= (sum over r.i, rdeg(r.i)) >= 4r e >= 2r (1) From Euler's Formula, r = 2-n+e (2) From (1) and (2), e >= 2*(2-n+e) >= 4 - 2n + 2e e =< 2n - 4 4. Let A, B, and C be arbitrary sets, and let ^ denote the set intersection operator and * denote the Cartesian product operator. Show, by contradiction, that (A^B = {}) => ((A*C)^(B*C) = {}). Sol: (A^B = {}) and (Exist (x,y) in ((A*C)^(B*C))) => {Definition of ^} (A^B = {}) and ((x,y) in (A*C)) and ((x,y) in (B*C)) => {Definition of *} (A^B = {}) and (x in A) and (y in C) and (x in B) and (y in C) => {Definition of ^} (A^B = {}) and (x in A^B) => F 5. Let A, B, and C be arbitrary sets and let (A sub B) denote the predicate (A is a subset of B). Show, by two direct inference proofs, that (C sub A^B) <=> (C sub A) and (C sub B) Sol: Proving =>: (x in C) => {Definition of (C sub A^B)} (x in A^B) => {Definition of ^} (x in A) and (x in B) Proving <=: (x in C) => {Definition of (C sub A) and (C sub B)} (x in A) and (x in B) => {Definition of ^} x in (A^B) 6. Let A and B be two arbitrary sets and let ^ denote the set intersection operator and - denote the set difference operator. Show, by a two-sided proof, that (A-(A-B)) = (A^B) Sol: (x in (A-(A-B))) <=> {Definition of -} (x in A ^ not(A-B)) <=> {Definition of -} (x in A ^ not(A ^ not(B))) <=> {De-Morgan's law} (x in A ^ (not(A) v B)) <=> {Distribution of ^ over v} (x in (A ^ not(A)) v (A ^ B)) <=> {A ^ not(A) = {}} (x in {} v (A ^ B)) <=> {{} v A = A} (x in (A^B))