Discrete Structures Lecture 14
Discrete Structures Lecture 14
(Discrete Mathematics)
Fall 2016
Lecture - 14
Graphs
Graphs
• What are graphs?
• A class of discrete structures useful for representing relations
among objects.
• Vertices (nodes) connected by edges.
• Theory about graphs can be used to solve a lot of important
problems
The First Graph Theory
• The first graph theory paper by Leonhard
• Euler in 1736: Seven bridges of Königsberg,
• A town with 7 bridges and 4 pieces of land…
The Origin of Graph Theory
• Can we travel each bridge exactly once and return to the
starting point?
Definition - Graphs
• A graph G = (V, E) is defined by a set of vertices V , and a
set of edges E consisting of ordered or unordered pairs of
vertices from V.
• Thus a graph G = (V, E)
• V = set of vertices
• E = set of edges = subset of V V
• Each edge has either one or two vertices
associated with it, called its endpoints.
• An edge is said to connect its endpoints.
Simple Graphs
• A graph in which each edge connects two different
vertices and where no two edges connect the same pair
of vertices.
Example
Multigraph
• A multigraph: multiple edges
connecting the same nodes
deg(a) = 3
deg(b) = 5
deg(c) = 5
deg(d) = 5
deg(e) = 0 (isolated vertex)
deg(v) 2 E
vV
• || has to be even.
Directed Degree
• When is an edge of the graph G with directed edges, is
said to be adjacent to . The vertex is called the initial
vertex of , and is called the terminal or end vertex of
• The initial vertex and terminal vertex of a loop are the
same.
Directed Degree
• Let G be a directed graph, v a vertex of G.
• The in-degree of v, , is the number of edges with as their
terminal vertex.
• The out-degree of v, , is the number of edges with as
their initial vertex.
• The degree of v, is the sum of v’s in-degree and out-
degree.
• Loop at a vertex contributes 1 to both the in-degree and
the out-degree of this vertex.
Example
• Determine in/out-degree of each node
•
•
Theorem
deg
vV
(v ) deg
vV
(v ) E
Chapter Exercise
• Chapter # 10
• Topic # 10.1
• Q – 1,3,4,5,6,7,8,9,13,16,19,21,22
• Topic # 10.2
• Q -1,2,3,4,7,8,9,10,21,22,23,24,27
• Topic # 10.3
• Q – 1,2,3,4,5,6,7,8,10,11,12,13,14,15,16,17,18,19,20,21,
22,23,24,26,27