Discrete Structures II, MATH 340. Instructor O. Kharlampovich. The edges in an undirected graph connect pairs of vertices.

Size: px
Start display at page:

Download "Discrete Structures II, MATH 340. Instructor O. Kharlampovich. The edges in an undirected graph connect pairs of vertices."

Transcription

1 1 Undirected graphs Discrete Structures II, MATH 340 Instructor O. Kharlampovich The edges in an undirected graph connect pairs of vertices. A graph is a pair G = (V, E) where V = {v 1, v 2,, v n } is the set of vertices and E = {e 1, e 2,, e m } is the set of edges. Each edge e i has two endpoints u, v V. If there is an edge e i with endpoints u and v then we say that u and v are adjacent, and that e i is incident with u and v. When u = v the edge e i is called a loop. We use V (G) to denote the vertices of G and E(G) to denote the edges of G. For each vertex v V (G) let deg(v) denote the number of edges incident with v (counting loops twice). This is called the degree of v. We say that G is simple if there are no loops in E(G) and at most one edge between any pair of vertices. In this case, an edge between u and v is denoted (u, v). In this course, we will use the word graph to denote a simple graph. This is the area where our terminology most differs from the Rosen text. A walk (in text: path) in a graph is a sequence of vertices v 1, v 2,..., v k such that v i 1 and v i are adjacent for all i. A trail (in text: simple path)is a walk without repeated edges. A path (this important concept has no name in the text) is a trail without repeated vertices. A closed walk or circuit (in text: circuit or cycle) is a walk v 0,..., v k where v k = v 0. A k cycle is a closed walk of length k with no repeated vertices except v 0 = v k. Notation C k. A graph G is connected if for all vertices u, v there is a path from u to v Lemma 1.1. Every walk from u to v contains a path from u to v. 1

2 Proof. Let w be a walk from u to v and let p = v 0, e 1, v 1, e 2,..., e k, v k be the shortest walk from u = v 0 to v = v k that uses only edges in w. We claim that p is a path. Suppose that p is not a path, and that there are vertices i, j such that i < j and v i = v j. Then p = v 0, e 1,..., v i, e j+1, v j+1,..., v k is a shorter path from u to v using only edges in w. This contradicts our choice of p. Hence all the vertices in p are distinct and p is a path. Lemma 1.2. If there is a path from u to v and a path from v to w then there is a path from u to w. Proof. Form a walk from u to w that starts with the path from u to v followed by the path from v to w. By Lemma 1.1 this walk contains a path from u to w. Definition 1.3 (connected). We say that two vertices u, v are connected if there exists a path from u to v. A graph G = (V, E) is connected if each pair of vertices is connected. Theorem 1.4. Let R be the relation on V whereby (u, v) R if and only if u is connected to v. Then R is an equivalence relation. Proof. Reflexive: For every v there the path of length 0 from v to itself, so (v, v) R. Symmetric: If there is a path from u to v then reversing the order of vertices and edges in the path gives a path from v to u. Hence (u,v) R implies (v,u) R. Transitivity: If (u, v) R and (v, w) R then there is a path from u to v and from v to w. By the preceding lemma there is a path from u to w and (u, w) R. Definition 1.5 (components, isolated). The components of G are the maximal connected subgraphs of G (Figure 1). These correspond to the equivalence classes of the connectedness relation. A vertex with degree 0 is an isolated vertex. Every isolated vertex is in a separated component. Lemma 1.6. Adding an edge to a graph reduces the number of components by at most one. Hence removing an edge from a graph increases the number of components by at most one. Proof. If u are v are in the same component then adding the edge e = (u, v) has no effect on the number of components. If u and v are in different components then adding the edge e = (u, v) combines the component containing u and the component containing v, thereby reducing the number of components by one. 2

3 Figure 1: 2 connected components Corollary 1.7. A graph with n vertices and k edges has at least n - k components. Proof. We prove this by induction on k. Let P (k) denote the proposition: if G has n vertices and k edges then G has at least n k components. Then P (0) is true since if k = 0 the graph would consist of n isolated vertices. Suppose that m 0 and that P (m) is true. Suppose that G has m + 1 edges. Remove an edge to give a graph with m edges, which by P (m) has at least n m components. Adding the edge again give a graph with at most n (m + 1) components. Definition 1.8 (Subgraph). Let G = (V, E) and H = (V, E ) be graphs. We say that G is a subgraph of H if V V and E E. Definition 1.9 (Spanning). H is called a spanning subgraph if V = V. Definition 1.10 (Induced). Suppose that U V and that E is the set of edges in E that have both endpoints in U. Then H = (U, E ) is called the subgraph of G induced by U (Figure 2). v 1 v 2 v 3 v 4 v 1 v 2 v 3 Figure 2: The right graph is an induced subgraph of the left graph on the set U = {v 1, v 2, v 3 }. Definition 1.11 (adjacency matrix). Let G be a finite graph with vertices v 1, v 2,..., v n. The adjacency matrix A for G is the n n matrix where A ij equals the number of edges with endpoints v i, v j (Figure 3). A is symmetric. For simple graphs, A ij {0, 1} Theorem The number of distinct walks from v i to v j of length k equals (A k ) ij. By definition, A 0 is the identity matrix. 3

4 v 1 v 3 A = v 5 v 4 v Figure 3: The adjacency matrix corresponding to a graph. Proof. We prove this by induction on k. Let W k (u, v) denote the set of walks from u to v. Let P (k) denote the proposition: W k (v i, v j ) = (A k ) ij. P (1) is true since there is only one distinct (trivial) walk of length zero from each vertex to itself. Suppose P (m) is true for m 0. For each l, let W m+1 (v i, v lj, v j ) denote the set of walks of length m + 1 from v i to v j that finish with an edge from v l to v j. Then each walk of length (m + 1) from v i to v j is in exactly one of the sets W m+1 (v i, v l, v j ), so W m+1 (v i v j ) = l W m+1 (v i, v l, v j ). How many walks are then in each set W m+1 (v i, v l, v j )? Each of these walks consists of a walk of length m from v i to v l followed by one of the edges from v l to v j. Hence the number of different walks in W m+1 (v i, v l, v j ) equals the number of walks of length m from v i to v l multiplied by the number of edges from v l to v j. That is, W m+1 (v i, v l, v j ) = (A m ) ij (A 1 ) lj = (A m+1 ) ij. Thus P (m + 1) is true and by induction, P (k) is true for all k 0. A 2 = A3 = Figure 4: Powers of A corresponding to Figure 3 Corollary G is connected if and only if n k=1 Ak has no zero elements. Proof. If G is connected then for each v i, v j there is a path from v i to v j. Let k be the length of the path. Since the vertices on the path are distinct the path contains at most n vertices, so k n. Thus (A k ) ij 1 while (A k ) ij 0 for all k k. It follows that ( n k=1 Ak ) > 0. Suppose that G is not connected. Then there are vertices v i and v j such that there is no path from v i to v j. It follows that (A k ) ij = 0 for all k. 4

5 2 Directed Graphs Definition 2.1 (Digraph, arcs). A directed graph (or digraph) is defined in the same way as an undirected graph, except the edges are oriented and have beginnings and endings. The edges in directed graphs are sometimes called arcs. Definition 2.2 (head, tail). If e i is an directed edge from u to v we say that u is the tail or initial vertex of e i and that v is the head or end vertex of e i. Definition 2.3 (In-degree, Out-degree). For each vertex v V (G) let deg + (v) denote the number of edges starting at v and let deg (v) denote the number of vertices ending at v. We say that deg + (v) is the out degree of v and deg (v) is the in degree of v. A (directed) walk in a directed graph is a sequence of vertices v 1, v 2,..., v k such that (v i 1, v i ) E for all i. A (directed) trail is a walk without repeated edges. A (directed) path is a trail without repeated vertices. A graph G is strongly connected if for all u, v there is a path from u to v and a path from v to u. The strong components of a digraph are the maximally strong connected subgraphs. We can construct adjacency matrices for digraphs and Theorem 1.12 holds in this case as well. Lemma 2.4. If G = (V, E) is a directed graph then E = v V deg + (v) = v V deg (v). Proof. We count the number of edges E two ways. For each vertex u there are deg + (u) edges starting at u, and every edge starts at exactly one vertex. Thus E = u V deg+ (u). For each vertex v there are deg (v) vertices ending at v and every edge ends at exactly one vertex. Thus E = v V deg (v). 3 Trees Definition 3.1 (K-cycle). A k cycle is a walk v 0, v1,..., v k v 0 such that all v 0, v 1,..., v k 1 are distinct (called a simple circuit in Rosen text). Definition 3.2 (tree). A tree is a connected graph without cycles. Definition 3.3 (forest). A forest is a graph without cycles. The connected components of a forest are trees. Definition 3.4 (leaf). A leaf is a vertex of degree 1. Lemma 3.5. Every finite tree with at least two vertices has at least two leaves. 5

6 Proof. Let P be the longest path in the tree and let u and v be its endpoints. If deg(u) > 1 then u is either adjacent to a different vertex of P (giving a cycle) or u is adjacent to a vertex not on P (so that we can make a longer path.) Either case leads to a contradiction. Hence, deg(u) = 1 and by the same argument deg(v) = 1. Theorem 3.6. A tree with n vertices has n - 1 edges. Proof. Let P (n) denote: if T is a tree with n vertices then T has n 1 edges. Then P (1) is true. Suppose that m 1 and that P (m) is true. Let T be a tree with m + 1 vertices. One of these is a leaf. Remove it. This gives a tree with one less vertex and, by P (m), m 1 edges. That means that T has m edges. Definition 3.7 (Cut edge). An edge e is a graph G is a cut edge if removing e increases the number of connected components of G. Theorem 3.8. A connected graph G is a tree if and only if every edge is a cut edge. Proof. Suppose G is a tree. Then G has n 1 edges. For any edges e, G e has n vertices and n 2 edges, so by Lemma 2.4, G e has at least two components. It follows that every edge e is a cut edge. Now suppose that every edge is a cut-edge. We use a proof by contradiction. Suppose that G contained a cycle, and let e = {u, v} be an edge on this cycle. This cycle contains a path from u to v in the graph G e. Let w be an arbitrary vertex in G. Since G is connected, there is a path P w from w to u. If this path does not go through e then w is connected to u is G e. If the path does go through e, then removing the last edge gives a path from w to v in G e. As there is already a path from v to u this implies that there is a path from w to u. Hence G e is connected and e is not a cut-vertex. Lemma 3.9. If G is a tree then there is a unique path between any two vertices. Proof. We use a proof by contradiction. Suppose there are two paths P 1, P 2 between two vertices u, v. Let e be an edge of P 1 that is not an edge of P 2. There is therefore a walk formed from P 1 e and P 2 that connects the endpoints of e. This walk contains a path between the endpoints of e which, together with e, creates a cycle in G. Definition 3.10 (Spanning tree). A spanning tree is a spanning subgraph which is a tree. Lemma Every finite connected graph contains a spanning tree. Proof. Remove edges that don t disconnect the graph. What remains is a minimally disconnect subgraph: a tree. 6

7 Lemma Let G be a finite connected graph and let e be an edge of G. Then there is a spanning tree of G that contains e. Proof. Repeatedly apply the following: find a cycle and remove an edge of this cycle that does not equal e. Since every cycle contains at least two edges, we can remove an edge each time we find a cycle. Removing an edge in the cycle doesn t disconnect the graph. The process repeats until we have obtained a spanning tree and this spanning tree will contain e. By the same argument we have that e is a cut edge if and only if e is contained in every spanning tree. Theorem (Cayley) Let K n be a complete graph on n vertices (every two vertices are adjacent). The number of spanning trees in K n is n n 2. Proof. The first proof we present, due to Prüfer (1918), uses the algorithm that produces a code that characterizes the tree. Any such code uniquely determines a tree. Let T be a tree with V (T ) = {1, 2,..., n}. We use the order on the vertex set. Let T 1 = T, for T i let b i denote the least leaf of T i, let a i be the vertex adjacent to b i and let T i+1 = T i {(a i, b i )}. We get the code {a 1,..., a n 1 } but the last number is always n = a n 1. Therefore {a 1,..., a n 2 } is the code for T (Figure 3). v 4 v 5 v 7 v 6 v 2 v 1 v 10 v 8 v 3 v 9 b 1 = 3 a 1 = 2 b 2 = 4 a 2 = 2 b 3 = 2 a 3 = 1 b 4 = 5 a 4 = 1 b 5 = 6 a 5 = 7 b 6 = 7 a 6 = 1 b 7 = 1 a 7 = 10 b 8 = 8 a 8 = 10 b 9 = 9 a 9 = 10 Figure 5: A tree T and the step-by-step application of Prüfer s algorithm. Applying the algorithm in reverse shows how to construct a tree if we have a Prüfer code {a 1,..., a n 2 }: Write a n 1 = n. For i = 1,..., n 1 let b i be 7

8 the least vertex not in {a i,..., a n 1 } {b 1,..., b i 1 }. Then {(b i, a i )} will be the edge set of a spanning tree (Figure 3). b 1 = 3 a 1 = 2 (3,2) b 2 = 4 a 2 = 2 (4,2) b 3 = 2 a 3 = 1 (2,1)..... Figure 6: The reverse of prüfer s algorithm. In general, any sequence of n 2 numbers from {1, 2,..., n} uniquely determines a tree on this set. There are n n 2 such sequences, proving the theorem. We now give a second proof of Cayley s theorem by counting since it is useful to have been seen this method. We remind the definition of a multinomial coefficient. Recall the binomial coefficient: (x + y) n = ( n i ) = Now the multinomial coefficient: n i=0 ( n i n! i!(n i)! ) x i y n i (x x k ) n = ( ) n x r1 r 1,..., r 1... xr k k k where the sum is over all k-tuples (r 1,..., r k ) with sum n. ( ) n n! = r 1,..., r k r 1!... r k! (x x k ) n = (x x k ) n 1 (x x k ) ( ) n k ( ) n 1 = r 1,..., r k r 1,..., r i 1,... r k i=1 Denote the number of spanning trees in K n for which the degrees of the vertices are d 1,..., d n by t(n, d 1,..., d n ). We may assume without loss of generality that d 1 d, d n = 1. Then, n d i = 2(n 1) = 2 E i=1 n (d i 1) = n 2 i=1 8

9 Theorem The number of spanning trees of K n having degrees of vertices d 1,..., d n is t(n, d i,..., d n ) ( ) n 2 (n 2)! = = d 1 1,..., d n 1 n i=1 (d i 1)! Proof. Take the leaf v n corresponding to d n = 1. It is joined to some vertex v j of deg d i 2 and any of the remaining vertices are candidates. Therefore t(n, d i,..., d n ) = n 1 t(n 1, d 1,..., d i 1,..., d n ) i=1 It is trivial to check by hand that ( t(n, d i,..., d n ) = n 2 d 1 1,..., d n 1 for n = 3. Since the numbers on the lefthand side and on the righthand side satisfy the same recurrence relation, it follows by induction that equality is true for all n. ( t(n, d i,..., d n ) = n 2 d 1 1,..., d n 1 We find now by putting x 1 =... = x n = 1 in the multinomial formula ( ) n 2 = n d 1 1,..., d n 1 n 2 which gives another proof of Cayley s theorem. Definition 3.15 (K-clique). A k clique in a graph is a subgraph isomorphic to K k (a set of pairwise adjacent vertices). w(g) denotes the size of the largest clique in G. Definition 3.16 (Anti-clique). An independent k-set anti clique of size k is a complement of a k-clique (k vertices no two of which are adjacent). α(g) denotes the maximum size of the anti-clique. Definition 3.17 (Distance). The distance between two vertices u and v is the length of the shortest path between u and v Definition 3.18 (Diameter). The diameter of G is the maximum distance between all pairs of vertices (but don t confuse the diameter with the length of the longest path). ) ) Definition 3.19 (Girth). The girth of G is the length of its shortest cycle. Every forest has infinite girth. 9

10 u v Figure 7: A cyclic graph whose diameter is 4 but where the longest path between u and v is 7. 4 Coloring Figure 8: The diameter of a n m grid is n + m 2. Definition 4.1 (K-coloring). A legal k-coloring is an assignment of k-colors to vertices of G such that any two adjacent colors have different colors. f : V [K] = {1, 2,..., k} Definition 4.2 (Chromatic number). Let G be a finite graph. The chromatic number χ(g) is the minimal number k such that G admits k-coloring. Example 4.3 (Exam Scheduling). Suppose we have n different courses: V = courses. The vertices u and v are adjacent if there exists a student taking both classes. Colors correspond to exam times. Example 4.4 (Mobile telephone frequencies). A similar problem occurs when assigning calling frequencies for mobile telephone towers. Two towers should not broadcast on the same frequency if it possible that someone might be in the range of both towers. Definition 4.5 (bipartite). A graph is bipartite if it is 2-colorable. (χ(g) = 2) V = V 1 V 2 There do not exist edges (u, v) such that u, v V 1 or u, v V 2. 10

11 Lemma 4.6. Every tree is bipartite. Proof. Let P (n) be the proposition: a tree of n vertices is bipartite. P (1) is true trivially. Suppose that m 1 and that P (m) is true. Let T be a tree with m + 1 vertices. Then T contains a leaf x. Let y be the vertex adjacent to x and let T be the tree formed by removing x from T. Then T has a 2-coloring and we can extend this to T by coloring x a different color than y. Lemma 4.7. If G is a bipartite graph, then every cycle in G has even length. Proof. Let C = a 1, a 2, a 3,..., a m, a 1 be a cycle of G and consider any 2-coloring of G. These colors must alternate around the cycle, so the cycle has to be of even length. Theorem 4.8. A connected graph G is bipartite if and only if it contains no cycles of odd length. Proof. We just proved that if G is bipartite then every cycle has odd length. We now prove the converse. Suppose that G contains no cycles of odd length. Let T be a spanning tree for G, and suppose we have a 2-coloring of T. We need to show that this will also be a two coloring of G. Suppose that it is not. That is, there are vertices u, v that are assigned the same color in T but that are adjacent in G. Let P be the path in T from u to v. Then P alternates between the two colors and so is of even length. However, then P, together with the edge {u, v}, gives a cycle of odd length in G. This is a contradiction. Hence the 2-coloring of T is also a 2-coloring of G and the graph is bipartite. Corollary 4.9. A graph G (not necessarily connected) is bipartite if and only if it contains no cycles of odd length. 5 Eulerian walks Definition 5.1 (Eulerian walk/circuit). A eulerian walk is a walk that uses edge exactly once. A eulerian circuit is a circuit (closed walk) with the same property. Example 5.2 (Seven Bridges of Königsberg). A famous early problem in graph theory was based on the geography of the city of Königsberg, Prussia (now Kaliningrad, Russia). The city is spread over two islands which are joined together and with the mainland by seven bridges. Mathematicians of the time sought to discover whether it is possible to construct a route which crosses each bridge once (that is, a Eulerian walk). The solution, by Leonhard Euler in 1736, is considered the first theorem of graph theory. 11

12 Figure 9: Three ways of viewing the city of Königsberg and the seven bridges problem (graphic from Bridges of Königsberg). Theorem 5.3. An Eulerian walk exists if and only if at most two vertices of the multigrahp are of odd degree. An eulerian circuit in a connected graph exists if and only if all vertices have even degrees. Definition 5.4 (Eulerian graph). A graph G is called Eulerian if it has an Eulerian circuit. Theorem 5.5. A graph G has an Eulerian trial if and only if it has at most 2 vertices with odd degrees. G is Eulerian if and only if every vertex has even degree. Proof. We begin with an observation: Let G be a graph and suppose that every vertex in G has even degree. If we remove a cycle C from G, then vertices of the connected components of {G C} will also have even degrees The algorithm is thus: find a cycle, remove it, and construct by induction an Eulerian circuit in each connected component of G C beginning with a vertex in C. Combining these circuits, construct an Eulerian circuit in G. v 1 v 2 Figure 10: Construct a path beginning from one vertex with odd degree (v 1 ) and ending at the other (v 2 ). If G has exactly two vertices of odd degree, then begin with a vertex of odd degree. If on the way we get a cycle C, remove C and apply induction to construct an Eulerian trial in G C Otherwise we come to the second vertex with odd degree, constructing path P. Connected components of {G P } are Eulerian graphs. 12

13 Fleury Algorithm. We begin in an arbitrary vertex. At each step, we move across an edge whose deletion doesn t result in more than one connected component unless we don t have a choice. Then we delete this edge from G and adjoin it to the Eulerian circuit. At the end of the algorithm there are no edges left. An Euler circuit in a digraph (directed graph) is a directed circuit that uses each edge once. Lemma 5.6. A digraph G = (V, E) has an Eulerian circuit if and only if it is weakly connected: v V : deg + (v) = deg (v) Example 5.7. If in a digraph G there exists a walk from u to v then there exists a path from u to v. If there exists a path from u to v and from v to w then there exists a path from u to w. This is an equivalence relation (Theorem 1.4). Every G is a union of disjoint strongly connected components. Figure 11: An example of a graph with two clearly delineated connected components. Definition 5.8 (Component graph). Once we have the strong components of G, we can construct the component graph. This has one vertex for each strong component and an edge between two vertices if the corresponding components are connected by an edge. Definition 5.9 (Acyclic digraph). An acyclic digraph is a digraph without cycles Definition 5.10 (Sink, source). A sink is a vertex with zero out degree. A source is a vertex with zero in degree. Example An acyclic digraph has a sink and a source. Proof. Let P be the longest path, then if P goes from u to v, then u is a source and v is a sink. There does not exist a path from w / P to u, because then some other path {P + w}. Figure 12: The component graph corresponding to Figure 11 13

14 6 Hamilton paths/cycle Definition 6.1. A Hamilton path is a path that uses all vertices of the graph (exactly once). A Hamilton cycle is a cycle that uses all vertices exactly once. The decision problem to determine if G has a Hamilton path is NP-Complete. Definition 6.2 (Hamiltonian). A graph is called Hamiltonian if it has a Hamilton cycle. Example 6.3 (Hamilton, 1865). The dodecahedron graph is hamiltonian (Figure 13). In fact, all the platonic solids (the cube, octahedron, dodecahedron, tetrahedron, and icosahedron) are hamiltonian. Figure 13: A graph of the dodecahedron and its hamiltonian path (graphic from path). Example 6.4. Every complete graph is hamiltonian. Theorem 6.5 (Ore, 1960). If G is a graph of order n 3 such that for all pairs of distinct nonadjacent vertices x and y, deg(x) +deg(y) n, then G is hamiltonian. Proof. Suppose the result is not true. Then there exists a maximal nonhamiltonian graph G of order n 3 that satisfies the conditions of the theorem. That is, G is non-hamiltonian, but for any pair of nonadjacent vertices x and y in G, the graph G + xy is Hamiltonian. Since p 3, the graph G is not complete. Now consider H = G + xy. The graph H is hamiltonian and, in fact, every hamiltonian cycle in H must use the edge from x to y. Thus, there is an x y hamiltonian path P : x = v 1, v 2,..., v h = y in G. Now, observe that if v i N(x), then v i 1 / N(y), or else (see Figure 6). v 1, v i, v i+1,..., v h, v i 1, v i 2,..., v 1 would be a hamiltonian cycle in G Hence, for each vertex adjacent to x, there is a vertex of V {y} not adjacent to y. But then, we see that deg(y) (n 1) deg(x). That is, deg(x) + deg(y) n 1, a contradiction. 14

15 Figure 14: The path P and possible adjacencies. it. We now state an immediate corollary of Ore s theorem that actually preceded Corollary 6.6 (Dirac, 1954). If for all vertices of the graph G with n 3, deg(v) n/2 then G is Hamiltonian. Following Ore s theorem, a stream of further generalizations were introduced. This line of investigation culminated in the following work of Bondy and Chvátal. The next result stems from their observation that Ore s proof does not need or use the full power of the statement that each nonadjacent pair satisfies the degree sum condition. Theorem 6.7. Let x and y be distinct nonadjacent vertices of a graph G or order p such that deg(x) + deg(y) p. Then G + xy is hamiltonian if and only if G is hamiltonian. Proof. If G is hamiltonian, then clearly G + xy is hamiltonian. Conversely, if G+xy is hamiltonian but G is not, then we proceed exactly as in Ore s theorem to produce a contradiction to the degree sum condition. Example 6.8 (Petersen graph). A famous non-hamiltonian graph, and a counter example to seemingly everything one can imagine, is the Petersen graph shown in Figure 6.8 Figure 15: The Petersen graph, shown here with its three-coloring (graphic from graph). 15

16 Example 6.9 (Tournament). A tournament is a directed graph obtained by choosing a direction for each edge in an undirected complete graph. For example, Figure 6.9 is a tournament on 4 vertices. The name tournament originates v 1 v 3 v 2 v 4 Figure 16: A tournament in four vertices. from such a graph s interpretation as the outcome of some sports competition in which every player encounters every other player exactly once, and in which no draws occur; let us say that an arrow points from the winner to the loser. If player a beats player b, then it is said that a dominates b. Any tournament on a finite number n of vertices contains a Hamiltonian path, i.e., directed path on all n vertices (Rédei 1934). This is easily shown by induction on n: suppose that the statement holds for n, and consider any tournament T on n+1 vertices. Choose a vertex v 0 of T and consider a directed path v 1, v 2,..., v n in T \{v 0 }. Now let i {0,..., n} be maximal such that v j v 0 for all j with 1 j i. Then v 1,..., v i, v 0, v i+1,..., v n is the directed path as desired. Similarly, any strongly connected tournament on n 3 vertices contains cycles of length 3,..., n. As a corollary, a tournament is strongly connected if and only if it has a Hamiltonian cycle (Camion 1959). T his example from : http : //en.wikipedia.org/wiki/t ournament %28graph theory%29 7 Planar Graphs Definition 7.1. A graph is planar if it can be drawn on the plane such that no two edges cross. Example 7.2. K 4 is planar, K 3,3 is non-planar, K 5 is non-planar. We prove that K 3,3 (complete bipartite graph) is non-planar. Suppose {v 1, v 2, v 3 } and {v 4, v 5, v 6 } is a partition of V (G) such that each vertex from the first set is adjacent to each vertex from the second set. In any planar representation of K 3,3, the vertices v 1 and v 2 must be connected to both v 4 and v 5. These four edges form a closed curve that splits the plane into two regions R 1 (the outside region) and R 2 (the inside one). The vertex v 3 is in either R 1 or R 2. When v 3 is in R 2, the edges between {v 3, v 4 } and {v 3, v 5 } separate R 2 into two regions R 21 and R 22. Now there is no way to place v 6 without forcing a crossing. A similar argument can be used when v 3 is in R 1. 16

17 Planar graphs are important because: 1. Many networks are designed to be planar (ex. roads); 2. Many algorithms are much faster on planar graphs. Theorem 7.3. Any planar graph has a planar drawing such that each edge is a straight line. Note that a planar drawing divides the plane into regions known as faces (the exterior region is also counted). The boundaries of faces are edges. Theorem 7.4 (Euler formula). If r, E, V are, respectively, the number of regions, edges and vertices of a connected planar (simple) graph, then r + V E = 2. Proof. By induction on e. If E = 0 then V = 1, r = 1, V + r = 2. Assume the statement of the theorem is true for graphs with fewer than E edges. If G has no cycles, then G is a tree with E + 1 vertices, r = 1 and the statement is true. Let G have a cycle C and e be any edge in C. Let G = G e. The graph G is connected and planar with one less edge than G. So by induction r + v E = 2. Since r = r + 1, V = V, E = E + 1, the formula is proved. If the graph has too many edges it probably isn t planar. As an example of an application, it has been known for millenia that there are only platonic solids - these are the unique k-regular (k > 2) planar graph in which all faces have degree s, where (k, s) = {(3, 3), (3, 4), (3, 5), (4, 3), (5, 3)}. Indeed, we combine the Euler formula with the formula for the degrees of regions : 2 E = sr and handshaking lemma 2 E = k V, and obtain 2/s + 2/k 1 = 2/ E. Since s > 2, and the lefthand side cannot be negative, we have the result. Theorem 7.5. In a connected planar simple graph E 3 V 6, when V 3. Proof. The proof is based on the concept of the degree of a region, which is defined to be the number of edges on the boundary of this region. When an edge occurs twice it contributes 2 to the degree. A connected planar simple graph drawn in the plane divides it into regions, say r of them. The degree of each region is at least 3. (The degree of the unbounded region is at least 3 since there are at least 3 vertices. It follows that 2 E = deg(r) 3r. all regions R Hence (2/3) E r. 17

18 Using Euler s formula r = E V + 2 we obtain E V + 2 (2/3) E. It follows that E /3 V 2. Corollary 7.6. K 5 is not planar. Indeed, K 5 has 5 vertices and 10 edges, these numbers don t satisfy the inequality in Theorem 7.5. Definition 7.7 (Elementary subdivision, homeomorphic). If a graph os planar, so will be any graph obtained by removing an edge {u, v} and adding a new vertex w together with edges {u, w} and {w, v}. Such an operation is called an elementary subdivision. Two graphs are homeomorphic if they can be obtained from the same graph by a sequence of elementary subdivisions. Theorem 7.8 (Kuratovski). A graph is non-planar if and only if it contains a subgraph homeomorphis to K 3,3 or K 5. The proof is too complicated to be presented in this course. There exists a polynomial time algorithm to check if the graph is planar [Hopcroft and Tarjan, 1974]. 8 Coloring Planar Graphs The most famous result in graph coloring is the four color theorem: Theorem 8.1 (Appel & Haken, 1976). Any map (which can be represented as a planar graph) can be colored using 4 colors. Equivalently, χ(g) 4 for any planar G. Appel and Haken showed that if the four-color theorem were false, there would have to be a counterexample of approximately one of 2000 different types. The rest of the proof is done by a computer. Theorem 8.2. χ(g) 5 for any planar graph G. Proof. Let V 5. Use induction on V. Take a straight line representation of G. Since E 3 V 6, there is a vertex v with at most 5 neighbors v 1,..., v 5 (otherwise 2 E = v V deg(v) 6 V ). So G v has a 5-coloring. If v 1,..., v 5 are colored with only 4 colors, then the other color may be used for v. So suppose that v 1,..., v 5 are colored by colors 1,...,5. (i) Suppose there is no path P in G from v 1 to v 3 whose vertices are alternatively colored by 1 and 3. Switch the colors 1 and 3 for v 1 and all the alternating 1-3 paths beginning at v 1. This is a valid coloring. Since there is no such path ending at v 3, the 18

19 color of v 3 remains the same (color 3). Now v 1 gets color 3, and we can use color 1 for v. (ii) If there is a 1-3 path from v 1 to v 3, then there is no 2-4 path from v 2 to v 4 because the graph is planar. The previous argument can be used for v 2, v 4. This gives a simple algorithm to 5-color a planar graph. First we consider the algorithm to 6-color. 1. Pick a vertex of degree 5, call it v n. 2. Find a vertex of degree 5 in G v n, call it v n Repeat. 4. Color the vertices in the order v 1,..., v n using the greedy algorithm. Since any vertex has 5 neighbors before it it this ordering, we use at most 6 colors. The algorithm runs in O( E ) = O( V ) time. To 5-color we just need to add the procedure that includes the color-switching operation in the proof. 9 Bipartite graphs: Edge coloring and matchings Definition 9.1 (Edge coloring). A function E(G) {1, 2,... } is called an edge coloring if two edges with a vertex in common don t receive the same coloring. If δ(g) = max v G {deg(v)} then we need at least δ(g) colors. Example 9.2. K 4 needs 3 colors for edge coloring. α γ β γ α Example 9.3. Peterson s graph requires more colors than δ(g) for edge coloring. Theorem 9.4. If G = (X Y, E) is a bipartite graph, then the minimal number of colors needed for edge colorings of G equals δ(g) Proof. We proceed by induction on E. The trivial case E = 1 is true. Let E > 1, remove an edge (x, y). Let δ(g) = k. δ(g {(x, y)}) is either k or k 1. If δ(g {(x, y)}) = k 1, then by induction it has an edge coloring with k 1 colors and we can use color k for (x, y). 19

20 Suppose δ(g {(x, y)}) = k. Fix an edge coloring for G {(x, y)} with k colors. If there exists a color α not used on x and not used on y, we can color (x, y) by α. Suppose not, in any case deg(x) k 1 and deg(y) k 1 in G {(x, y)}. Let α be the color not used on x and β the color not used on y. Let (x, y 1 ) be the edge colored by β. If α is not used on y 1, we stop, else if α is used, suppose (x 1, y 1 ) has color α. If β is not used on x 1, we stop, else suppose (x 1, y 2 ) as color β. x x 1 Finally we stop. We have a path: y β α β y 1 x 2 α y 2 x β y 1 α x 1 β y 2 α x 2 β y 2 y k Switch the colors in this path. x β y α x 1 We can now assign (x, y) the color β. β α y 1 x 2 β y 2 Definition 9.5 (Latin square). A latin square is a square table with rows r 1, r 2,..., r k and columns c 1, c 2,..., c k such that each entry contains a symbol s 1, s 2,..., s k and each row and each column contains each symbol exactly once. Example 9.6. c 1 c 2 c 3 r 1 s 2 s 3 s 1 r 2 s 3 s 1 s 2 r 3 s 1 s 2 s 3 One solution to find a latin square is to edge color the corresponding bipartite 20

21 graph: r 1 s 2 c 1 r 2 c 2 r 3 s3 c 3 or s 1 r 3 c 1 s 2 c 2 s 3 r3 c 3 Definition 9.7 (Latin rectangle). A latin rectangle (m < n). Each row contains each symbol only once and no symbol occurs more than once in a column. Example 9.8 (A 3 by 5 latin rectangle). c 1 c 2 c 3 c 4 c 5 r 1 s 1 s 2 s 3 s 4 s 5 r 2 s 5 s 1 s 4 s 3 s 2 r 3 s 2 s 3 s 1 s 5 s 4 Theorem 9.9. Every latin rectangle can be extended to a latin square. Proof. We form a bipartite graph with edges connecting symbols with columns: G = (S C, E), E = {s i c j : symbol s i doesn t appear in column j} Example 9.10 (for the example rectangle). s 1 c 1 s 2 c 2 s 3 c 3 s 4 c 4 s 5 c 5 21

22 Max deg(g) = δ(g) = n m, because each column contains m symbols and thus doesn t contain n m. G is regular bipartite δ(g) = n m. By theorem 9.4, the edges can be colored by n m colors. Completing a partial latin rectangle Suppose we have a table of m rows and p columns filled in with symbols from {s 1,..., s n }; p, m < n such that no symbol occurs more than once in a row and in a column. Question: When can such a rectangle be completed to a n by n square? Example 9.11 (Of a rectangle that can not be completed). B occurs too few times to complete the square. A C D E C E A B E A C D Theorem Let R be a partial m p latin rectangle in which the symbols s 1,..., s n are used and let n R (s i ) denote the number of times s i occurs in R. (1 i n) R can be completed to an n n latin square if and only if n R (s i ) m + p n ( i = {1,..., n}). Proof. Suppose R can be completed. Then there are n m rows and n p columns to be filled in. n (n p) + (n m) + n R (s i ) m + p n n p (s i ) Now suppose the inequality holds. Construct a bipartite graph G = {rows S, E}. E = {r i s j : s j is not used in r i }. Each symbol s i occurs at least m+p n times and each occurrence is in a different row. deg(s i ) = m (m + p n) n p Every row contains p different symbols, thus n p are not used, and deg(r i ) = n p. So δ(g) n p and there exists an edge coloring of G with n p colors c p+1, c p+2,..., c n. If r i s j E and colored with c k (p + 1 k n), then we put s j in row r j and columns c k. Thus gives m n latin rectangle, which can be completed to a latin square by Theorem 9.9. Example Find all values of Q {A, B, C, D, E, F } such that rectangle R can be extended to a 6 6 latin square. A B C D F E A B R 1 : C D F A D A B Q n p (x) m + p n = = 2 Q = E 22

23 To complete the rectangle: R 2 : A B C D F E A B B D F A D A B Q r 1 A B C D E F r 2 r 3 r 4 There does not exist a value of Q 10 Matchings and Bipartite Graph Definition 10.1 (Matching, Perfect matching). A matching in a graph is a disjoint set of edges. A perfect matching is a matching which covers all the vertices. Consider the following problem: There is a set of people X and a set of jobs Y such that each person is qualified to do exactly k jobs and for each job there exists exactly k people who are qualified to do it. Prove that: 1: X = Y 2: For any subset of n people in X, there exists at least n jobs which they are qualified to do. Proof. 1: E = x X deg(x) = y Y deg(y) E = k X = k Y X = Y Proof. 2: If A X, J(A) = {y Y : x A, (x, y) E} the set of jobs for which people from A are qualified. 23

24 Let A = n, show J(A) n. There are nk edges with one vertex in A. All these edges have one vertex in J(A). The total number of edges with one vertex in J(A) is k J(A). nk k J(A) A J(A) Definition 10.2 (Maximal matching). A matching is maximal if there does not exist a matching with more edges. Definition 10.3 (Complete matching). A matching is complete if M = X (all people get jobs). Example A complete matching does not exist for G with 3 people and 2 jobs. Theorem 10.5 (Hall). A bipartite graph G = (X Y ) has a complete matching if and only if A X, J(A) A. Proof. Suppose a complete matching exists, then: A X, J(A) A. Now suppose that Hall s condition is satisfied. Let M be an incomplete matching, we will construct M such that M = M + 1. There exists x 0 X such that x 0 is unmatched. J({x 0 }) 1. There exists y 1 adjacent to x 0. If y 1 is unmatched then M = M (x 0, y 1 ). Suppose y 1 is matched to x 1. J({x 0, x 1 } 2 and there exists y 2 such that J({x 0, x 1 }) {y 1, y 2 } If y 2 is unmatched, we stop. Otherwise continue... x 0 / M y 1 M x 1 x 2 / M y 2 M / M y 3 We eventually stop, we have constructed a path: x 0 / M y M 1 x 1 y M 2 x 2 / M / M such that (y i, x i ) M and (x i+1, y i ) / M. y 2 y n M = M (y i, x i ) M + (x i+1, y i ) / M M = M

25 The algorithm from the proof: Begin with an arbitrary matching M. If it is not complete, construct M. If M is not complete, find an alternating path to construct (M ) and so on. Corollary A bipartite graph G has perfect matching if and only if: A X, B Y J(A) A & J(B) B Definition 10.7 (Deficiency). A deficiency of a bipartite graph is: d = max A X { A J(A) } 0. We remark that the emply set is a subset of X, os d ) in all the cases. Theorem A maximal matching for a bipartite graph G = (X Y, E) has size X d. Proof. Consider a set Z of cardinality d and let G = (X Y, E ) Y = Y Z E = E {(x, z) x X, z Z} Let A 0 be the subset of X such that d = A 0 J(A 0 ). Let M be a complete matching for G (G satisfies the Hall condition.) Then (M the edges in M \ E) = M. M is a maximal matching for G. M = M d = X d. M is maximal because d people from the set A 0 are not satisfied without jobs in Z. To verify Hall s condition, one has to check 2 X subsets which takes exponential time. But there exists a polynomial algorithm to construct a maximal matching (not necessarily in a bipartite graph). Theorem If M is not a maximal matching in G = (X Y, E), then there exists an alternating path. Proof. Suppose there exists M of greater cardinality than M. Let H be a subgraph of G formed by edges that belongs to M or M but not both. Each vertex has degree 1 or 2 initially. Connected components of M are either alternating paths or alternating cycles. Each cycle contains the same number of edges in M and M there exists an alternating path. 25

26 The algorithm: We begin at some unmatched vertex x 0. G = (X Y, E), X = {x 1,..., x 5 } Y = {y 1,..., y 5 } We have an adjacency table: x 1 x 2 x 3 x 4 x 5 y 1 y 1 y 1 y 2 y 3 y 3 y 3 y 3 y 4 y 4 y 5 y 5 M = {(x 1, y 3 ), (x 2, y 1 ), (x 3, y 5 ), (x 4, y 4 )} Begin at some unmatched x 0 : 1: In level 1, insert all ys adjacent to x 0. If one of the y s (y i ) is unmatched, then we found the alternating path: (x 0, y i ). 2: If all ys at level 1 are matched, insert corresponding x s. 3: Insert all the new y s adjacent to x s at level 2. If one of the y s is unmatched, then the path is alternating. x 5 y 3 y 4 x 1 x 4 y 1 y 2 y 5 If at some odd numbered level, there do not exist new y s to insert, then there does not exist an alternating path from x 0. But we have to try all other unmatched x s. If there does not exist an alternating path from any of them, then M is maximal. M = {(x 1, y 3 ), (x 2, y 1 ), (x 3, y 5 ), (x 5, y 4 ), (x 4, y 2 )} 11 Transversals for families of finite sets Example There are 4 committes in a university math department: Teaching: {M, A} Research: {M, B} Admin: {M, A, B} Car Parking {C, D, E} We want to form the committee for committees, which consists of one different person from each committee. Construct a complete matching: M = {(T, A), (R, B), (Adm., M), (Car, C)} 26

27 Definition 11.2 (Transversal). In general, let i I S i be a finite family of finite sets. A complete set of representatives: {s i : i I, s i S i } i j s j s j is called a transversal for a family of finite sets. Theorem Hall s condition implies there exists a transversal for the family {s i, i I} if and only if: A I, A i A S i 12 Applications of trees Definition 12.1 (Rooted tree). A rooted tree is a tree with a vertex designated as the root. Every edge is directed from the root. Definition 12.2 (Parent, Child, Sibling). v is a parent of child u if it is the vertex directly above u in the tree. Siblings are children of the same parent. Definition 12.3 (Internal vertex). Internal vertices are vertices with children. Definition 12.4 (Ancestor, Descendant). The ancestors of u are all the vertices in the path from u to the root. The descendants of u are all the vertices for which u is an ancestor. Definition 12.5 (Subtree). A subtree originating at u is u and all its descendants. Definition 12.6 (M-ary, Full m-ary, Binary). Tree T is called an m-ary tree if every internal vertex has at most m children. A full m-ary tree has exactly m children of each internal vertex. If m = 2, then T is called a binary tree. Binary trees have left subtrees and right subtrees; vertices in binary trees have left children and right children. Definition 12.7 (Height). The height of the tree is the maximal level of vertices. Lemma There exist at most m h leaves in an m-ary tree of height h. Corollary h log m l If the tree is full and balanced (every leaf has height h or h 1), then h = log m l. 27

28 Proof. l = m h log m l h l > m h 1 h 1 < log m l h h = log m l Example (The false coin). There exists one genuine coin labelled 0 and r other coins labeled by 1,..., r. One of these r coins is false and must be heavier or lighter than the others. One needs at least log 3 (2r + 1) weightings on a balance scale to determine if all the coins are good or one is heavier/lighter than the others. Proof. There exist 2r + 1 outcomes: {G, 1H, 1L,..., }. We form a ternary tree with each of the outcomes as a leaf. By Lemma 12.8, h log 3 (2r + 1). 0, 1 : 2, 3 < = > 2 : 3 0 : 4 2 : 3 < = > < = > < = > 3H 1L 2H 4H G 4L 3L 1H 2L Figure 17: The solution tree for the false coin problem with r = 4 that uses two weightings. Example To sort 3 numbers {a, b, c} with comparisons, we can construct a binary tree. h log 2 6 h 3 Example Sort the following words in alphabetical order: {math, physics, 28

29 a : b a>b a<b a : c b : c a>c c>b a>c a<c a > b > c a > c > b b > a > c a < c < b Figure 18: The comparison tree to sort three numbers a, b, and c geography, biology, meteorology, geology, psychology, chemistry}. math geography physics biology geology meteorology psychology chemistry Following the tree from left to right gives the sorted order: {biology chemistry geography geology mathematics meteorology physics psychology}. Every vertex has a key, for every vertex all the keys of the left subtree are less than the keys of this vertex, and all the keys of the right subtree are greater than the key of this vertex. For all children, it is known if this is a right or left child. Lemma A full m-ary tree with i internal vertices has n = mi + 1 vertices. 2. A full m-ary tree with n vertices has i = n 1 m internal vertices. 3. A full m-ary tree with i internal vertices has l = (m 1)i + 1 leaves. 4. A full m-ary tree with l leaves has n = ml 1 m 1 Proof. 1: Every vertex is a child except the root : n = i + l mi + 1 = i + l (m 1)i + 1 = l l 1 vertices and i = m 1. 29

30 13 Complexity of sorting algorithms based on binary comparisons The worst case complexity is h log 2 (n!) (n! leaves). log(n!) = θ(nlogn) n! n n log(n!) nlogn log(n!) = O(nlogn) One can also show that log(n!) = Ω(nlogn) Theorem The worst case complexity for any binary comparison based sorting algorithm is Ω(nlogn). 14 Prefix codes Encode letters by binary strings of different lengths. 1. A code for one letter should not be a prefix of a code for a different letter (if we code a by 0, b by 1, and c by 01, then 01 could be interpreted as ab or as c ). 2. Letters that occur frequently should be encoded by shorter strings. Huffman coding We know the probabilities of the occurrences of each letter (divide the number of occurrences of letter by the length of the sequence). Huffman Begin with a forest consisting of isolated vertices label by each letter. 1 while T is not a tree 2 Replace the rooted trees T 1 and T 2 of least weights with a tree of new root that has T 1 and T 2 as its left and right subtrees where w(t 1 ) > w(t 2 ). 3 The label of each leaf is the label of the path from the root to that leaf 30

31 Example Given a set of letters with probabilities {A :.08, B :.10, C :.12, D :.15, E :.20, F :.35}, we construct the Huffman code as follows: Step 1:.18 Step 2: Step 3: B :.10 A : D :.15 C :.12 B :.10 A : E : D :.15 C :.12 B :.10 A :.08 Step 4: F : E : D :.15 C :.12 B :.10 A :.08 Final Tree: F : E : D :.15 C :.12 B :.10 A :.08 The complete code is therefore: {A = 111, B = 110, C = 011, D = 010, E = 10, F = 00} 31

32 15 Depth First Search DFS(G) G is a connected graph with vertices v 1,..., v n 1 T = tree consisting only of v 1 2 visit(v 1 ) visit(v, T ) v is a vertex in a graph, T a tree 1 for each w adjacent to v and not yet in T 2 do Add w to T and add (v, w) to T 3 visit(w) For every v, the procedure visit(v) is called only once, when v is first encountered. Every edge is considered at most twice. The complexity is thus O(e) = O(n 2 ). 16 Breath First Search BFS(G) G is a connected graph with vertices v 1,..., v n 1 T = tree consisting only of v 1 2 L = a list, initially empty 3 Add v 1 to L 4 while L is not empty 5 do Remove the first vertex from L 6 for each neighbor of v 7 if w is not in T and not in L 8 do Add it to the end of L 9 Add w and (v, w) to T The complexity of breath first search is O( E ). Example a b c l d e f g h i j m k 32

33 e b f i d a c g j h k l m L = {e, b, f, i, d, a, c, g, j, h, k} T = {(e, b), (e, f), (e, i), (e, d), (b, a), (b, c), (f, g), (f, j), (g, l), (i, h), (i, k), (k, m)} 17 Minimum Spanning Trees Definition 17.1 (Minimum Spanning Tree). A minimum spanning tree in a connected, weighted graph is a spanning tree with minimum possible weight (the minimum sum of weights of edges). Example SF Chicago 1000 NY C Denver 1400 Atlanta 2200 The minimum spanning tree for the above graph consists of the four edges: {(Chicago, Atlanta), (N Y C, Atlanta), (SF, Denver), (SF, Chicago)}. Kruskal s Algoritm 1200 SF Chicago NY C Denver Atlanta 1 Begin with an edge of minimal weight 2 Successively add edges with minimal weight that do not form a cycle with the edges that have already been added. 3 Stop after n 1 steps. 33

34 It s easy to show that the complexity of Kruskal s Algorithm is O(n logn). But we can improve the bound to O(n log n), where log n = M denotes the iterated logarithm such that log(log(... log(n))) 1. }{{} M 18 Disjoint Sets We have a collection of disjoint sets. Each set is identified by a unique representative. X x Y y z, Z Our data structure will have the following operation: i) Make-Set(v): Creates a singleton set with the element v. ii) Find-Set(v): Find the set that v is contained in i.e. find the representative of the set cpntaining v. iii) Merge(x, y): Merge the two sets that contain x and y Applications: Kruskal s algorithm for Minimum Spanning Trees Equivalence Classes Computer Vision (pixelized pictures) Parent Pointer Sets: We store sets as directed trees where nodes point to their parents: Text1 So, we get 34

35 i) Make-Set(v): Makes a node v pointing at itself. ii) Find-Set(v): Follows a path from v to the root and returns the root. iii) So, Merge(x, we get y): Finds the representatives of the sets containing x and y, say rep(x) and rep(y) respectively, and either makes rep(x) point to rep(y) or i) Make-Set(v): vice versa. 1 Makes a node v pointing at itself. ii) Find-Set(v): Follows a path from v to the root and returns the root. The bottleneck operation is Find-Set. The runtime of Find-Set depends iii) Merge(x, y): Finds the representatives of the sets containing x and y, say on the path lengths of trees. So if we can keep the depth of the trees small rep(x) and rep(y) respectively, and either makes rep(x) point to rep(y) or then the viceoperations versa. 1 are fast. TrickThe 1. bottleneck On merging, operation we merge is Find-Set. the shallower The runtimetree of Find-Set into the depends deeper tree. onwe the give path lengths every node of thevtrees. a rank So ifρ(v). we caninitially keep the ρ(v) depth= of height(v) the trees small = maximum distance then thefrom operations v to aare leaf fast. node. The rank of a node doesn t change when we perform Trick the1. second On merging, trick (path we merge compression) the shallower below. tree into When the we deeper preform tree. Make-Set(x) we set Weρ(x) give = every 0. node v a rank ρ(v). Initially ρ(v) = height(v) = maximum distance from v to a leaf node. When we preform Make-Set(x) we set ρ(x) = 0. We perform Link(x, y) y) as as follows: follows: i) We do: x y if ρ(x) < ρ(y) PSfrag replacementsii) We do: x y if ρ(x) > ρ(y) iii) We do: x y if ρ(x) = ρ(y) and we set ρ(y) = ρ(y) + 1 So our Merge-Set(x, y) of two Find-Set operations followed by Link(rep(x), rep(y)). So our Merge-Set(x, y) operation consists of two Find-Set operations followed by Link(rep(x), rep(y)). Lemma 1. Lemma The number of nodes in the subtree rooted at v is at least 2 r where r = 1. The ρ(v). number of nodes in the subtree rooted at v is at least 2 r where r = n 2. ρ(v). The number of nodes of rank r is at most 2 where n is the number of r nodes in our forest. n 2. The number of nodes of rank r is at most 2 where n is the number of r Proof. nodes 1. in Byour induction. forest. The statement holds for r = 0. After linking, it is clearly true for cases i) and ii). In case iii) we see that the new tree has Proof. size 1. at least By induction. 2 r + 2 r = 2 r+1 The. statement holds for r = 0. After linking, it is 1 We clearly shall call true this sub-operation for cases i) link(rep(x), and ii). rep(y)) In case iii) we see that the new tree has size at least 2 r + 2 r = 2 r+1. 1 We shall call this sub-operation link(rep(x), 2 rep(y)) 35

36 2. Fix some number r. Only set representatives can change their rank. Whenever the rank of any set representative x changes from r 1 to r mark all the objects in x s. Since representative s rank can only increase over time, each object is marked at most once. There exists n objects alltogether, and any object with rank r marks at least 2 r objects. It follows immediately from the preceding part that there are at most n/2 r objects with rank r as claimed. Corollary Each tree has height O(log(n)). So our Find-Set operation shold run in time O(log(n)). Trick 2 (Path Compression). After traversing a path during a Find-Set operation, set the parent pointers of the nodes along the path to point the root of the tree. b c d e g r i pc h j gt a b c d f e g r i h j a f This multiplies the runtime of the Find-Set by a constant factor 2 A way to analyse the effect of path compression is to procede as follows: First divide the ranks into blocks where b 0 = 1 b i+1 = 2 bi [0, b 0 ], [b 0 + 1, b 1 ],..., [b i + 1, b i+1 ] Note that there are at most log (log(n)) = log (n) 1 blocks. 3 We use amortized analysis. Suppose we do N operations n of which are Make-Set operations (i.e. n nodes). The only operation that is not O(1) is Find-Set. Consider the path we compress at each step: 2 Go along the path once to find the parent and go a second time and at each node along the way set the pointer to the root, so it should take three times longer. 3 log (k) = M, the least integer such that log log... log(k) 1 {z } M times 36

37 c r b4 b3 b2 b1 b0 The cost is 2(#red nodes +#grey nodes), where a node x is red if the rank of its parent is in a higher block. Observations: ρ(x) < ρ(parent(x)) ρ(parent(x)) < ρ(parent (x)) where Parent (x) is the parent of x after path compression. ρ(x) never changes once x is not a root. These observations imply that a red node always stays red. The highest possible rank is logn. Clearly the cost assigned to red nodes is at most log (n) for each Find-Set operation as there are at most log (n) red nodes along a path. To analyze the total cost assigned to the grey nodes note that 1. A node x in block B j can change parents at most b j b j 1 b j times before it turns red. 2. By Lemma 18.1, the number if nodes in block j is bounded by b j i=b j 1+1 n 2 i n n (1 + 1/2 + 1/4 +...) 2bj = n bj 1 b j So the total time spent traversing grey nodes in block B j is at most b j n b j = n. 4. Hence the total time spent on grey nodes over all blocks is at most n log (n). So overall, the amortized time is O log (n) per operation. We proved the following result. 4 And this result holds even in N n in particular when all the nodes turn red or become children of the root 37

38 Theorem Suppose we perform N disjoint set operations, i.e. find-root and merge operations, on a disjoint set forest containing n nodes. Then path compression and merging by rank give the amortized running time devoted to these operations at most O((N + n)log (n)). 19 Networks & Flows Definition 19.1 (Network). A network is a diagram with two distinguished vertices: the source s and the sink t. Definition 19.2 (Capacity, Flow). C : E R > 0 is called the capacity of the edges. F : E R > 0 is called the flow function. (u, v) E : f(u, v) c(u, v) Example a 3:5 1:6 2:3 s 2:2 b 2:4 d 4:4 t 3:3 1:7 2:5 c Figure 19: A network, its flows, and its edge capacities. Definition 19.4 (In-flow, Out-flow). inflow(v) = outflow(v) = (x,v) E (v,y) E f(x, v) f(v, y) v s, t : inflow(v) = outflow(v) Definition 19.5 (Cut). A cut in a network is a partition of the vertices into two disjoint parts: S T = E such that s S and t T. The capacity of the cut is c(u, v). u S v T (u,v) E 38

39 Definition 19.6 (Value). The value of a flow F is val(f ) = outflow(s) = inflow(t) The conservation rule, v s, t : inflow(v) = outflow(v), implies val(f ) = x S y T f(x, y) u T v S f(u, v) Example Continuing from example 19, let S = {a, b, s} and T = {c, d, t}. val(f ) = F (s, c) + F (a, t) + F (a, d) + F (b, d) = = 8 Theorem For any cut S T = E, Proof. Let S T = E be a cut. val(f ) = x S val(f ) c(s, T ) y T x S f(x, y) u T v S f(x, y) f(u, v) y T c(x, y) = c(s, T ) x S y T Example Define a new flow in example 19 as follows: a 4:5 1:6 3:3 s 2:2 b 2:4 d 4:4 t 3:3 1:7 2:5 c Let path refer to the path in the graph obtained from the network by disregarding edge directions. Then the a path from s to t is: s 4 5 a 1 6 d 1 2 c 2 5 t 39

40 Definition (Augmenting path, Incomplete augmenting path). A path s = x 1,..., x k 1, x k = t in the undirected graph corresponding to the network is called an augmenting path if f(x i, x i+1 ) < c(x i, x i+1 ) and (x i, x i+1 E) or f(x i+1, x i ) > 0 and (x i+1, x i ) E). An incomplete augmenting path is the same as an augmenting path except that the final vertex is not t. Denote by α = min { c(xi, x i+1 ) f(x i, x i+1 )for(x i, x i+1 ) E f(x i+1, x i )for(x i+1, x i ) E We can define f 1 such that val(f 1 ) = val(f) + α. f 1 (x i, x i+1 ) = f(x i, x i+1 ) + αfor(x i, x i+1 ) E f 1 (x i+1, x i ) = f(x i+1, x i ) αfor(x i+1, x i ) E Theorem (Min-cut/Max-flow). The maximal value of the flow from s to t in a network is equal to the minimal value of a cut. Proof. Let f be a maximal flow. We will construct a cut with the same capacity as val(f). Let s = {v such that there exists an incomplete augmenting path from s to v. T is the rest of the vertices. t T because there does not exist an augmenting path from s to t. For a maximal flow S,T is a cut. val(f) = x S y T f(x, y) z T u S f(z, u) If x S such that f(x, y) < c(x, y), then the augmenting path from s to x y T could be extended to y y S which is a contradiction. Therefore, f(x, y) = c(x, y). If u S such that f(z, u) > 0, then the augmenting path from s to u could t T be extended to z, which is a contradiction. Thus, val(f) = x S y T c(x, y) = c(s, T ). 20 Basic Counting Techniques 20.1 Product Rule If a procedure of two tasks and task 1 can be preformed in n 1 ways, task 2 in n 2 ways, then there exists n 1 n 2 ways to preform the procedure. 40

41 Example How many binary strings are there of length 6? Answer: 2 6. Example The number of functions from an m-set (a set with m elements) to an n-set is n m. Similarly, the number of words of length m in an alphabet of n letters is also n m Pigeonhole principle If there exist n pigeonholes and n + 1 pigeons, then there are at least 2 pigeons in at least one hole. Example In the set of n people, at least 2 people have the same number of friends within the set. Proof. If each have friends, then there exist n 1 possibilities within the set. Suppose someone doesn t have any friends. If there are two such people, we are done, otherwise exclude the loner and consider the problem with n 1 people. Example In a set of 27 english words, at least two begin with the same letter. Lemma In pigeon form, if there exist n pigeons and k holes, then there is at least one hole with n/k pigeons. Example In a set of 100 people, what is the least number of people whose birthdays are in the same month? Example If there are five possible grades, what is the minimal number of students such that at least four of them share the same grade? Answer: 16, because 16/5 = Inclusion & Exclusion (Sieve) Principle IF A&B are two finite sets, then A B = A + B A B A B C = A + B + C A B A C B C + A B C Example In a set of 50 students, 18 speak German, 30 English, 26 French, 9 both English and German, 16 both English and French, and 8 both French and German. 47 speak at least one of the languages. How many speak all three? Answer: 47 = English French German 6 = English French German 41

42 Example 20.9 (Computing Euler s function). n&m are called co-prime if gcd(n, m) = 1. The Euler function ϕ(n) = the number of natural numbers k in the range 1 k n that are co-prime with n. If n = p is prime, then ϕ(p) = p 1. Compute ϕ(60): 60 = If A is the set of number in [1, 60] that are multiples of 2, B the set that are multiples of 3, and C the set that are multiples of 5, then ϕ(60) = 60 A B C A = 60/2 = 30, B = 60/3 = 20, C = 60/5 = 12 A B = 60/10, A C = 60/10 = 6, B C = 60/15 = 4 A B C = = 2 A B C = = 44 ϕ(60) = = R-permutations and R-combinations Definition 21.1 (Permutation). An ordered arrangement of r elements from the set of n elements is called an r-permutation (r n). P (n, r) = n(n 1)... (n r + 1) = n! (n r)! Definition 21.2 (Combination). An unordered arrangement of r elements from an n-set is called an r-combination. ( ) P (n, r) n! n C(n, r) = = r! r!(n r)! =. r Theorem 21.3 (Binomial Theorem). (x + y) n = n ( n i i=0 ) x n i y i Corollary 21.4 (Corollaries of the Binomial Theorem). 42

43 1. 2 n = n i=0 ( n i 2. n k=0 ( 1)k ( n k 3. ( n 0 ) ( n + 2 ) 4. 3 n = n k=0 2k ( n k (x = y = 1). ) = 0 (x = 1, y = 1) ) ( n +... (even numbers) = 1 ) (x = 2, y = 1) ) ( n + 3 ) +... (odd numbers) Theorem 21.5 (Pascal s Identity). ( ) ( n + 1 n = k k ) ( n + k 1 ) Example 21.6 (Pascal s Triangle). ( 0 0 ) ( 1 0 ) ( 1 1 ) ) ( 2 ) 0 ( 3 1 ) ( 2 ) 1 ( 3 2 ) ( 2 ( 3 0 ) 2 ( 3 3 ) ( 4 0 ) ( 4 1 ) ( 4 2 ) ( ) ( 4 4 ) Theorem 21.7 (Vandermonde s Identity). ( m + n r ) = r k=0 ( m r k ) ( n k ) r m, n Proof. 43

44 m + n r-k k m n Theorem ( n + 1 r + 1 ) = n ( ) j r ( ) n + 1 Proof. = the number of binary strings of length n + 1 with r + 1 r + 1 ones. Each term in the sum corresponds to the number of sequences whose last one is in the place j + 1. j=r The number of permutations of n elements, when there are r 1 indistinguishable elements of type 1, r k indistinguishable elements of type k, is where r 1 + r r k = n. ( n! We denote r 1!r 2!...r k! as n! r 1!r 2!... r k! ) n and call it the multinomial number. r 1,..., r k Example How many 11 letter words can one make from the letters of the word: ABRRACADABRA? Answer: n = 1 r A = 5 r B = 2 r R = 2 r E = 1 r D = 1 11! 5!2!2!1!1! = 160 Lemma (Multinomial Formula). (x x k ) n = ( n r 1,..., r k ) x r1 1 xr xr k k 44

45 The monomial x r1 1 xr xr k k r 2 brackets, and so forth. arises from chosing x 1 from r 1 brackets, x 2 from Example What is the coefficent of x 3 1x 2 2x 5 3 in the expression (x 1 + x 2 + x 3 ) 10? Answer: ( ) 10! 5!2!3! = 10 3, 2, 5 Example How many positive integer solution does the equation (x 1 + x 2 + x 3 ) = 11 have? Answer: There are 11 objects of three types. What is the number of ways to make a selection? The solution corresponds to a string of 11 stars and 2 bars; stars are objects, bars mark off cells. ( ) ( 13 = 2 ) = = 128 Theorem The number of selections of n objects from the set of objects of k types is ( ) ( ) n + k 1 n + k 1 = k n Proof. Corresponds to strings with n stars and k 1 bars. This is also the number of bijections from an n-set to a k-set. If f(i) = j then we put i into bar j. 22 Permutations A permutation on the set A is a bijection from A A. We will consider permutations on finite sets A = {1,..., n}. Notation: 2 σ = 3 or σ(2) = 3 means permutation σ takes 2 to 3. τ(σ(2)) = τ σ(2) is a composition of σ and τ. Similarly, (2 σ ) τ = 2 στ means the composition of σ and τ. Definition 22.1 (Group). A group G is a set of elements with an operation such that: 1. (Closure) g 1, g 2 G g 3 G such that g 1 g 2 = g 3 2. (Associativity) (g 1 g 2 ) g 3 = g 1 (g 2 g 3 ) g 1, g 2, g 3 G 3. (Identity) e G such that g G, g e = e g = g 4. (Inverse) g G g 1 G such that g 1 g = g g 1 = e. Example All permutations on {1,..., n} form a group with the composition operation Example Z + (All integers with addition as the group operation) e = 0 and the inverse of z Z + is z. 45

46 Example Q or R If only axioms 1,2, and 3 apply the group is called a monoid. Axioms 1 and 2 give a semi-group. Example The group of isometries (distance preserving bijections) of the plane. Example A group of automorphisms of a given graph. If the graph is finite, then it is a subgroup of the group of permutations on the set V of vertices. Definition 22.7 (Sub-group). A subset H of a group G is a subgroup if H is itself a group with respect to the same operation in G. We denote this relation as H G. Example Let G = Z + Every subgroup of Z + has the form mz + = {ma a Z + }, m Z +, m > 0. Let H = mz +. 0 H. If x = ma, y = mb x+y = m(a+b) H). So H is closed under addition. If x = ma, then x = ma x H. So H is closed under inversion. Lemma H G a, b H : ab 1 H Definition (Order). The order of G, G, is the number of elements in G. Definition (Generator). A subgroup H of G is generated by a set S if H is the intersection of all subgroups of G containing S. Denote by < S > the subgroup generated by S. Definition If A, B G, then AB = {ab a A, b B}. B = Lemma For S G, denote by S 1 = {a G a 1 S}. Denote by A n = AA }{{... A }. n times Then the subgroup of G generated by S is n=0(s S 1 ) n. Proof. Obviously, < S > n=0(s S 1 ) n (notice, that S 0 = e). Notice also that (abc) 1 = c 1 b 1 a 1. The equality < S >= n=0(s S 1 ) n because n=0(s S 1 ) n is a subgroup itself. 46

47 23 Representing permutations means σ : 1 σ : n i 2... n i Definition 23.1 (Support, Fix). supp(σ) = support of σ = {x X : x σ x} fix(σ) = fix of σ = {x X : x σ = x} fix(σ) supp(σ) = {1,..., n} Definition 23.2 (Disjoint). σ and τ are disjoint if and only if supp(σ) supp(τ) = Lemma If σ and τ are disjoint, then στ = τσ. Proof. Let σ, τ S n = Sym({1,..., n}). If x {1,..., n}, then either x supp(σ) of x supp(τ), or x {1,..., n} (supp(σ) supp(τ)). If x (supp(σ), then x (fix(τ) and x τ = x. So, x τσ = x σ. Thus, x στ = (x σ ) τ, show x σ supp(τ) because x σ supp(σ) because σ is a bijection. If x supp(σ), then x σ supp(σ). Similarly, if x supp(τ), then x στ = x τ = x τσ. If x supp(σ), then x σ supp(σ). 24 Cyclic notation for permutations Definition ( k) = ( k ) If σ = (i 1... i k ) then σ is called a cycle of length k (k-cycle). A 2-cycle is a transposition. Two cycles are disjoint if they are disjoint permutations. Example (1 2 3) and (4 6 7) are disjoint 3-cycles. Theorem Every permutation can be written as a product of disjoint cycles. This form is unique except for the order of the cycles and the addition of cycles of length 1. 47

48 Example ( ) σ = = (1 3 2)(4 9)(5 8)(6 7)( )(11 15)(12 16)(18) Remarks: 1. ( ) = ( ) = ( ) 1 = ( ) and (i 1... i k ) 1 = (i k... i 1 ) 3. ( )( ) = ( ) Definition 24.5 (Order). The order of the element g in a group is the minimal n such that g n = e. The order is if this n does not exist. Example The order of a k-cycle in S n is k. ( k)( k)... ( k) = (1)(2)... (k) }{{} k times Example If σ is a product of disjoint cycles of length k 1,..., k m then Example σ = lcm(k 1,..., k m ). σ = (1 2 3)( ) σ n = (1 2 3) n ( ) n σ = 15 Definition A permutation is even if it is a product of even number of transpositions (i, j) and odd if it is a product of an odd number of transpositions. The same permutation cannot be represented both by even and odd number of transpositions. Hint of proof: A transposition (i, j) corresponds to a product of an elementary matrix E ij obtained from the identity matrix by switching rows i and j by the column vector (x 1,..., x n ) t. Every permutation corresponds to a product of elementary matrices because it is a composition of transpositions. If A = E i1j 1... E ik j j det E ij = 1, det A = dete i1j 1. A permutation is even iff det(a) = 1 is odd iff det A = -1 One can define for σ S n sign(σ) = +1 if σ is even, -1 if odd Ex (1) = (12)(12) Every k-cycle for k odd is an even permutation (12... k) = (12)(13)... (1k) }{{} k 1 48

49 25 Basic algebra in groups Example The identity element of a group is unique. e 1 e 2 = e 2 = e 1 e 2 = e 1 2. If ab = ac in group G, then b = c a 1 ab = a 1 ac eb = ec 3. Each element has an unique inverse ba = ca b = c Definition 25.2 (Order of a group element). The order of g G, denoted g, is either the min positive integer n such that g n = e or is infinity if no such n exists. Definition 25.3 (Group Table). If G is a finite group of order m, then we construct an m m table as follows: g 1 g 1 g 2... g j... g m. g i g i g j. g m Example The group table is a latin square Definition 25.5 (Group Isomorphism). Two groups G, and H, are isomorphic if there exists a bijection φ : G H such that g 1, g 2 G : φ(g 1 g 2 ) = φ(g 1 ) φ(g 2 ) The image of the product is the product of the images. If α is the group table for G, α ij = g i g j, then β ij = φ(g i )φ(g j ) is the group table for H. 26 Cyclic groups Definition 26.1 (Cyclic group). If G is a group, S a subset, then we say that a subgroup H is generated by S (denoted H = < S >) if H is the intersection of all subgroups containing S. If G is generated by one element, then G is called a cyclic group. 49

50 Theorem Every infinite cyclic group C is isomorphic to Z + (the integers with group operation addition.) Every finite cyclic group of order m is isomorphic to Z + m (residues modulo m). Proof. If G is generated by c then G = {..., c 2, c 1, e, c 1, c 2,... }. Case 1: i j : c i c j Consider φ : G Z + such that φ(c k ) = k. e = c 0 φ(e) = 0. φ is a bijection. φ(c k c t ) = φ(c k+t ) = k + t φ(c k ) + φ(c t ) = k + t therefore φ is an isomorphism. Case 2: i > j such that c i = c j c i j = c j j = e. m > 0 such that c m = e. Take the minimum positive m such that c m = e. This m = c. Show that G = {e, c,..., c m 1 }. Take c n, n Z. Then t such that n = tm + r, 0 r m 1. φ : G Z + m φ(c r ) = r φ(c r1 c r2 = r 1 + r 2 = r 1 + r 2 ) Example In S 3, < (1 2 3) > = C 3, the cyclic group of order Cosets and Lagrange s Theorem Lemma Let H G. Consider the equivalence relation g 1 g 2 is an equivalence relation because: (reflectivity) g 1 1 g 1 H g 1 2 g 1 H. (transitivity) If g 1 3 g 2 H and g 1 2 g 1 H, then g 1 3 g 2g 1 2 g 1 = g 1 3 g 1 H. (symmetry) g 1 2 g 1 H g 1 1 g 2 = (g 1 2 g 1) 1 H. G is a disjoint union of the equivalent classes of. Definition 27.2 (Coset). Equivalent classes gh = {gh h H} are called left cosets of H. Proof. If g 2 g then g 1 2 g = h H, g 2 = gh gh. If g 2 gh, then g 2 = gh, h H and g 1 g 2 = h H. 50

51 Corollary Two left cosets are either the same or disjoint Corollary gh = H G = g i H Theorem 27.5 (Lagrange). If H G, G < then H G. Proof. G g 1 H g 2 H g k H G = k H where k is the number of left cosets. Corollary 27.6 (Corollary of Sylow s Theorem). If G = n = p α pαm m, p i p j primes. Then i = 1,..., m, G has a subgroup of order p αi i subgroup of order p αi i is called a Sylow p i -subgroup. and of order p i. A Theorem Every subgroup of order p is cyclic. Proof. Let H = p. a such that H = <a>. If not, then take some a H, <a> H.. <a> H <a> = H Consider S 3. S 3 = 6 = 2 3. S 3 has one subgroup of order 3: H = {e, (1 2 3), (1 3 2)}. S 3 has three subgroups of order 2: {e, (1 2)}, {e, (1 3)}, {e, (2 3)}. Example 27.8 (Triangle Group D 3 = S3 ). The group of symmetries of a regular triangle is called the triangle group or D 3, the dihedral group. Let ρ be rotation by 2π 3 : (1 2 3). Let r represent reflection. Then, D 3 = {e, ρ, ρ 2, r, ρr, ρ 2 r}. 51

52 Definition 27.9 (Isometry). An isometry of the plane is a bijection that preserves distances between any two points. Remark An isometry also preserves angles. Definition (Orientation preserving, reversing). An isometry is orientation preserving if it preserves an orientation of vertices of every triangle ( clockwise clockwise). Otherwise it is called an orientation reversing. Every orientation preserving isometry is either a translation or rotation. Every orientation reversing isometry is either reflection or a glide reflection: a reflection followed by translation parallel to the reflection line. Definition (Dihedral Group). D n is the dihedral group of symmetries of a regular n-gon. D n S n, D n = Sn n > 3. Example D 4 is the square. reflection: (1 2)(4 3). Example D n =< ρ, r ρ n = e, r 2 = e, ρr = rρ 1 > ρ is rotation by π 2 ( ). r is ρ 3 rρ 2 r = ρ 3 ρ 2 rr = ρe = ρ Example Take G = D 4, H =< e, r >. Find all left cosets of H in G. G = {e, r} {ρ, ρr} {ρ 2, ρ 2 r} {ρ 3, ρ 3 r} = H ρh ρ 2 H ρ 3 H G = 8, H = 2 Definition (index). The index [G : H] is the number of left cosets of H in G. Example [D 4 : H] = 4 Definition (Conjugate). If h, g G then h 1 gh is called the conjugate of g by h (also denoted g h ). Definition (Commutator). h 1 g 1 hg = [h, g] is called the commutator of h and g. Lemma Let σ S n, τ = ( k), then σ 1 τσ = (σ(1), σ(2),..., σ(k)). Proof. Let i {1,..., k}. σ(i) = i σ. (i σ ) σ 1 τσ = i σσ 1 τσ = i τσ (i + 1) σ mod k If i / {1,..., k}, (i σ ) σ 1 τσ = i σ. 52

53 Corollary σ 1 (i 1... i k )(j 1... j k )... (t 1... t k )σ = (σ(i 1 )... σ(i k ))(σ(j 1 )... σ(j k ))(σ(t 1 )... Definition (cyclic). A cyclic structure of a permutation is the expression 1 k1 2 k k5 where k 5 is the number of 5-cycles in the canonical representation of the permutation. Corollary Conjugation preserves the cyclic structure of a permutation. Example Find σ such that σ 1 τσ = δ where τ = (1 2)(4 5 3) δ = (4 5)(6 7 1) ( ) σ = = ( ) Example Find σ such that σ 1 τσ = δ where τ = (3 5 1)(4 7 6)(2 8) δ = (7 6)(2 1 3)(4 8 5) ( ) σ = = ( )(4) Example Find all subgroups of A 4 (the alternating group, which is the group of even permutations, on a 4 element set). S n = A n (1 2)A n Since every odd σ = (1 2)τ for some even τ. Suppose σ is odd, then τ = (1 2)σ is even σ = (1 2)τ. A 4 = S 4 2 = 4! 2 = 12 A 4 = {e, (1 2)(3 4), (1 3)(2 4), (1 4)(2 3), (1 2 3), (1 3 2), (1 3 4), (1 4 3), (1 2 4), (1 4 2), (2 3 4), (2 4 3)} Construct a digraph (Figure 20), vertices are labeled by subgroups. If H 1 H 2, then we draw an edge from H 1 to H 2. By symmetry, the product of any two elements of order two in A 4 give the third element of order 2. [(1 2)(3 4)][(1 3)(2 4)] = (1 4)(2 3) Order 6: A subgroup of order 6 must contain an element of order 3 and of order 2. Suppose it contains (1 2 3), then it contains (1 3 2). It also contains a product of two transpositions. (1 2 3) 1 (1 2)(3 4)(1 2 3) = (1 4)(2 3) (1 3 2) 1 (1 2)(3 4)(1 3 2) = (1 3)(2 4) We ve obtained 6 elements so far. Thus the seventh element is: (1 2)(3 4)(1 2 3)(1 2)(3 4) = (1 4 2). 53

54 Figure 20: A graph, called a lattice, showing the relation of the subgroups. Figure 13.4 in Bigg s text. Example Find the group of automorphisms of the graphs: An automorphism takes a vertex into a vertex of the same degree. We can extend every symmetry of a triangle 135 to an automorphism of the group. G = Aut(Γ) = D 3 Aut(Γ) = {e, (1 3 5)(2 4 6), (1 5 3)(2 6 4), (5 3)(6 2), (5 1)(2 4), (3 1)(4 6)} φ = Aut(Γ) D 3 =< ρ, r ρ 3 = e, r 2 = e, ρr = rρ 1 > φ is an isomorphism: (1 3 5)(2 4 6) φ ρ (5 3)(6 2) φ r 54

Graph and Digraph Glossary

Graph and Digraph Glossary 1 of 15 31.1.2004 14:45 Graph and Digraph Glossary A B C D E F G H I-J K L M N O P-Q R S T U V W-Z Acyclic Graph A graph is acyclic if it contains no cycles. Adjacency Matrix A 0-1 square matrix whose

More information

Discrete mathematics II. - Graphs

Discrete mathematics II. - Graphs Emil Vatai April 25, 2018 Basic definitions Definition of an undirected graph Definition (Undirected graph) An undirected graph or (just) a graph is a triplet G = (ϕ, E, V ), where V is the set of vertices,

More information

Basics of Graph Theory

Basics of Graph Theory Basics of Graph Theory 1 Basic notions A simple graph G = (V, E) consists of V, a nonempty set of vertices, and E, a set of unordered pairs of distinct elements of V called edges. Simple graphs have their

More information

Fundamental Properties of Graphs

Fundamental Properties of Graphs Chapter three In many real-life situations we need to know how robust a graph that represents a certain network is, how edges or vertices can be removed without completely destroying the overall connectivity,

More information

Elements of Graph Theory

Elements of Graph Theory Elements of Graph Theory Quick review of Chapters 9.1 9.5, 9.7 (studied in Mt1348/2008) = all basic concepts must be known New topics we will mostly skip shortest paths (Chapter 9.6), as that was covered

More information

Math 776 Graph Theory Lecture Note 1 Basic concepts

Math 776 Graph Theory Lecture Note 1 Basic concepts Math 776 Graph Theory Lecture Note 1 Basic concepts Lectured by Lincoln Lu Transcribed by Lincoln Lu Graph theory was founded by the great Swiss mathematician Leonhard Euler (1707-178) after he solved

More information

Introduction III. Graphs. Motivations I. Introduction IV

Introduction III. Graphs. Motivations I. Introduction IV Introduction I Graphs Computer Science & Engineering 235: Discrete Mathematics Christopher M. Bourke cbourke@cse.unl.edu Graph theory was introduced in the 18th century by Leonhard Euler via the Königsberg

More information

v V Question: How many edges are there in a graph with 10 vertices each of degree 6?

v V Question: How many edges are there in a graph with 10 vertices each of degree 6? ECS20 Handout Graphs and Trees March 4, 2015 (updated 3/9) Notion of a graph 1. A graph G = (V,E) consists of V, a nonempty set of vertices (or nodes) and E, a set of pairs of elements of V called edges.

More information

Characterizing Graphs (3) Characterizing Graphs (1) Characterizing Graphs (2) Characterizing Graphs (4)

Characterizing Graphs (3) Characterizing Graphs (1) Characterizing Graphs (2) Characterizing Graphs (4) S-72.2420/T-79.5203 Basic Concepts 1 S-72.2420/T-79.5203 Basic Concepts 3 Characterizing Graphs (1) Characterizing Graphs (3) Characterizing a class G by a condition P means proving the equivalence G G

More information

Graph Theory CS/Math231 Discrete Mathematics Spring2015

Graph Theory CS/Math231 Discrete Mathematics Spring2015 1 Graphs Definition 1 A directed graph (or digraph) G is a pair (V, E), where V is a finite set and E is a binary relation on V. The set V is called the vertex set of G, and its elements are called vertices

More information

Chapter 11: Graphs and Trees. March 23, 2008

Chapter 11: Graphs and Trees. March 23, 2008 Chapter 11: Graphs and Trees March 23, 2008 Outline 1 11.1 Graphs: An Introduction 2 11.2 Paths and Circuits 3 11.3 Matrix Representations of Graphs 4 11.5 Trees Graphs: Basic Definitions Informally, a

More information

4. (a) Draw the Petersen graph. (b) Use Kuratowski s teorem to prove that the Petersen graph is non-planar.

4. (a) Draw the Petersen graph. (b) Use Kuratowski s teorem to prove that the Petersen graph is non-planar. UPPSALA UNIVERSITET Matematiska institutionen Anders Johansson Graph Theory Frist, KandMa, IT 010 10 1 Problem sheet 4 Exam questions Solve a subset of, say, four questions to the problem session on friday.

More information

GRAPHS, GRAPH MODELS, GRAPH TERMINOLOGY, AND SPECIAL TYPES OF GRAPHS

GRAPHS, GRAPH MODELS, GRAPH TERMINOLOGY, AND SPECIAL TYPES OF GRAPHS GRAPHS, GRAPH MODELS, GRAPH TERMINOLOGY, AND SPECIAL TYPES OF GRAPHS DR. ANDREW SCHWARTZ, PH.D. 10.1 Graphs and Graph Models (1) A graph G = (V, E) consists of V, a nonempty set of vertices (or nodes)

More information

1. a graph G = (V (G), E(G)) consists of a set V (G) of vertices, and a set E(G) of edges (edges are pairs of elements of V (G))

1. a graph G = (V (G), E(G)) consists of a set V (G) of vertices, and a set E(G) of edges (edges are pairs of elements of V (G)) 10 Graphs 10.1 Graphs and Graph Models 1. a graph G = (V (G), E(G)) consists of a set V (G) of vertices, and a set E(G) of edges (edges are pairs of elements of V (G)) 2. an edge is present, say e = {u,

More information

Math 778S Spectral Graph Theory Handout #2: Basic graph theory

Math 778S Spectral Graph Theory Handout #2: Basic graph theory Math 778S Spectral Graph Theory Handout #: Basic graph theory Graph theory was founded by the great Swiss mathematician Leonhard Euler (1707-178) after he solved the Königsberg Bridge problem: Is it possible

More information

Graph Theory S 1 I 2 I 1 S 2 I 1 I 2

Graph Theory S 1 I 2 I 1 S 2 I 1 I 2 Graph Theory S I I S S I I S Graphs Definition A graph G is a pair consisting of a vertex set V (G), and an edge set E(G) ( ) V (G). x and y are the endpoints of edge e = {x, y}. They are called adjacent

More information

Assignment 4 Solutions of graph problems

Assignment 4 Solutions of graph problems Assignment 4 Solutions of graph problems 1. Let us assume that G is not a cycle. Consider the maximal path in the graph. Let the end points of the path be denoted as v 1, v k respectively. If either of

More information

Adjacent: Two distinct vertices u, v are adjacent if there is an edge with ends u, v. In this case we let uv denote such an edge.

Adjacent: Two distinct vertices u, v are adjacent if there is an edge with ends u, v. In this case we let uv denote such an edge. 1 Graph Basics What is a graph? Graph: a graph G consists of a set of vertices, denoted V (G), a set of edges, denoted E(G), and a relation called incidence so that each edge is incident with either one

More information

Chapter 2 Graphs. 2.1 Definition of Graphs

Chapter 2 Graphs. 2.1 Definition of Graphs Chapter 2 Graphs Abstract Graphs are discrete structures that consist of vertices and edges connecting some of these vertices. Graphs have many applications in Mathematics, Computer Science, Engineering,

More information

Assignments are handed in on Tuesdays in even weeks. Deadlines are:

Assignments are handed in on Tuesdays in even weeks. Deadlines are: Tutorials at 2 3, 3 4 and 4 5 in M413b, on Tuesdays, in odd weeks. i.e. on the following dates. Tuesday the 28th January, 11th February, 25th February, 11th March, 25th March, 6th May. Assignments are

More information

Chapter 3: Paths and Cycles

Chapter 3: Paths and Cycles Chapter 3: Paths and Cycles 5 Connectivity 1. Definitions: Walk: finite sequence of edges in which any two consecutive edges are adjacent or identical. (Initial vertex, Final vertex, length) Trail: walk

More information

Part II. Graph Theory. Year

Part II. Graph Theory. Year Part II Year 2017 2016 2015 2014 2013 2012 2011 2010 2009 2008 2007 2006 2005 2017 53 Paper 3, Section II 15H Define the Ramsey numbers R(s, t) for integers s, t 2. Show that R(s, t) exists for all s,

More information

SCHOOL OF ENGINEERING & BUILT ENVIRONMENT. Mathematics. An Introduction to Graph Theory

SCHOOL OF ENGINEERING & BUILT ENVIRONMENT. Mathematics. An Introduction to Graph Theory SCHOOL OF ENGINEERING & BUILT ENVIRONMENT Mathematics An Introduction to Graph Theory. Introduction. Definitions.. Vertices and Edges... The Handshaking Lemma.. Connected Graphs... Cut-Points and Bridges.

More information

Discrete mathematics , Fall Instructor: prof. János Pach

Discrete mathematics , Fall Instructor: prof. János Pach Discrete mathematics 2016-2017, Fall Instructor: prof. János Pach - covered material - Lecture 1. Counting problems To read: [Lov]: 1.2. Sets, 1.3. Number of subsets, 1.5. Sequences, 1.6. Permutations,

More information

INTRODUCTION TO GRAPH THEORY. 1. Definitions

INTRODUCTION TO GRAPH THEORY. 1. Definitions INTRODUCTION TO GRAPH THEORY D. JAKOBSON 1. Definitions A graph G consists of vertices {v 1, v 2,..., v n } and edges {e 1, e 2,..., e m } connecting pairs of vertices. An edge e = (uv) is incident with

More information

Graphs and trees come up everywhere. We can view the internet as a graph (in many ways) Web search views web pages as a graph

Graphs and trees come up everywhere. We can view the internet as a graph (in many ways) Web search views web pages as a graph Graphs and Trees Graphs and trees come up everywhere. We can view the internet as a graph (in many ways) who is connected to whom Web search views web pages as a graph Who points to whom Niche graphs (Ecology):

More information

Number Theory and Graph Theory

Number Theory and Graph Theory 1 Number Theory and Graph Theory Chapter 7 Graph properties By A. Satyanarayana Reddy Department of Mathematics Shiv Nadar University Uttar Pradesh, India E-mail: satya8118@gmail.com 2 Module-2: Eulerian

More information

Artificial Intelligence

Artificial Intelligence Artificial Intelligence Graph theory G. Guérard Department of Nouvelles Energies Ecole Supérieur d Ingénieurs Léonard de Vinci Lecture 1 GG A.I. 1/37 Outline 1 Graph theory Undirected and directed graphs

More information

Lecture 6: Graph Properties

Lecture 6: Graph Properties Lecture 6: Graph Properties Rajat Mittal IIT Kanpur In this section, we will look at some of the combinatorial properties of graphs. Initially we will discuss independent sets. The bulk of the content

More information

Varying Applications (examples)

Varying Applications (examples) Graph Theory Varying Applications (examples) Computer networks Distinguish between two chemical compounds with the same molecular formula but different structures Solve shortest path problems between cities

More information

Bipartite Roots of Graphs

Bipartite Roots of Graphs Bipartite Roots of Graphs Lap Chi Lau Department of Computer Science University of Toronto Graph H is a root of graph G if there exists a positive integer k such that x and y are adjacent in G if and only

More information

Treewidth and graph minors

Treewidth and graph minors Treewidth and graph minors Lectures 9 and 10, December 29, 2011, January 5, 2012 We shall touch upon the theory of Graph Minors by Robertson and Seymour. This theory gives a very general condition under

More information

Introduction to Graph Theory

Introduction to Graph Theory Introduction to Graph Theory Tandy Warnow January 20, 2017 Graphs Tandy Warnow Graphs A graph G = (V, E) is an object that contains a vertex set V and an edge set E. We also write V (G) to denote the vertex

More information

Graph theory. Po-Shen Loh. June We begin by collecting some basic facts which can be proved via bare-hands techniques.

Graph theory. Po-Shen Loh. June We begin by collecting some basic facts which can be proved via bare-hands techniques. Graph theory Po-Shen Loh June 013 1 Basic results We begin by collecting some basic facts which can be proved via bare-hands techniques. 1. The sum of all of the degrees is equal to twice the number of

More information

MATH 363 Final Wednesday, April 28. Final exam. You may use lemmas and theorems that were proven in class and on assignments unless stated otherwise.

MATH 363 Final Wednesday, April 28. Final exam. You may use lemmas and theorems that were proven in class and on assignments unless stated otherwise. Final exam This is a closed book exam. No calculators are allowed. Unless stated otherwise, justify all your steps. You may use lemmas and theorems that were proven in class and on assignments unless stated

More information

Discrete Mathematics (2009 Spring) Graphs (Chapter 9, 5 hours)

Discrete Mathematics (2009 Spring) Graphs (Chapter 9, 5 hours) Discrete Mathematics (2009 Spring) Graphs (Chapter 9, 5 hours) Chih-Wei Yi Dept. of Computer Science National Chiao Tung University June 1, 2009 9.1 Graphs and Graph Models What are Graphs? General meaning

More information

Module 7. Independent sets, coverings. and matchings. Contents

Module 7. Independent sets, coverings. and matchings. Contents Module 7 Independent sets, coverings Contents and matchings 7.1 Introduction.......................... 152 7.2 Independent sets and coverings: basic equations..... 152 7.3 Matchings in bipartite graphs................

More information

Algorithms: Graphs. Amotz Bar-Noy. Spring 2012 CUNY. Amotz Bar-Noy (CUNY) Graphs Spring / 95

Algorithms: Graphs. Amotz Bar-Noy. Spring 2012 CUNY. Amotz Bar-Noy (CUNY) Graphs Spring / 95 Algorithms: Graphs Amotz Bar-Noy CUNY Spring 2012 Amotz Bar-Noy (CUNY) Graphs Spring 2012 1 / 95 Graphs Definition: A graph is a collection of edges and vertices. Each edge connects two vertices. Amotz

More information

Algorithms. Graphs. Algorithms

Algorithms. Graphs. Algorithms Algorithms Graphs Algorithms Graphs Definition: A graph is a collection of edges and vertices. Each edge connects two vertices. Algorithms 1 Graphs Vertices: Nodes, points, computers, users, items,...

More information

Jordan Curves. A curve is a subset of IR 2 of the form

Jordan Curves. A curve is a subset of IR 2 of the form Jordan Curves A curve is a subset of IR 2 of the form α = {γ(x) : x [0, 1]}, where γ : [0, 1] IR 2 is a continuous mapping from the closed interval [0, 1] to the plane. γ(0) and γ(1) are called the endpoints

More information

Discrete mathematics

Discrete mathematics Discrete mathematics Petr Kovář petr.kovar@vsb.cz VŠB Technical University of Ostrava DiM 470-2301/02, Winter term 2018/2019 About this file This file is meant to be a guideline for the lecturer. Many

More information

Section Summary. Introduction to Trees Rooted Trees Trees as Models Properties of Trees

Section Summary. Introduction to Trees Rooted Trees Trees as Models Properties of Trees Chapter 11 Copyright McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill Education. Chapter Summary Introduction to Trees Applications

More information

Lecture Notes on Graph Theory

Lecture Notes on Graph Theory Lecture Notes on Graph Theory Vadim Lozin 1 Introductory concepts A graph G = (V, E) consists of two finite sets V and E. The elements of V are called the vertices and the elements of E the edges of G.

More information

Exercise set 2 Solutions

Exercise set 2 Solutions Exercise set 2 Solutions Let H and H be the two components of T e and let F E(T ) consist of the edges of T with one endpoint in V (H), the other in V (H ) Since T is connected, F Furthermore, since T

More information

Crossing bridges. Crossing bridges Great Ideas in Theoretical Computer Science. Lecture 12: Graphs I: The Basics. Königsberg (Prussia)

Crossing bridges. Crossing bridges Great Ideas in Theoretical Computer Science. Lecture 12: Graphs I: The Basics. Königsberg (Prussia) 15-251 Great Ideas in Theoretical Computer Science Lecture 12: Graphs I: The Basics February 22nd, 2018 Crossing bridges Königsberg (Prussia) Now Kaliningrad (Russia) Is there a way to walk through the

More information

WUCT121. Discrete Mathematics. Graphs

WUCT121. Discrete Mathematics. Graphs WUCT121 Discrete Mathematics Graphs WUCT121 Graphs 1 Section 1. Graphs 1.1. Introduction Graphs are used in many fields that require analysis of routes between locations. These areas include communications,

More information

Graph Theory. Part of Texas Counties.

Graph Theory. Part of Texas Counties. Graph Theory Part of Texas Counties. We would like to visit each of the above counties, crossing each county only once, starting from Harris county. Is this possible? This problem can be modeled as a graph.

More information

Graph Theory. 1 Introduction to Graphs. Martin Stynes Department of Mathematics, UCC January 26, 2011

Graph Theory. 1 Introduction to Graphs. Martin Stynes Department of Mathematics, UCC   January 26, 2011 Graph Theory Martin Stynes Department of Mathematics, UCC email: m.stynes@ucc.ie January 26, 2011 1 Introduction to Graphs 1 A graph G = (V, E) is a non-empty set of nodes or vertices V and a (possibly

More information

Chapter 3 Trees. Theorem A graph T is a tree if, and only if, every two distinct vertices of T are joined by a unique path.

Chapter 3 Trees. Theorem A graph T is a tree if, and only if, every two distinct vertices of T are joined by a unique path. Chapter 3 Trees Section 3. Fundamental Properties of Trees Suppose your city is planning to construct a rapid rail system. They want to construct the most economical system possible that will meet the

More information

IMO Training 2008: Graph Theory

IMO Training 2008: Graph Theory IMO Training 2008: Graph Theory by: Adrian Tang Email: tang @ math.ucalgary.ca This is a compilation of math problems (with motivation towards the training for the International Mathematical Olympiad)

More information

Basic Combinatorics. Math 40210, Section 01 Fall Homework 4 Solutions

Basic Combinatorics. Math 40210, Section 01 Fall Homework 4 Solutions Basic Combinatorics Math 40210, Section 01 Fall 2012 Homework 4 Solutions 1.4.2 2: One possible implementation: Start with abcgfjiea From edge cd build, using previously unmarked edges: cdhlponminjkghc

More information

MATH 350 GRAPH THEORY & COMBINATORICS. Contents

MATH 350 GRAPH THEORY & COMBINATORICS. Contents MATH 350 GRAPH THEORY & COMBINATORICS PROF. SERGEY NORIN, FALL 2013 Contents 1. Basic definitions 1 2. Connectivity 2 3. Trees 3 4. Spanning Trees 3 5. Shortest paths 4 6. Eulerian & Hamiltonian cycles

More information

UNDIRECTED GRAPH: a set of vertices and a set of undirected edges each of which is associated with a set of one or two of these vertices.

UNDIRECTED GRAPH: a set of vertices and a set of undirected edges each of which is associated with a set of one or two of these vertices. Graphs 1 Graph: A graph G = (V, E) consists of a nonempty set of vertices (or nodes) V and a set of edges E. Each edge has either one or two vertices associated with it, called its endpoints. An edge is

More information

Foundations of Discrete Mathematics

Foundations of Discrete Mathematics Foundations of Discrete Mathematics Chapter 12 By Dr. Dalia M. Gil, Ph.D. Trees Tree are useful in computer science, where they are employed in a wide range of algorithms. They are used to construct efficient

More information

ECS 20 Lecture 17b = Discussion D8 Fall Nov 2013 Phil Rogaway

ECS 20 Lecture 17b = Discussion D8 Fall Nov 2013 Phil Rogaway 1 ECS 20 Lecture 17b = Discussion D8 Fall 2013 25 Nov 2013 Phil Rogaway Today: Using discussion section to finish up graph theory. Much of these notes the same as those prepared for last lecture and the

More information

CS 311 Discrete Math for Computer Science Dr. William C. Bulko. Graphs

CS 311 Discrete Math for Computer Science Dr. William C. Bulko. Graphs CS 311 Discrete Math for Computer Science Dr. William C. Bulko Graphs 2014 Definitions Definition: A graph G = (V,E) consists of a nonempty set V of vertices (or nodes) and a set E of edges. Each edge

More information

Module 11. Directed Graphs. Contents

Module 11. Directed Graphs. Contents Module 11 Directed Graphs Contents 11.1 Basic concepts......................... 256 Underlying graph of a digraph................ 257 Out-degrees and in-degrees.................. 258 Isomorphism..........................

More information

Number Theory and Graph Theory

Number Theory and Graph Theory 1 Number Theory and Graph Theory Chapter 6 Basic concepts and definitions of graph theory By A. Satyanarayana Reddy Department of Mathematics Shiv Nadar University Uttar Pradesh, India E-mail: satya8118@gmail.com

More information

Definition For vertices u, v V (G), the distance from u to v, denoted d(u, v), in G is the length of a shortest u, v-path. 1

Definition For vertices u, v V (G), the distance from u to v, denoted d(u, v), in G is the length of a shortest u, v-path. 1 Graph fundamentals Bipartite graph characterization Lemma. If a graph contains an odd closed walk, then it contains an odd cycle. Proof strategy: Consider a shortest closed odd walk W. If W is not a cycle,

More information

Matching Theory. Figure 1: Is this graph bipartite?

Matching Theory. Figure 1: Is this graph bipartite? Matching Theory 1 Introduction A matching M of a graph is a subset of E such that no two edges in M share a vertex; edges which have this property are called independent edges. A matching M is said to

More information

Simple graph Complete graph K 7. Non- connected graph

Simple graph Complete graph K 7. Non- connected graph A graph G consists of a pair (V; E), where V is the set of vertices and E the set of edges. We write V (G) for the vertices of G and E(G) for the edges of G. If no two edges have the same endpoints we

More information

Problem Set 2 Solutions

Problem Set 2 Solutions Problem Set 2 Solutions Graph Theory 2016 EPFL Frank de Zeeuw & Claudiu Valculescu 1. Prove that the following statements about a graph G are equivalent. - G is a tree; - G is minimally connected (it is

More information

Lecture 22 Tuesday, April 10

Lecture 22 Tuesday, April 10 CIS 160 - Spring 2018 (instructor Val Tannen) Lecture 22 Tuesday, April 10 GRAPH THEORY Directed Graphs Directed graphs (a.k.a. digraphs) are an important mathematical modeling tool in Computer Science,

More information

The Konigsberg Bridge Problem

The Konigsberg Bridge Problem The Konigsberg Bridge Problem This is a classic mathematical problem. There were seven bridges across the river Pregel at Königsberg. Is it possible to take a walk in which each bridge is crossed exactly

More information

Lecture 20 : Trees DRAFT

Lecture 20 : Trees DRAFT CS/Math 240: Introduction to Discrete Mathematics 4/12/2011 Lecture 20 : Trees Instructor: Dieter van Melkebeek Scribe: Dalibor Zelený DRAFT Last time we discussed graphs. Today we continue this discussion,

More information

Chapter 12 and 11.1 Planar graphs, regular polyhedra, and graph colorings

Chapter 12 and 11.1 Planar graphs, regular polyhedra, and graph colorings Chapter 12 and 11.1 Planar graphs, regular polyhedra, and graph colorings Prof. Tesler Math 184A Fall 2017 Prof. Tesler Ch. 12: Planar Graphs Math 184A / Fall 2017 1 / 45 12.1 12.2. Planar graphs Definition

More information

CHAPTER 2. Graphs. 1. Introduction to Graphs and Graph Isomorphism

CHAPTER 2. Graphs. 1. Introduction to Graphs and Graph Isomorphism CHAPTER 2 Graphs 1. Introduction to Graphs and Graph Isomorphism 1.1. The Graph Menagerie. Definition 1.1.1. A simple graph G = (V, E) consists of a set V of vertices and a set E of edges, represented

More information

CMSC Honors Discrete Mathematics

CMSC Honors Discrete Mathematics CMSC 27130 Honors Discrete Mathematics Lectures by Alexander Razborov Notes by Justin Lubin The University of Chicago, Autumn 2017 1 Contents I Number Theory 4 1 The Euclidean Algorithm 4 2 Mathematical

More information

1 Digraphs. Definition 1

1 Digraphs. Definition 1 1 Digraphs Definition 1 Adigraphordirected graphgisatriplecomprisedofavertex set V(G), edge set E(G), and a function assigning each edge an ordered pair of vertices (tail, head); these vertices together

More information

DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI

DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI Department of Computer Science and Engineering CS6702 - GRAPH THEORY AND APPLICATIONS Anna University 2 & 16 Mark Questions & Answers Year / Semester: IV /

More information

CHAPTER 10 GRAPHS AND TREES. Alessandro Artale UniBZ - artale/z

CHAPTER 10 GRAPHS AND TREES. Alessandro Artale UniBZ -  artale/z CHAPTER 10 GRAPHS AND TREES Alessandro Artale UniBZ - http://www.inf.unibz.it/ artale/z SECTION 10.1 Graphs: Definitions and Basic Properties Copyright Cengage Learning. All rights reserved. Graphs: Definitions

More information

Combinatorics Summary Sheet for Exam 1 Material 2019

Combinatorics Summary Sheet for Exam 1 Material 2019 Combinatorics Summary Sheet for Exam 1 Material 2019 1 Graphs Graph An ordered three-tuple (V, E, F ) where V is a set representing the vertices, E is a set representing the edges, and F is a function

More information

Majority and Friendship Paradoxes

Majority and Friendship Paradoxes Majority and Friendship Paradoxes Majority Paradox Example: Small town is considering a bond initiative in an upcoming election. Some residents are in favor, some are against. Consider a poll asking the

More information

Hamiltonian cycles in bipartite quadrangulations on the torus

Hamiltonian cycles in bipartite quadrangulations on the torus Hamiltonian cycles in bipartite quadrangulations on the torus Atsuhiro Nakamoto and Kenta Ozeki Abstract In this paper, we shall prove that every bipartite quadrangulation G on the torus admits a simple

More information

Brief History. Graph Theory. What is a graph? Types of graphs Directed graph: a graph that has edges with specific directions

Brief History. Graph Theory. What is a graph? Types of graphs Directed graph: a graph that has edges with specific directions Brief History Graph Theory What is a graph? It all began in 1736 when Leonhard Euler gave a proof that not all seven bridges over the Pregolya River could all be walked over once and end up where you started.

More information

14 More Graphs: Euler Tours and Hamilton Cycles

14 More Graphs: Euler Tours and Hamilton Cycles 14 More Graphs: Euler Tours and Hamilton Cycles 14.1 Degrees The degree of a vertex is the number of edges coming out of it. The following is sometimes called the First Theorem of Graph Theory : Lemma

More information

Lecture 1: Examples, connectedness, paths and cycles

Lecture 1: Examples, connectedness, paths and cycles Lecture 1: Examples, connectedness, paths and cycles Anders Johansson 2011-10-22 lör Outline The course plan Examples and applications of graphs Relations The definition of graphs as relations Connectedness,

More information

Key Graph Theory Theorems

Key Graph Theory Theorems Key Graph Theory Theorems Rajesh Kumar MATH 239 Intro to Combinatorics August 19, 2008 3.3 Binary Trees 3.3.1 Problem (p.82) Determine the number, t n, of binary trees with n edges. The number of binary

More information

A graph is finite if its vertex set and edge set are finite. We call a graph with just one vertex trivial and all other graphs nontrivial.

A graph is finite if its vertex set and edge set are finite. We call a graph with just one vertex trivial and all other graphs nontrivial. 2301-670 Graph theory 1.1 What is a graph? 1 st semester 2550 1 1.1. What is a graph? 1.1.2. Definition. A graph G is a triple (V(G), E(G), ψ G ) consisting of V(G) of vertices, a set E(G), disjoint from

More information

Matching and Planarity

Matching and Planarity Matching and Planarity Po-Shen Loh June 010 1 Warm-up 1. (Bondy 1.5.9.) There are n points in the plane such that every pair of points has distance 1. Show that there are at most n (unordered) pairs of

More information

Advanced Algorithms Class Notes for Monday, October 23, 2012 Min Ye, Mingfu Shao, and Bernard Moret

Advanced Algorithms Class Notes for Monday, October 23, 2012 Min Ye, Mingfu Shao, and Bernard Moret Advanced Algorithms Class Notes for Monday, October 23, 2012 Min Ye, Mingfu Shao, and Bernard Moret Greedy Algorithms (continued) The best known application where the greedy algorithm is optimal is surely

More information

3 Euler Tours, Hamilton Cycles, and Their Applications

3 Euler Tours, Hamilton Cycles, and Their Applications 3 Euler Tours, Hamilton Cycles, and Their Applications 3.1 Euler Tours and Applications 3.1.1 Euler tours Carefully review the definition of (closed) walks, trails, and paths from Section 1... Definition

More information

context. (Similarly, we write ν for ν(g), etc. if there is no risk of confusion.) For a subset A V we write N G (A) = {v V ( w A)(v w)} (the set of

context. (Similarly, we write ν for ν(g), etc. if there is no risk of confusion.) For a subset A V we write N G (A) = {v V ( w A)(v w)} (the set of Graph Theory CMSC-27500 Spring 2015 http://people.cs.uchicago.edu/ laci/15graphs Homework set #4. First batch posted 4-9, 8am, updated 10:20am. Problems 4.16 4.31 added at 11:30pm. Due Tuesday, April 14

More information

Math 170- Graph Theory Notes

Math 170- Graph Theory Notes 1 Math 170- Graph Theory Notes Michael Levet December 3, 2018 Notation: Let n be a positive integer. Denote [n] to be the set {1, 2,..., n}. So for example, [3] = {1, 2, 3}. To quote Bud Brown, Graph theory

More information

How can we lay cable at minimum cost to make every telephone reachable from every other? What is the fastest route between two given cities?

How can we lay cable at minimum cost to make every telephone reachable from every other? What is the fastest route between two given cities? 1 Introduction Graph theory is one of the most in-demand (i.e. profitable) and heavily-studied areas of applied mathematics and theoretical computer science. May graph theory questions are applied in this

More information

CS521 \ Notes for the Final Exam

CS521 \ Notes for the Final Exam CS521 \ Notes for final exam 1 Ariel Stolerman Asymptotic Notations: CS521 \ Notes for the Final Exam Notation Definition Limit Big-O ( ) Small-o ( ) Big- ( ) Small- ( ) Big- ( ) Notes: ( ) ( ) ( ) ( )

More information

Graph Theory II. Po-Shen Loh. June edges each. Solution: Spread the n vertices around a circle. Take parallel classes.

Graph Theory II. Po-Shen Loh. June edges each. Solution: Spread the n vertices around a circle. Take parallel classes. Graph Theory II Po-Shen Loh June 009 1 Warm-up 1. Let n be odd. Partition the edge set of K n into n matchings with n 1 edges each. Solution: Spread the n vertices around a circle. Take parallel classes..

More information

Discrete Mathematics Course Review 3

Discrete Mathematics Course Review 3 21-228 Discrete Mathematics Course Review 3 This document contains a list of the important definitions and theorems that have been covered thus far in the course. It is not a complete listing of what has

More information

CS6702 GRAPH THEORY AND APPLICATIONS QUESTION BANK

CS6702 GRAPH THEORY AND APPLICATIONS QUESTION BANK CS6702 GRAPH THEORY AND APPLICATIONS 2 MARKS QUESTIONS AND ANSWERS 1 UNIT I INTRODUCTION CS6702 GRAPH THEORY AND APPLICATIONS QUESTION BANK 1. Define Graph. 2. Define Simple graph. 3. Write few problems

More information

List of Theorems. Mat 416, Introduction to Graph Theory. Theorem 1 The numbers R(p, q) exist and for p, q 2,

List of Theorems. Mat 416, Introduction to Graph Theory. Theorem 1 The numbers R(p, q) exist and for p, q 2, List of Theorems Mat 416, Introduction to Graph Theory 1. Ramsey s Theorem for graphs 8.3.11. Theorem 1 The numbers R(p, q) exist and for p, q 2, R(p, q) R(p 1, q) + R(p, q 1). If both summands on the

More information

CS 2336 Discrete Mathematics

CS 2336 Discrete Mathematics CS 2336 Discrete Mathematics Lecture 15 Graphs: Planar Graphs 1 Outline What is a Planar Graph? Euler Planar Formula Platonic Solids Five Color Theorem Kuratowski s Theorem 2 What is a Planar Graph? Definition

More information

The Structure of Bull-Free Perfect Graphs

The Structure of Bull-Free Perfect Graphs The Structure of Bull-Free Perfect Graphs Maria Chudnovsky and Irena Penev Columbia University, New York, NY 10027 USA May 18, 2012 Abstract The bull is a graph consisting of a triangle and two vertex-disjoint

More information

Chapter Summary. Introduction to Trees Applications of Trees Tree Traversal Spanning Trees Minimum Spanning Trees

Chapter Summary. Introduction to Trees Applications of Trees Tree Traversal Spanning Trees Minimum Spanning Trees Trees Chapter 11 Chapter Summary Introduction to Trees Applications of Trees Tree Traversal Spanning Trees Minimum Spanning Trees Introduction to Trees Section 11.1 Section Summary Introduction to Trees

More information

1. [1 pt] What is the solution to the recurrence T(n) = 2T(n-1) + 1, T(1) = 1

1. [1 pt] What is the solution to the recurrence T(n) = 2T(n-1) + 1, T(1) = 1 Asymptotics, Recurrence and Basic Algorithms 1. [1 pt] What is the solution to the recurrence T(n) = 2T(n-1) + 1, T(1) = 1 1. O(logn) 2. O(n) 3. O(nlogn) 4. O(n 2 ) 5. O(2 n ) 2. [1 pt] What is the solution

More information

CLAW-FREE 3-CONNECTED P 11 -FREE GRAPHS ARE HAMILTONIAN

CLAW-FREE 3-CONNECTED P 11 -FREE GRAPHS ARE HAMILTONIAN CLAW-FREE 3-CONNECTED P 11 -FREE GRAPHS ARE HAMILTONIAN TOMASZ LUCZAK AND FLORIAN PFENDER Abstract. We show that every 3-connected claw-free graph which contains no induced copy of P 11 is hamiltonian.

More information

K 4 C 5. Figure 4.5: Some well known family of graphs

K 4 C 5. Figure 4.5: Some well known family of graphs 08 CHAPTER. TOPICS IN CLASSICAL GRAPH THEORY K, K K K, K K, K K, K C C C C 6 6 P P P P P. Graph Operations Figure.: Some well known family of graphs A graph Y = (V,E ) is said to be a subgraph of a graph

More information

Modules. 6 Hamilton Graphs (4-8 lectures) Introduction Necessary conditions and sufficient conditions Exercises...

Modules. 6 Hamilton Graphs (4-8 lectures) Introduction Necessary conditions and sufficient conditions Exercises... Modules 6 Hamilton Graphs (4-8 lectures) 135 6.1 Introduction................................ 136 6.2 Necessary conditions and sufficient conditions............. 137 Exercises..................................

More information

Lecture 2 - Graph Theory Fundamentals - Reachability and Exploration 1

Lecture 2 - Graph Theory Fundamentals - Reachability and Exploration 1 CME 305: Discrete Mathematics and Algorithms Instructor: Professor Aaron Sidford (sidford@stanford.edu) January 11, 2018 Lecture 2 - Graph Theory Fundamentals - Reachability and Exploration 1 In this lecture

More information

TWO CONTRIBUTIONS OF EULER

TWO CONTRIBUTIONS OF EULER TWO CONTRIBUTIONS OF EULER SIEMION FAJTLOWICZ. MATH 4315 Eulerian Tours. Although some mathematical problems which now can be thought of as graph-theoretical, go back to the times of Euclid, the invention

More information

Lecture 5: Graphs. Rajat Mittal. IIT Kanpur

Lecture 5: Graphs. Rajat Mittal. IIT Kanpur Lecture : Graphs Rajat Mittal IIT Kanpur Combinatorial graphs provide a natural way to model connections between different objects. They are very useful in depicting communication networks, social networks

More information