Chapter 10: Graphs 10.1
Total Page:16
File Type:pdf, Size:1020Kb
Chapter 10: Graphs 10.1 - Introduction to Graphs Definition 1 (Graph). A graph G = (V; E) consists of a nonempty set V of vertices (or nodes) and a set E of edges. V may be finite or infinite { if V is finite we say the graph is finite, if V is infinite then we say the graph is infinite. Every edge has either one or two vertices associated with it, called its endpoints. An edge is said to connect its endpoints. Example 1. Definition 2 (Types of Graphs). Simple Graph: Undirected edges, no multiple edges, no loops. a f b e c d Multigraph: Undirected edges, multiple edges allowed, no loops. a f b e c d Pseudograph: Undirected edges, multiple edges allowed, loops allowed. a f b e c d 1 Digraph: Directed edges, no multiple edges [in the same direction], loops allowed. a f b e c d Simple Directed Graph (Simple Digraph): Directed edges, no multiple edges, no loops. a f b e c d Directed Multigraph: Directed edges, multiple edges allowed, loops allowed. a f b e c d Mixed Graph: Anything goes. a f b e c d 2 10.2 - Terminology and Special Graphs Definition 3. Two vertices u and v in an undirected graph G are said to be adjacent (or neighbors) if and only if u and v are endpoints of the same edge e of G. The edge e is said to be incident with u and v and said to connect u and v. Definition 4 (Neighborhood). The set of all neighbors of a vertex v in a graph G = (V; E) is denoted by N(v) and is called the neighborhood of v. If A ⊆ V then the set of all vertices in G that are adjacent to at least one vertex in A is [ N(A) = N(v): v2A Definition 5 (Degree). The degree of a vertex v in an undirected graph, denoted deg(v), is the number of edges incident with v. A loop at v contributes twice to the degree of v. Theorem 1 (The Handshaking Theorem). Suppose G = (V; E) is an undirected graph with jEj = m. Then X 2m = deg(v): v2V Definition 6. Suppose (u; v) is an edge of a directed graph G. Then u is said to be adjacent to v and v is said to be adjacent from u. We say that u is the initial vertex of (u; v) and that v is the terminal vertex of (u; v). Definition 7 (Degree). Let G be a directed graph. The in-degree of a vertex v is the number of edges with v as their terminal vertex, and is denoted by deg−(v). The out-degree of v is the number of edges with v as their initial vertex, and is denoted by deg+(v). A loop at v adds 1 to both the in- and out-degrees. 3 Special Graphs Complete Graphs Kn, n ≥ 1 Vertex set V = fv1; v2; v3; : : : ; vng. Edge set E = f(vi; vj) j 1 ≤ i < j ≤ ng (i.e., all possible edges). Cycles Cn, n ≥ 3 Vertex set V = fv1; v2; v3; : : : ; vng. Edge set E = f(v1; v2); (v2; v3); (v3; v4);::: (vn−1; vn); (vn; v1)g. Wheels Wn, n ≥ 3 Vertex set V = fv1; v2; v3; : : : ; vn; vn+1g. Edge set E = f(v1; v2); (v2; v3); (v3; v4);::: (vn−1; vn); (vn; v1); (vn+1; v1); (vn+1; v2); (vn+1; v3);:::; (vn+1; vn)g. n-Cubes Qn,, n ≥ 1 4 Bipartite Graphs Definition 8 (Bipartite Graph). A pseudograph [i.e., undirected, multiple edges and loops allowed] G = (V; E) is said 1 to be bipartite iff there is a \two-set partition fV1;V2g of V " such that every edge e 2 E has one of its endpoints in V1 and the other in V2. Complete Bipartite Graphs Km;n A simple bipartite graph with m + n vertices and as many edges as possbile: Theorem 2. A simple graph is bipartite iff it is possible to assign one of two different colors to each vertex of the graph so that no two adjacent vertices are assigned the same color. 1 In this context this means that V1 [ V2 = V and V1 \ V2 = ?. 5 Creating New Graphs from Old Definition 9 (Subgraph). A graph Ge = V;e Ee is a subgraph of G = (V; E) iff Ve ⊆ V and Ee ⊆ E. Definition 10 (Union and Intersection). The union of two graphs G1 = (V1;E1) and G2 = (V2;E2) is G1 [ G2 = (V1 [ V2;E1 [ E2). The intersection of G1 and G2 is G1 \ G2 = (V1 \ V2;E1 \ E2). Definition 11 (Complement). The complement of a graph G = (V; E) is the graph G = V; E = fall possible edges that are not also in Eg : Example 2. a a f b f b e c e c d d G1 G2 (a) Is the following graph a subgraph of either G1 or G2? f b c d (b) Find G1, G2, G1 [ G2, and G1 \ G2. 6 10.4 - Connectivity Definition 12 (Path of Length n). Let G = (V; E) be a pseudograph and let n be a positive integer. A path of length n between vertices v and w is a sequence of edges e1; e2; : : : ; en 2 E such that e1 = fv; v1g, e2 = fv1; v2g,..., en−1 = fvn−2; vn−1g, en = fvn−1; wg for some v1; v2; : : : ; vn−1 2 V . Example 3. a b e d c Definition 13 (Circuit). A circuit of length n is a path of length n with v = w (i.e., the same starting and ending vertex). Definition 14 (Simple Path/Circuit). A simple path or simple circuit is one in which no edge is repeated. Definition 15 (Connected). An undirected graph is said to be connected if and only if there is a path between every pair of distinct vertices. Example 4. a b a b d d c c Definition 16 (Disconnecting). We say that we have disconnected a graph when, given a connected graph, we remove vertices or edges (or both) to form a disconnected graph. Example 5. (10.4.1) a b c Are these paths? If so are they simple? circuits? What is the length? 1. a; e; b; c; b 2. a; e; a; d; b; c; a d e 3. e; b; a; d; b; e 4. c; b; d; a; e; c 7 10.5 - Euler and Hamilton Paths Definition 17 (Euler Path). An Euler path is a simple path containing every edge of G. Definition 18 (Euler Circuit). An Euler circuit is a simple circuit containing every edge of G. Definition 19 (Hamilton Path). A simple path that passes through every vertex exactly once is called a Hamilton path. Definition 20 (Hamilton Circuit). A simple circuit that passes through every vertex exactly once is called a Hamilton circuit. (The preceding definitions all hold for directed and undirected graphs.) Recall that a multigraph is an undirected graph in which multiple edges are allowed but loops are not allowed. Theorem 3. A connected multigraph with jV j ≥ 2 has an Euler circuit if and only if each of its vertices has even degree. Theorem 4. A connected multigraph has an Euler path (but not an Euler circuit) if and only if it has exactly two vertices of odd degree. (The book has the reader prove analogous theorems for directed graphs in the exercises.) Theorem 5 (Dirac's Theorem). If G is a simple graph with n ≥ 3 vertices such that the degree of every vertex in G is n ≥ 2 then G has a Hamilton circuit. Theorem 6 (Ore's Theorem). If G is a simple graph with n ≥ 3 vertices such that deg(u) + deg(v) ≥ n for every pair of non-adjacent vertices u; v 2 G then G has a Hamilton circuit. Example 6. Determine whether there exists an Euler circuit (if so, draw one). If no Euler circuit then determine whether it has an Euler path (if so, draw one). 1. (10.5.2) 2. (10.5.4) 8 10.7 - Planar Graphs Definition 21 (Planar). A graph is planar if and only if it can be drawn in the plane without any crossing edges. Example 7. K5 and K3;3 are not planar. Q3 is planar: K2;3 is planar: Theorem 7 (Euler's Formula). Let G = (V; E) be a connected simple planar graph and let r be the number of regions in a planar representation of G. Then r = jEj − jV j + 2: Corollary 8. Let G = (V; E) be a connected simple graph with jEj = e and jV j = v ≥ 3. 1. If G is planar then e ≤ 3v − 6. So, if e > 3v − 6 then G is not planar. 2. If G is planar then there exists a vertex of degree ≤ 5. So, if the degrees of all vertices are > 5 then G is not planar. 3. Suppose G also has no circuits of length 3. If G is planar then e ≤ 2v − 4. So, if e > 2v − 4 then G is not planar. Note that in the preceeding corollary the contrapositive is the more useful form of the result if our goal is to determine whether a graph is not planar. Example 8. K5 Example 9. K3;3 9 Definition 22 (Elementary Subdivision). An elementary subdivision of a graph is the operation whereby we remove an edge fu; vg and add a vertex w and the edges fu; wg and fw; vg Definition 23 (Homeomorphic).