Chapter 4 Graph Theory Chapter 4 Graph Theory

  • Slides: 34
Download presentation
Chapter 4 Graph Theory

Chapter 4 Graph Theory

Chapter 4: Graph Theory 1 2 3 4 5 6 7 Basic Concepts Euler

Chapter 4: Graph Theory 1 2 3 4 5 6 7 Basic Concepts Euler Circuits Hamilton Circuits and Algorithms Shortest Path in Weighted Graph Factors of a graph Planar Graph Travelling Salesman Problem

Chapter 1 Basic Concepts

Chapter 1 Basic Concepts

Basic Concepts • Graphs • Walks, Paths, and Circuits • Complete Graphs and Subgraphs

Basic Concepts • Graphs • Walks, Paths, and Circuits • Complete Graphs and Subgraphs

Vertex: The point of intersection of lines. The terminating point of some lines in

Vertex: The point of intersection of lines. The terminating point of some lines in a figure or curve Several Vertices Edge: Line that connects 2 vertices Loop: an edge that connects the same two vertices

Multiple Edges: More than one edge connecting two vertices

Multiple Edges: More than one edge connecting two vertices

Simple Graphs in which there is no more than one edge between any two

Simple Graphs in which there is no more than one edge between any two vertices and in which no edge goes from vertex to the same vertex are called simple. Simple Not simple

Degree of the Vertex The number of edges joined to a vertex is called

Degree of the Vertex The number of edges joined to a vertex is called the degree of the vertex. D A C B A has degree 0, B has degree 1, C has degree 2 and D has degree 3.

Undirected Graph: A graph whose edges are all undirected Directed graph: A graph whose

Undirected Graph: A graph whose edges are all undirected Directed graph: A graph whose edges are directed

Simple Graph: A graph that does not contain any loops or multiple edges

Simple Graph: A graph that does not contain any loops or multiple edges

Examples 1. Example of a graph: Notice it is undirected, has multiple edges and

Examples 1. Example of a graph: Notice it is undirected, has multiple edges and loops

2. Example of a graph: Notice the unconnected components

2. Example of a graph: Notice the unconnected components

3. Example of a mutigraph (graph with multiple edges)

3. Example of a mutigraph (graph with multiple edges)

Isomorphic Graphs Two graphs are isomorphic if there is a one-to-one matching between vertices

Isomorphic Graphs Two graphs are isomorphic if there is a one-to-one matching between vertices of the two graphs with the property that whenever there is an edge between two vertices of either one of the graphs, there is an edge between the corresponding vertices of the other graph.

Connected and Disconnected Graphs A graph is connected if one can move from each

Connected and Disconnected Graphs A graph is connected if one can move from each vertex of the graph to every other vertex of the graph along edges of the graph. If not, the graph is disconnected. The connected pieces of a graph are called the components of the graph.

Example: Isomorphic Graphs Are the two graphs isomorphic? Solution Yes, and corresponding vertices are

Example: Isomorphic Graphs Are the two graphs isomorphic? Solution Yes, and corresponding vertices are labeled below. A D B C B A D C

Sum of Degrees Theorem In any graph, the sum of the degrees of the

Sum of Degrees Theorem In any graph, the sum of the degrees of the vertices equals twice the number of edges.

Example: Sum of Degrees A graph has exactly four vertices, each of degree 3.

Example: Sum of Degrees A graph has exactly four vertices, each of degree 3. How many edges does this graph have? Solution The sum of degrees of the vertices is 12. By theorem, this number is twice the number of edges, so the number of edges is 12/2 = 6.

Walk A walk in a graph is a sequence of vertices, each linked to

Walk A walk in a graph is a sequence of vertices, each linked to the next vertex by a specified edge of the graph.

Path A path in a graph is a walk that uses no edge more

Path A path in a graph is a walk that uses no edge more than once.

Circuit A circuit in a graph is a path that begins and ends at

Circuit A circuit in a graph is a path that begins and ends at the same vertex.

Venn Diagram of Walks, Paths, and Circuits

Venn Diagram of Walks, Paths, and Circuits

Example: Classifying Walks Using the graph, classify each sequence as a walk, a path

Example: Classifying Walks Using the graph, classify each sequence as a walk, a path or a circuit. A E B D C

Example: Classifying Walks A Solution E B D C Walk Path Circuit a) No

Example: Classifying Walks A Solution E B D C Walk Path Circuit a) No No No b) Yes Yes c) Yes No No d) Yes No No

Hamilton Path in an Undirected Graph: A path that spans all the vertices in

Hamilton Path in an Undirected Graph: A path that spans all the vertices in a graph Path: {5, 0, 2, 3, 1, 4, 6} Hamilton Path in a Directed Graph: A path that spans all the vertices in the digraph Eg: {0, 3, 5, 7, 10, 17, 21, 28}

Hamilton Cycles: A Cycle that covers all the vertices in a graph Hamilton Cycle

Hamilton Cycles: A Cycle that covers all the vertices in a graph Hamilton Cycle in a directed graph {0, 1, 3, 2, 4, 5, 6, 7, 0} Hamiltion Cycle in an undirected graph {7, 8, 1, 4, 3, 2, 0, 5, 6, 7}

Cyclic and Acyclic Digraphs A cyclic digraph: a directed graph with cycles: {0, 3,

Cyclic and Acyclic Digraphs A cyclic digraph: a directed graph with cycles: {0, 3, 6, 0}, {0, 1, 2, 4, 5, 3, 6, 0} An acyclic digraph: a directed graph with no cycles

Complete Graph A complete graph is a graph in which there is exactly one

Complete Graph A complete graph is a graph in which there is exactly one edge going from each vertex to each other vertex in the graph.

Example: Complete Graph Draw a complete graph with four vertices. Solution Answers may vary,

Example: Complete Graph Draw a complete graph with four vertices. Solution Answers may vary, but one solution is shown below.

Example: Complete Graph Complete graph of 3 vertices Complete graph of 11 vertices

Example: Complete Graph Complete graph of 3 vertices Complete graph of 11 vertices

Bipartite Graphs: A graph whose vertices can be divided into two classes. Edges exist

Bipartite Graphs: A graph whose vertices can be divided into two classes. Edges exist only between vertices that belong to different classes. An example of a complete bipartite graph

Subgraph A graph consisting of some of the vertices of the original graph and

Subgraph A graph consisting of some of the vertices of the original graph and some the original edges between those vertices is called a subgraph.

Tree: A connected, acyclic undirected graph Forest: An acyclic undirected graph, i. e. many

Tree: A connected, acyclic undirected graph Forest: An acyclic undirected graph, i. e. many trees grouped together

Articulation Points In an Undirected Graph An articulation point is a vertex in a

Articulation Points In an Undirected Graph An articulation point is a vertex in a graph whose removal disconnects the graph. In the example below, the red vertices are the articulation points.