An introduction to graph theory - Indiana State Universitycs.indstate.edu/~arash/adslec8.pdf · An...

Post on 06-Jun-2018

235 views 0 download

transcript

An introduction to graph theory

Arash Rafiey

13 October, 2015

Arash Rafiey An introduction to graph theory

Definition of Graph

Let V be a finite nonempty set and let E ⊆ V × V .

(V ,E ) is called a digraph where V is a set of vertices and E iscalled a set of (directed) edges or arcs.

When the order does not matter (relation is symmetric) we have agraph G = (V ,E ) and E (G ) ⊆ {{u, v}|u, v ∈ V (G )}

a

b c

d e

V={a,b,c,d,e}

a

b c

de

V={a,b,c,d,e}

E={{a,b},{a,c},{b,c},{b,d},{d,c},{c,e}} E={(a,b),(b,d),(d,b),(c,b),(c,e)}

Arash Rafiey An introduction to graph theory

Definition of Graph

Let V be a finite nonempty set and let E ⊆ V × V .

(V ,E ) is called a digraph where V is a set of vertices and E iscalled a set of (directed) edges or arcs.

When the order does not matter (relation is symmetric) we have agraph G = (V ,E ) and E (G ) ⊆ {{u, v}|u, v ∈ V (G )}

a

b c

d e

V={a,b,c,d,e}

a

b c

de

V={a,b,c,d,e}

E={{a,b},{a,c},{b,c},{b,d},{d,c},{c,e}} E={(a,b),(b,d),(d,b),(c,b),(c,e)}

Arash Rafiey An introduction to graph theory

For simplicity instead of edge {u, v} we write edge uv .

Two vertices u and v are called adjacent if uv is an edge of G .

We say v is a neighbor of u if uv is an edge of G .Let x , y be two vertices of graph G .

An x − y walk is an alternating sequence of vertices and edges,starting at x and ending at y .

If x = y then the walk is called closed.

A trail is a walk in which all the edges are distinct.

A path is a simple walk (no vertex repeated).

A cycle is a simple closed walk (no vertex repeated except thebeginning ).

Arash Rafiey An introduction to graph theory

For simplicity instead of edge {u, v} we write edge uv .

Two vertices u and v are called adjacent if uv is an edge of G .

We say v is a neighbor of u if uv is an edge of G .Let x , y be two vertices of graph G .

An x − y walk is an alternating sequence of vertices and edges,starting at x and ending at y .

If x = y then the walk is called closed.

A trail is a walk in which all the edges are distinct.

A path is a simple walk (no vertex repeated).

A cycle is a simple closed walk (no vertex repeated except thebeginning ).

Arash Rafiey An introduction to graph theory

For simplicity instead of edge {u, v} we write edge uv .

Two vertices u and v are called adjacent if uv is an edge of G .

We say v is a neighbor of u if uv is an edge of G .Let x , y be two vertices of graph G .

An x − y walk is an alternating sequence of vertices and edges,starting at x and ending at y .

If x = y then the walk is called closed.

A trail is a walk in which all the edges are distinct.

A path is a simple walk (no vertex repeated).

A cycle is a simple closed walk (no vertex repeated except thebeginning ).

Arash Rafiey An introduction to graph theory

For simplicity instead of edge {u, v} we write edge uv .

Two vertices u and v are called adjacent if uv is an edge of G .

We say v is a neighbor of u if uv is an edge of G .Let x , y be two vertices of graph G .

An x − y walk is an alternating sequence of vertices and edges,starting at x and ending at y .

If x = y then the walk is called closed.

A trail is a walk in which all the edges are distinct.

A path is a simple walk (no vertex repeated).

A cycle is a simple closed walk (no vertex repeated except thebeginning ).

Arash Rafiey An introduction to graph theory

For simplicity instead of edge {u, v} we write edge uv .

Two vertices u and v are called adjacent if uv is an edge of G .

We say v is a neighbor of u if uv is an edge of G .Let x , y be two vertices of graph G .

An x − y walk is an alternating sequence of vertices and edges,starting at x and ending at y .

If x = y then the walk is called closed.

A trail is a walk in which all the edges are distinct.

A path is a simple walk (no vertex repeated).

A cycle is a simple closed walk (no vertex repeated except thebeginning ).

Arash Rafiey An introduction to graph theory

For simplicity instead of edge {u, v} we write edge uv .

Two vertices u and v are called adjacent if uv is an edge of G .

We say v is a neighbor of u if uv is an edge of G .Let x , y be two vertices of graph G .

An x − y walk is an alternating sequence of vertices and edges,starting at x and ending at y .

If x = y then the walk is called closed.

A trail is a walk in which all the edges are distinct.

A path is a simple walk (no vertex repeated).

A cycle is a simple closed walk (no vertex repeated except thebeginning ).

Arash Rafiey An introduction to graph theory

For simplicity instead of edge {u, v} we write edge uv .

Two vertices u and v are called adjacent if uv is an edge of G .

We say v is a neighbor of u if uv is an edge of G .Let x , y be two vertices of graph G .

An x − y walk is an alternating sequence of vertices and edges,starting at x and ending at y .

If x = y then the walk is called closed.

A trail is a walk in which all the edges are distinct.

A path is a simple walk (no vertex repeated).

A cycle is a simple closed walk (no vertex repeated except thebeginning ).

Arash Rafiey An introduction to graph theory

For simplicity instead of edge {u, v} we write edge uv .

Two vertices u and v are called adjacent if uv is an edge of G .

We say v is a neighbor of u if uv is an edge of G .Let x , y be two vertices of graph G .

An x − y walk is an alternating sequence of vertices and edges,starting at x and ending at y .

If x = y then the walk is called closed.

A trail is a walk in which all the edges are distinct.

A path is a simple walk (no vertex repeated).

A cycle is a simple closed walk (no vertex repeated except thebeginning ).

Arash Rafiey An introduction to graph theory

Theorem

Let G = (V ,E ) be undirected graph with a, b ∈ V , a 6= b. If thereexists a trail from a to b, then there exists a path from a to b.

Proof.

Consider the shortens trail a, x1, x2, . . . , xn, b in G(ax1, x1x2, x2x3, . . . , xn−1xn, xnb are edges). If this trail is not apath then there exist k,m where xk = xm (x0 = a, xm+1 = b,k < m ). But then we can contract and get a shorter traila, x1, . . . , xk , xm+1, . . . , xn, b from a to b.

Arash Rafiey An introduction to graph theory

Theorem

Let G = (V ,E ) be undirected graph with a, b ∈ V , a 6= b. If thereexists a trail from a to b, then there exists a path from a to b.

Proof.

Consider the shortens trail a, x1, x2, . . . , xn, b in G(ax1, x1x2, x2x3, . . . , xn−1xn, xnb are edges). If this trail is not apath then there exist k,m where xk = xm (x0 = a, xm+1 = b,k < m ). But then we can contract and get a shorter traila, x1, . . . , xk , xm+1, . . . , xn, b from a to b.

Arash Rafiey An introduction to graph theory

Definition

A graph G is called connected if there is a path between any twodistinct vertices of G .

G H(connected) (not connected)

a

b c

d e

a

b c

d e

Definition

If G is not connected then it can be partitioned into pieces whereeach piece is a connected graph and is called a connectedcomponent .The number of connected components of G is denoted by κ(G ).

Arash Rafiey An introduction to graph theory

Example :

Let G = (V ,E ) be an undirected graph whose vertices are binaryn-sequences and the two vertices x , y are adjacent if they differ inexactly two positions.Find κ(G ).

Arash Rafiey An introduction to graph theory

Definition

A graph G is simple if there are no parallel edges and there is noself-loop.

Definition

If v is a vertex of graph G , then the degree of v , denoted deg(v)(dG (v), or dv ) is the number of edges incident to v . Is the numberof neighbors of v . The self-loop is counted twice.

If G is a simple graph and each vertex has degree k then G iscalled a k-regular graph.

Arash Rafiey An introduction to graph theory

Definition

A graph G is simple if there are no parallel edges and there is noself-loop.

Definition

If v is a vertex of graph G , then the degree of v , denoted deg(v)(dG (v), or dv ) is the number of edges incident to v . Is the numberof neighbors of v . The self-loop is counted twice.

If G is a simple graph and each vertex has degree k then G iscalled a k-regular graph.

Arash Rafiey An introduction to graph theory

Theorem (Handshaking)

For any graph G = (V ,E ) we have∑v∈V

deg(v) = 2|E (G )|.

Proof.

If an edge e has two end points u and v then it will contribute oneto each of deg(u), deg(v). If e is a self loop incident to vertex uthen it will contribute two to deg(u). In any case each edgecontributes two in the sum and identity follows.

Corollary

In any graph G the number of vertices of odd degree must be even.

Arash Rafiey An introduction to graph theory

Theorem (Handshaking)

For any graph G = (V ,E ) we have∑v∈V

deg(v) = 2|E (G )|.

Proof.

If an edge e has two end points u and v then it will contribute oneto each of deg(u), deg(v). If e is a self loop incident to vertex uthen it will contribute two to deg(u). In any case each edgecontributes two in the sum and identity follows.

Corollary

In any graph G the number of vertices of odd degree must be even.

Arash Rafiey An introduction to graph theory

Theorem (Handshaking)

For any graph G = (V ,E ) we have∑v∈V

deg(v) = 2|E (G )|.

Proof.

If an edge e has two end points u and v then it will contribute oneto each of deg(u), deg(v). If e is a self loop incident to vertex uthen it will contribute two to deg(u). In any case each edgecontributes two in the sum and identity follows.

Corollary

In any graph G the number of vertices of odd degree must be even.

Arash Rafiey An introduction to graph theory

Some families of Graphs

1) A graph G is called complete if every vertex is adjacent toevery other vertex.

2) For every n ≥ 2, the n-path-graph, denoted by Pn is just a pathon n vertices.

V (Pn) = {v1, v2, . . . , vn} and E (Pn) = {v1v2, v2v3, . . . , vn−1vn}.

3) For every n ≥ 2, the n-cycle-graph, denoted by Cn is just a cycleon n vertices.

V (Cn) = {v1, v2, . . . , vn}, E (Cn) = {v1v2, v2v3, . . . , vn−1vn, vnv1}.

4) For every n ≥ 2, the n-hypercube, denoted by Qn has vertex set

V (Qn) = {length n bit string} and two vertices are adjacent iftheir bit strings differ in exactly one position.

Arash Rafiey An introduction to graph theory

Some families of Graphs

1) A graph G is called complete if every vertex is adjacent toevery other vertex.

2) For every n ≥ 2, the n-path-graph, denoted by Pn is just a pathon n vertices.

V (Pn) = {v1, v2, . . . , vn} and E (Pn) = {v1v2, v2v3, . . . , vn−1vn}.

3) For every n ≥ 2, the n-cycle-graph, denoted by Cn is just a cycleon n vertices.

V (Cn) = {v1, v2, . . . , vn}, E (Cn) = {v1v2, v2v3, . . . , vn−1vn, vnv1}.

4) For every n ≥ 2, the n-hypercube, denoted by Qn has vertex set

V (Qn) = {length n bit string} and two vertices are adjacent iftheir bit strings differ in exactly one position.

Arash Rafiey An introduction to graph theory

Some families of Graphs

1) A graph G is called complete if every vertex is adjacent toevery other vertex.

2) For every n ≥ 2, the n-path-graph, denoted by Pn is just a pathon n vertices.

V (Pn) = {v1, v2, . . . , vn} and E (Pn) = {v1v2, v2v3, . . . , vn−1vn}.

3) For every n ≥ 2, the n-cycle-graph, denoted by Cn is just a cycleon n vertices.

V (Cn) = {v1, v2, . . . , vn}, E (Cn) = {v1v2, v2v3, . . . , vn−1vn, vnv1}.

4) For every n ≥ 2, the n-hypercube, denoted by Qn has vertex set

V (Qn) = {length n bit string} and two vertices are adjacent iftheir bit strings differ in exactly one position.

Arash Rafiey An introduction to graph theory

Some families of Graphs

1) A graph G is called complete if every vertex is adjacent toevery other vertex.

2) For every n ≥ 2, the n-path-graph, denoted by Pn is just a pathon n vertices.

V (Pn) = {v1, v2, . . . , vn} and E (Pn) = {v1v2, v2v3, . . . , vn−1vn}.

3) For every n ≥ 2, the n-cycle-graph, denoted by Cn is just a cycleon n vertices.

V (Cn) = {v1, v2, . . . , vn}, E (Cn) = {v1v2, v2v3, . . . , vn−1vn, vnv1}.

4) For every n ≥ 2, the n-hypercube, denoted by Qn has vertex set

V (Qn) = {length n bit string} and two vertices are adjacent iftheir bit strings differ in exactly one position.

Arash Rafiey An introduction to graph theory

Bipartite Graphs

Definition

A graph G = (V ,E ) is bipartite if V can be partitioned into U,Wsuch that each edge of G has one end point in U and one endpoint in W .

ExampleFor which n, Cn is a bipartite ?

For which value of n, Kn is bipartite ?

For which value of n, Pn is bipartite ?

For which value of n, Qn is bipartite ?

Arash Rafiey An introduction to graph theory

Bipartite Graphs

Definition

A graph G = (V ,E ) is bipartite if V can be partitioned into U,Wsuch that each edge of G has one end point in U and one endpoint in W .

ExampleFor which n, Cn is a bipartite ?

For which value of n, Kn is bipartite ?

For which value of n, Pn is bipartite ?

For which value of n, Qn is bipartite ?

Arash Rafiey An introduction to graph theory

Bipartite Graphs

Definition

A graph G = (V ,E ) is bipartite if V can be partitioned into U,Wsuch that each edge of G has one end point in U and one endpoint in W .

ExampleFor which n, Cn is a bipartite ?

For which value of n, Kn is bipartite ?

For which value of n, Pn is bipartite ?

For which value of n, Qn is bipartite ?

Arash Rafiey An introduction to graph theory

Bipartite Graphs

Definition

A graph G = (V ,E ) is bipartite if V can be partitioned into U,Wsuch that each edge of G has one end point in U and one endpoint in W .

ExampleFor which n, Cn is a bipartite ?

For which value of n, Kn is bipartite ?

For which value of n, Pn is bipartite ?

For which value of n, Qn is bipartite ?

Arash Rafiey An introduction to graph theory

Bipartite Graphs

Definition

A graph G = (V ,E ) is bipartite if V can be partitioned into U,Wsuch that each edge of G has one end point in U and one endpoint in W .

ExampleFor which n, Cn is a bipartite ?

For which value of n, Kn is bipartite ?

For which value of n, Pn is bipartite ?

For which value of n, Qn is bipartite ?

Arash Rafiey An introduction to graph theory

Definition

For positive integers n,m, the complete bipartite graph Kn,m hasthe following vertex and edge sets :

V (Kn,m) = {u1, u2, . . . , un} ∪ {v1, v2, . . . , vm}E (Kn,m) = {uivj |1 ≤ i ≤ n, 1 ≤ j ≤ m}

K3,3

K2,3

Arash Rafiey An introduction to graph theory

Degree Sequence

Give any graph, we can obtain the degree sequence (d1, d2, . . . , dn)of its vertices v1, v2, . . . , vn.

We are given a sequence (d1, d2, . . . , dn). Can we decide whetherthere exists a graph G whose degree sequence is (d1, d2, . . . , dn) ?

If this is the case then (d1, d2, . . . , dn) is called a graphic sequence.

(2, 2, 2) is graphic but (2, 3, 4, 3, 2, 3) is not graphic.

Arash Rafiey An introduction to graph theory

Degree Sequence

Give any graph, we can obtain the degree sequence (d1, d2, . . . , dn)of its vertices v1, v2, . . . , vn.

We are given a sequence (d1, d2, . . . , dn). Can we decide whetherthere exists a graph G whose degree sequence is (d1, d2, . . . , dn) ?

If this is the case then (d1, d2, . . . , dn) is called a graphic sequence.

(2, 2, 2) is graphic but (2, 3, 4, 3, 2, 3) is not graphic.

Arash Rafiey An introduction to graph theory

Degree Sequence

Give any graph, we can obtain the degree sequence (d1, d2, . . . , dn)of its vertices v1, v2, . . . , vn.

We are given a sequence (d1, d2, . . . , dn). Can we decide whetherthere exists a graph G whose degree sequence is (d1, d2, . . . , dn) ?

If this is the case then (d1, d2, . . . , dn) is called a graphic sequence.

(2, 2, 2) is graphic but (2, 3, 4, 3, 2, 3) is not graphic.

Arash Rafiey An introduction to graph theory

Theorem

Suppose π = (d1, d2, . . . , dn) is a sequence withn > d1 ≥ d2 ≥ · · · ≥ dn.

1 If π is graphic then there is a graph G withV (G ) = {v1, v2, . . . , vn} and deg(vi ) = di and the neighborsof v1 are v2, v3, . . . , vd1+1.

2 π is graphic if and only if(d2 − 1, d3 − 1, . . . , dd1+1 − 1, dd1+2, . . . , dn) is graphic.

Proof.

Proof of (1). Since π is graphic, there is a graph G with verticesv1, v2, . . . , vn and degree sequence π.We may assume that G = (V ,E ) is such a graph that N(v1) ∩ S ismaximum where S = {v2, v3, . . . , vd1+1} (N(v1) is theneighborhood of v1). If v1 is adjacent to all the elements in S thenwe are done. Otherwise there exists some vk such that v1vk 6∈ Eand hence there exits ` > d1 + 1 where v1v` ∈ E .

Arash Rafiey An introduction to graph theory

Proof.

Since k < `, vk has as many neighbors as v` and hence vk has aneighbor vj that is not neighbor of v`. Now create new graph G ′

by removing edge v1v` and adding edge v1vk and removing edgevkvj and adding edge vjv`. G ′ has the same degree sequence as Gbut N(v1) ∩ S increases in G ′, a contradiction.

Proof of (2). If π is graphic then by (1) there is G with verticesv1, v2, . . . , vn and degree sequence π where v1 is adjacent tov2, v3, . . . , vd1+1. If we remove v from G then we have a sequence(d2−1, d3−1, . . . , dd1+1−1, dd1+2, . . . , dn). Conversely, if we startwith graphic sequence (d2 − 1, d3 − 1, . . . , dd1+1 − 1, dd1+2, . . . , dn)associated with graph G ′ then we add a new vertex v and connectit to the vertices of G ′ with degrees d2 − 1, d3 − 1, . . . , dd1+1 − 1.This way we obtain G with degree sequence π.

Arash Rafiey An introduction to graph theory

Proof.

Since k < `, vk has as many neighbors as v` and hence vk has aneighbor vj that is not neighbor of v`. Now create new graph G ′

by removing edge v1v` and adding edge v1vk and removing edgevkvj and adding edge vjv`. G ′ has the same degree sequence as Gbut N(v1) ∩ S increases in G ′, a contradiction.

Proof of (2). If π is graphic then by (1) there is G with verticesv1, v2, . . . , vn and degree sequence π where v1 is adjacent tov2, v3, . . . , vd1+1. If we remove v from G then we have a sequence(d2−1, d3−1, . . . , dd1+1−1, dd1+2, . . . , dn). Conversely, if we startwith graphic sequence (d2 − 1, d3 − 1, . . . , dd1+1 − 1, dd1+2, . . . , dn)associated with graph G ′ then we add a new vertex v and connectit to the vertices of G ′ with degrees d2 − 1, d3 − 1, . . . , dd1+1 − 1.This way we obtain G with degree sequence π.

Arash Rafiey An introduction to graph theory

Algorithm to detect graphic sequence

Graphic (n > d1 ≥ d2 ≥ d3 ≥ · · · ≥ dn)1. while d1 > 0

2. Set (d ′1, d′2, . . . , d

′n−1) be a non-decreasing permutation of

(d2 − 1, d3 − 1, . . . , dd1+1 − 1, dd1+2, . . . , dn)

3. Set n = n − 1 and (d1, d2, . . . , dn) = (d ′1, d′2, . . . , d

′n)

4. if di < 0 then output NO exit

5. else if d1 = 0 then output YES exit

Arash Rafiey An introduction to graph theory

ExampleInitial Sequence : (4,4,3,3,2,2)

(1) : (3,2,2,1,2)

Sort : (3,2,2,2,1)

(2) : (1,1,1,1)

(3) : (0,1,1)

Sort (1,1,0)

(4) : (0,0) True

Is the sequence (5, 5, 3, 5, 3, 3, 3, 3) is graphic ?

Arash Rafiey An introduction to graph theory

ExampleInitial Sequence : (4,4,3,3,2,2)

(1) : (3,2,2,1,2)

Sort : (3,2,2,2,1)

(2) : (1,1,1,1)

(3) : (0,1,1)

Sort (1,1,0)

(4) : (0,0) True

Is the sequence (5, 5, 3, 5, 3, 3, 3, 3) is graphic ?

Arash Rafiey An introduction to graph theory

ExampleInitial Sequence : (4,4,3,3,2,2)

(1) : (3,2,2,1,2)

Sort : (3,2,2,2,1)

(2) : (1,1,1,1)

(3) : (0,1,1)

Sort (1,1,0)

(4) : (0,0) True

Is the sequence (5, 5, 3, 5, 3, 3, 3, 3) is graphic ?

Arash Rafiey An introduction to graph theory

ExampleInitial Sequence : (4,4,3,3,2,2)

(1) : (3,2,2,1,2)

Sort : (3,2,2,2,1)

(2) : (1,1,1,1)

(3) : (0,1,1)

Sort (1,1,0)

(4) : (0,0) True

Is the sequence (5, 5, 3, 5, 3, 3, 3, 3) is graphic ?

Arash Rafiey An introduction to graph theory

ExampleInitial Sequence : (4,4,3,3,2,2)

(1) : (3,2,2,1,2)

Sort : (3,2,2,2,1)

(2) : (1,1,1,1)

(3) : (0,1,1)

Sort (1,1,0)

(4) : (0,0) True

Is the sequence (5, 5, 3, 5, 3, 3, 3, 3) is graphic ?

Arash Rafiey An introduction to graph theory

ExampleInitial Sequence : (4,4,3,3,2,2)

(1) : (3,2,2,1,2)

Sort : (3,2,2,2,1)

(2) : (1,1,1,1)

(3) : (0,1,1)

Sort (1,1,0)

(4) : (0,0) True

Is the sequence (5, 5, 3, 5, 3, 3, 3, 3) is graphic ?

Arash Rafiey An introduction to graph theory

ExampleInitial Sequence : (4,4,3,3,2,2)

(1) : (3,2,2,1,2)

Sort : (3,2,2,2,1)

(2) : (1,1,1,1)

(3) : (0,1,1)

Sort (1,1,0)

(4) : (0,0) True

Is the sequence (5, 5, 3, 5, 3, 3, 3, 3) is graphic ?

Arash Rafiey An introduction to graph theory

ExampleInitial Sequence : (4,4,3,3,2,2)

(1) : (3,2,2,1,2)

Sort : (3,2,2,2,1)

(2) : (1,1,1,1)

(3) : (0,1,1)

Sort (1,1,0)

(4) : (0,0) True

Is the sequence (5, 5, 3, 5, 3, 3, 3, 3) is graphic ?

Arash Rafiey An introduction to graph theory

Subgraphs

Definition

Let G = (V ,E ) be a graph. Graph H ′ = (V ′,E ′) is a subgraph ofG if V ′ ⊆ V and E ′ ⊆ E .

C5 is a subgraph of K6, and K1,K2, . . . ,K5 are all subgraph of K6.

Arash Rafiey An introduction to graph theory

Subgraphs

Definition

Let G = (V ,E ) be a graph. Graph H ′ = (V ′,E ′) is a subgraph ofG if V ′ ⊆ V and E ′ ⊆ E .

C5 is a subgraph of K6, and K1,K2, . . . ,K5 are all subgraph of K6.

Arash Rafiey An introduction to graph theory

Graph Isomorphism

Definition

Let G = (V ,E ), G ′ = (V ′,E ′) two graphs. Suppose f : V → V ′ isa one-to-one function.

1 f preserve adjacency if for every uv ∈ E , f (u)f (v) ∈ E ′.

2 f preserve non-adjacency if for every non adjacent verticesu, v then f (u), f (v) are non-adjacent.

3 f is a graph isomorphism from G to G ′ if it is bijective andpreserve both adjacency and non-adjacency. In this case wewrite G ∼= G ′.

a b c d

G G’

f(a)=c and f(b)=d f is isomorphism

Arash Rafiey An introduction to graph theory

Graph Isomorphism

Definition

Let G = (V ,E ), G ′ = (V ′,E ′) two graphs. Suppose f : V → V ′ isa one-to-one function.

1 f preserve adjacency if for every uv ∈ E , f (u)f (v) ∈ E ′.

2 f preserve non-adjacency if for every non adjacent verticesu, v then f (u), f (v) are non-adjacent.

3 f is a graph isomorphism from G to G ′ if it is bijective andpreserve both adjacency and non-adjacency. In this case wewrite G ∼= G ′.

a b c d

G G’

f(a)=c and f(b)=d f is isomorphism

Arash Rafiey An introduction to graph theory

Graph Isomorphism

Definition

Let G = (V ,E ), G ′ = (V ′,E ′) two graphs. Suppose f : V → V ′ isa one-to-one function.

1 f preserve adjacency if for every uv ∈ E , f (u)f (v) ∈ E ′.

2 f preserve non-adjacency if for every non adjacent verticesu, v then f (u), f (v) are non-adjacent.

3 f is a graph isomorphism from G to G ′ if it is bijective andpreserve both adjacency and non-adjacency. In this case wewrite G ∼= G ′.

a b c d

G G’

f(a)=c and f(b)=d f is isomorphism

Arash Rafiey An introduction to graph theory

Graph Isomorphism

Definition

Let G = (V ,E ), G ′ = (V ′,E ′) two graphs. Suppose f : V → V ′ isa one-to-one function.

1 f preserve adjacency if for every uv ∈ E , f (u)f (v) ∈ E ′.

2 f preserve non-adjacency if for every non adjacent verticesu, v then f (u), f (v) are non-adjacent.

3 f is a graph isomorphism from G to G ′ if it is bijective andpreserve both adjacency and non-adjacency. In this case wewrite G ∼= G ′.

a b c d

G G’

f(a)=c and f(b)=d f is isomorphism

Arash Rafiey An introduction to graph theory

a b

d

e f

gh

x w

y z

u v

st

H

c

G

a b

cd

e f

h g

u

y

s

w

v

x

z

t

Arash Rafiey An introduction to graph theory

a b

d

e f

gh

x w

y z

u v

st

H

c

G

a b

cd

e f

h g

u

y

s

w

v

x

z

t

Arash Rafiey An introduction to graph theory