Lecture Notes (CS503)
Lecture Notes (CS503)
Graph Coloring
The intuitive idea behind the colouring of a graph is simply paint its vertices such
that no two adjacent vertices have same color. What is the minimum number of colors
necessary? This constitutes a coloring problem.
After the vertices have been painted, they can be categorized into the groups or
its; for example, one set having all the blue colors, another of red and so forth. This is a
partitioning problem. The colouring and partitioning can either be carried out on vertices
or on edges of the graph and for planer graphs; these can be performed in the regions.
Colouring and petitioning have several important applications such as; coding theory,
partitioning of logic in digital computer, scheduling and assignments etc.
A graph can be coloured by assigning a different colour to each of its vertices. However,
for most graphs, a colouring can be found that uses fewer colours than the number of
vertices in the graph. A colour with colours such that no two adjacent vertices have the
same colour is called properly coloured graph.
R G B B Y
R R R
R
Y B Y B R B
Fig.-1
Definition 2: A graph G is said to be k-colourable if each vertex can be assigned one of k
colours so that adjacent vertices get different colours.
Here, we are interested with the proper colouring that requires the minimum number of
colours. The minimum colouring of a graph is generally difficult to compute, but the
following theorem provides an upper bound.
Proof: We use the induction principle on the number of vertex n of G. Let P(n) be the
proposition that an n-vertex graph with maximum degree at most k is (k+1)-colorable. A
1-vertex graph G has maximum degree 0 and is 1-colorable, so P(1) is true.
Let us assume that P(n) is true and G be an (n+1) vertex graph with maximum degree at
most k. Remove a vertex v from G. The maximum degree of G-v is at most k and G-v is
(k+1)-colorable by our assumption P(n). Now add back the vertex v to G. We can assign
v a different color from all adjacent vertices, since v has degree at most k and k+1 color
are available. Therefore, G is (k+1)-colorable. The theorem follows by induction.
It is easily verified that the graph in Fig.(i),(ii) and (iii) are all 3-chromatic.
In coloring graphs we are concentrates with colouring of connected graphs only (as in
disconnected graphs, colouring of the vertices in one component does not effect the
other). Self-loops are also not considered for the colouring. Parallel edges between two
vertices can be replaced by a simple edge without effecting adjacency of vertices. Thus,
for colouring problems we need to consider only simple connected graphs.
v2 v3 v4
v1
v5 v6
v7 v8
Fig.-2
The first color is assigned to vertex v1 and v2.
The second color is assigned to vertex v4, v5 and v8.
The third color is assigned to vertex v7, v3 and v6.
All the vertices have been assigned a color and so G is 3-colorable. Observe that G is not
2-colorable since vertices v2, v3, v4 that are connected to each other, must be assigned
different colors. Accordingly (G) = 3.
Theorem 4: For any graph G, (G) 1 + (G) where (G) is the maximum degree of a
vertex in G.
Proof: Let H be the smallest induced subgraph of G such that (H) = n. Then (H - v) =
n – 1 for any vertex v H. It follows that d(v) n – 1 so that n - 1 dmax(H) dmax(G) =
(G).
Proof: Let G be a simple connected planer graph with n-vertices. If n 5, the result is
obvious. Let n 5. We complete the proof by induction hypothesis. Since G is a
connected planer graph. It must have a vertex of degree less than or equal to 5. Let v be a
vertex of G such that d(v) 5. Let G/ = G - v. Then by induction hypothesis G/ is 5-
colorable. When v has degrees 1, 2, 3 and 4 there is no difficulty, since we can give to v
one more color.
We are left with the case when d(v) = 5 and all the five colors are used in coloring
vertices v1, v2, v3, v4, v5 which are adjacent to v in G. Let vi be colored by ci (say) for i
=1, 2, 3, 4 and 5.
v5 v1 c3
v2 c1
v4 v
c3
v3
c1
c1
c3
Fig.-3
Suppose there is a path between the vertices v1 and v3 colored alternately with color c1
and c3 as shown in fig. 1. Then, a similar path between v2 and v4 cannot exist, since this
path, if it exist will intersect the path between v1 and v3, contradicting that G is planer.
We can interchange the colors of all vertices connected to v2, giving color c4 to v2, while
v2 has still color c4. Thus we can point v with color c2 and hence the graph G= G/ + v is 5-
colorable. Similarly, if we have assumed that no path exists between v1 and v3, we could
paint v3 with color c1 and v with color c3 and we set a 5-coloring of G.
1 1
Note: Every graph with e edges satisfies (G) 2e .
2 4
a b
e
g c
f d
Fig.-4
e1 e2
e3
v1
e4 e5
v3 e6 v4
Fig.- 5
v3 v4
v1 v2
We may color the vertex v1 with any one of colors the second vertex v2 can be color
properly in -1 ways. Father we may color the third vertex v3 using any of - 1 color
which has not been used in v2 similarly in v4.
Hence the fundamental principle of counting the total number of different coloring from
colors of the graph L4 is PG1 (λ) = ( - 1)3 .
Theorem 1: A n vertex graph is a tree if and only if it's chromatic polynomial
PG ( ) = ( - 1)n-1 .[to proved the theorem by indication (example - 1)]
Theorem 4: If v1 and v2 be the two nonadjacent vertices of a graph G then its polynomial
PG ( ) = PG1 (λ) + PG 2 (λ) . Where G1 and G2 are obtain from G by adding an edge
between v1, v2 and by fusion of v1, v2 respectively.
Proof: PG ( ) = the number of different colorings from colors = (the number of
colorings of G in which u and v receive different colors) + (the number of coloring in
which u and v receive the same color)
= (number of coloring of G1) + (number of coloring of G2)
= PG1 (λ) + PG 2 (λ) .
Example: the following figure illustrates how the chromatic polynomial of a graph G is
as a sum of chromatic polynomial of complete graphs.
= +
v
+ + +
Exercise:
1. Prove that chromatic polynomial of any tree with n vertices is k(k – 1)n -1.
2. Find the chromatic polynomials of the following graphs and hence determine their
chromatic numbers.
Within a class of students (containing some girls and some boys), each girl likes some
boys and does not like others. Under what conditions can each girl are paired up with a
boy that she likes? Many applications of graphs involve such pairings. We can model the
situation with a bipartite graph, since it has a vertex partition into two sets. If a girl likes a
boy, put an edge between them. Here our goal is to find a matching (or assignment) for
the girls. That is, a subset of edges such that exactly one edge is incident to each girl and
at most one edge is incident to each boy.
A complete matching (if it exists) is the largest matching. Whereas the converse is not
necessary true.
An alternating path P, with respect to M is termed as M-augmenting if its end vertices are
not incident with any edge of M (that is end vertices are M-unsaturated).
Proof: Assume, for contradiction, that there exists an M-augmenting path P. Then by
deleting the edges of E(P) M and adding the edges of E(P) M we get a new matching
M/ =(M - E(P)) (E(P) - M) . It is easy to verify that M/ is indeed a valid matching in G.
Further M = M + 1. This contradicts the fact that M is a maximum matching.
Conversely, suppose M is a matching without any M-augmenting path in G. let M be any
maximum matching in G. By the necessary proof, M has no M -augmenting path in G.
Hence the component of M M (=M M - M M ) can only be single vertex. This
implies that M = M and hence M is also a maximum matching.
Given a finite set of girl each of whom knows several boys, under what condition
can we marry of the girls in such a way that each girl marries a boy he knows. The
problem was solved by P. Hall in 1935, and knows as Hall’s marriage theorem.
Hall’s marriage theorem states necessary and sufficient conditions for the existence of a
matching in a bipartite graph. Hall’s, theorem is a very useful mathematical tool in graph
theory.
Here we proof the Hall’s theorem using girl marry-boy terminology. For example the
relation between the girls and boys as shown below:
For us to have any chance at all of matching up the girls, the following ‘marriage
condition’ must hold:
‘Every sub set of girls marry at least as large a set of boys’.
For example, we cannot find a matching if some 4 girls like only 3 boys. Hall’s theorem
says that this necessary condition is actually sufficient, if the marriage condition holds,
then a matching exist.
Hall’s theorem: Let G= (V1 V2, E) be a bipartite graph such that V1 V2 . Ten G has
a complete matching saturating every vertex of V1 if an only if S N(S) for every set
S V1, where N(S) is the neighborhood subset of V2 that are adjacent to some vertex in
S, i.e.
N(S) = v V2 : there exist u S, {u, v} E .
Graph Covering:
A graph has many minimal coverings and they may be different sizes. The number of
vertices in a minimal covering of the smallest size is called vertex covering number and
denoted by V(G).
Example 1: In fig-(a) we mark a vertex covering of size 2 and in Fig-(b) show a vertex
covering of size 4. Hence V(G) = 2.
Example 2: In the graph of Fig-(a) we mark a vertex covering of size 2 and show a
matching of size 2 in heavy lines. The optimal values are same since the graph is
bipartite. But in Fig-(b) the optimal values differ by 1.
Properties:
1. For any graph G the set of its vertices is trivially a vertex covering of G.
2. Every vertex covering contains a minimal covering.
3. For any graph G(V, E), V(G) + maximum independent set = number of
vertices in V.
4. For a complete bipartite graph Gm,n has V(Gm,n) = min{m, n}.
Independent sets and Covering: Independent number of a graph is the maximum size of
an independent set of vertices. No vertex covers two edges of a matching. Similarly, no
edge contains two vertices of an independent set. This yields another dual covering
problem, called edge covering. For example, a spanning tree or Hamiltonian circuits in a
graph are edge coverings.
Example 3: In fig.- a graph and two of its minimal covering are shown in heavy lines.
Properties:
1. For any graph G the set of its vertices is trivially a vertex covering of G.
2. An edge covering exist if and only if the graph has no isolated vertex.
3. An edge covering of an n-vertex graph will have at least n/2 edges. ( x
denotes the smallest integer not less than x).
4. Every pendant edge in a graph is included in every edge covering of the
graph.
5. Every edge covering contains a minimal covering.
6. The set of edges E(G) – L(G) is an edge covering if and only if for every
vertex v, the degree of vertex in G(V, E-L) (degree of vertex v in G(V, E)) –
1.
7. A minimal covering of an n-vertex graph can contain no more than n-1 edges.
8. For a complete bipartite graph Gm,n has E(Gm,n) = max{m, n}.
Objective Questions:
1. How many vertices does a regular graph of degree 4 with 10 edges have? Ans 5
Permutations - The different arrangements that can be made with a given number of
things taking some or all of them at a time are called permutations. The symbol n P r or
P(n,r) is used to denote the number of permutations of n things taken r at a time.
permutation is the arrangement of objects with ordering of same and different objects in
different ways. Permutation is always greater than combination as in combination we
neglect the ordering of the same objects in different ways, so as peter said abve ordering
is very important in permutation.
When things are arranged in places along a line with first and last place, they form a
linear permutation. So far we have dealt only with linear permutations. When things are
arranged in places along a closed curve or a circle, in which any place may be regarded as
the first or last place, they form a circular permutation.
The permutation in a row or along a line has a beginning and an end, but there is nothing
like beginning or end or first and last in a circular permutation. In circular permutations,
we consider one of the objects as fixed and the remaining objects are arranged as in linear
permutation.
Thus, the number of permutations of 4 objects in a row = 4!, where as the number of
circular permutations of 4 objects is (4-1)! = 3!.
The following arrangements of 4 objects O1, O2, O3, O4 in a circle will be considered as
one or same arrangement.
Observe carefully that when arranged in a row, O1 O2 O3 O4, O2O3O4 O1, O3O4O1O2,
O4O1O2O3 are different permutations. When arranged in a circle, these 4 permutations
are considered as one permutation.
Theorem:
The number of circular permutations of n different objects is (n-1)!.
Proof:
Each circular permutation corresponds to n linear permutations depending on where we
start. Since there are exactly n! linear permutations, there are exactly permutations.
Hence, the number of circular permutations is the same as (n-1)!.
Suggested answer:
The arrangement is as shown in the figure, the boy X will have B2, B3 as neighbours. The
girl Y will have G2, G3 as neighbours. The two boys B2, B3 can be arranged in two ways.
The two girls G2, G3 can be arranged in two ways.
Hence, the total number of arrangements = 2 x 2 = 4.
Example 2:
In how many different arrangements can 6 gentlemen and 6 ladies sit around a table if
Suggested answer:
i) Here, the total number = 6 + 6 = 12.
Then, corresponding to each seating arrangement for the gentlemen, the 6 ladies can be
seated in 6! ways.
The required number of arrangements = (5!)(6!)
= (120)(720) = 86400