Introduction to Graph Theory Instructor: Dr. Chaudhary Department of Computer Science Millersville University Reading Assignment Chapter 1.

Slides:



Advertisements
Similar presentations
CSE 211 Discrete Mathematics
Advertisements

Chapter 8 Topics in Graph Theory
Lecture 5 Graph Theory. Graphs Graphs are the most useful model with computer science such as logical design, formal languages, communication network,
22C:19 Discrete Math Graphs Fall 2010 Sukumar Ghosh.
22C:19 Discrete Math Graphs Fall 2014 Sukumar Ghosh.
Midwestern State University Department of Computer Science Dr. Ranette Halverson CMPS 2433 – CHAPTER 4 GRAPHS 1.
Graph-02.
Introduction to Graphs
Lecture 21 Paths and Circuits CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Section 14.1 Intro to Graph Theory. Beginnings of Graph Theory Euler’s Konigsberg Bridge Problem (18 th c.)  Can one walk through town and cross all.
Midwestern State University Department of Computer Science Dr. Ranette Halverson CMPS 2433 CHAPTER 4 - PART 2 GRAPHS 1.
Koenigsberg bridge problem It is the Pregel River divided Koenigsberg into four distinct sections. Seven bridges connected the four portions of Koenigsberg.
C++ Programming: Program Design Including Data Structures, Third Edition Chapter 21: Graphs.
Discrete Structures Chapter 7B Graphs Nurul Amelina Nasharuddin Multimedia Department.
Graphs. Graph A “graph” is a collection of “nodes” that are connected to each other Graph Theory: This novel way of solving problems was invented by a.
Chapter 11 Graphs and Trees This handout: Terminology of Graphs Eulerian Cycles.
Discrete Mathematics Lecture 9 Alexander Bukharovich New York University.
22C:19 Discrete Math Graphs Spring 2014 Sukumar Ghosh.
GRAPH Learning Outcomes Students should be able to:
Theory of Computing Lecture 10 MAS 714 Hartmut Klauck.
EECS 203: It’s the end of the class and I feel fine. Graphs.
Slide 14-1 Copyright © 2005 Pearson Education, Inc. SEVENTH EDITION and EXPANDED SEVENTH EDITION.
Chapter 2 Graph Algorithms.
Graph Theory Topics to be covered:
Can you connect the dots as shown without taking your pen off the page or drawing the same line twice.
Euler and Hamilton Paths. Euler Paths and Circuits The Seven bridges of Königsberg a b c d A B C D.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
CS 200 Algorithms and Data Structures
Graphs.  Definition A simple graph G= (V, E) consists of vertices, V, a nonempty set of vertices, and E, a set of unordered pairs of distinct elements.
Graphs, Puzzles, & Map Coloring
Fall 2015 COMP 2300 Discrete Structures for Computation Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1.
1 Graphs Theory UNIT IV. 2Contents  Basic terminology,  Multi graphs and weighted graphs  Paths and circuits  Shortest path in weighted graph  Hamiltonian.
Introduction to Graph Theory
1.5 Graph Theory. Graph Theory The Branch of mathematics in which graphs and networks are used to solve problems.
Graph Theory and Applications
Graph Theory. A branch of math in which graphs are used to solve a problem. It is unlike a Cartesian graph that we used throughout our younger years of.
Lecture 10: Graph-Path-Circuit
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley. Ver Chapter 13: Graphs Data Abstraction & Problem Solving with C++
AND.
Graph theory and networks. Basic definitions  A graph consists of points called vertices (or nodes) and lines called edges (or arcs). Each edge joins.
MAT 2720 Discrete Mathematics Section 8.2 Paths and Cycles
Lecture 52 Section 11.2 Wed, Apr 26, 2006
Chapter 6: Graphs 6.1 Euler Circuits
Chapter 11 - Graph CSNB 143 Discrete Mathematical Structures.
Chapter 20: Graphs. Objectives In this chapter, you will: – Learn about graphs – Become familiar with the basic terminology of graph theory – Discover.
Chapter 14 Section 3 - Slide 1 Copyright © 2009 Pearson Education, Inc. AND.
Grade 11 AP Mathematics Graph Theory Definition: A graph, G, is a set of vertices v(G) = {v 1, v 2, v 3, …, v n } and edges e(G) = {v i v j where 1 ≤ i,
1 GRAPH Learning Outcomes Students should be able to: Explain basic terminology of a graph Identify Euler and Hamiltonian cycle Represent graphs using.
Programming Abstractions Cynthia Lee CS106B. Upcoming Topics Graphs! 1.Basics  What are they? How do we represent them? 2.Theorems  What are some things.
رياضيات متقطعة لعلوم الحاسب MATH 226. Chapter 10.
Chapter Chapter Summary Graphs and Graph Models Graph Terminology and Special Types of Graphs Representing Graphs and Graph Isomorphism Connectivity.
MAT 110 Workshop Created by Michael Brown, Haden McDonald & Myra Bentley for use by the Center for Academic Support.
An Introduction to Graph Theory
EECS 203 Lecture 19 Graphs.
Graphs Hubert Chan (Chapter 9) [O1 Abstract Concepts]
Redraw these graphs so that none of the line intersect except at the vertices B C D E F G H.
Graph theory Definitions Trees, cycles, directed graphs.
Agenda Lecture Content: Introduction to Graph Path and Cycle
EECS 203 Lecture 20 More Graphs.
Graph Algorithm.
Introduction to Graph Theory Euler and Hamilton Paths and Circuits
Graph Theory.
Graphs Chapter 13.
Genome Assembly.
Foundations of Discrete Mathematics
Discrete Math II Howon Kim
Graph Theory What is a graph?.
Graphs CS 2606.
Graph Theory Relations, graphs
Chapter 10 Graphs and Trees
Presentation transcript:

Introduction to Graph Theory Instructor: Dr. Chaudhary Department of Computer Science Millersville University Reading Assignment Chapter 1

Topics Definition of a Graph Walks and Paths Degree of Vertecies Minimum Spanning Tree (MST) Relationship Between Degrees and Vertices Euler's Path Problem Traveling Salesman’s Problem

Definition of a Graph A graph G = (V, E) is an ordered pair, where V is a nonempty finite set, and E is a binary relation on V. Members of V are called vertices and members of E are called edges. An edge connects two vertices. (v3, v4) and (v2, v2) are edges Fig 1: An undirected graph Fig 2: A directed weighted graph D S D C F

Walks and Paths A sequence of edges (v i, v j ), (v j, v k ), …, (v m, v n ) is said to be a walk from v i to v n. Walk A path is a walk in which no edges are repeated. Path (v1, v5), (v5, v2), (v2, v1), (v1, v2), and (v2, v3) is a walk from v1 to v3. (v1, v5), (v5, v2), (v2, v2), and (v2, v3) is a path from v1 to v3. (v1, v5), (v5, v2), and (v2, v3) is a simple path from v1 to v3. (v2, v2) is a loop.

Degree of a Vertex The degree of a vertex v, denoted by deg(v), is simply the number of times an edge of G meets v. This is not quite the same as the number of edges that are incident with v, since we must count any loops at v twice when determining the degree of v. Degree deg(v1) = 2, deg(v2) = 7, deg(v3) = 2 deg(v4) = 1, deg(v5) = 2, deg(v6) = 4 deg(v7) = 1, deg(v8) = 3, deg(v9) = 0 Referring to fig. 1

Relationship Between Degrees and Vertices A connection between degrees of vertices in a graph and number of edges in a graph is expressed in the following theorem. Theorem: If G(V, E) is a graph with V = {v 1, v 2,..., v n }, then deg(v 1 ) + deg(v 2 ) deg(v n ) = 2|E|. That is, the sum of degrees of all vertices in a graph G is equal to twice the number of edges of G. We observe that each edge that is not a loop is incident with exactly two vertices, and each loop is incident with same vertex twice. Hence, the number 2|E|.

Linear and Complete Graphs If a graph G has vertices of degrees 2, 2, 2, 3, 3, 3, 4, 4, 5, and 6 then, according to the above theorem, the number of edges = 17. ( = 34) There is no graph G with degrees of its vertices 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, and 6. Why? A graph is called linear graph if there is a single edge between every pair of vertices. A linear graph with n vertices has at most C(n, 2) edges. If a linear graph with C(n, 2) edges is called a complete graph. A complete graph on 5 nodes.

A linear graph with n vertices has at most C(n, 2) edges If a linear graph with C(n, 2) edges is called a complete graph. C(n, 2) means combination of n things taken 2 at a time. Number of edges =

A complete graph with 5 vertices Exercise : Use mathematical induction to prove that a complete linear graph on n vertices has edges.

Spanning Trees Example

Example 2: Spim’s Algorithm Start at vertex a

Example Continued

Path Length = = 22

Euler's Path Problem Euler's Path (Konigsberg’s bridge problem) Theorem: An undirected graph possesses an Eulerian path if and only if it is connected and has none or two vertices of odd degree. A path in a graph is called Eulerian path if it traverses each edge in a graph exactly once. The people wondered whether or not one could walk around the city in a way that would involve crossing each bridge exactly once.

Euler’s Path Problem :Example – Page 1 b a c d e f g Since all vertices have even degrees, there is an Euler’s circuit in the graph.

Euler’s Path Problem :Example – Page 2 b a c d e f g b a c d e f g

Euler’s Path Problem :Example – Page 3 b a c d e f g The numbers indicate the order of traversal.

Traveling Salesman’s Problem Theorem: A Hamiltonian path in a graph is a path that passes through every vertex in the graph. Consider a salesperson who wants a tour of n cities which starts and ends at the same city and includes visiting each of the remaining n - 1 cities once and only once, subject to the condition that such a tour is also of minimum length. The problem is no more than finding a Hamiltonian circuit in a weighted graph. But no efficient algorithm has been discovered to solve this problem. Please visit the site

Traveling Salesman Problem: Nearest Neighbor Algorithm 1.Start with an arbitrary chosen vertex, and find the vertex that is closest to the starting vertex to form an initial path of one edge. This path will be augmented in a vertex-by-vertex manner as described in step 2. 2.Let x be the latest vertex that was added to the path. Among all vertices that are not in the path, pick the one that is closest to x, and add to the path the edge connecting x and this vertex. Repeat this step 2 until all vertices are included in the path. 3.Form a circuit by adding the edge connecting the starting vertex and the vertex added.

Example – Page a b c d e 1 Start from vertex a.

Example – Page 2 7 a b c d e 2

Example – Page a b c d e 3

Example – Page a b c d e 4 8

Example – Page a b c d e 5 8 5

Example – Page a b c d e Total Path Length = = 40 5

A Better Solution b c d e a Total Path Length = = 37

Four-color Problem Is it true that any map can be colored using four colors in such a way that adjacent regions (i.e. those sharing a common boundary segment, not just a point) receive different colors? The answer is yes. Please read the history by visiting the following web sites.