Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 12/2/2015 MATH 224 – Discrete Mathematics Formally a graph is just a collection of unordered or ordered pairs, where for example, if {a,b} G if a, b.

Similar presentations


Presentation on theme: "1 12/2/2015 MATH 224 – Discrete Mathematics Formally a graph is just a collection of unordered or ordered pairs, where for example, if {a,b} G if a, b."— Presentation transcript:

1 1 12/2/2015 MATH 224 – Discrete Mathematics Formally a graph is just a collection of unordered or ordered pairs, where for example, if {a,b} G if a, b V. Here G is the graph and V is called the set of nodes. So a graph G(V, E) is a set of objects V (of any type), which are called nodes or sometimes vertices. And E is actually the set of pairs, which are called edges or sometimes called links. The edges may be unordered pairs {a,b} or ordered pairs (a,b). With unordered pairs {a,b} and {b, a} are equivalent. But with ordered pairs the order matters so (a,b) is not the same as (b,a). Graphs

2 2 12/2/2015 MATH 224 – Discrete Mathematics Undirected Graph 0 1 3 4 2 5 Edges = {{0,2}, {1,2}, {1,3}, {1,4}, {2,4}, {2,5}, …}

3 3 12/2/2015 MATH 224 – Discrete Mathematics Directed Graph 0 1 3 4 2 5 Edges = {(0,2), (1,2), (3,1), (1,4), (2,4), (4,2), …}

4 4 12/2/2015 MATH 224 – Discrete Mathematics Simple Graphs Multiple edges between pairs of nodes and self loops are not allowed in simple graphs. 0 1 3 4 2 5 Multiple Edges Self Loop

5 5 12/2/2015 MATH 224 – Discrete Mathematics Paths 0 1 3 4 2 5 Paths are a sequence of nodes, e.g., 0, 2, 5, 3, where no node is repeated and consecutive nodes correspond to an edge.

6 6 12/2/2015 MATH 224 – Discrete Mathematics Not a Path (called a walk) 0 1 3 4 2 5 Note that some nodes are repeated: 1, 2, 4, 1, 3, 5

7 7 12/2/2015 MATH 224 – Discrete Mathematics Cycle 0 1 3 4 2 5 A cycle is a sequence of nodes, e.g., 1, 2, 4, 5, 3, 1, where consecutive nodes correspond to an edge and the only node that is repeated is the first and last node.

8 8 12/2/2015 MATH 224 – Discrete Mathematics Cycle Graph 0 3 1 2 5 4 A cycle graph consists of a single cycle.

9 9 12/2/2015 MATH 224 – Discrete Mathematics Trees 0 1 3 4 2 5 Trees are acyclic (no cycles) graphs that are connected (a path between every pair of edges). In an N node tree, how many edges are there?

10 10 12/2/2015 MATH 224 – Discrete Mathematics Not a Tree 0 1 3 4 2 5 Cycle

11 11 12/2/2015 MATH 224 – Discrete Mathematics Not a Tree 0 1 3 4 2 5 Cycle This graph is not a tree because it has a cycle and is not connected. There is no path between 0 and 4 for example. What other pairs of nodes are not connected?

12 12 12/2/2015 MATH 224 – Discrete Mathematics Not a Tree 0 1 3 4 2 5 6 A graph with two components. Two subgraphs that are connected. What are the nodes in each component?

13 13 12/2/2015 MATH 224 – Discrete Mathematics Isomorphic Graphs 0 1 3 4 2 5 Two graphs are called isomorphic if they are the same if renaming the nodes will result in identical graphs. Vertex 1 Corresponds to Vertex 4 0 1 3 4 2 5

14 14 12/2/2015 MATH 224 – Discrete Mathematics Isomorphic Graphs ? 0 1 3 4 2 5 0 1 3 4 2 5 Are these two graphs isomorphic? Graph A Graph B

15 15 12/2/2015 MATH 224 – Discrete Mathematics 0 1 3 4 2 5 0 1 3 4 2 5 Graph A Graph B 2 1 3 0 4 5 Graph B with node 4 moved to the upper right, 2 moved to the upper center and 0 moved to the lower center position. Now Graphs A and B look the same except for labeling. Are these two graphs isomorphic? Yes! Graph B’s nodes have been moved to show the isomorphism.

16 16 12/2/2015 MATH 224 – Discrete Mathematics Graph Properties - Degree The degree of a node in an undirected graph is the number of edges incident to that node. 0 1 3 4 2 5 What is the degree of node4? Of node 0? Of node 2?

17 17 12/2/2015 MATH 224 – Discrete Mathematics Graph Properties – Complete Graphs How is the degree of a graph related to the number of edges? The minimum number of edges in a graph is 0. A graph with the maximum number of edges is called a complete graph. The graph below is a complete undirected graph with four nodes. What is the degree of each node in an N node complete Graph? What is the sum of the degrees in an N node complete Graph? How many edges are there in an N node complete Graph?

18 18 12/2/2015 MATH 224 – Discrete Mathematics Graph Properties – Bipartite Graphs Bipartite graphs are graphs whose nodes can be divided into two disjoint sets, called partitions, in which there are no edges between nodes within a partition. A complete bipartite graph has all possible edges. So for example, if one partition has K nodes and the other has M nodes, nodes in the K node partition will have degree M and the nodes in the M node partition will have degree K. How many edges will there be in a complete bipartite graph with partitions of size K and M?

19 19 12/2/2015 MATH 224 – Discrete Mathematics Graph Properties – Bipartite Graphs Bipartite graphs have a number of interesting properties. For example, any cycle in a bipartite graph must have an even number of edges. Note the cycle in red below (0,4,3,5,0). 0 1 2 3 4 5

20 20 12/2/2015 MATH 224 – Discrete Mathematics Graph Properties – Hypercube Hypercubes have interesting properties that make them useful for some forms of parallel computing. The text illustrates hypercubes for n = 1, 2, 3 on Page 549. The figure below illustrates a 4-cube. How many nodes are in an n-cube for n > 0? How many edges?

21 21 12/2/2015 MATH 224 – Discrete Mathematics Graph Properties – Planar Graphs Planar graphs are graphs that may be drawn on a 2-dimensional plane without having any of the edges intersect. Below are several planar graphs that are also complete graphs. Try to draw a complete 5 node graph without having any edges intersect. Can you do that?

22 22 12/2/2015 MATH 224 – Discrete Mathematics Graph Properties – Planar Graphs A complete 5 node graph is not planar. Planar graphs are important in circuit board design. With a single layer circuit board the graph needs representing the circuit needs to be planar so that traces do not intersect. In order to build more complicated circuits multiple layer boards are often needed. In order to connect the edge in red to node a it will have to cross one or more of the other edges unless it is allowed to go outside of the plane. a


Download ppt "1 12/2/2015 MATH 224 – Discrete Mathematics Formally a graph is just a collection of unordered or ordered pairs, where for example, if {a,b} G if a, b."

Similar presentations


Ads by Google