0% found this document useful (0 votes)
12 views

Lecture12 Graphs Summary

Uploaded by

26YiJie
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Lecture12 Graphs Summary

Uploaded by

26YiJie
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

Lecture #12: Graphs

Summary

Aaron Tan

AY2024/25 Semester 1 1
Graphs: Introduction Trails, Paths, and Circuits Matrix Representations Isomorphism and Planar Graphs

10. Graphs and Trees

10.1 Graphs: Definitions and Basic Properties


• Introduction, Basic Terminology
• Special Graphs
• The Concept of Degree

10.2 Trails, Paths, and Circuits


• Definitions
• Connectedness
• Euler Circuits and Hamiltonian Circuits

10.3 Matrix Representations of Graphs


• Matrices and Directed Graphs; Matrices and Undirected Graphs
• Matrix Multiplication
• Counting Walks of Length N

10.4 Isomorphisms of Graphs/Planar Graphs


• Definition of Graph Isomorphism
• Planar Graphs and Euler’s Formula
Reference: Epp’s Chapter 10 Graphs and Trees 2
Summary
10.1 Definitions and Basic Properties

An undirected graph 𝐺 = (𝑉, 𝐸) consists of


 a set of vertices 𝑉 = {𝑣1 , 𝑣2 , ⋯ , 𝑣𝑛 } , and
 a set of (undirected) edges 𝐸 = {𝑒1 , 𝑒2 , ⋯ , 𝑒𝑘 }.
 An (undirected) edge 𝑒 connecting 𝑣𝑖 and 𝑣𝑗 is denoted as 𝑒 = {𝑣𝑖 , 𝑣𝑗 }.

V = {v1, v2, v3, v4, v5, v6, v7}


E = {e1, e2, e3, e4, e5, e6}

e1 = {v1, v4}
e2 = e3 = {v2, v3}
e4 = {v3, v4}
e5 = {v4, v4}
e6 = {v6, v7}

Edges incident on v4: e1, e4 and e5.


Vertices adjacent to v4: v1, v3 and v4.
Edges adjacent to e2: e3 and e4.
3
Summary
10.1 Definitions and Basic Properties

Definition: Undirected Graph

An undirected graph G consists of 2 finite sets: a nonempty set V of vertices and a set
E of edges, where each (undirected) edge is associated with a set consisting of either
one or two vertices called its endpoints.
An edge is said to connect its endpoints; two vertices that are connected by an edge
are called adjacent vertices; and a vertex that is an endpoint of a loop is said to be
adjacent to itself.
An edge is said to be incident on each of its endpoints, and two edges incident on the
same endpoint are called adjacent edges.
We write e = {v, w} for an undirected edge e incident on vertices v and w.

Definition: Directed Graph


A directed graph, or digraph, G, consists of 2 finite sets: a nonempty set V of
vertices and a set E of directed edges, where each (directed) edge is associated
with an ordered pair of vertices called its endpoints.
We write e = (v, w) for a directed edge e from vertex 𝑣 to vertex 𝑤.
4
Summary
10.1 Definitions and Basic Properties

Definition: Simple Graph


A simple graph is an undirected graph that does not have any loops or parallel edges.
(That is, there is at most one edge between each pair of distinct vertices.)

Definition: Complete Graph


A complete graph on n vertices, n > 0, denoted Kn, is a simple graph with n vertices
and exactly one edge connecting each pair of distinct vertices.

Definition: Bipartite Graph

A bipartite graph (or bigraph) is a simple graph whose vertices can be divided into
two disjoint sets 𝑈 and 𝑉 such that every edge connects a vertex in 𝑈 to one in 𝑉.

Definition: Complete Bipartite Graph

A complete bipartite graph is a bipartite graph on two disjoint sets 𝑈 and 𝑉 such
that every vertex in 𝑈 connects to every vertex in 𝑉.
If 𝑈 = 𝑚 and 𝑉 = 𝑛, the complete bipartite graph is denoted as 𝐾𝑚,𝑛 .
5
Summary
10.1 Definitions and Basic Properties

Definition: Subgraph of a Graph


A graph H is said to be a subgraph of graph G iff every vertex in H is also a vertex in
H, every edge in H is also an edge in G, and every edge in H has the same endpoints
as it has in G.

Definition: Degree of a Vertex and Total Degree of a Graph


Let G be a graph and v a vertex of G. The degree of v, denoted deg(v), equals the
number of edges that are incident on v, with an edge that is a loop counted twice.
The total degree of G is the sum of the degrees of all the vertices of G.

Theorem 10.1.1 The Handshake Theorem


If the vertices of G are v1, v2, …, vn, where n  0, then the total degree of G
= deg(v1) + deg(v2) + … + deg(vn) = 2  (the number of edges of G).

Corollary 10.1.2 Proposition 10.1.3

The total degree of a graph is even. In any graph there are an even
number of vertices of odd degree. 6
Summary
10.1 Definitions and Basic Properties

Definition: Indegree and outdegree of a Vertex of a Directed Graph


Let G=(V,E) be a directed graph and v a vertex of G. The indegree of v, denoted
deg(v), is the number of directed edges that end at v. The outdegree of v, denoted
deg(v), is the number of directed edges that originate from v.
Note that
෍ 𝑑𝑒𝑔− 𝑣 = ෍ 𝑑𝑒𝑔+ 𝑣 = |𝐸|
𝑣∈𝑉 𝑣∈𝑉

7
Summary
10.2 Trails, Paths, and Circuits

Definitions

Let G be a graph, and let v and w be vertices of G.


A walk from v to w is a finite alternating sequence of adjacent vertices and edges of G.
Thus a walk has the form v0 e1 v1 e2 … vn-1 en vn , where the v’s represent vertices, the e’s
represent edges, v0=v, vn=w, and for all i  {1, 2, …, n}, vi-1 and vi are the endpoints of ei.
The number of edges, n, is the length of the walk.
The trivial walk from v to v consists of the single vertex v.
A trail from v to w is a walk from v to w that does not contain a repeated edge.
A path from v to w is a trail that does not contain a repeated vertex.
A closed walk is a walk that starts and ends at the same vertex.
A circuit (or cycle) is a closed walk of length at least 3 that does not contain a repeated
edge.
A simple circuit (or simple cycle) is a circuit that does not have any other repeated
vertex except the first and last.
An undirected graph is cyclic if it contains a loop or a cycle; otherwise, it is acyclic.

8
Summary
10.2 Trails, Paths, and Circuits

Definition: Connectedness
Two vertices v and w of a graph G are connected iff there is a walk from v to w.
The graph G is connected iff given any two vertices v and w in G, there is a walk from
v to w. Symbolically, G is connected iff  vertices v, w V(G),  a walk from v to w.

Lemma 10.2.1
Let G be a graph.
a. If G is connected, then any two distinct vertices of G can be connected by a path.
b. If vertices v and w are part of a circuit in G and one edge is removed from the
circuit, then there still exists a trail from v to w in G.
c. If G is connected and G contains a circuit, then an edge of the circuit can be
removed without disconnecting G.

Definition: Connected Component


A graph H is a connected component of a graph G iff
1. The graph H is a subgraph of G;
2. The graph H is connected; and
3. No connected subgraph of G has H as a subgraph and contains vertices or
edges that are not in H. 9
Summary
10.2 Trails, Paths, and Circuits

Definitions: Euler Circuit and Eulerian Graph

Let G be a graph. An Euler circuit for G is a circuit that contains every vertex and
every edge of G.
An Eulerian graph is a graph that contains an Euler circuit.

Theorem 10.2.2
If a graph has an Euler circuit, then every vertex of the graph has positive even degree.

Contrapositive Version of Theorem 10.2.2


If some vertex of a graph has odd degree, then the graph doesn’t have an Euler circuit.

Theorem 10.2.3
If a graph G is connected and the degree of every vertex of G is a positive even
integer, then G has an Euler circuit.

Theorem 10.2.4
A graph G has an Euler circuit iff G is connected and every vertex of G has positive
even degree. 10
Summary
10.2 Trails, Paths, and Circuits

Definition: Euler Trail

Let G be a graph, and let v and w be two distinct vertices of G. An Euler trail/path
from v to w is a sequence of adjacent edges and vertices that starts at v, ends at w,
passes through every vertex of G at least once, and traverses every edge of G exactly
once.

Corollary 10.2.5
Let G be a graph, and let v and w be two distinct vertices of G. There is an Euler trail
from v to w iff G is connected, v and w have odd degree, and all other vertices of G
have positive even degree.

11
Summary
10.2 Trails, Paths, and Circuits

Definitions: Hamiltonian Circuit and Hamiltonian Graph

Given a graph G, a Hamiltonian circuit for G is a simple circuit that includes every
vertex of G. (That is, every vertex appears exactly once, except for the first and the
last, which are the same.)
A Hamiltonian graph (also called Hamilton graph) is a graph that contains a
Hamiltonian circuit.

Proposition 10.2.6
If a graph G has a Hamiltonian circuit, then G has a subgraph H with the following
properties:
1. H contains every vertex of G.
2. H is connected.
3. H has the same number of edges as vertices.
4. Every vertex of H has degree 2.

12
Summary
10.3 Matrix Representations of Graphs

Definition: Adjacency Matrix of a Directed Graph

Let G be a directed graph with ordered vertices v1, v2, … vn. The adjacency matrix of
G is the n  n matrix A = (𝑎𝑖𝑗 ) over the set of non-negative integers such that
𝑎𝑖𝑗 = the number of arrows from vi to vj for all i, j = 1, 2, …, n.

Definition: Adjacency Matrix of an Undirected Graph

Let G be an undirected graph with ordered vertices v1, v2, … vn. The adjacency
matrix of G is the n  n matrix A = (𝑎𝑖𝑗 ) over the set of non-negative integers such
that
𝑎𝑖𝑗 = the number of edges connecting vi and vj for all i, j = 1, 2, …, n.

Definition: Symmetric Matrix

An n  n square matrix A = (𝑎𝑖𝑗 ) is called symmetric iff for all i, j = 1, 2, …, n,


𝑎𝑖𝑗 = 𝑎𝑗𝑖 .

13
Summary
10.3 Matrix Representations of Graphs

Definition: nth Power of a Matrix


For any n  n matrix A, the powers of A are defined as follows:
A0 = I where I is the n  n identity matrix
An = A An – 1 for all integers n  1

Theorem 10.3.2
If G is a graph with vertices v1, v2, …, vm and A is the adjacency matrix of G, then for
each positive integer n and for all integers i, j = 1, 2, …, m,
the ij-th entry of An = the number of walks of length n from vi to vj.

14
Summary
10.4 Planar Graphs

Definition: Isomorphic Graph

Let 𝐺 = (𝑉𝐺 , 𝐸𝐺 ) and 𝐺 ′ = (𝑉𝐺 ′ , 𝐸𝐺′ ) be two graphs.


𝑮 is isomorphic to 𝑮′, denoted 𝐺 ≅ 𝐺′, if and only if there exist bijections
𝑔: 𝑉𝐺 → 𝑉𝐺 ′ and ℎ: 𝐸𝐺 → 𝐸𝐺 ′ that preserve the edge-endpoint functions of 𝐺 and 𝐺′
in the sense that for all 𝑣 ∈ 𝑉𝐺 and 𝑒 ∈ 𝐸𝐺 ,
v is an endpoint of e  g(v) is an endpoint of h(e).

Alternative definition (for simple graphs)


Let 𝐺 = (𝑉𝐺 , 𝐸𝐺 ) and 𝐺 ′ = (𝑉𝐺 ′ , 𝐸𝐺′ ) be two simple graphs.
𝑮 is isomorphic to 𝑮′ if and only if there exists a permutation 𝜋: 𝑉𝐺 → 𝑉𝐺 ′ such that
{𝑢, 𝑣} ∈ 𝐸𝐺  {𝜋(𝑢), 𝜋(𝑣)} ∈ 𝐸𝐺′ .

Theorem 10.4.1 Graph Isomorphism is an Equivalence Relation


Let S be a set of graphs and let ≅ be the relation of graph isomorphism on S.
Then ≅ is an equivalence relation on S.

15
Summary
10.4 Planar Graphs

Definition: Planar Graph

A planar graph is a graph that can be drawn on a (two-dimensional) plane without


edges crossing.

Euler’s Formula
For a connected planar simple graph G = (V, E) with e = |E| and v = |V|, if we let f be
the number of faces, then
f=e–v+2

16
END OF FILE

17

You might also like