Download Presentation
## Foundations of Discrete Mathematics

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -

**Foundations of Discrete Mathematics**Chapters 9 and 10 By Dr. Dalia M. Gil, Ph.D.**Graphs**• Graphs are discrete structures consisting of vertices and edges that connect these vertices.**Graphs**• A graph is a pair (V, E) of sets, V nonempty and each element of E a set of two distinct elements of V. • The elements of V are called vertices; • the elements of E are called edges.**Graphs**• If e is an edge, then e = {v, w}, where v and w are different elements of set V called the end vertices of ends of e. • The vertices v and w are said to be incident with the edge vw. The edge vw is incident with each vertex.**Graphs**• Two vertices are adjacent if they are the end vertices of an edge. • Two vertices are adjacent if they have a vertex in common. • The number of edges incident with a vertex v is called the degree of that vertex and is denoted deg v.**Graphs**• If deg v is an even number, then v is said to be an even vertex. • If deg v is an odd number, then v is odd vertex. • A vertex of degree 0 is said to be isolated.**Subgraph**• A graph G1 is a subgraph of another graph G if and only if the vertex and edge sets of G1 are, respectively, subsets of the vertex and edge sets of G.**Example: Subgraph**• A graph G and three subgraphs G1, G2, and G3 “Discrete Mathematics with Graph Theory.” Fifth Edition, by E. G. Goodaire ane M. Parmenter Prentce Hall, 2006. pag 290**A Bipartite Graph**• A bipartite graph is one whose vertices can be partitioned into two (disjoint) sets V1 and V2, called bipartition sets in such a way that every edge joins a vertex in V1 and a vertex in V2.**A Bipartite Graph**• The complete bipartite graph on bipartition sets of m vertices and n vertices, respectively, is denoted Km,n.**Bipartite Graphs**• Three bipartite graphs, two of which are not complete. • No two top vertices are adjacent, and no two bottom vertices are adjacent. “Discrete Mathematics with Graph Theory.” Fifth Edition, by E. G. Goodaire ane M. Parmenter Prentce Hall, 2006. pag 291**Euler**• The sum of the degrees of the vertices of a pseudograph is an even number equal to twice the number of edges. • In symbols, if G(V, E) is a pseudograph, then deg v = 2 |E| vV**Example: Euler**• The graph has 8 vertices of degree 3 deg v = 8(3) = 24 =2|E| vV it must have 12 edges. “Discrete Mathematics with Graph Theory.” Fifth Edition, by E. G. Goodaire ane M. Parmenter Prentce Hall, 2006. pag 291**Graphs**• There are several different types of graphs that differ with respect to the kind and number of edges that connect a pair of vertices. • Many real problems can be solved using graph models.**Types of Graphs**• Simple graph. • Multigraph. • Pseudograph. • Directed graph. • Direct multigraph.**A Simple Graph**• 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 (edges).**Example of a Simple Graph**• A computer network that represents computers (vertices) and telephone lines (undirected edges) that connect two distinct vertices. “Discrete Mathematics and its Applications.” Fifth Edition, by Kenneth H. Rosen. Mc Graw Hill, 2003. pag 538**A Multigraph**• A multigraph G = (V, E) consists of • a set V of vertices, • a set E of edges, and • a function f (from E to {{u, v} | u, v V, u ≠ v}). • The edges e1 and e2 are called multiple or parallel edges if f(e1) = f(e2).**Example of a Multigraph**• This graph consist of vertices and undirected edges between these vertices with multiple edges between pairs of vertices allowed (two or more edges may connect the same pair of vertices). “Discrete Mathematics and its Applications.” Fifth Edition, by Kenneth H. Rosen. Mc Graw Hill, 2003. pag 538**A Pseudograph**• A pseudograph G = (V, E) consists of • a set V of vertices, • a set E of edges, and • a function f (from E to {{u, v} | u, v V}). • An edge is a loop if f (e) = {u, v} = {u}**Example of a Pseudograph**• A computer network may contain vertices with loops, which are edges from a vertex to itself. “Discrete Mathematics and its Applications.” Fifth Edition, by Kenneth H. Rosen. Mc Graw Hill, 2003. pag 539**A Direct Graph**• A direct graph (V, E) consists of • a set of vertices V and • a set of edges E that are ordered pairs of elements of V.**Example of a Direct Graph**• A network may not operate in both directions. In this case an arrow pointing from u to v to indicate the direction of the edge (u, v) is used. “Discrete Mathematics and its Applications.” Fifth Edition, by Kenneth H. Rosen. Mc Graw Hill, 2003. pag 539**A Directed Multigraph**• A directed multigraph G = (V, E) consists of • a set V of vertices, • a set E of edges, and • a function f (from E to {(u, v) | u, v V}). • The edges e1 and e2 are multiple edges if f(e1) = f(e2).**Example of a Directed Multigraph**• The algorithm uses a finite number of steps, since it terminates after all the integers in the sequence have been examined. “Discrete Mathematics and its Applications.” Fifth Edition, by Kenneth H. Rosen. Mc Graw Hill, 2003. pag 540**Graph Terminology**“Discrete Mathematics and its Applications.” Fifth Edition, by Kenneth H. Rosen. Mc Graw Hill, 2003. pag 540**Niche Overlap Graphs in Ecology**• The competition between species in an ecosystem can be modeled using a niche overlap graph. • Each species is represented by a vertex.**Niche Overlap Graphs in Ecology**• An undirected edge connects two vertices if the two species represented by these vertices compete. Two species are connected if the food resources they use are the same. “Discrete Mathematics and its Applications.” Fifth Edition, by Kenneth H. Rosen. Mc Graw Hill, 2003. pag 541**Acquaintanceship Graph**• To represent whether two people know each other (whether they are acquainted) Each person is represented by a vertex. An undirected edge connects two people when they know each other. “Discrete Mathematics and its Applications.” Fifth Edition, by Kenneth H. Rosen. Mc Graw Hill, 2003. pag 541**Influence Graph**• In studies of group behavior it is observed that certain people can influence the thinking of others. • A directed graph can model this behavior. • Each person is represented by a vertex. • There is a directed vertex from vertex a to vertex b when person a influences person b.**Influence Graph (A Directed Graph)**Deborah can influence Brian, Fred, and Linda, but no one can influence her. Yvonne and Brian can influence each other. “Discrete Mathematics and its Applications.” Fifth Edition, by Kenneth H. Rosen. Mc Graw Hill, 2003. pag 542**Round-Robin Tournaments**• A tournament where each team plays each other team exactly once is called a round-robin tournament. • In this case a directed graph is used. • Each team is represented by a vertex.**Round-Robin Tournaments**• (a, b) is an edge if team a beats team b. • Team 1 is undefeated in this tournament • Team 3 is winless. “Discrete Mathematics and its Applications.” Fifth Edition, by Kenneth H. Rosen. Mc Graw Hill, 2003. pag 542**Call Graphs**• Graphs can be used to model telephone calls made in a network, such as a long-distance telephone network. • A directed multigraph can be used. • Each telephone is a vertex • Each telephone call is represented by a directed edge.**Call Graph using Directed Graph**Three calls have been made from 732-555-1234 to 732-555-9876 and two in the other direction . “Discrete Mathematics and its Applications.” Fifth Edition, by Kenneth H. Rosen. Mc Graw Hill, 2003. pag 542**Call Graph using Directed Graph**One call has been made from 732-555-4444 to 732-555-0011. “Discrete Mathematics and its Applications.” Fifth Edition, by Kenneth H. Rosen. Mc Graw Hill, 2003. pag 542**Call Graph using Undirected Graph**• An undirected graph is used if there has been a call connecting two telephone numbers. Each edge tells us whether there has been a call between two numbers. “Discrete Mathematics and its Applications.” Fifth Edition, by Kenneth H. Rosen. Mc Graw Hill, 2003. pag 542**Precedence Graph and Concurrent Processing**• Computer programs can be executed more rapidly by executing certain statements concurrently. • It is important not to execute a statement that requires results of statement not yet executed.**Precedence Graph and Concurrent Processing**• The dependence of statements on previous statements can be represented by a directed graph. • There is an edge from one vertex to a second vertex if the statement represented by the second vertex cannot be executed before the statement represented by the first vertex has been executed.**Precedence Graph and Concurrent Processing**In this section of a computer program the statement S5 cannot be executed before S1, S2, and S4 are executed. “Discrete Mathematics and its Applications.” Fifth Edition, by Kenneth H. Rosen. Mc Graw Hill, 2003. pag 543**Representing Graphs**To represent a graph without multiple edges is to list all the edges of this graph. To represent a graph with no multiple edges is to use adjacentlist, which specify the vertices that are adjacent to each vertex of the graph.**Example: Representing Graphs**Use adjacent lists to describe the simple graph given in the figure. “Discrete Mathematics and its Applications.” Fifth Edition, by Kenneth H. Rosen. Mc Graw Hill, 2003. pag 557**Example: Representing Graphs**Represent the directed graph shown in the figure by listing all the vertices that are the terminal vertices of edges starting at each vertex of the graph in the figure. “Discrete Mathematics and its Applications.” Fifth Edition, by Kenneth H. Rosen. Mc Graw Hill, 2003. pag 558**The Adjacency Matrix A (AG)**• If A = {aij} is the adjacency matrix A of G, then aij = 1 if {vi, vj} is an edge of G and aij = 0 otherwise. • The adjacency matrix of a simple graph is symmetric if aij = aji. • A simple graph has no loops, so each entry aii = 1, 2, …, n is 0.**Example: Adjacent Matrix**Use an adjacent matrix to represent the graph. “Discrete Mathematics and its Applications.” Fifth Edition, by Kenneth H. Rosen. Mc Graw Hill, 2003. pag 558**Example: Adjacent Matrix**Draw a graph with the adjacent matrix with respect to ordering of vertices a, b, c, d. “Discrete Mathematics and its Applications.” Fifth Edition, by Kenneth H. Rosen. Mc Graw Hill, 2003. pag 559**Example: Adjacent Matrix**Use an adjacent matrix to represent the pseudograph shown in the figure. “Discrete Mathematics and its Applications.” Fifth Edition, by Kenneth H. Rosen. Mc Graw Hill, 2003. pag 559**Incidence Matrices**• Let G = (V, E) be an undirected graph. Suppose that v1,v2, …, vn are the vertices and e1, e2, …, em are the edges of G. • Then the incidence matrix with respect to this ordering of V and E is n x m matrix M = {mij}, where mij= 1 when edge ei is incident with vi, mij= 0 otherwise**Example: Incidence Matrix**Represent the graph with an incidence matrix. “Discrete Mathematics and its Applications.” Fifth Edition, by Kenneth H. Rosen. Mc Graw Hill, 2003. pag 560**Example: Incidence Matrix**Represent the pseudograph with an incidence matrix. “Discrete Mathematics and its Applications.” Fifth Edition, by Kenneth H. Rosen. Mc Graw Hill, 2003. pag 560