Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
14 views53 pages

GTmodule 5

Uploaded by

Nisha rai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views53 pages

GTmodule 5

Uploaded by

Nisha rai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 53

Module 5

Graph coloring
Introduction
• Suppose that you are given a graph G with n vertices and are asked to
paint its vertices such that no two adjacent vertices have the same
color.
• What is the minimum number of colors that you would require?
This constitutes a coloring problem
CHROMATIC NUMBER
• Painting all the vertices of a graph with colors such that no two
adjacent vertices have the same color is called the proper coloring of
a graph.
• A graph in which every vertex has been assigned a color according to
a proper coloring is called a properly colored graph.
• Graph can be properly colored in many different ways.
• Proper coloring which is of interest to us is one that requires the
minimum number of colors.
• A graph G that requires κ different colors for its proper coloring, and
no less, is called a κ-chromatic graph,
• The number κ is called the chromatic number of G.
4. Agraph consisting of simply one circuit with n ≥ 3 vertices is 2-
chromatic if n is even and 3-chromatic if n is odd.
THEOREM: Every tree with two or
more vertices is 2-chromatic
THEOREM: A graph with at least one edge is 2-
chromatic if and only if it has no circuits of odd
length.
CHROMATIC POLYNOMIAL
• A given graph G of n vertices can be properly colored in many
different ways using a sufficiently large number of colors.
• This property of a graph is expressed elegantly by means of a
polynomial.
• This polynomial is called the chromatic polynomial of G
• It is defined as follows : The value of the chromatic polynomial Pn(λ) of
a graph with n vertices gives the number of ways of properly coloring
the graph, using λ or fewer colors.
• Let ci be the different ways of properly coloring G using exactly i
different colors. Since i colors can be chosen out of λ colors in

• There are different ways of properly coloring G using exactly i

colors out of λ colors.


Since i can be any positive integer from 1 to n (it is not possible to use more than
n colors on n vertices), the chromatic polynomial is a sum of these terms; that is
Example: The graph has a triangle, it will require at
least three different colors for proper
coloring.
Therefore, c1 = c2 = 0 and c5 = 5!.
• To evaluate c3, suppose that we have
three colors x, y, and z.
• These three colors can be assigned
properly to vertices v1, v2, and v3 in 3! = 6
different ways.
• Having done that, we have no more
choices left, because vertex v5 must have
the same color as v3, and v4 must have
the same color as v2. Therefore, c3 = 6
• Similarly, with four colors, v1, v2, and v3 can be properly colored in
4*6 = 24 different ways.
• The fourth color can be assigned to v4 or v5, thus providing two
choices.
• The fifth vertex provides no additional choice.
• Therefore, c4 = 24*2 = 48
THEOREM: A graph of n vertices is a complete
graph if and only if its chromatic polynomial is
Theorem:An n-vertex graph is a
tree if and only if its chromatic
polynomial
THEOREM: Let a and b be two nonadjacent vertices
in a graph G. Let G′ be a graph obtained by adding
an edge between a and b. Let G″ be a simple graph
obtained from G by fusing the vertices a and b
together and replacing sets of parallel edges with
single edges. Then
Matchings
• problem of matching (or assignment)
• A matching in a graph is a subset of edges in which no two edges are
adjacent. A single edge in a graph is obviously a matching.
maximal matching

• A maximal matching is a matching to which no edge in the graph can be added.


• For example, in a complete graph of three vertices (i.e., a triangle) any single edge
is a maximal matching.

the maximal matchings with the largest number of edges are called the largest
maximal matchings. In the above figure (b) a largest maximal matching
complete matching
• In a bipartite graph having a vertex partition V1 and V2, a complete
matching of vertices in set V1 into those in V2, is a matching in
which there is one edge incident with every vertex in V1.
Theorem: A complete matching of V1 into V2 in a
bipartite graph exists if and only if every subset of
r vertices in V1 is collectively adjacent to r or more
vertices in V2 for all values of r.
• Problem of Distinct Representatives:

One member from each committee is to be represented in a super-committee


Theorem(Hall’s Marriage Theorem)
• The matching problem or the problem of distinct representatives is
also called the marriage problem
• If one fails to find a complete matching, he is most likely to be
interested in finding a maximal matching, that is, to pair off as many
vertices of V1 with those in V2 as possible. For this purpose, let us
define a new term called deficiency, δ(G), of a bipartite graph G.
• A set of r vertices in V1 is collectively incident on, say, q vertices of V2.
Then the maximum value of the number r – q taken over all values of
r = 1, 2,. . . and all subsets of V1 is called the deficiency δ(G) of the
bipartite graph G.
A complete matching in a bipartite
graph G exists if and only if δ(G) ≤
0.
Matching and Adjacency Matrix:
• Consider a bipartite graph G with nonadjacent sets of vertices V1 and
V2, having number of vertices n1 and n2, respectively, and let n1 ≤ n2,
n1 + n2 = n, the number of vertices in G.
• The adjacency matrix X(G) of G can be written in the form
Coverings
• In a graph G, a set g of edges is said to cover G if every vertex in G is
incident on at least one edge in g
• A set of edges that covers a graph G is said to be an edge covering, a
covering subgraph, or simply a covering of G. .
observations made:
1. A covering exists for a graph if and only if the graph has no isolated
vertex.
2. A covering of an n-vertex graph will have at least ⌈n/2⌉ edges.
3. Every pendant edge in a graph is included in every covering of the
graph.
4. If we denote the remaining edges of a graph by (G – g), the set of
edges g is a covering if and only if, for every vertex V, the degree of
vertex in (G- g) ≤ (degree of vertex v in G) – 1.
6. minimal covering of an n-vertex graph can contain no more than
n – 1 edges.
7. A graph, in general, has many minimal coverings, and they may be of
different sizes (i.e., consisting of different numbers of edges). The
number of edges in a minimal covering of the smallest size is called the
covering number of the graph
THEOREM: A covering g of a graph is
minimal if and only if g contains no paths of
length three or more
• g contains a path of length three, and it is v1e1v2e2v3e3v4
Minimization of Switching
Functions

Represent each of the seven terms in F by a vertex, and join


every pair of vertices that differ only in one variable.
Dimer Problem:
• In crystal physics, a crystal is represented by a three dimensional
lattice. Each vertex in the lattice represents an atom, and an edge
between vertices represents the bond between the two atoms.
• To obtain an analytic expression for certain surface properties of
crystals consisting of diatomic molecules (also called dimers), one is
required to find the number of ways in which all atoms on a two-
dimensional lattice can be paired off as molecules (each consisting of
two atoms). The problem is equivalent to finding all different
coverings of a given graph such that every vertex in the covering is of
degree one.
Four color theorem:states that no more than
four colors are needed to color the regions of any map
so that no two adjacent regions share the same color.
• the regions of a planar graph are said to be properly colored if no two
contiguous or adjacent regions have the same color.
• The proper coloring of regions is also called map coloring,
Vertex Coloring Versus Region Coloring:
• a graph has a dual if and only if it is planar.
• Therefore, coloring the regions of a planar graph G is equivalent to
coloring the vertices of its dual G*, and vice versa.
Five colour theorem:The vertices of every planar
graph can be properly colored with five colors.

• Let G be a planar graph with n vertices


• We know that every planar graph has atleast one vertex whose
degree<=5,Consider it as v
• Let G’ be a graph after removing V……………………G’ =G-V
• Then if G’ can properly coloured using the 5 colors
• But if v is present
• This happens only if there is a vertex of degree 5
• Suppose that there is a path in G′ between vertices a and c colored alternately with
colors 1 and 3
• Then a similar path between b and d, colored alternately with colors 2 and 4, cannot
exist
• If there is no path between b and d colored alternately with colors 2
and 4, starting from vertex b we can interchange colors 2 and 4 of all
vertices connected to b through vertices of alternating colors 2 and 4.
• This interchange will paint vertex b with color 4 and yet keep G′
properly colored. Since vertex d is still with color 4, we have color 2
left over with which to paint vertex v.
Greedy algorithm
• Color first vertex with first color.

• Do following for remaining V-1 vertices.


• Consider the currently picked vertex and color it with
the lowest numbered color that has not been used on any
previously colored vertices adjacent to it.
• If all previously used colors appear on vertices adjacent to v,
assign a new color to it.
Note

You might also like