Graph COLORING-FINAL

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 38

Graph Theory

Planar Graphs
 A graph (or multigraph) G is called planar if G can be drawn
in the plane with its edges intersecting only at vertices of G,
such a drawing of G is called an embedding of G in the plane.

Application Example: VLSI design (overlapping edges requires


extra layers), Circuit design (cannot overlap wires on board)

Representation examples: K1,K2,K3,K4 are planar, Kn for


n>4 are non-planar

K4
Planar Graphs

 Representation examples: Q3
Planar Graphs

 Representation examples: K3,3 is Nonplanar

v1 v2 v3 v1 v5 v1 v5

R21
R2 R1 R1
R22
v3

v4 v5 v6 v4 v2 v4 v2
Planar Graphs
Theorem : Euler's planar graph theorem
For a connected planar graph or multigraph:
v–e+r=2

number number
number of regions
of vertices of edges
Planar Graphs
Example of Euler’s theorem

A planar graph divides the plane


R1 into several regions (faces), one
K4 R2 R4
of them is the infinite region.

R3 v=4,e=6,r=4, v-e+r=2
Regions of Plane-

 The planar representation of the graph splits


the plane into connected areas called
as Regions of the plane.
 Each region has some degree associated with

it given as-
 Degree of Interior region = Number of edges

enclosing that region


 Degree of Exterior region = Number of edges

exposed to that region


Degree (R1) =
Degree (R2) =
Degree (R3) =
Degree (R4) =
 Planar Graph Chromatic Number-

 Chromatic Number of any planar graph is


always less than or equal to 4.
 Thus, any planar graph always requires

maximum 4 colors for coloring its vertices.


 Property-01:
In any planar graph, Sum of degrees of all
the vertices = 2 x Total number of edges in
the graph
 Property-02:
 In any planar graph, Sum of degrees of all the

regions = 2 x Total number of edges in the


graph
 Property-03:
 If G is a connected planar simple graph with

‘e’ edges, ‘v’ vertices and ‘r’ number of


regions in the planar representation of G,
then-
r=e–v+2
 This is known as Euler’s Formula.
 It remains same in all the planar

representations of the graph.


 Problem-01:

Let G be a connected planar simple graph


with 25 vertices and 60 edges. Find the
number of regions in G.
 Given-
 Number of vertices (v) = 25
 Number of edges (e) = 60

 By Euler’s formula, we know r = e – v + 2.

 Substituting the values, we get-
 Number of regions (r)
 = 60 – 25 + 2
 = 37

 Thus, Total number of regions in G = 37.
Graph Coloring Problem
 Graph coloring is an assignment of "colors", almost always
taken to be consecutive integers starting from 1 without loss
of generality, to certain objects in a graph. Such objects can
be vertices, edges, faces, or a mixture of the above.

 Application examples: scheduling, register allocation in a


microprocessor, frequency assignment in mobile radios, and
pattern matching
Vertex Coloring Problem

 Assignment of colors to the vertices of the graph such that proper


coloring takes place (no two adjacent vertices are assigned the
same color)
 Chromatic number: least number of colors needed to color the
graph
 A graph that can be assigned a (proper) k-coloring is k-colorable,
and it is k-chromatic if its chromatic number is exactly k.
Vertex Coloring Problem
 The chromatic number for Cn = 3 (n is odd) or 2 (n is even), Kn = n,
Km,n = 2

 Because (n-2(n/2)+2)

 Cn: cycle with n vertices; Kn: fully connected graph with n vertices;
Km,n: complete bipartite graph

C4 C5
K4 K2, 3
 Every Bipartite graph is 2-colorable?
 Every 2 colorable graph is bipartite?
 ……So we can say
 A graph is bipartite iff it is 2-colorable.

Some Facts about coloring :


1) Chromatic No.(G) <= lVl
2) If some subgraph requires k-colorable then
Chromatic No.(G) >=k
3) Chromatic No.(G)=maximum{x(c)l c is
connected component}
Question: Minimum no. of colors
required to color the following graph?
 1)2
 2) 3
 3)4
 4)5
Question: How many ways below
graph is colored if almost 4 color
can be used?

A B

C D
 Case:1 <A,D> -same color
 Case 2- <A,D>- different color
 Answer: 84
A B

C D
 Question: A graph G(V,E) has 6 vertices x(G)
=3 then maximum no. of edges it can
have___12_______
Problem?
 Sherry is a manager at MathDyn Inc. and is attempting to get
a training schedule in place for some new employees. There
are four meetings to be scheduled, and she wants to use as
few time slots as possible for the meetings. However, if an
employee has to be at two different meetings, then those
meetings must be scheduled at different times. To get a
visual representation of this, Sherry represents the meetings
with dots, and if two meetings have an employee that needs
to be at both of them, they are connected by an edge.
PERMUTATIONS AND COMBINATIONS
 permutations and combinations is concerned
with determining the number of different
ways of arranging and selecting objects out
of a given number of objects, without actually
listing them
Fundamental principle of counting
 Multiplication principle (Fundamental
Principle of Counting)
- Suppose an event E can occur in m different ways and
associated with each way of occurring of E, another event F can
occur in n different ways, then the total number of occurrence of the
two events in the given order is m × n
 Addition principle
- If an event E can occur in m ways and another event F can
occur in n ways, and suppose that both can not occur together, then
E or F can occur in m + n ways.
Fundamental principle of counting
 Permutations: A permutation is an arrangement of
objects in a definite order.
 Permutation of n different objects without
repetition : The number of permutations of n objects
taken all at a time, denoted by the symbol nPn , is given
by nPn = n(n – 1) (n – 2) ... 3.2.1, read as factorial n, or
n factorial.
 The number of permutations of n objects taken r at a
time, where 0 < r ≤ n, denoted by nPr , is given by
n
Pr = n!
(n-r)! We assume that
0!=1
 Example: How many ways can first and
second place be awarded to 10 people?
 When repetition of objects is allowed : The number of
permutations of n things taken all at a time, when repetition of objects
is allowed is nn .
- The number of permutations of n objects, taken r at a time, when
repetition of objects is allowed, is n r .

 In the lock with 3 numbers, there are 10 numbers to choose from


(0,1,2,3,4,5,6,7,8,9) and we choose 3 of them:
 10 × 10 × ... (3 times) = 103 = 1,000 permutations

 Permutations when the objects are not distinct: The number of


permutations of n objects of which p1 are of one kind, p2 are of second
kind, ..., pk are of k th kind and the rest if any, are of different kinds is
n!
p1!p2!...pk!
Combinations
 On many occasions we are not interested in
arranging but only in selecting r objects from
given n objects.
 A combination is a selection of some or all of a
number of different objects where the order of
selection is immaterial. The number of
selections of r objects from the given n objects
is denoted by nCr , and is given by (without
repetition)
 n
Cr = n!

r!(n-r)!
Example
 If there are 30 people on your tennis team.
How many ways can you choose 2 co-
captain?

 Answer: C2 = 30!
30

(30-2)!2!
Combinations with Repetition

 When repetitions are allowed, we have seen


that for n distinct objects an arrangement of
size r of these objects can be obtained in n r
ways, for an integer r ≥ 0.
(n + r − 1)!
r!(n − 1)!
Example:
 In how many ways can we choose 3 drinks, if
we can choose water, juice, milk, or beer?

Answer: C(4+3-1, 3) = C(6,3) = 6!/(3!3!) = 20.


Exercise:
 1) The number of different permutations of
the word BANANA is
Answer?
 2) How many words can be made from the

word “APPLE” using all the alphabets with


repetition and without repetition respectively?
Answer ?
 1)Answer: 60

 2) Answer: 1024,60
 In how many different ways can you arrange
three books on a shelf from a group of 7?
 In how many ways we can arrange 5 books on

a shelf.

You might also like