GRAPH Learning Outcomes Students should be able to:

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.
Introduction to Graph Theory Instructor: Dr. Chaudhary Department of Computer Science Millersville University Reading Assignment Chapter 1.
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.
 期中测验时间:本周五上午 9 : 40  教师 TA 答疑时间 : 周三晚上 6 : 00—8 : 30  地点:软件楼 315 房间,  教师 TA :李弋老师  开卷考试.
Lecture 21 Paths and Circuits CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
 Graph Graph  Types of Graphs Types of Graphs  Data Structures to Store Graphs Data Structures to Store Graphs  Graph Definitions Graph Definitions.
C++ Programming: Program Design Including Data Structures, Third Edition Chapter 21: Graphs.
Discrete Structures Chapter 7B Graphs Nurul Amelina Nasharuddin Multimedia Department.
Representing Graphs Wade Trappe. Lecture Overview Introduction Some Terminology –Paths Adjacency Matrix.
Discrete Structures Chapter 7A Graphs Nurul Amelina Nasharuddin Multimedia Department.
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.
Copyright © Cengage Learning. All rights reserved.
Data Structures Using C++ 2E
Graphs Chapter 10.
Graph Theoretic Concepts. What is a graph? A set of vertices (or nodes) linked by edges Mathematically, we often write G = (V,E)  V: set of vertices,
Graph Theory Topics to be covered:
1 Graphs Chapters 9.1 and 9.2 University of Maryland Chapters 9.1 and 9.2 Based on slides by Y. Peng University of Maryland.
Copyright © Cengage Learning. All rights reserved. CHAPTER 10 GRAPHS AND TREES.
Fall 2015 COMP 2300 Discrete Structures for Computation Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1.
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2007 Chapter 9 (Part 2): Graphs  Graph Terminology (9.2)
CSNB143 – Discrete Structure Topic 9 – Graph. Learning Outcomes Student should be able to identify graphs and its components. Students should know how.
1 CS104 : Discrete Structures Chapter V Graph Theory.
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.
Week 11 - Monday.  What did we talk about last time?  Binomial theorem and Pascal's triangle  Conditional probability  Bayes’ theorem.
Data Structures & Algorithms Graphs
Fall 2015 COMP 2300 Discrete Structures for Computation Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1.
Basic Notions on Graphs. The House-and-Utilities Problem.
September1999 CMSC 203 / 0201 Fall 2002 Week #13 – 18/20/22 November 2002 Prof. Marie desJardins.
Introduction to Graph Theory
Aaron Tan October Graphs and Trees 1 Graphs: DefinitionsTrails, Paths, and CircuitsMatrix RepresentationsIsomorphisms 1.
Graph Theory and Applications
Graphs 9.1 Graphs and Graph Models أ. زينب آل كاظم 1.
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
 Quotient graph  Definition 13: Suppose G(V,E) is a graph and R is a equivalence relation on the set V. We construct the quotient graph G R in the follow.
Basic properties Continuation
Discrete Structures CISC 2315 FALL 2010 Graphs & Trees.
Chapter 11 - Graph CSNB 143 Discrete Mathematical Structures.
Chapter 9: Graphs.
Chapter 20: Graphs. Objectives In this chapter, you will: – Learn about graphs – Become familiar with the basic terminology of graph theory – Discover.
Week 11 - Wednesday.  What did we talk about last time?  Graphs  Paths and circuits.
(CSC 102) Lecture 30 Discrete Structures. Graphs.
Chap 7 Graph Def 1: Simple graph G=(V,E) V : nonempty set of vertices E : set of unordered pairs of distinct elements of V called edges Def 2: Multigraph.
1 GRAPH Learning Outcomes Students should be able to: Explain basic terminology of a graph Identify Euler and Hamiltonian cycle Represent graphs using.
1 Lecture 5 (part 2) Graphs II (a) Circuits; (b) Representation Reading: Epp Chp 11.2, 11.3
رياضيات متقطعة لعلوم الحاسب MATH 226. Chapter 10.
Chapter Chapter Summary Graphs and Graph Models Graph Terminology and Special Types of Graphs Representing Graphs and Graph Isomorphism Connectivity.
An Introduction to Graph Theory
Graphs: Definitions and Basic Properties
Chapter 9 (Part 2): Graphs
Special Graphs By: Sandeep Tuli Astt. Prof. CSE.
Graphs Hubert Chan (Chapter 9) [O1 Abstract Concepts]
Chapters 8.1 and 8.2 Based on slides by Y. Peng University of Maryland
Graph theory Definitions Trees, cycles, directed graphs.
Agenda Lecture Content: Introduction to Graph Path and Cycle
Can you draw this picture without lifting up your pen/pencil?
Introduction to Graph Theory Euler and Hamilton Paths and Circuits
Graph Theory.
Chapters 8.1 and 8.2 Based on slides by Y. Peng University of Maryland
CS100: Discrete structures
Let us switch to a new topic:
Chapter 10 Graphs and Trees
Presentation transcript:

GRAPH Learning Outcomes Students should be able to: Explain basic terminology of a graph Identify Euler and Hamiltonian cycle Represent graphs using adjacency matrices

Contents Introduction Paths and circuits Matrix representations of graphs

Introduction to Graphs DEF: A simple graph G = (V,E ) consists of a non-empty set V of vertices (or nodes) and a set E (possibly empty) of edges where each edge is associated with a set consisting of either one or two vertices called its endpoints. Q: For a set V with n elements, how many possible edges there?

Terminology Loop, parallel edges, isolated, adjacent Loop - an edge connects a vertex to itself Two edges connect the same pair of vertices are said to be parallel. Isolated vertex – unconnected vertex. Two vertices that are connected by an edge are called adjacent. An edge is said to be incident on each of its end points.

Example of a graph Vertex set = {u1, u2, u3} Edge set = {e1, e2, e3, e4} e1, e2, e3 are incident on u1 u2 and u3 are adjacent to u1 e4 is a loop e2 and e3 are parallel

Types of Graphs Directed – order counts when discussing edges Undirected (bidirectional) Weighted – each edge has a value associated with it Unweighted 21 April 2017 Graphs and Trees 6

Examples 21 April 2017 Graphs and Trees 7 http://richard.jones.name/google-hacks/google-cartography/google-cartography.html 21 April 2017 Graphs and Trees 7

Special Graphs Simple – does not have any loops or parallel edges Complete graphs – there is an edge “between” every possible tuple of vertices Bipartite graph – V can be partitioned into V1 and V2, such that: (x,y)E  (xV1  yV2)  (xV2  yV1) Sub graphs G1 is a subset of G2 iff Every vertex in G1 is in G2 Every edge in G1 is in G2 Connected graph – can get from any vertex to another via edges in the graph 21 April 2017 Graphs and Trees 8

Complete Graphs there is an edge “between” every possible tuple of vertices. |e| = C(n,2) = n. (n-1)/2

Bipartite graph A graph is bipartite if its vertices can be partitioned into two disjoint subsets U and V such that each edge connects a vertex from U to one from V.

Complete bipartite A bipartite graph is a complete bipartite graph if every vertex in U is connected to every vertex in V. If U has m elements and V has n, then we denote the resulting complete bipartite graph by Km,n. The illustration shows K3,2

Degree of Vertex Defined as the number of edges attached (incident) to the vertex. A loop is counted twice. 21 April 2017 Graphs and Trees 12

Handshake Theorem If G is any graph, then the sum of the degrees of all the vertices of G equals twice the number of edges of G. Specifically, if the vertices of G are v1, v2, …, vn, where n is a nonnegative integer, then: The total degree of G = d(v1)+d(v2)+…+d(vn) = 2  (the number of edges of G) 21 April 2017 Graphs and Trees 13

Total degree of a graph is even Prove that the total of the degrees of all vertices in a graph is even. Since the total degree equals 2 times of edges, which is an integer, the sum of all degree is even. 21 April 2017 Graphs and Trees 14

Whether certain graphs exist Draw a graph with the specified properties or show that no such graph exists. (a) A graph with four vertices of degrees 1,1,2, and 3 (b) A graph with four vertices of degrees 1,1,3 and 3 (c) A simple graph with four vertices of degrees 1,1,3 and 3

Even no. of vertices with odd degree In any graph, there are an even number of vertices with odd degree Is there a graph with ten vertices of degrees 1,1,2,2,2,3,4,4,4, and 6? 21 April 2017 Graphs and Trees 16

Learning Outcomes Students should be able to: Explain basic terminology of a graph Identify Euler and Hamiltonian cycle Represent graphs using adjacency matrices

Seven Bridges of Königsberg Is it possible for a person to take a walk around town, starting and ending at the same location and crossing each of the seven bridges exactly once? No 21 April 2017 Graphs and Trees 18

Definitions Terminology - Walk, path, simple path, circuit, simple circuit. Walk from two vertices is a finite alternating sequence of adjacent vertices and edges Trivial walk from v to v consists of single vertex v0e1v1e2…envn 21 April 2017 Graphs and Trees 19

Path Path – a walk that does not contain a repeated edge (may have a repeated vertex) v0e1v1e2…envn where all the ei are distinct Simple path – a path that does not contain a repeated vertex v0e1v1e2…envn where all the ei and vj are distinct

Circuit Closed walk – starts and ends at same vertex Circuit – a closed walk without repeated edge Simple circuit – a circuit with no repeated vertex except first and last

Connectedness Connectedness – if there is a walk from one to the other

Euler Circuits A circuit that contains every vertex and every edge of G. A sequence of adjacent vertices and edges that starts and ends at the same vertex, uses every vertex of G at least once, and uses every edge of G exactly once. 21 April 2017 Graphs and Trees 23

If a graph has an Euler circuit, every vertex has even degree. Contrapositive: if some vertex has odd degree, then the graph does not have an Euler circuit. 21 April 2017 Graphs and Trees 24

If every vertex of nonempty graph has even degree and if graph is connected, then the graph has an Euler circuit. 21 April 2017 Graphs and Trees 25

Euler Circuit A graph G has an Euler circuit if, and only if, G is connected and every vertex of G has even degree. 21 April 2017 Graphs and Trees 26

Hamiltonian Path A path in an undirected graph which visits each vertex exactly once. 21 April 2017 Graphs and Trees 27

Hamiltonian Circuit A simple circuit that includes every vertex of G. A sequence of adjacent vertices and distinct edges in which every vertex of G appears exactly once, except for the first and last, which are the same. 21 April 2017 Graphs and Trees 28

Hamiltonian Circuit Proved simple criterion for determining whether a graph has an Euler circuit No analogous criterion for determining whether a graph has a Hamiltonian circuit Nor is there an efficient algorithm for finding such an algorithm 21 April 2017 Graphs and Trees 29

Traveling Salesman Problem http://en.wikipedia.org/wiki/Traveling_Salesman_Problem 21 April 2017 Graphs and Trees 30

TSP One way to solve the general problem is to: Write down all Hamiltonian circuits Compute total distance for each Pick one for which total is minimal What if graph has 30 vertices: 29! =8.84 x 1030 different Hamiltonian circuits If each circuit could be found and total distance computed in a nanosecond, then would take: 2.8 x 1014 years!!! No known algorithm that is more efficient!!! Some that find “pretty good” solutions 21 April 2017 Graphs and Trees 31

Learning Outcomes Students should be able to: Explain basic terminology of a graph Identify Euler and Hamiltonian cycle Represent graphs using adjacency matrices

Matrix Representations of Graphs 21 April 2017 Graphs and Trees 33

Matrices and Connected Components 21 April 2017 Graphs and Trees 34

Counting Walks of Length n Matrix multiplication 21 April 2017 Graphs and Trees 35

How do these graphs relate? =    21 April 2017 Graphs and Trees 36

Summary