0% found this document useful (0 votes)
44 views

3chapt2 & 3-1

This document discusses recurrence relations and their solutions. It defines recursive definitions and recurrence relations. It covers linear homogeneous and nonhomogeneous recurrence relations with constant coefficients. Methods for solving these relations including characteristic equations and undetermined coefficients are presented. Several examples of solving first and second order recurrence relations are provided.

Uploaded by

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

3chapt2 & 3-1

This document discusses recurrence relations and their solutions. It defines recursive definitions and recurrence relations. It covers linear homogeneous and nonhomogeneous recurrence relations with constant coefficients. Methods for solving these relations including characteristic equations and undetermined coefficients are presented. Several examples of solving first and second order recurrence relations are provided.

Uploaded by

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

CHAPTER 2

RECURRENCE RELATIONS

2.1. Definition and Examples

Recursion involves recursive definition of an algorithm, a set or a sequence in terms of itself.


When a recursive definition is used as a tool for solving combinatorial problems, an equation
called recurrence relation is applied to represent present and future values on the basis of earlier
or prior terms.
Recurrence relations are also called difference equations or recurrence equations.
METHODS OF DESCRIBING SEQUENCES
There are several methods of representing a sequence and the most commonly techniques are
the following.
a. Enumerating the first few terms of the sequence. Note that we list terms of the sequence till
a rule for telling the present and future values is observed.
b. Supplying a rule that defines a sequence f as an explicit function a(n), preferably written
as an = f(n), n  0. It should be noted that an= f(n) depends upon n and only n.
c. A technique called recursive definition stated in terms of recurrence relations and initial
conditions may be used to describe the terms of a sequence.

The recursive definition for the Fibonacci sequence is composed of two parts, namely, the
equation: fn = fn-1 + fn-2, n  0 and the values f0 = 0 and f1=1.

RECURSIVE DEFINITION AND RECURRENCE RELATIONS


Recursive Definition
A technique of defining an algorithm, a set or a function in terms of itself by:
(i) Giving a rule for finding present and future values from earlier or prior values.

Instructor: Eng. Fantahun A. 1


(ii) Specifying one or more starting values to activate the rule mentioned in (i)
An algorithm, a set or a function stated in terms of these two conditions is called a
recursively defined algorithm, set or function, respectively.

Note that a recursive definition is well defined if and only if it satisfies conditions (i) and (ii)
above. If any one of these two properties is lacking, the recursive definition may not describe the
required phenomenon in a unique manner.

2.2. LINEAR RCCURRENCE RELATION WITH CONSTANT COEFICIENT

A recurrence relation of the form:


cofn + c1fn-1+ c2fn-2 + … + ck f n-k= f(n) … [1].

ORDER OF RECURRENCE RELATION

Instructor: Eng. Fantahun A. 2


HOMOGENEOUS RELATION

NONHOMOGENEOUS RELATION

Examples
Classify the following recurrence relations

2.3. Solutions of linear recurrence relations

2.3.1. Solutions of Linear Homogeneous Relations


Solving First Order and Second Linear Homogeneous Relations
A first order linear homogeneous relation with constant coefficients had a general solution:
an = crn, where c and r are non-zero constants.
A typical second-order linear homogeneous recurrence relation with constant coefficients
(LHRRWCC of order-two) has the form:
c0an + c1an-1+ c2an-2 = 0, n ≥2 with accompanying boundary conditions expressed usually as:
a0 = k0 and a1 = k1 where k0, k1, c0, c1, c2 are constants with c0, c2 ≠ 0.
Based on this work (regarding the first order case), we shall seek a solution for the second-order
homogeneous recurrence relation with constant coefficients, that assumes the same form: an = crn.
Note that we are using inductive procedure to suggest a solution.

Instructor: Eng. Fantahun A. 3


Now, consider the second-order LHRRWCC:
A0an +A1an-1+ A2 an-2 = 0, n ≥ 2 …. (*)
Assume that this relation has a solution of the form:
an= crn with c ≠0 and r ≠ 0.
Then, observe that the two subsequent terms are expressed as:
an-1 = crn-1 and an-2 = crn-2
Substituting these formulas into the equation (*), we get:

A0 crn + A1crn-1+ A2crn-2 = 0

crn-2[A0r2+ A1r + A2] = 0.


Dividing throughout this last equation by crn-2 ≠ 0, we get a second-degree (or quadratic)
equation in r, which will be given by:
A0r2 + A1r + A2 = 0.
Consequently, the discrete function {an} with an = crn is a solution of the 2nd – order recurrence
relation: A0an + A1an-1 + A2an-2 = 0
if and only if the number r is a solution of the 2nd-degree equation:
A0 r2+ A1r + A2 = 0.
CHARCTERISTIC EQUATION AND ROOTS
Definition:
The characteristic equation of a homogeneous 2nd - order linear recurrence relation with constant
coefficients:
A0an + A1an-1 + A2an-2 = 0. is the 2nd -degree equation in r, which may be written as:
A0 r2+ A1r + A2 = 0.
The solutions r2 and r1 of the characteristic equation are called the characteristic roots of the
recurrence relation.
Note: (1) the characteristic equation and characteristic roots are also called auxiliary equation
and auxiliary roots, respectively.
(2) The first order linear homogeneous relation with constant coefficients: A0an + A1an-1 = 0. is
the first degree equation: A0 r + A1 = 0.

Instructor: Eng. Fantahun A. 4


Algorithm for Solving Homogenous Recurrence Relations
The essential steps for solving a linear homogeneous recurrence relation with constant
coefficients of any order are the following.
Suppose that the given kth order LHRRWCC is:

Instructor: Eng. Fantahun A. 5


Case (i): If there are k distinct characteristic roots, say r1, r2, r3….rk to the equation obtained in
step 1, then the general solution is of the form:
fn = A1r1n + A2r2n + A3r3n + … Ak rkn.
Case (ii): If there is a root r of multiplicity m, 2  m  k, for the auxiliary equation
obtained in step 1, then the part of the general solution that involves the root r has
the form:

Step4: Use the boundary conditions to determine the constants


Step5: Replace the specific values of the arbitrary constants obtained in step 4 and write
the unique solution.
Examples
1. Solve the recurrence relation un+1 = 4un, n > 0 with the initial condition u0 = 5.

2. Solve the recurrence relation:


an= 2an-1 + an-2 – 2an-3 for n ≥ 3 with a0 = 0 and a1=a2=1.

Instructor: Eng. Fantahun A. 6


c1 + c2 + c3 = 0
c1 – c2 + 2c = 1
c1 + c2 + 4c3 = 1

3. Solve recurrence relation


yn= 6yn-1- 9yn-2, n>1, with its initial conditions y0= 5 and y1= 3.

Instructor: Eng. Fantahun A. 7


Example
A bank pays 6% annual interest on savings, compounding the interest monthly. If Ato Gallo
deposits $ 1000 on the first day of May, how much will this deposit worth a year later?
Solution:
6%
Since the annual interest rate is 6%, the monthly rate is = 0.5%. , which means that the
12
0.5
monthly interest is = 0.005
100

For 0 ≤ n≤ 12, let pn denote the amount of Gallo’s deposit at the end of n months. Then, clearly
we have the relation: 0.005 pn-1= The interest earned on the amount pn-1 during the month, Thus;
Pn = pn-1+ 0.005 pn-1 for a 1 ≤ n ≤ 12 and p0 = $ 1000 …. (*)
represents the problem recursively. What remains is, therefore, to solve this recurrence relation
with its initial condition.
Hence, the relation in (*):

Instructor: Eng. Fantahun A. 8


2.3.2. Solutions of Linear Nonhomogeneous Recurrence Relations

The Method of Undetermined Coefficients


This method considers a general or a total solution to the nonhomogeneous relation to be the sum
of two parts; which we shall call the homogeneous solution and the particular solution.
To have a better insight to this method, consider the kth- order nonhomogeneous relation:
c0an + c1an-1+ c2an-2+ … + ckak = f(n)

The method of undetermined coefficients, then, solves the homogeneous and the
nonhomogeneous parts separately. If the homogeneous solution (the solution of homogeneous
part) and the particular solution (the solution of the nonhomogeneous part) are denoted by an(h)
and an(p), respectively, then the general or total solution a is the sum of these two solutions:
an = an(h) + an(p).
Note that
(1) The homogeneous solution an(h) is obtained by the application of the standard methods of
solving linear homogeneous recurrence relations with constant coefficients discussed in the
preceding units of this chapter.

Instructor: Eng. Fantahun A. 9


(2) As said earlier, there is no general technique for determining the particular solution an(p) that
fits a given difference equation. However, when the function f(n) has a certain form, we can
inductively suggest its form (i.e., the form of an(p) ), in line with the nature of f(n).
The following table may be used as a guide-table in choosing a suitable particular solution
GUIDE-TABLE

Example 1
Solve the recurrence relation:
an - 7an-1 + 12 an-2 = 1, n ≥ 2 with boundary conditions: a0 = 0 and a1 = 1.
Solution:
(1) Homogeneous Solution
The associated homogeneous relation is:
an – 7an-1 + 12an-2 = 0 and its characteristic equation is:

Instructor: Eng. Fantahun A. 10


r2 –7r+12 = 0
(r-3) (r-4) =0, r1 = 3 and r2=4 are the characteristic roots

(2) Particular solution


Since f(n) = 1 is a constant function, the particular solution is of the same form (see guide table ).
an(p) = A, a constant to be determined (undetermined coefficient).
Substituting this suggested solution in the given nonhomogeneous relation:
an- 7an-1 + 12a n-2 = 1,
We get:
A - 7A + 12A = 1
 6A = 1
1
 A = 6

(3) Total solution


Since the total solution is the sum of the homogeneous and the particular solutions:
an = an(h) + an(p),
then the required general (total) solution will be:

(4) Unique Solution


We finally solve for the arbitrary constants c1 and c2 in the total solution to obtain the solution
unique to the given recurrence relation. To this end, we use the initial conditions for the cases
n= 0 and n=1. That is:

Instructor: Eng. Fantahun A. 11


Example 2
Solve the relation;
an - 3an-1 = n, n ≥ 1 and a0 = 1
Solution:
(1) Homogenous solution
The associated homogenous recurrence relation is:
an - 3an-1 = 0
Thus, the characteristic equation is: r-3 = 0 which gives r = 3 as a characteristic root. So, the
homogeneous solution of the recurrence relation is:

(2) Particular solution


Since f(n) = n is a polynomial function of degree one in n, the particular solution is also a
polynomial of degree one in n such that:

Substituting this solution in the given recurrence relation, we get:

Instructor: Eng. Fantahun A. 12


(3) Total Solution
Since the total solution a is the sum of the homogeneous and particular solutions, it follows that

To evaluate the arbitrary constant c, we substitute the initial condition a0 = 1 in the total solution.
Thus

Example 3
Find the particular solution of the recurrence relation:
an + 5an-1 + 6an-2 = 3n2
Solution:
f(n) =3n2  an(p) = A2n2 + A1n+ A0 by (2) of GUIDE TABLE
Substituting the expression for an(p) in the RR:

Instructor: Eng. Fantahun A. 13


Example 4
Solve the recurrence relation
an –4an-1 = 5(4)n , n ≥ 1, a0 =2
Solution: The associated homogeneous recurrence relation is an –4an-1 = 0. It’s characteristic
equation is: r - 4 = 0. Therefore, r =4 is the characteristic root. So, the homogeneous solution is

Since f(n) = 5 (4)n is an exponential function and 4n is a homogeneous solution, the particular
solution will be: an(p)= An(4)n substituting this solution in the recurrence relation, we get:

Example 5
Find an explicit sequence of n that solves the recurrence relation:

Instructor: Eng. Fantahun A. 14


an – 6an-1 + 8an-2= n (4)n, n ≥ 2
with its initial conditions a0= 8 and a1 =22.
Solution:
The associated homogenous relation is: an – 6an-1 + 8an-2 = 0 and its characteristic equation is:
r2– 6r +8 = 0. The characteristic roots, upon solving the auxiliary equation, are r1 = 2 and r2= 4.
Thus, the general form of the homogeneous solution is:
an(h) = c1(2)n + c2 (4)n
Since 4 is a characteristic root for the homogeneous case, then by item (4) of Guide-Table

as the general form of the particular solution. Substituting the


assumed particular solution in the given NRR,

Instructor: Eng. Fantahun A. 15


Chapter 3
3. Elements of Graph Theory
3.1. Definition and examples of a graph
A graph is a set of points, called nodes or vertices, which are interconnected by a set of lines
called edges. The study of graphs, or graph theory is an important part of a number of disciplines
in the fields of mathematics, engineering and computer science.
Definition:
A graph (denoted as G = (V, E)) consists of a non-empty set of vertices or nodes V and a set of
edges E.
 V is called a vertex set and E is called an edge list.
 Vertices u and v are said to be adjacent if there is an edge e= {u, v} between them.
In such a case u and v are called the end points of e.
 The edge e is said to be incident on each of its end points u and v.
Graphs are pictured by diagrams in a natural way, specifically, each vertex v in V is represented
by a dot (small circle), and edge e = {v1, v2} is represented by a curve which connects its end
points v1 and v2.
Example 1: consider the graph G given below.

G is a graph with G= (V, E) where


i. V = {A, B, C, D}
ii. E= {e1, e2, e3, e4, e5} with
e1 = {A, B}, e2 = {B, C}, e3= {C, D}, e4= {A, C} and e5= {B, D}
Definition: Two or more edges joining the same pair of vertices are called multiple (parallel)
edges. An edge joining a vertex to itself is called a Loop. Depending on loops (self-loops) and
parallel edges we state the following types of graphs.
Simple graph: A graph with no loops and parallel edges is called simple graph.
Multigraph: A graph which consists of parallel (multiple edges) is called a multigraph.
Pseudo graph: A graph which consists of loops and parallel edges is called pseudo graph.
Example 2: State the nature of following graph G'.

Instructor: Eng. Fantahun A. 16


G' is a graph with set of pairs
(V, E) where
i. V= {A, B, C, D} is a vertex set
ii. E= {e1,e2,e3,e4,e5,e6}is an edge list
- e6 is a loop where as e4 and e5 are multiple edges
- The graph is not a multigraph but it is a pseudo graph
Degree of a vertex:
The degree of a vertex V in a graph G is equal to:
1. The number of edges in G which contain V if it has no loops.
2. The number of edges in G which contain V plus twice the number of loop(s) if it has loop(s).
Note: For a graph with loops, each loop contributes 2 to the degree of the corresponding vertex.
Example1: Determine the degree of each vertex of the graph given below.

Solution:
deg (v1)= 2
deg (v2)= 3
deg (v3)= 2
deg (v4)= 3
Definition: -
i) A vertex is said to be even if its degree is even number and odd if its degree is odd number.
ii) A vertex of degree zero is called isolated vertex.
iii) A vertex of degree one is called pendant vertex.
 A graph with only one vertex is trivial.
 Edges are adjacent if they share a common end vertex.
Minimum and maximum degree
 Let G be a graph. The minimum and maximum degrees of G are denoted by δ (G) and
Δ(G) respectively and given by:
 δ (G)= min {deg(v);v ɛ V (G)}& Δ (G) = max {deg v; v ɛ V (G)}
Example: Find the minimum and maximum degree of G given below.

Solution: δ(G) =2, i.e., deg(v1), Δ(G) = 4, i.e., deg(v2)

Instructor: Eng. Fantahun A. 17


3.2. Matrix representation of a graph
Graphs can be represented by any one of the following types of matrices.
a) Adjacency matrix - a matrix that describes the adjacency relationships between
vertices of a graph.
b) Incidence Matrix - A matrix that describes the incidence relationships between
vertices and edges of a graph.
Adjacency Matrix
Definition: Suppose G is a graph with m vertices and suppose the vertices have been ordered,
say v1,v2,- - - ,vm. Then the adjacency matrix A= [aii] of the graph G is the m×n matrix defined
by:

Examples
Draw the adjacency matrix for:

Solution: Let the vertex set be ordered and labeled as V = {v1, v2, v3, v4}
Then the adjacency matrix A is:

Write out the adjacency matrix A(G) of the following graph.

Solution: Let the vertex set be ordered and labeled as V = {v1, v2, v3, v4}
Then the adjacency matrix A is:

Instructor: Eng. Fantahun A. 18


Incidence Matrix
Definition: Suppose G is a graph with vertices v1,v2,…,vm. The incidence matrix I= [bij] of the
graph G is given by:

Note: 1. The incident matrix of a graph is not necessarily a square matrix.


2. An incident matrix I has a row for each vertex and a column for each edge.
Example: Find the incidence matrix I for the graph shown below.

Note:
1. Sum of all the entries in every row is the degree of the vertex leading the row if there is no
loop and the sum plus n if there are n loops at this vertex.

3.3. Isomorphic graphs


Definition: Graphs G(V,E) and G*(V*,E*) are said to be isomorphic if there exists a one to one
correspondence f :V V * such that {u,v} is an edge of G iff {f (u), f (v)}is an edge of G*.

Instructor: Eng. Fantahun A. 19


Example: Show that G and H are isomorphic graphs

3.4. Path and connectivity of a graph


Paths:
Let G be a graph and e be an edge in G with end points u and v. Then the ordered triple (u,e,v) is
a step (walk) in G.
Definition: A path in a graph G consists of an alternating finite sequence of vertices and edges of
the form:
v0, e1, v1, e2, v2….en-1,vn-1,en,vn
Where each edge ei contains the vertices vi-1 and vi (which appears on the sides of ei in the
sequence).

Instructor: Eng. Fantahun A. 20



Example: Consider the graph G.


𝛼 is an open path from p4 to p6 but it is not a cycle and not a trial as well
𝛽 is not a path since there is no edge {p2,p6}in G.
is a trial (no edge is used twice) but not a cycle.
The sequence 𝛿 is a simple path as well as a trial between p4 and p6 but not the shortest path
between p4 and p6.
The shortest path between p64 and p6 is (p4,p5,p6) which has length 2.
The sequence p is a circuit of length 5.
Connectivity on nondirected graph
A graph G is connected if there is a path between any two of its vertices. That is, a graph is
connected if it is possible to go from any vertex to any other by following the edges of the graph.
A graph that is not connected is said to be disconnected.

Instructor: Eng. Fantahun A. 21


Example 1: Are the graphs G and H Given below connected?

Solution:
G is a connected graph because every pair of vertices in G forms a path.
H is a disconnected graph because no path can be constructed from vi, i = 1,2,3,4 to
vj, j = 5, 6, 7.
Theorem: - A connected graph with n-vertices must have at least n-1 edges. (i.e, E ≥n -1).
Example 2: a) A connected graph with 2 vertices must have at least (2-1) = 1 edge.

b) A connected graph with 3 vertices must have at least: (3-1) = 2 edges.

3.5. Complete, regular and bipartite graphs


Complete graph: A graph G is said to be complete if every vertex in G is connected to every
other vertex in G. Thus a complete graph G must be connected.
Notation: The complete graph with n-vertices is denoted by kn.
Example 1: Some of the complete graphs are listed below.

Remark: In a complete graph;


𝑛(𝑛 −1)
 There are 2 edges.
 All vertices are mutually adjacent.
Regular graph: A graph G is said to be regular of degree k or K-regular if every vertex has
degree k. In other words, a graph is regular if every vertex has the same degree.
Example 2: Here are some examples of regular graphs.

Instructor: Eng. Fantahun A. 22


Bipartite graphs: A graph G is said to be bipartite if its vertices V can be partitioned into two
subsets M and N such that each edge of G connect a vertex of M to a vertex of N. (i.e. none of
the edges in G connect vertices with in the same set M or N).
By a complete bipartite graph we mean that each vertex of M is connected to each vertex of N;
this graph is denoted by Km,n where m is the number of vertices in M and n is the number of
vertices in N(m≤ n) .
Example 1: Complete bipartite graphs K1,5, K2,4, K3,3 are shown below in a, b and c respectively.

Example 2: Is the graph given below bipartite? Or complete bipartite?

Solution: Yes it is bipartite since we can partition the vertex


set into
M={v1,v3,v5} and N= {v2,v4,v6} such that none of the edges in G connect vertices with in the
same set M or N.
But it is not complete bipartite graph. (why?)
Theorem: In a complete bipartite graph Km,n; the number of edges is given by E =mn.
Null Graph:
A null graph of order n is a graph with n vertices and no edges and is denoted by Nn.
3.6. Eulerian and Hamiltonian graphs
Eulerian Graphs
Eulerian Path:
Definition: An Eulerian path in a graph G(V,E) is a path which uses each edge in E exactly once.
An Euler path that begins and ends at the same vertex is called Eulerian trial.
A graph that contains an Eulerian (closed) trial is called an Eulerian graph.
Theorem: A connected graph is Eulerian iff all of its vertices have even degree.
Examples
1. Consider the graph G and answer the following questions
a. Show that G has an Euler closed trial.
b. Find an Euler trial starting and ending at U.

Instructor: Eng. Fantahun A. 23


Solution a) G is a connected graph and degree of each vertex is even (i.e.
deg(u)=deg(x)=2;deg (z)=deg(y)=deg(u) = deg(u)= deg(v)=4).
b) One Euler trial beginning and ending at U is UZWVZYXWYVU.
Remark: i) A connected graph G with exactly two odd vertices is called Semi-Eulerian graph.
ii) A graph (connected) with more than two odd vertices is neither Eulerian nor semi-
Eulerian.
Hamilton Paths:
- A path that visits every vertex in a graph G exactly once is called a Hamilton path.
- A closed Hamilton path is called a Hamilton cycle.
- G is called a Hamiltonian graph if it admits a Hamiltonian cycle.
Remark: An Eulerian trial traverses every edge exactly once, but may repeat vertices while a
Hamiltonian cycle (circuit) visits each vertex exactly once but may repeat edges.
Properties of Hamiltonian graph
- Only connected graphs can be Hamiltonian
- There is no simple criterion to identify a graph is Hamiltonian or not.
Theorem: If G is a simple graph with vertices 3n and if deg(u)+deg(v) n for all pairs of non-
adjacent vertices u and v, then G is Hamiltonian. (The converse is not always true)
Example 1: show that a graph G given below is Hamilton.

𝑛
Corollary: If G is a simple graph with number of vertices n ≥ 3 and if deg(v)≥ for all vertices v
2
in G, then G is Hamiltonian.
Example 2 : Consider the simple graph G and H given below.

Instructor: Eng. Fantahun A. 24


But deg(u)=2 for all vertices u  {A, B, C, D, E}.
i.e. deg(u)=2 < n/2 = 5/2 = 2.5.
The converse of the corollary does not hold.
H is not a Hamiltonian graph
3.7. Trees and forests (rooted and binary trees)
Definitions:
A graph T is called a tree if T is connected and T has no cycle.
A forest G is a graph with no cycles; hence the connected components of a forest G are
trees.
A graph without a cycle is said to be cycle-free (acyclic) graph.
The tree consisting of a single variable with no edges is called the degenerate tree.
Since a loop is a cycle of length one, then a tree is a loop free graph.
Example 1:- The following graphs are trees or forests.

G1 is a degenerate tree.
Since these graphs G1, G2, and G3 are connected acyclic graphs, i.e., connected graphs with no
cycles, then they are trees.
G4 is a forest not a tree as it is not connected.
Example 2:- Which of the following graphs is a tree. If the graph is not a tree, justify why it is
not.

Instructor: Eng. Fantahun A. 25


Solution:-i) The graph G1 is a tree since it is connected and acyclic.
ii) The graph G2 is not a tree. Even though it is connected, it contains the cycle
V1V2V3V4V1. Hence the acyclic property of a tree is violated.
iii) The graph G3 is not a tree. Though G3 is acyclic, it is not connected. Hence the connectedness
property of a tree is violated.
Note 1) In each of the trees with 6 vertices, there are exactly 5 edges.
2) In each tree T, there are some vertices of degree 1. These vertices (of degree1) are
called leaves.
3) Every tree T with at least one edge has at least two leaves.
4) The edges of a tree T are called branches.
Theorem: Let G be a graph with n>1 vertices. Then the following are equivalent.
i) G is a tree
ii) G is cycle-free and has n-1 edges
iii) G is connected and has n-1 edges.
Spanning Tree
In this section we try to find a sub graph of a graph G such that this sub graph is a tree graph that
contains all the vertices of the graph. This tree - sub graph is called a spanning tree.
Definition: - A spanning tree of a connected graph G is acyclic connected Subgraph of G which
contains all the vertices of G.
Example: - Find the spanning tree of the graph G.

Note: - For any connected graph G, we can find a spanning tree of G by Cutting - down method
We start by choosing any cycle in G and remove one of its edges - (destroying a cycle containing
this edge). We repeat this procedure until no cycle is left in the resulting graph.
Example: - In the graph G above remove the edges:
VY (destroying the cycle VWYV)
ZY (destroying the cycle VWYZV)
YX (destroying the cycle WXYW). Now, there is no cycle left and this procedure gives the first
spanning tree of G.

3.8. Planar graphs


In the representation of K4 shown in fig. 1, the two edges AC and BD appear to cross at a point
where there is no vertex. But in the second depiction, i.e., K4 as represented in fig. 2, this
crossing of edges doesn't happen (except at a common vertex).

Instructor: Eng. Fantahun A. 26


The graph in figure 2, the second depiction of K4 is called a plane representation of K4. Not every
graph has a plane representation. A graph which has a plane representation is called a planner
graph.
Definition (planar Graph)
A graph G which can be drawn in a plane with its edges intersecting only at (common) vertices is
called a planar graph. A graph that has no such plane representation (or depiction) is called a
non-planner graph.
Faces and planar Graphs
Suppose we draw a planar graph on the plane of a paper. If we cut the graph along its edges, then
the plane of the paper splits in to a number of regions. These regions are called the faces of the
graph. In other words, a plane representation of a planar graph divides the plane in to regions
called faces.
3.9. Graph coloring
A traditional application of the theory of planar graphs is in the study of map colouring. The
problem is to take a map with various countries, some bordering each other, and to find how
many colors are required to color the countries in such a way that no two bordering countries
have the same color.
If we let the countries be represented by vertices and the borders by edges, then the coloring
problem becomes a problem in the theory of planar graphs.
Definition: Consider a graph G. a vertex coloring or simply a coloring of G is an assignment of
colors to the vertices of G such that adjacent vertices have different colors.
Chromatic Number
Definitions:
1) For a positive integer K, a graph G is said to be K- colorable or K- colored if there exists a
coloring of G which uses K colors.
2) The chromatic number of graph G, denoted by X(G), is the minimum number of colors needed
to paint (or color) G so that no two adjacent vertices receive the same color.
Examples
1. Find the chromatic numbers of the graphs G and H below
Solution:
a) X (G) = 2; since G is a rectangular grid.
b) X (H) = 3; since H contains a cycle ABCA with 3 vertices A , B, C - which is odd cycle.

Instructor: Eng. Fantahun A. 27


2. What is the chromatic number of a cycle?
Solution:
The chromatic number of a cycle is either 2 or 3. It all depends on the type of the cycle. If the
cycle has an even number of vertices (i.e.; it is an even cycle), then it is 2- colorable. Otherwise,
the cycle is three colorable.

Welch-Powel algorithm
Step 1: Order the vertices according to decreasing sequence of degrees.
Step 2: Assign the first color c1, to the first vertex in the sequence and then in sequential order,
assign c1, to each vertex w/c is not adjacent to a previous vertices.
Step 3: Repeat step2 with a second color c2 and the subsequence of non-colored vertices.
Step 4: Repeat step 3 with color c3, the c4 and so on.
Example: Use Welch – Powel algorithm to find X(G).

Solution
Ordering the vertices in decreasing order of degrees we get:
{A5, A7, A3, A4, A2, A1, A6, A8}.
Now assign the first color c1 for A5 and A1.
Then we obtain the subsequence {A7, A3, A4, A2, A6, A8}to assign the second color c2.
That is assign c2 for A7, A6 and A2
Finally assign the third color c3 for A3, A4 and A8
G is 3 colorable
X (G) = 3

Instructor: Eng. Fantahun A. 28

You might also like