Presentation is loading. Please wait.

Presentation is loading. Please wait.

Homework 8 Graph G is given by the figure below.

Similar presentations


Presentation on theme: "Homework 8 Graph G is given by the figure below."— Presentation transcript:

1

2 Homework 8 Graph G is given by the figure below.
Chapter 6 Graphs Homework 8 Graph G is given by the figure below. (a) List all possible paths from A to C. (b) List all possible circuits. (c) Write down at least 4 cut sets of the graph. (d) Draw the subgraph G1 = {B,C,X,Y}. (e) Draw the complement of subgraph G1. Graph G

3 Solution to Homework 8 (a) All possible paths from A to C.
Chapter 6 Graphs Solution to Homework 8 (a) All possible paths from A to C. (A,X,Y,C) and (A,X,B,Y,C) (b) All possible circuits. (B,X,Y,B) (c) At least 4 cut sets of the graph. {(A,Z) }, {(A,X) },{(C,Y)}, {(A,Z),(A,X)}, {(B,X),(B,Y)}, {(B,X),(X,Y)} Graph G

4 Solution to Homework 8 (d) Subgraph G1 = {B,C,X,Y}.
Chapter 6 Graphs Solution to Homework 8 (d) Subgraph G1 = {B,C,X,Y}. (e) Complement of subgraph G1. Graph G

5 Chapter 6 Graphs Bipartite Graph If the vertices of graph G can be separated into two subsets V1 and V2, such that every edge of G connects a vertex in V1 to a vertex in V2, then G is called a bipartite graph. Bipartite graph is denoted as as G(V1,V2). V1 V2

6 Bipartite Graph Is this graph a bipartite graph?
Chapter 6 Graphs Bipartite Graph Is this graph a bipartite graph? Yes, because the vertices can be divided into two subsets V1 = {a,b,d} and V2 = {c,e,f,g}.

7 Chapter 6 Graphs Isomorphic Graph Graphs that are actually identical but geometrically different are called isomorphic. Two graphs G1 and G2 are isomorphic if there is a bijective relation between vertices of the two graphs that preserves the adjacency relationship. In other words, suppose the edge e is incident to vertex u and vertex v in G1, then the corresponding edge e’ must be incident to vertex u’ and vertex v’ in G2. Two isomorphic graphs are identical graphs, different only in the naming of the vertices and edges or the geometrical representation only.

8 Isomorphic Graph Graph (a) and graph (b) are isomorphic.
Chapter 6 Graphs Isomorphic Graph Graph (a) and graph (b) are isomorphic. Graph (a) and graph (c) are not isomorphic.

9 Isomorphic Graph 2 isomorphic graphs 3 isomorphic graphs Chapter 6

10 Chapter 6 Graphs Isomorphic Graph From the definition of isomorphic graphs, it can be concluded that if two graphs are isomorphic, then both of them: Have the same number of vertices. Have the same number of edges. Have the same number of vertices of each degree. The 3 conditions listed above are necessary conditions, but not sufficient conditions. Further visual inspection is required, as can be seen from the example below. The 3 conditions are met but both graphs are not isomorphic.

11 Example of planar graph
Chapter 6 Graphs Planar Graph A graph is called planar if it can be drawn in a plane without any edges crossing (where a crossing of edges is the intersection of the arcs representing them at a point other than their common vertices). Such a drawing is called a planar representation of the graph. If there is any edges crossing, then the graph called non-planar. Example of planar graph

12 Planar Graph Example of planar graph Example of non-planar graph
Chapter 6 Graphs Planar Graph Example of planar graph Example of non-planar graph

13 Graph (a), (b), (c) are planar graphs Graph (b), (c) are plane graphs
Chapter 6 Graphs Plane Graph A planar graph which is drawn without any edges crossing is called a plane graph. Graph (a), (b), (c) are planar graphs Graph (b), (c) are plane graphs

14 Euler Path and Euler Circuit
Chapter 6 Graphs Euler Path and Euler Circuit An Euler path in a graph is a path that contains every edge of the graph exactly once. An Euler circuit in a graph is a circuit that contains every edge of a graph exactly once. A graph that contains Euler path is also called semi-Eulerian graph. A graph that contains Euler circuit is also called Eulerian graph.

15 Euler Path and Euler Circuit
Chapter 6 Graphs Euler Path and Euler Circuit Example: Euler path in graph (a): 3, 1, 2, 3, 4, 1. Euler path in graph (b): 1, 2, 4, 6, 2, 3, 6, 5, 1, 3, 5. Euler circuit in graph (c): 1, 2, 3, 4, 7, 3, 5, 7, 6, 5, 2, 6, 1. Graph (a) and (b) are semi-Eulerian graph Graph (c) is an Eulerian graph

16 Euler Path and Euler Circuit
Chapter 6 Graphs Euler Path and Euler Circuit Example: Euler circuit in graph (d): a, c, f, e, c, b, d, e, a, d, f, b, a. Graph (e) contains neither Euler path nor Euler circuit. Graph (f) contains Euler path. Graph (d) is an Eulerian graph Graph (e) is neither semi-Eulerian nor Eulerian graph Graph (f) is a semi-Eulerian graph

17 Euler Path and Euler Circuit
Chapter 6 Graphs Euler Path and Euler Circuit Theorem: An undirected graph G contains Euler path if and only if it is connected and has two vertices of odd degree or does not have any vertices of odd degree at all. Theorem: An undirected graph G contains Euler circuit if and only if it is connected and each of its vertices has even degree. In other words: An undirected graph G is an Eulerian graph if and only if the degree of every vertex is even.

18 Euler Path and Euler Circuit
Chapter 6 Graphs Euler Path and Euler Circuit Theorem: A directed graph G contains Euler path if and only if G is connected and for each vertex, the in-degree and out-degree are the same, except two vertices, where the first vertex’s out-degree is one greater than the in- degree and the second vertex’s in-degree is one greater than the out- degree. Theorem: A directed graph G contains Euler circuit if and only if G is connected and for each vertex, the in-degree and out-degree are the same.

19 Euler Path and Euler Circuit
Chapter 6 Graphs Euler Path and Euler Circuit Example: Graph (a) is an Eulerian digraph: a, g, c, b, g, e, d, f, a. Graph (b) is a semi-Eulerian digraph: d, a, b, d, c, b. Graph (c) is a digraph, but neither Eulerian nor semi-Eulerian.

20 Bridges of Königsberg (Euler, 1736)
Chapter 6 Graphs Bridges of Königsberg (Euler, 1736) Can someone pass every bridge exactly once and come back the his/her original position? No, impossible. The degrees d(A) = 5, d(B) = 3, d(C) = 3, d(D) = 3  4 vertices of odd degree. The Euler circuit cannot be drawn.

21 Hamilton Path and Hamilton Circuit
Chapter 6 Graphs Hamilton Path and Hamilton Circuit A Hamilton path in a graph is a path that passes every vertex of the graph exactly once. A Hamilton circuit in a graph is a circuit that passes every vertex of the graph exactly once, except one vertex which is the origin and (at the same time) the destination, is passed twice. A graph that contains Hamilton path is also called semi-Hamiltonian graph. A graph that contains Hamilton circuit is also called Hamiltonian graph.

22 Hamilton Path and Hamilton Circuit
Chapter 6 Graphs Hamilton Path and Hamilton Circuit Example: Graph (a) contains Hamilton paths: i.e., 3, 2, 1, 4. Graph (b) contains Hamilton circuits: i.e., 1, 2, 3, 4, 1. Graph (c) does not contain either Hamiltonian path or Hamiltonian circuit.

23 Hamilton Path and Hamilton Circuit
Chapter 6 Graphs Hamilton Path and Hamilton Circuit Example: Find a Hamilton circuit in the following graph.

24 Chapter 6 Graphs Paths and Circuits A graph can contain Euler circuit/path and Hamilton circuit/path simultaneously. A graph can also only contain Euler circuit/path or Hamilton circuit/path. Graph (a) contains Euler path only Graph (b) contains Euler path and Hamilton circuit Graph (c) contains Euler circuit and Hamilton circuit

25 Applications of Graphs: Travelling Salesman Problem
Chapter 6 Graphs Applications of Graphs: Travelling Salesman Problem For this problem, a number of cities and the distances between them are given. Determine the shortest circuit that must be traveled by a salesman if he departs from a city of origin and stop by in each city exactly once and goes back to the city of origin. This is a problem of how to find a Hamilton circuit with the minimum weight (distance).

26 Applications of Graphs: Travelling Salesman Problem
Chapter 6 Graphs Applications of Graphs: Travelling Salesman Problem Similar applications: Mr. Postman collects the letters for mailboxes which are distributed in n locations in a certain town. The robot arm fastens n bolts of a car in an assembly line. Production process of n different products in one cycle.

27 Applications of Graphs: Travelling Salesman Problem
Chapter 6 Graphs Applications of Graphs: Travelling Salesman Problem Example: Determine the shortest Hamilton circuit in the following graph. There are 3 Hamilton circuits in the given graph above.

28 Applications of Graphs: Travelling Salesman Problem
Chapter 6 Graphs Applications of Graphs: Travelling Salesman Problem P1 = (a, b, c, d, a) or (a, d, c, b, a) ; Total weight = = 45. P2 = (a, b, d, c, a) or (a, c, d, b, a) ; Total weight = = 41. P3 = (a, c, b, d, a) or (a, d, b, c, a) ; Total weight = = 32. Shortest Hamilton circuit: P3.

29 Applications of Graphs: Graph Coloring
Chapter 6 Graphs Applications of Graphs: Graph Coloring A graph is colored in such a way that each vertex is given a color while two adjacent vertices may not have the same color. Chromatic Number: the minimum number of colors required to color a graph. Symbol: (G), pronounced “k-eye”. A graph G with chromatic number k is denoted as (G) = k. The graph below has (G) = 3.

30 Applications of Graphs: Graph Coloring
Chapter 6 Graphs Applications of Graphs: Graph Coloring Map Coloring. A map consists of a number of regions. A map should be colored in such a way that two neighboring regions must have different colors.

31 Applications of Graphs: Graph Coloring
Chapter 6 Graphs Applications of Graphs: Graph Coloring Map Coloring. The regions are represented by the vertices, and the border between two neighboring regions is represented by an edge. Coloring a region in a map means coloring the vertex in the corresponding graph. Neighboring regions must have different colors  The color of every incident vertices must be different.

32 Applications of Graphs: Graph Coloring
Chapter 6 Graphs Applications of Graphs: Graph Coloring Map Map and corresponding graph representation Graph representation Graph coloring, 8 different colors Graph coloring, 4 different colors

33 Applications of Graphs: Graph Coloring
Chapter 6 Graphs Applications of Graphs: Graph Coloring Scheduling. Suppose there are eight students (1, 2, …, 8) and five lectures available to be chosen (A, B, C, D, E). The following table shows the matrix of five lectures and eight students. Value 1 in a cell (i, j) means student i takes lecture j. Value 0 means student i does not take lecture j.

34 Applications of Graphs: Graph Coloring
Chapter 6 Graphs Applications of Graphs: Graph Coloring The problem: If in one day there may only be one exam, what is the minimum number of days required to schedule the exams such that every student can take his/her exams without any time conflicts? As solution: vertex lecture, edge connecting two lectures which are taken simultaneously by at least one student

35 Applications of Graphs: Graph Coloring
Chapter 6 Graphs Applications of Graphs: Graph Coloring Graph of exam schedule problem The result of graph coloring The chromatic number is 2. The exams of lectures A, E, and D can be conducted together in one day. The exams of lectures B and C should be conducted in another day.

36 Chapter 6 Graphs Homework 9 Take a look at the graphs (a), (b), and (c). Determine whether each graph is an Eulerian graph, semi-Eulerian graph, Hamiltonian graph, or semi-Hamiltonian graph. Give enough explanation to your answer.

37 Chapter 6 Graphs Homework 9A A department has six task forces. Every task force conducts a routine monthly meeting. The member of the six task forces are: TF1 = {Amir, Budi, Yanti} TF2 = {Budi, Hasan, Tommy} TF3 = {Amir, Tommy, Yanti} TF4 = {Hasan, Tommy, Yanti} TF5 = {Amir, Budi} TF6 = {Budi, Tommy, Yanti} What is the minimum number of time slots that must be allocated so that everyone that belong to more than one task force can attend the meetings that he/she must join without any time conflict? Draw the graph that represents this problem. What does a vertex and an edge represent?


Download ppt "Homework 8 Graph G is given by the figure below."

Similar presentations


Ads by Google