Basics of Graph Theory� III B.sc Mathematics,� Graph Theory�
Presented by,
B.Suguna Selvarani,
Assistant Professor,
Department of Mathematics,
Cardamom Planters’ Association College,
Bodinayakanur.
Applications of Graph Theory
Topics Covered
Definition – Graph
A generalization of the simple concept of a set of dots, links, edges or arcs.
Representation: Graph G =(V, E) consists set of vertices denoted by V, or by V(G) and set of edges E, or E(G)
Definitions –Types of Edges
Directed: Ordered pair of vertices. Represented as (u, v) directed from vertex u to v.
Undirected: Unordered pair of vertices. Represented as {u, v}. Disregards any sense of direction and treats both end vertices interchangeably.
u
v
u
v
Definitions – Types of Edges
u
Definitions –Types of Graphs
Simple (Undirected) Graph: consists of V, a nonempty set of vertices, and E, a set of unordered pairs of distinct elements of V called edges (undirected)
Representation Example: G(V, E), V = {u, v, w}, E = {{u, v}, {v, w}, {u, w}}
u
v
w
Definitions – Types of Graphs
Multigraph: G(V,E), consists of set of vertices V, set of Edges E and a function f from E to {{u, v}| u, v V, u ≠ v}. The edges e1 and e2 are called multiple or parallel edges if f (e1) = f (e2).
Representation Example: V = {u, v, w}, E = {e1, e2, e3}
u
v
w
e1
e2
e3
Definitions – Types of Graphs
Pseudograph: G(V,E), consists of set of vertices V, set of Edges E and a function F from E to {{u, v}| u, v Î V}. Loops allowed in such a graph.
Representation Example: V = {u, v, w}, E = {e1, e2, e3, e4}
u
v
w
e1
e3
e2
e4
Definitions – Types of Graphs
Directed Graph: G(V, E), set of vertices V, and set of Edges E, that are ordered pair of elements of V (directed edges)
Representation Example: G(V, E), V = {u, v, w}, E = {(u, v), (v, w), (w, u)}
u
w
v
Definitions – Types of Graphs
Directed Multigraph: G(V,E), consists of set of vertices V, set of Edges E and a function f from E to {{u, v}| u, v V}. The edges e1 and e2 are multiple edges if f(e1) = f(e2)
Representation Example: V = {u, v, w}, E = {e1, e2, e3, e4}
u
w
v
e1
e2
e3
e4
Definitions – Types of Graphs
Type | Edges | Multiple Edges Allowed ? | Loops Allowed ? |
Simple Graph | undirected | No | No |
Multigraph | undirected | Yes | No |
Pseudograph | undirected | Yes | Yes |
Directed Graph | directed | No | Yes |
Directed Multigraph | directed | Yes | Yes |
Terminology – Undirected graphs
Representation Example: For V = {u, v, w} , E = { {u, w}, {u, v} }, deg (u) = 2, deg (v) = 1, deg (w) = 1, deg (k) = 0, w and v are pendant , k is isolated
u
k
w
v
Terminology – Directed graphs
Note: A loop contributes 1 to both in-degree and out-degree (why?)
Representation Example: For V = {u, v, w} , E = { (u, w), ( v, w), (u, v) }, deg- (u) = 0, deg+ (u) = 2, deg- (v) = 1,
deg+ (v) = 1, and deg- (w) = 2, deg+ (u) = 0
u
w
v
Theorems: Undirected Graphs
Theorem 1
The Handshaking theorem:
(why?) Every edge connects 2 vertices
Theorems: Undirected Graphs
Theorem 2:
An undirected graph has even number of vertices with odd degree
Simple graphs – special cases
Representation Example: K1, K2, K3, K4
K2
K1
K4
K3
Simple graphs – special cases
Representation Example: C3, C4
C3
C4
Bipartite graphs
Application example: Representing Relations
Representation example: V1 = {v1, v2, v3} and V2 = {v4, v5, v6},
v1
v2
v3
v4
v5
v6
V1
V2
Complete Bipartite graphs
Representation example: K2,3, K3,3
K2,3
K3,3
Subgraphs
Application example: solving sub-problems within a graph
Representation example: V = {u, v, w}, E = ({u, v}, {v, w}, {w, u}}, H1 , H2
u
v
w
u
u
w
v
v
H1
H2
G
Subgraphs
Representation example: V1 = {u, w}, E1 = {{u, w}}, V2 = {w, v},
E1 = {{w, v}}, V = {u, v ,w}, E = {{{u, w}, {{w, v}}
u
v
w
w
v
w
u
G1
G2
G
Representation
Representation- Incidence Matrix
Can also be used to represent :
Multiple edges: by using columns with identical entries, since these edges are incident with the same pair of vertices
Loops: by using a column with exactly one entry equal to 1, corresponding to the vertex that is incident with the loop
Representation- Incidence Matrix
v
w
u
e1
e3
e2
| e1 | e2 | e3 |
v | 1 | 0 | 1 |
u | 1 | 1 | 0 |
w | 0 | 1 | 1 |
Representation- Adjacency Matrix
For undirected graph
Representation- Adjacency Matrix
Representation- Adjacency Matrix
| v | u | w |
v | 0 | 1 | 1 |
u | 1 | 0 | 1 |
w | 1 | 1 | 0 |
u
v
w
Representation- Adjacency Matrix
| v | u | w |
v | 0 | 1 | 0 |
u | 0 | 0 | 1 |
w | 1 | 0 | 0 |
u
v
w
Graph - Isomorphism
Application Example:
In chemistry, to find if two compounds have the same structure
Graph - Isomorphism
Representation example: G1 = (V1, E1) , G2 = (V2, E2)
f(u1) = v1, f(u2) = v4, f(u3) = v3, f(u4) = v2,
u1
u3
u4
u2
v3
v4
v1
v2