# Lecture 09: Basic Graph Theory - PowerPoint PPT Presentation

PPT – Lecture 09: Basic Graph Theory PowerPoint presentation | free to download - id: 150632-OTBlM

The Adobe Flash plugin is needed to view this content

Get the plugin now

View by Category
Title:

## Lecture 09: Basic Graph Theory

Description:

### JC Liu. MACM101 Discrete Mathematics I. 1. Lecture 09: Basic Graph Theory. Introduction to Graphs ... The two graphs below are in fact the same graph (structure-wise) ... – PowerPoint PPT presentation

Number of Views:3143
Avg rating:3.0/5.0
Slides: 31
Provided by: hart66
Category:
Tags:
Transcript and Presenter's Notes

Title: Lecture 09: Basic Graph Theory

1
Lecture 09 Basic Graph Theory
• Introduction to Graphs
• Basic Definitions
• Complete Graph/Cycle
• Bipartite Graphs
• Operations on Graphs
• Other Graph Representations
• Graph Isomorphism

2
9.1. Basic Definitions
• A graph G (V, E)
• Is a discrete structure consisting of
• A nonempty set of vertices (nodes) V and
• a set of edges E that connect these vertices.
• First consider graph that contains
• No arrows (directions)
• No loops edges from a vertex to itself.
• No multiple edges joining the same two vertices.
• Also referred to as undirected simple graph.

3
9.1. Basic Definitions
• A graph can be described either by the use of
• Sets or
• a diagram.
• The diagram can be drawn differently and still
represents the same graph.
• Example
• Sets A graph with vertices V ? A, B, C, D ?
and edges E ? ?A,B?, ?B,C?, ?C,D? ?.

4
9.1. Basic Definitions
• Two vertices u and v in V are adjacent or
neighbors if there is an edge e between u and v.
• The edge e ?u, v? joins (or connects/links) the
vertices u and v.
• The vertices u and v are endpoints of e.
• The edge e is incident with the vertex u and v.
• The degree of u, denoted deg(u), is the number of
edges incident with a vertex u.

5
9.1. Basic Definitions
• Example
• Vertices A and B are adjacent.
• Vertices A and D are not because there is no edge
between them.
• deg(A) 1
• deg(B) 3
• deg(C) 0, C is called isolated.

6
9.1. Basic Definitions
• The Handshaking Theorem
• Let G (V, E). Then
• Proof
• Each edge contributes twice to the degree count
of all vertices. (Q.E.D.)
• Example
• If a graph has 3 vertices, can each vertex have
degree 3? Or 4?
• The sum is 3?3 9 which is an odd number. Not
possible.
• The sum is 4?3 12 2 E and 12/2 6 edges.
May be possible.

7
9.2. Some Special Graphs
• Complete graphs - Kn
• The (simple) graph with
• n vertices
• exactly one edge between every pair of distinct
vertices.
• Examples
• K5 is important because it is the simplest
nonplanar graph. It cannot be drawn in a plane
with nonintersecting edges.

8
9.2. Some Special Graphs
• Complete graphs - Kn
• How many edges of Kn?

9
9.2. Some Special Graphs
• Cycles Cn
• Is an n vertex graph with all vertices having a
degree two, and all are connected.
• Examples

10
9.3. Bipartite Graphs
• A bipartite graph G is
• Is a graph in which the vertices V can be
partitioned into two disjoint subsets V1 and V2
such that
• No two vertices in V1 are adjacent.
• No two vertices in V2 are adjacent.

11
9.3. Bipartite Graphs
• Examples
• Let the courses and professors be the vertices of
a graph G.
• Put an edge between a course and a professor
whenever the professor can teach the course.
• The resulting graph is bipartite.

12
9.3. Bipartite Graphs
• Examples
• Is a Star network (K1,n) bipartite graph?
• Is a cycle Ck bipartite graph?

13
9.3. Bipartite Graphs
• Examples
• Is the following graph bipartite?
• Solution
• If a is in V1 then b, d and e must be in V2
(why?)
• Then c is in V1 and there is no inconsistency.
• The graph is a complete bipartite graph K2,3.

14
9.3. Bipartite Graphs
• A bipartite graph G is
• Is a graph in which the vertices V can be
partitioned into two disjoint subsets V1 and V2
such that
• No two vertices in V1 are adjacent.
• No two vertices in V2 are adjacent.
• A complete bipartite graph Km,n is
• Is a bipartite graph in which the sets V1 and V2
contain m and n vertices, respectively, and every
vertex in V1 is adjacent to every vertex in V2.
• How many edges ?

15
9.4. Operations on Graphs
• A subgraph of G (V, E)
• Is a graph H (W, F) where W ? V and F ? E.
• Examples
• K5 and its subgraph

16
9.4. Operations on Graphs
• The union of two graphs G1 (V1, E1) and G2
(V2, E2)
• Is a graph with vertex set V1 ? V2 and edge set
E1 ? E2.
• i.e. G1 ? G2 (V1 ? V2, E1 ? E2)
• Examples
• G1 and G2 with their union G1 ? G2

17
9.5. Other Graph Representations
• To analyze a graph using a computer, we need to
communicate the vertices and edges of the graph.
• Graph representations

18
9.5. Other Graph Representations
• Adjacency list of a graph G
• Specify the vertices that are adjacent to each
vertex of the graph.
• Examples
• A graph and its adjacency list.

19
9.5. Other Graph Representations
• Adjacency matrix of a graph G (V, E) with n
vertices
• Is an n ? n matrix A aij, where
• Sum of the entries in row i of the adjacency
matrix ?
• The matrix is symmetric, i.e. aij aji.

20
9.5. Other Graph Representations
• Examples
• Two graphs and their adjacency matrices.

21
9.6. Graph Isomorphism
• The two graphs below are in fact the same graph
(structure-wise).
• We say that these graphs are isomorphic.

22
9.6. Graph Isomorphism
• Let G1 (V1, E1) and G2 (V2, E2) be simple
graphs.
• The graphs G1 and G2 are isomorphic iff
• There exists a bijection f V1?V2
• The function f is called an isomorphism of G1
with G2.
• i.e. For all vertices u and v in V1,
• if u and v are adjacent in G1
• then f(u) and f(v) are adjacent in G2.

23
9.6. Graph Isomorphism
• Graph isomorphism invariant properties
• Are the properties that G1 and G2 must have in
common in order to be isomorphic
• the same number of vertices.
• the same number of edges.
• degrees of corresponding vertices are the same.
• if one is bipartite, the other must be.
• if one is complete, the other must be.
• etc. but these are necessary, not sufficient !

24
9.6. Graph Isomorphism
• Examples
• The following graphs are isomorphic.

25
9.6. Graph Isomorphism
• Examples
• The following graphs are not isomorphic. Why?

26
9.6. Graph Isomorphism
• Examples
• The following graphs are not isomorphic.
• Vertex C in G1 is adjacent to the vertices A, B,
D and E. So it has a degree of 4.
• But there are no vertices of degree 4 in G2.

27
9.6. Graph Isomorphism
• Examples
• Determine if the following two graphs G1 and G2
are isomorphic.

28
9.6. Graph Isomorphism
• Solution
• Check . . .
• They have the same number of vertices 5
• They have the same number of edges 8
• They have the same number of vertices with the
same degrees 2, 3, 3, 4, 4.

29
9.6. Graph Isomorphism
• 3?2, 1?1, 5?4, 2?3, 4?5
• The problem in general is very difficult, even
using
• a computer !

30