You are on page 1of 120

1.

Introduction

What is a graph G?
It is a pair G = (V,
E), where
V = V(G) = set of vertices
E = E(G) = set of edges

v
u

Example:
V = {s, u, v, w, x, y, z}
E = { (x,v), (x,u), (v,w),
(s,v), (s,u), (s,w), (s,y),
(w,y), (u,y), (u,z),(y,z)}
09/12/16

y
w
s
1

Special edges

Parallel edges
Two or more edges
joining a pair of
vertices

in the example, a and


c are joined by two
parallel edges

Loops
An edge that starts
and ends at the
same vertex

In the example,
vertex a has a loop

09/12/16

v
c
y
w
s
2

Simple graph

Simple graph
A graph without
loops or parallel
edges.

v
u
y
w
s

09/12/16

Degree of a vertex

The degree of a vertex


v, denoted by d(v), is
the number of edges
incident on v
Example:

x
v

d(x) = 3, d(v) = 3,
d(u) = 4, d(y) = 4,
d(z) = 2, d(s) = 5, w
d(w) = 3.

u
y
s
z

09/12/16

Sum of the degrees of


vertices of a graph
Theorem : If G =(V,E) is a graph with
|E| edges and n vertices u1, u2,, un,
then
n

d(u) = 2|E|
i=1

In particular, the sum of the


degrees of all the vertices of a graph
is even.
09/12/16

Degree sequence
Degree sequence if we arrange
degrees of vertices of the
graph in non increasing order
then resulting string of length
n of nonnegative integers is
called degree sequence of G
Examples
09/12/16

d(x) = 3, d(v) = 3,
d(u) = 4, d(y) = 4,
d(z) = 2, d(s) = 5,
d(w) = 3.

Degree
sequence of
graph G is
(5,4,4,3,3,3,2)

x
v
u
y
w
s
z

09/12/16

Number of vertices of
odd degree is even

09/12/16

Walk : A walk is a
sequence
of
edges
and
x
vertices in which none
of edges can be repeated
but a vertex can be
repeated like u-v-x-wu-z
vertex u occurs twice in
the above walk
09/12/16

w
z
u
x
v

OPEN WALK: A walk is


said to be open if its end
vertices are distinct.
Other wise it is called
Path : A
open Walk is
closed
called a path if all its
vertices are distinct i.e in a
path every vertex other
than end vertex is of degree
2
09/12/16

10

u-x-v-s-w-y-s is open walk but not the path


x

u
y

y
w

s
z

09/12/16

z
11

Complete graph K

The complete
graph Kn is the
graph with n
vertices and every
pair of vertices is
joined by an edge.
The figure
represents K5
Number of Edges
in Kn is n(n-1)/2

09/12/16

c
z

12

Bipartite graphs

A bipartite graph G is
a graph such that
V(G) = V V
|V | = r, |V | = s
V V =
There does not exist
any edge between
any two vertices in
the subset V & V

w
x

Given a graph how do we test it is Bipartite or


09/12/16

13

Complete bipartite graph


Kr,s
A bipartite graph is the

K 3,4
09/12/16

complete bipartite graph


Kr,s if every vertex in V
is joined to a vertex in
V and conversely,
|V | = r
| V | = s

Number of edges in K

r,s

=rs
14

Def. If G = (V , E ) is a graph, then


G (V , E ) is called a subgraph
of G if V Vand E E ,
where each edge of E is incident
with vertices in V .
a

c
G

G
d

09/12/16

m
15

Connected graphs

A graph is connected if
every pair of vertices can
be connected by a path

09/12/16

16

Component of a graph
We have already defined sub graph
and connected graph .

Definition :A maximal
connected subgraph
G=(V,E)of a graph
G=(V,E) is called
component of G
09/12/16

17

What does maximal mean here?


Maximal connected would mean
that G is connected and if we
add any edge or vertex of
G/G to G then graph obtained
is disconnected.

09/12/16

18

Thm : A graph G is
disconnected iff its
vertex set V can be
partitioned into two
nonempty disjoint sets V
and V such that none of
the vertices in V are
joined through an edge
to a vertex in V.
09/12/16

19

Example
c

g w

09/12/16

A disconnected
graph with
three
m component

20

Not a component
of G as it is not
maximal
connected
a

z
09/12/16

21

Example
c

g w

v
z
Partition of V
09/12/16

A disconnected
m graph with
three
component

V=

{a,c,m,z,w}
V ={u,v,q,g}

22

Thm : If a graph has


exactly two vertices of
odd degree then there is
path joining them in G

09/12/16

23

Circuit or cycle

Circuit : Circuit is
a closed walk all
of whose vertices
except starting
and end vertex
are distinct. In a
circuit every
vertex is of degree
2
09/12/16

u
v

Length of
circuit is
number of
vertices in G

24

A simple graph with


n vertices and r-components
has at most (n-r)(n-r+1)/2
edges.
Let the number of vertices of ith component of graph
r

be q i .

n i.e we need to prove

i 1

q (q
i

1) / 2 (n - r)(n - r 1)/2 ......(a)

i 1

Why ?

09/12/16

25

09/12/16

26

(q i2 ) 2n r (n r ) 2

i 1

(q i2 ) 2n r (n r ) 2 i.e we proved (i)

i 1

1
q i (q i 1) / 2
2
i 1

i 1

2
qi

1
2n r ( n r ) 2 n / 2
2
1 2
(n 2nr r 2 n r )
2
1
(n r ) 2 (n r )
2

09/12/16

i 1

27

Thm : a graph is Bipartite


iff every circuit in it is of
even length
Proof to be given later
a

e
c

Bipartite ?
If so Partition

09/12/16

28

Euler Graph & Unicursal


graph
A connected graph G is said to be

Euler graph if it has a closed walk


which passes through every edge of
G. Such a walk if exist is called
Euler line .
A connected graph G is said to be
unicursal graph if it has a open
walk which passes through every
edge of G. Such a walk if exist is
called unicursal line .
09/12/16

29

Euler & Unicursal graphs


Theorem : G is an Euler
graph if and only if G is
connected and all its
vertices have even
degree. .
Proof : not included

09/12/16

30

Theorem : G is an
unicursal graph if and
only if G is connected
and G has exactly two
vertices of odd degree.

09/12/16

31

v
m

w
z

Q. Tell whether the


graph is Euler or
unicursal ?Justify.

Sol. As G contains exactly two vertices


a & m of odd degree G has an unicursal
line which starts at m & ends at a say
m-v-u-w m-x-a-z-m-a. But clearly G is
not a Euler graph.
09/12/16

32

REGULAR Graph : A graph is said to be


m- regular graph if every vertex has degree
m.

Example : A circuit is a 2-regular


graph .
Complete graph on n vertices is
(n-1) regular.graph.

09/12/16

33

v
m

w
z

Q. Tell whether the


graph is Euler or
unicursal ?Justify.

Sol. As G contains exactly two vertices


a & m of odd degree G has an unicursal
line which starts at m & ends at a
say m-v-u-w m-x-a-z-m-a. But clearly
G is not a Euler graph.
09/12/16

34

Hamiltonian circuits

Traveling salesperson
problem
To visit every vertex of
a graph G by a circuit.
Such a circuit is called
a Hamiltonian circuit.
If a connected graph G
has a Hamiltonian
circuit, G is called a
Hamiltonian graph.

09/12/16

z
m

Does above graph have a


Hamiltonian circuit?

35

Definition : IF G has a path


which passes through every
vertex of G then G is said to
have a Hamiltonian
path
c
Has a Hamiltonian
path but not a
d hamiltonian
a
circuit.
w
m
z

q
09/12/16

36

Theorem : Let G = (V , E ) be a
undirected graph with | V |= n 3.
If deg(u ) n / 2 , u V
then G contains contains a Hamilton
circuit.

09/12/16

37

A sufficient condition for existence of


Hamiltonian circuit
Theorem : Let G = (V , E ) be a
undirected graph with | V |= n 3.
If deg( x) + deg( y ) n for all nonadjacent
x, y V , then G contains contains a Hamilton
circuit.
09/12/16

38

Does G satisfy above


condition?

deg(u)=3
deg(a)=3

G has a
Hamiltonian
circuit.

v
m

w
z
09/12/16

a
39

Few points about Hamiltonian circuits if


they exist
(i) All edges incident on vertices of degree
2 must be in Hamiltonian circuit
(ii)At a vertex only 2 edges can be in the
Hamiltonian circuit
(iii)There should not be any proper circuit
formed through edges forced in to
Hamiltonian circuit while trying to
form Hamiltonian circuit..
09/12/16

40

Q. In the graph Find a Hamiltonian circuit if it exists?


m
c
w
z
a

d
v

09/12/16

41

Edges ca and da must be in Hamiltonian circuit if it


Exists.
m

c
w
z
a

d
v

09/12/16

42

m
c
w
z

Similarly mw and wu
09/12/16

43

m
c
w
z
a

d
v

a-c-m-w-u-z-v-d-a is the Hamiltonian Circuit.


09/12/16

Edge ca, ad
mw, wu
should be in
Hamiltonian
circuit.now
clearly cd can
not be in
Hamiltonian
circuit Hence
cm should be
there hence
mz is not
there
44

Q .Are the following graph Hamiltonian,are they


bipartite?

c
f
i

09/12/16

45

What can we say in


general about such graphs

Bipartite graph with partite


Sets equal
09/12/16

46

Every circuit is of even length Hence G is


Bipartite , but G is not Hamiltonian as a bipartite
graph on odd number of vertices is not hamiltonian

09/12/16

47

Is the graph G Hamiltonian ?

09/12/16

48

Edges incident
on vertices of
degree 2 are put first
c
v

u
q
w

09/12/16

r
s

e
x

49

Now at vertex c ca and cd cannot be put in


Hamiltonian circuit
c
v

u
q
w

09/12/16

r
s

e
x

50

Hence at d fd & dm should be put i.e. G is


not Hamiltonian
c
v

u
q
w

09/12/16

r
s

e
x

51

Q. What is a necessary
condition for a Bipartite
graph to be Hamiltonian
Partite sets should have equal number of
vertices? Why?
As Hamiltonian circuit passes through
every vertex and every edge joins two
vertices in different partite sets ,
hence to complete the circuit we must
have partite sets must have equal
number of vertices

09/12/16

52

Condition of partite sets


having equal number of
vertices is not sufficient .
Why?
Example

09/12/16

53

Theorem : Let G = (V , E ) be a simple graph


with | V |= n 2. If deg( x) + deg( y ) n - 1
for all x, y V , x y, thenG has a Hamilton
path.
c

z
m

09/12/16

Proof not in course


G has a Hamiltonian Path
Through above thm . Does
G have a Hamiltonian
Circuit? It does not have
Justify?
54

Havel Hakimi Thm

09/12/16

55

Q.4 Is it possible for a graph to


have degree sequence
(7,7,7,6,5,4,3,2,2,1) ? Explain
through Havel Hakimi thm. If
exists draw the graph.

Length of degree sequence to start with is 10

09/12/16

56

(7,7,7,6,5,4,3,2,2,1) is graphical iff


(6,6,5,4,3,2,1,2,1) is graphical
(6,6,5,4,3,2,1,2,1) is not in monotonic
order arrange that like that
i.e (6,6,5,4,3,2,2,1,1) [length is now 9]
Again Apply Havel Hakimi thm to
(6,6,5,4,3,2,2,1,1)
(6,6,5,4,3,2,2,1,1) is graphical iff
(5,4,3,2,1,1,1,1) is graphical
[ length is 8]

09/12/16

57

(5,4,3,2,1,1,1,1) is graphical iff


(3,2,1,1,1,0,0) length is seven
degrees have been rearranged
(3,2,1,1,1,0,0) is graphical iff
(1,0,0,1,0,0 (1,1,0,0,0,0) is
graphical
Now clearly simple graph with
above degree sequence exist

09/12/16

58

Does there exist a graph on degree


sequence (5,4,4,2,2,1) through

Havel Hakimi theorem

Simple graph on (5,4,4,2,2,1) exists if it


exists on ( 3,3,1,1,0)
Simple graph on exists ( 3,3,1,1,0)
iff it exists on (2,0,0,0)
simple graph on (2,0,0,0) exists iff
graph exists on (-1,-1,0)
Hence graph does not exist.

09/12/16

59

09/12/16

60

Operations on graphs
Union & intersection
G = (V, E) & G = (V, E) are two
graphs then
GG=(VV, EE)
GG=(VV, EE)

09/12/16

61

Ring Sum of two


graphs
Defn :G = (V, E) & G = (V, E) are two
graphs then ring sums of graphs written
as
GG is defined as the graph whose vertex set is
VV but edge set is symmetric difference of
E& E i.e edge contains the edges which are not
in both GG =(VV , EE )

09/12/16

62

G G= null graph
If G = Kn and G
G then GG =

is a subgraph of

G\G is as well

written as G-G
Defn : G is a subgraph of G then
G-G is called compliment of G in G

09/12/16

63

G(Kn G)= Kn Why ?

Q. Find ring sum of G&G


c

a
c

z
m

09/12/16

G
64

a
c

GG =(VV , EE ) VV= {a,c,d,m,z,q}


EE = {am,cm,cz,mz,md, aq,dq,ad}
Now one can easily draw the graph GG
09/12/16

65

Edge decompositon of
graph G
Defn : A graph is said to have
decomposed into graphs G&G
if
GG=G & GG = null graph
i.e. every edge of G occurs in G or G
But not in both. Some of the vertices may
occur in both
09/12/16

66

a
z
m
d

z
m

z
m

09/12/16

67

Operation of deletion
of a vertex v from G
If v is any vertex of G then
G\{v} the graph obtained after
deleting vertex v is the graph in
which vertex v and any edge
incident on v is deleted

09/12/16

68

m
c

G\{z}

a
z

G
09/12/16

69

Fusion of two vertices


If a & c are two vertices of G
then graph G obtained through
fusing vertices a& c is the graph
in which every edge incident on
a & c is incident on the fused
vertex {a,c}, usually a or c is
chosen as {a,c}
09/12/16

70

G
a

{a,c}

deg({a,c}) = deg(a)+deg(c)
09/12/16

71

Even if G is simple fused


graph need not be
simple.

if ac is an edge in G then there is a


self loop on {a,c}

Number of vertices in fused graph


is
(n-1) , where as number of edges is
same.
09/12/16

72

q
z
v

{v,w}
u

z
u

Every edge incident on w is now incident on {v,w}


09/12/16

73

m
w

q
{c,z}
m
w

09/12/16

q
74

What is the maximum


number of edges in
bipartite graph on nvertices
Based
on simple?result of calculus that if

sum of two (+ve) numbers x,y is a


then maximum value of their product
is a2/4. Hence if r& s are (+ve) integers
such that r+s=n then
rs n2/4 as it is maximum value of
product for any choice of r&s
nonnegative hence it is true even for
integers.
09/12/16

75

Q.16 Prove that if G is a


r- regular bipartite
graph, then r n/2.

09/12/16

76

09/12/16

77

09/12/16

78

09/12/16

79

Q.1 When a graph G said to be Hamiltonian. Are the Graphs G & G Hamiltonian?
Justify your answer clearly.

Home work.
09/12/16

80

Q. If G is disconnected , prove that


complement of G is connected.

09/12/16

81

Q.19. If a graph G has 13 vertices & 76 edges, prove


that G is Hamiltonian but not Eulerian.

09/12/16

82

ISOMORPHISM
In simple graphs
09/12/16

83

09/12/16

84

09/12/16

85

Draw all nonismorphic


graphs on 4 vertices
We draw sequentially
A graph on 4 vertices may have 0-6 edges.

II

I
z
m

09/12/16

86

IV

III
z
m

09/12/16

87

VI
z
m

VIII

VII
z

09/12/16

88

With 3 edges graph and compliment both have 3


edges we need to check isomorphism
Compliment drawn
with dashed lines

IX&
X

09/12/16

89

Are they not self


Complimentary?
XI

09/12/16

90

Definition of Isomorphism would mean that


necessary condition for graphs to be isomorphic
is
Two Isomorphic Graphs have
1. Same no. of vertices
2. Same no. of edges
3. same degree sequence
09/12/16

91

Same no. of vertices .


Same no. of edges
Degree sequences not same hence not isomorphic

09/12/16

92

An effective way of
proving two graphs are
non-isomorphic is
through showing that
graphs have different
degree sequence.
09/12/16

93

DEGREE Sequence
Degree sequence can help
to identify that given two
graphs are non-isomorphic
and cannot be used to
conclude that the graphs are
isomorphic
09/12/16

94

q. Isomorphic graphs
have equal number of
circuits of same length ?
Solution :

u1u 2 ............umu1 is a circuit


of length m in G iff
f(u1 )f(u 2 )............f(um ) f (u1 )
is a circuit in G.
09/12/16

95

Examples of graphs in which the Degree sequences are same but


graphs are non-isomorphic.

a
c

w
x

m
Why not Isomorphic ?

09/12/16

z
96

G
G is not
isomorphic to G
G

09/12/16

97

No. of Graphs (Non-Isomorphic) on


1 vertex is 1
2 vertices is 2
3 vertices is 4
4 vertices is 11
5 vertices is 34

09/12/16

98

Solution : As every vertex has degree at least three


Every component must have at least 4 vertices
So in situation of 8 vertices there is just one graph
why?

09/12/16

99

For 9 vertices how many components?


There are two components
And components should have 4 and 5 vertices

How many such graphs are there


How many graphs on 5 vertices with
degree of every vertex >2?
How many non-isomorphic graphs in all?
09/12/16

3+1

100

Are the following


graph
isomorphic?

Degree sequence
(4,4,4,3,3,2)
09/12/16

101

Q. Draw all nonisomorphic on 5


vertices with deg(v)>2 for all v
in V

Solution : sum of degrees should


be at least 15(actually 16) must
have 8 edges nine edges or 10
edges i.e we have three graphs
(4,4,4,4,4) (4,3,3,3,3),(4,4,4,3,3)
Justify that?
Are there any other possible degree sequences
For example (4,4,4,4,3) simple graph does not
Exist, (4,4,3,3,3) does not exist
09/12/16

102

(4,4,4,3,3),

z
m

09/12/16

103

Complete graph

(4,4,4,4,4)

(4,3,3,3,3)
d

z
m

09/12/16

104

Are they not circuits?

09/12/16

105

SELF COMPLIMENTARY
GRAPHS
A graph is said to be self
complimentary G
If G is isomorphic to
A simple example

09/12/16

106

G and
09/12/16

G are circuits of length 5


107

(6, 5, 5, 4, 4, 3,2,1) exists


iff (4,4,3,3,2,1,1) exists
iff (3,2,2,1,1,1) exists
iff ( 1,1,1,1,0) exists
iff (1,1,0,0) exists hence simple
graph exists
09/12/16

108

What is compliments
degree sequence?
(6, 5, 5, 4, 4, 3,2,1)
Number of vertices 8
Hence degree sequence
(7-6,7-5,7-5,7-4,7-4,7-3,7-2,7-1)
Rearrange (6,5,4,3,3,2,2,1) hence
not
Self complimentary.
09/12/16

109

Regular of degree o null graph


Regular of degree one

09/12/16

110

Regular of degree 2
Circuit of length 6
and graph consists of two triangles

09/12/16

111

Regular of degree 3 are


compliments of regular
graph of degree 2
K3,3 &

09/12/16

112

Regular of degree 4
complement of 1 regular graph

Regular of degree 5
K5
09/12/16

113

Q> Draw all non-isomorphic


graphs with degree sequence
(5,4,4,3,2,2)

Such graphs must have 6


vertices & 10 edges hence
their compliments must have
6 vertices and 5 edges
compliments degree sequence
is (3,3,2,1,1,0)

09/12/16

114

Compliment of above graph is answer of question


Draw the compliment.
09/12/16

115

Why that is just the graph

09/12/16

116

Q. 15 Draw four non-isomorphic


connected graphs with 6
vertices and 7 edges with
exactly one vertex of degree
four. degree sequences in which
Possible
number of vertices of odd degree is
even & does not have isolated vertex
& has exactly one vertex of degree four
(5,4,2,1,1,1),
(4,3,3,2,1,1), (4,2,2,2,2,2),(4,3,2,2,2,1),
09/12/16

117

(4,3,3,2,1,1)

(4,3,3,2,1,1
)

09/12/16

Why are they non


isomorphic though
They have same
degree sequence
118

(4,3,2,2,2,1)

(4,2,2,2,2,2)

09/12/16

119

Q.20 Draw all non-isomorphic


graphs with 6 vertices having
degree sequence (4,4,3,3,2,2)
Hint find complements degree sequence and
all such graphs
Compliments degree sequence is ( 3,3,2,2,1,1)

Try to draw all graphs with compliments degree sequence then we have answer for
Above question?
09/12/16

120

You might also like