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

Slides:



Advertisements
Similar presentations
CSE 211 Discrete Mathematics
Advertisements

Chapter 8 Topics in Graph Theory
Chapter 9 Graphs.
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 :李弋老师  开卷考试.
Introduction This chapter explores graphs and their applications in computer science This chapter explores graphs and their applications in computer science.
 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.
1 Section 8.2 Graph Terminology. 2 Terms related to undirected graphs Adjacent: 2 vertices u & v in an undirected graph G are adjacent (neighbors) in.
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.
Applied Discrete Mathematics Week 12: Trees
Chapter 11 Graphs and Trees This handout: Terminology of Graphs Eulerian Cycles.
Discrete Mathematics Lecture 9 Alexander Bukharovich New York University.
Graphs Rosen 8.1, 8.2. There Are Many Uses for Graphs! Networks Data organizations Scene graphs Geometric simplification Program structure and processes.
22C:19 Discrete Math Graphs Spring 2014 Sukumar Ghosh.
9.2 Graph Terminology and Special Types Graphs
GRAPH Learning Outcomes Students should be able to:
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.
GRAPHS CSE, POSTECH. Chapter 16 covers the following topics Graph terminology: vertex, edge, adjacent, incident, degree, cycle, path, connected component,
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.
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.
Fall 2015 COMP 2300 Discrete Structures for Computation Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1.
Chapter 5 Graphs  the puzzle of the seven bridge in the Königsberg,  on the Pregel.
Introduction to Graph Theory
An Introduction to Graph Theory
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.
GRAPHS. Graph Graph terminology: vertex, edge, adjacent, incident, degree, cycle, path, connected component, spanning tree Types of graphs: undirected,
 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.
Graph Theory Unit: 4.
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.
CS 261 – Nov. 17 Graph properties – Bipartiteness – Isomorphic to another graph – Pseudograph, multigraph, subgraph Path Cycle – Hamiltonian – Euler.
Week 11 - Wednesday.  What did we talk about last time?  Graphs  Paths and circuits.
(CSC 102) Lecture 30 Discrete Structures. Graphs.
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
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
Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103 Chapter 10 Graphs Slides are adopted from “Discrete.
Can you draw this picture without lifting up your pen/pencil?
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:
Euler and Hamilton Paths
Graphs G = (V, E) V are the vertices; E are the edges.
Chapter 5 Graphs the puzzle of the seven bridge in the Königsberg,
Chapter 10 Graphs and Trees
Presentation transcript:

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

2 Contents Introduction Paths and circuits Matrix representations of graphs

3 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?

4 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.

5 Example of a graph Vertex set = {u 1, u 2, u 3 } Edge set = {e 1, e 2, e 3, e 4 } e 1, e 2, e 3 are incident on u 1 u 2 and u 3 are adjacent to u 1 e 4 is a loop e 2 and e 3 are parallel

610 June 2016Graphs and Trees6 Types of Graphs Directed – order counts when discussing edges Undirected (bidirectional) Weighted – each edge has a value associated with it Unweighted

710 June 2016Graphs and Trees7 Examples

810 June 2016Graphs and Trees8 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

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

10 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.

11 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

1210 June 2016Graphs and Trees12 Degree of Vertex Defined as the number of edges attached (incident) to the vertex. A loop is counted twice.

1310 June 2016Graphs and Trees13 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 v 1, v 2, …, v n, where n is a nonnegative integer, then: –The total degree of G = d( v 1 )+d( v 2 )+…+d( v n ) = 2  (the number of edges of G )

1410 June 2016Graphs and Trees14 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.

15 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

1610 June 2016Graphs and Trees16 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?

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

1810 June 2016Graphs and Trees18 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

1910 June 2016Graphs and Trees19 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 v 0 e 1 v 1 e 2 …e n v n

20 Path Path – a walk that does not contain a repeated edge (may have a repeated vertex) v 0 e 1 v 1 e 2 …e n v n where all the e i are distinct Simple path – a path that does not contain a repeated vertex v 0 e 1 v 1 e 2 …e n v n where all the e i and v j are distinct. e 1 is represented by {v 0,v 1 }.

21 Example - path Path v Simple path w

22 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

23 Examples Cuircuit Simple circuit

24 Connectedness Connectedness – if there is a walk from one to the other Let G be a graph. Two vertices v and w of G are connected if, and only if, there is a walk from v to w. The graph G is connected if, and only if, given any two vertices v and w in G, there is a walk from v to w.

25 Examples

2610 June 2016Graphs and Trees26 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.

2710 June 2016Graphs and Trees27 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.

2810 June 2016Graphs and Trees28 If every vertex of nonempty graph has even degree and if graph is connected, then the graph has an Euler circuit.

2910 June 2016Graphs and Trees29 Euler Circuit A graph G has an Euler circuit if, and only if, G is connected and every vertex of G has even degree.

3010 June 2016Graphs and Trees30 Hamiltonian Path A path in an undirected graph which visits each vertex exactly once.

3110 June 2016Graphs and Trees31 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.

32 Hamiltonian circuit An Euler circuit for a graph G may not be a Hamiltonian circuit. An Hamiltonian circuit may not be an Euler circuit.

3310 June 2016Graphs and Trees33 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

34 Hamiltonian Circuit Finding Hamiltonian circuits

3510 June 2016Graphs and Trees35 Traveling Salesman Problem sman_Problem sman_Problem

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

37 Matrices and Digraph Let G be a directed graph with ordered vertices v 1,v 2,…,v n. The adjacency matrix of G is the n x n matrix A =(a ij ) over the set of nonnegative integers such that a ij = the numbers of arrows from v i to v j for all i,j = 1,2,…,n.

38 Examples Adjacency Matrix of a graph Obtaining a Directed graph from a Matrix.

39 Matrices and (Undirected) Graphs Let G be a (undirected) graph with ordered vertices v 1,v 2,…,v n. The adjacency matrix of G is the n x n matrix A =(a ij ) over the set of nonnegative integers such that a ij = the numbers of edges connecting v i and v j for all i,j = 1,2,…,n.

40 Example Finding the adjacency Matrix of a Graph

41 Question ?????

42 Exercise Find the adjacency matrices for the following directed graphs.

43 Summary Definitions: vertex, edge, loop, parallel edges, complete graph and bipartite. Paths & circuits: Euler and Hamiltonian circuits. Finding Euler circuit is easy but not so for Hamiltonian. Matrix representation of graphs: adjacency matrix.

44 THANK YOU Last updated: 21/9/2009