Graph Theory QB
Graph Theory QB
Graph Theory QB
UNIT I
INTRODUCTION Graphs – Introduction – Isomorphism – Sub graphs – Walks, Paths, Circuits –
Connectedness – Components – Euler graphs – Hamiltonian paths and circuits – Trees – Properties of trees –
Distance and centers in tree – Rooted and binary trees.
UNIT-I / PART-A
1 Define a Graph.
A graph is a ordered pair G=(V,E) where, V={v1,v2,v3...vn} is the vertex set whose elements are the vertices
or nodes of the graph, denoted by V(G) or just V. E= ={e1,e2,e3...en} is the edge set whose elements are the
edges or connections between vertices of the graph, denoted by E(G) or E.
7 What is a subgraph?
If G=(V,E) is a graph(directed or undirected), then G `1=(V1,E1) is called a subgraph of G if Φ≠V1 and
8. State the necessary conditions to show that two graphs are isomorphic.
The two graphs must have-
same number of vertices
a) same number of edges
b) an equal number of vertices with a given degree
9 Is it possible to have a 4-regular graph with 10 edges?
Page 1 of 22 PREPARED BY P.JAYALAKSHMI, AP/ CSE
Graph Theory and Applications Department of CSE
We have
4|V| = 20
v=5
Thus, we have five vertices of degree 4
10 What is Konigsberg bridge problem?
The city of Königsberg in Prussia was set on both sides of the Pregel River, and included two large islands
which were connected to each other and the mainland by seven bridges. The problem was to devise a walk
through the city that would cross each bridge once and only once.
12 What are the necessary and sufficient conditions to determine whether a given graph has an Euler
circuit and Euler trail?
a) a given graph G will contain an Euler circuit if and only if all the vertices of G are of even
degree.
b) a given graph G will contain an Euler trail if and only if it contains atmost two vertices of
odd degree.
Looking at the graph, if we start at vertex V, there is no way to visit each vertex exactly once and return
back to V because there is only a single edge to V.
16 Prove that the sum of the degrees of the vertices of any finite graph is even.
Each edge ends at two vertices. If we begin with just the vertices and no edges, every vertex has degree
zero, so the sum of those degrees is zero, an even number. Now add edges one at a time, each of which
connects one vertex to another, or connects a vertex to itself. Either the degree of two vertices is increased
by one (for a total of two) or one vertex’s degree is increased by two. In either case, the sum of the degrees
is increased by two, so the sum remains even.
17 Prove that a complete graph with n vertices contains n(n−1)/2 edges.
This is easy to prove by induction. If n = 1, zero edges are required, and 1(1− 0)/2 = 0. Assume that a
complete graph with k vertices has k(k −1)/2. When we add the (k + 1)st vertex, we need to connect it to
the k original vertices, requiring k additional edges. We will then have -
k(k−1)/2 + k = (k + 1)((k + 1)−1)/2 vertices. Hence the proof.
c
e
d
E(a)=E(e)=3; E(b)=E(c)=E(d)=2
19 What is path length of a tree? Calculate the path length for the given tree.
The path length of a tree is the sum of the path lengths from the root to all the pendant vertices. The path
length of the given tree is 2+2+2+3+3=1.
UNIT-I / PART-B
1 Define a tree. Illustrate with example. State and prove any two properties of trees.
SOME PROPERTIES OF TREES
THEOREM 1 :
There is one and only one path between every pair of vertices in a tree, T.
Proof: Since T is a connected graph, there must exist at least one path between every pair of vertices in T.
Now suppose that between two vertices a and b of T there may have two distinct paths. The union of these
two paths will contain a circuit and T cannot be a tree.
THEOREM 2: If in a graph G there is one and only one path between every pair of vertices, G is a tree.
Proof: Existence of a path between every pair of vertices assures that G is connected.
A circuit in a graph (with two or more vertices) implies that there is at least one pair of vertices a, b such
that there are two distinct paths between a and b.
Since G has one and only one path between every pair of vertices, G can have no circuit. Therefore, G is a
tree.
1.8.2 Distance and centers in tree
The below mentioned tree has four vertices.
Intuitively, it seems that vertex b is located more "centrally" than any of the other three vertices.
Tree
Lets see if in a tree there exists a "center" (or centers). Inherent in the concept of a center is the idea of
"distance," so we must define distance before we can talk of a center.
In a connected graph G, the distance d(vi vj) between two of its vertices viand vj is the length of the shortest
Theorem:
The distance between vertices of a connected graph is a metric.
Let us define another term called eccentricity (also referred to as associated number or separation) of a
vertex in a graph.
The eccentricity E(v) of a vertex v in a graph G is the distance from v to the vertex farthest from v in G;
that is,
A vertex with minimum eccentricity in graph G is called a center of G. The eccentricities of the four
vertices in Fig.are E(a) = 2, E(b) = 1, E(c) = 2, and E(d) 2. Hence vertex b is the center of that tree.
On the other hand, consider the tree in Fig. The eccentricity of each of its six vertices is shown next to the
vertex.
This tree has two vertices having the same minimum eccentricity. Hence this tree has two centers.
Some refer to such centers as bicenters; we shall call them just centers,We easily verify that a graph, in
e
d f g
e k
h i j e e
f
b)Let G=(V,E) be the undirected graph as shown in the figure. How many paths are there in
G from a to h? How many of these have length 5?
7 e an Euler circuit nor a Hamilton cycle.
a) Give an examplee of a connected graph that has (i) Neither
(ii) An Euler circuit but an Hamilton cycle.e(iii) A Hamilton cycle but no Euler circuit. (iv) Both a
e
Hamilton cycle and an Euler circuit.
b) (i)Determine all non isomorphic tournaments with three vertices.
(ii) Find all of the non isomorphic tournaments with four vertices. List the in degree and the out
Page 6 of 22 PREPARED BY P.JAYALAKSHMI, AP/ CSE
Graph Theory and Applications Department of CSE
degree for each vertex, in each of these tournaments.
8 Define the following with one example each :
a) Infinite graph.
b) Component of a graph.
c) Euler graph.
d) Spanning subgraph.
9 Explain Hamiltonian path with theorem proof.
DEFINITION. A path P of a graph G is a Hamilton path, if P visits every vertex of G once. Similarly, a
cycle C is a Hamilton cycle, if it visits each vertex once.
A graph is hamiltonian, if it has a Hamilton cycle.
Note that if C : u1 → u2 → · · · → un is a Hamilton cycle, so is u i → . . . un→u1 → . . . ui−1 for each i ∈ [1,
n], and thus we can choose where to start the cycle.
Now vi∈ S for each i by the choice of u i, and vj vt for all j t, because C is a cycle and u ivi∈ G for all
i. Thus |S| ≥ k as required.
UNIT-II / PART-A
1 Define Minimum Spanning Tree:
In a weighted graph, a minimum spanning tree is a spanning tree that has minimum weight that all other
spanning trees of the same graph. In real world situations, this weight can be measured as distance,
congestion, traffic load or any arbitrary value denoted to the edges.
6 For the following graph given below draw the adjacency matrix
The above graph G1 can be split up into two components by removing one of the edges bc or bd.
Therefore, edge bc or bd is a bridge.
10 Define articulation point
A vertex in an undirected connected graph is an articulation point (or cut vertex) iff removing it (and edges
through it) disconnects the graph. Articulation points represent vulnerabilities in a connected network –
single points whose failure would split the network into 2 or more disconnected components. They are
useful for designing reliable networks.
Spanning Tree
Every connected graph has a spanning tree which can be obtained by removing edges until the resulting
graph becomes acyclic. In practice, however, removing edges is not efficient because finding cycles is time
consuming.
Next, we give two algorithms to find the spanning tree T of a loop-free connected undirected graph G —
(V, E). We assume that the vertices of G are given in a certain order v 1 , v2, .vm. The resulting spanning tree
will be T — (Vi,Ei).
The graph T − bi has two components T1 and T2. The corresponding vertex sets are V1 and V2. Then, (v1,v2)
is a cut of G. It is also a cut set of G if we treat it as an edge set because G − hV1, V2i has two components
. Thus, every branch bi of T has a corresponding cut set I i .
The cut sets I1, . . . , In−1 are also known as fundamental cut sets and they form a fundamental set of cut
sets. Every fundamental cut set includes exactly one branch of T and every branch of T belongs to exactly
one fundamental cut set. Therefore, every spanning tree defines a unique fundamental set of cut sets for G.
4 Write about Fundamental circuits and cut sets with theorem proof?
5 Explain Connectivity and Separability?
6 Explain 1-Isomorphism with theorem proof?
7 Explain 2-Isomorphism with examples?
8 a. Write Short notes on Network flows?
b. Write about combinational and geometric Graphs?
9 Write in detail about different representation of a Planar graph?
10 Evaluate using using prims algorithm
18 A connected graph G is an Euler graph if and only if all vertices of G are of even degree.
Proof : Necessity Let G(V, E) be an Euler graph.
Thus G contains an Euler line Z, which is a closed walk. Let this walk start and end at the vertex u ∈ V.
Since each visit of Z to an intermediate vertex v of Z contributes two to the degree of v and since Z
UNIT IV
PERMUTATIONS & COMBINATIONS : Fundamental principles of counting - Permutations and
combinations - Binomial theorem - combinations with repetition - Combinatorial numbers - Principle of
inclusion and exclusion - Derangements - Arrangements with forbidden Positions.
UNIT-IV / PART-A
Page 15 of 22 PREPARED BY P.JAYALAKSHMI, AP/
CSE
Graph Theory and Applications Department of CSE
1 Define Fundamental Counting Principle:
The principle for determining the number of ways two or more operations can be performed together.
Example:How many ways can six different books be positioned on a book shelf?
6! = 6 × 5 × 4 × 3 × 2 × 1 = 720
Six different books can be positioned 720 ways on a book shelf.
2 Explain Addition rule or Sum rule.
If one task or operation can be performed in m ways, while a second ask can be performed in n ways
and the two tasks cannot be done simultaneously, then either of the tasks can be done in m + n ways.
Example: There are 3 lists of computer projects consisting of 23, 15 and 19 possible projects
respectively. No project is found in more than one list. How many possible projects can a student choose?
Solution: Total number of projects is 23+15+19 = 57. Since no project is found in more than one list,
the number of ways a project can be chosen is 57 ways.
4 Define Permutation.
A permutation is an arrangement of a given collection of objects in a definite order taking some of the
objects or all the objects.
6 Define Combination.
A Combination is a selection of objects from a given collection of objects taken some objects or all the
objects at a time. The order of selection is immaterial.
9 A salesman at a computer store would like to display 5 models of personal computers, 4 models of
computer monitors and 3 models of keyboards. In how many ways can he arrange them in a row if
the items of the same kind are together?
Solution:
Page 16 of 22 PREPARED BY P.JAYALAKSHMI, AP/
CSE
Graph Theory and Applications Department of CSE
The total number of arrangements
= 3! x 5! x 4! x 3! = 103,680 .
10 From a college if we select 367 students, how many students have the same birthday?
Solution: There are 367 students and the maximum number of days in a year is 366 (leap year)
and so 366 possible birthdays are there. Treating the 367 students as pigeons and the 366 birthdays as
pigeonholes, by Pigeonhole principle atleast two students will have the same birthday.
11 How many different 7 digit phone numbers are possible if the 1 st digit cannot be a 0 or 1?
8*10*10*10*10*10*10=8000000 ways
12 Find the number of distinguishable permutations of the letters ” MISSISSIPPI”
11 letters with I repeated 4 times, S repeated 4 times, P repeated 2 times
11! = 39,916,800 = 34,650
4!*4!*2! 24*24*2
7x6x5 6x5
= x + (7C3 x 6C1) + (7C2)
3x2x1 2x1
7x6x5 7x6
= 525 + x6 +
3x2x1 2x1
= 756.
16 List all the derangements of the number 1, 2, 3, 4 and 5 where there first three numbers are 1, 2 and
3 in some order.
When 1, 2 and 3 are in some order there are only two derangements.
23154 and 31254.
17 In how many ways can 8 papers in an examination be arranged so that the two Mathematics papers
are not consecutive?
Since the two Mathematics papers are not to be consecutive, remove them for the time being. Arrange the
remaining 6 papers. This can be done in P(6,6) = 6! ways = 720 ways.
In each of these arrangements of the 6 papers there are 7 gaps. In these gaps, the 2 Mathematics
papers can be arranged in P(7,2) = (7)(6) = 42 ways.
the total number of ways arranging all the 8 papers = 720 x 42 = 30240 ways.
18 How many different license plates are possible if each plate contains a sequence of 3 English
alphabets followed by 3 digits? (Repetition is allowed)
There ar 26 alphabets and 10 digits.
there ar 26 choices for each alphabet and 10 choices for each digit.
Page 17 of 22 PREPARED BY P.JAYALAKSHMI, AP/
CSE
Graph Theory and Applications Department of CSE
all 3 alphabets can be chosen in 26 x 26 x 26
= 263 ways,
and the 3 numbers can be chosen in 10 x10 x 10
= 103 ways.
total number of possible license plates
= 263 x 103 = 17,576,000
19 7 students enter a restaurant where each of them has one of the following:
a cheese burger, a chicken sandwich, a egg puff or a veg puff. How many different purchases are
possible? (from restaurant point of view)
n = 7, r = 4,
no: of purchases = (n+r-1)Cr
= (7+4-1)C4
=120.
20 Out of 7 consonants and 4 vowels, how many words of 3 consonants and 2 vowels can be formed?
Number of ways of selecting 3 consonants from 7
= 7C3
Number of ways of selecting 2 vowels from 4
= 4C2
Number of ways of selecting 3 consonants from 7 and 2 vowels from 4
= 7C3 × 4C2
=(7×6×53×2×1)×(4×32×1)=210=(7×6×53×2×1)×(4×32×1)=210
It means we can have 210 groups where each group contains total 5 letters (3 consonants and 2
vowels).
UNIT-IV / PART-B
1 Explain the fundamental principles of counting.
2 A survey of 100 students with respect to their choice of the ice cream flavours Vanilla, Chocolate and
Strawberry shows that 50 students like Vanilla, 43 like Chocolate, 28 like Strawberry, 13 like Vanilla
and Chocolate, 11 like Chocolate and Strawberry, 12 like Strawberry and Vanilla, and 5 like all of
them. Find the number of students who like
(i)Vanilla only (ii) Chocolate only (iii) Strawberry only (iv) Chocolate but
not Strawberry (v) Chocolate and Strawberry but not Vanilla
(vi) Vanilla or Chocolate, but not Strawberry. Also find the number of students who do not
like any of these flavors.
3 In making a seating arrangement for their son’s wedding reception. Grace and Nick are down to
four relatives, donated Ri for 1 ≤ i ≤ 4, who do not get along with one another. There is a single open
seat at each of the five tables Tj where 1 ≤ j ≤ 5. Because of family differences,
a) R1 will not sit at T1 or T2. c) R2 will not sit at T2.
b) R3 will not sit at T3 or T4. d) R4 will not sit at T4 or T5.
UNIT V
GENERATING FUNCTIONS: Generating functions - Partitions of integers - Exponential generating function
– Summation operator - Recurrence relations - First order and second order – Non-homogeneous recurrence
relations - Method of generating functions.
UNIT-V / PART-A
1 Define Generating Function.
A generating function is a formal power series
whose coefficients give the sequence .
4 If ek represents the number of ways to make change for k rupees, using Rs. 1, Rs. 2, Rs. 5, Rs. 10
and Rs. 100 , find the generating function for ek.
f(x) = (Rs 1 factor) ( Rs 2 factor) (Rs 5 factor) (Rs 10 Factor) (Rs 100 factor)
=(1+x+x2+…) ( 1+x2+x4+…) (1+x5+x15+…) (1+x10+x20+…) (1+ x100+x200+…)
=(1/(1-x)) (1/(1-x2)) (1/(1-x5)) (1/(1-x10)) ( 1/(1-x100))
5 Steps for solving a linear homogeneous recurrence relation of degree 2:
Step #1. Get the characteristic equation of the given recurrence relation.
Step #2. Solve the characteristic equation to get the two roots r1, r2. The general solution is
an = 1r1n + 2r2n
Step #3. Substitute the initial conditions into the general solution to find the constants 1 and 2.
6 Solve the recurrence relation Fn = 5Fn−1 − 6Fn−2 where F0 = 1 and F1 = 4
The characteristic equation of the recurrence relation is −
x2 − 5x + 6 = 0,
So, (x − 3) (x − 2) = 0
Hence, the roots are −
x1 = 3 and x2 = 2
The roots are real and distinct. So, this is in the form of case 1
Hence, the solution is −
Page 19 of 22 PREPARED BY P.JAYALAKSHMI, AP/
CSE
Graph Theory and Applications Department of CSE
Fn = ax1n + bx2n
Here, Fn = a3n + b2n (As x1 = 3 and x2 = 2)
Therefore,
1 = F0 = a30 + b20 = a+b
4 = F1 = a31 + b21 = 3a+2b
Solving these two equations, we get a = 2 and b = −1
Hence, the final solution is −
Fn = 2.3n + (−1) . 2n = 2.3n − 2n
7 List some applications of Generating Functions.
For solving a variety of counting problems. For example, the number of ways to make change for
a Rs. 100 note with the notes of denominations Rs.1, Rs.2, Rs.5, Rs.10, Rs.20 and Rs.50.
For solving recurrence relations.
For proving some of the combinatorial identities.
For finding asymptotic formulae for terms of sequences.
8 What is the generating function of the infinite series; 1, 1, 1, 1..?
Here, ak = 1, for 0 ≤k≤ ∞.
Hence, G(x)=1+x+x2+x3+........=1(1−x).
9 Find the coefficient of 17 x in the expansion of (1+x5+x7)20
The only way to form an 17 x term is to gather two 5 x and one 7 x . Since there are 20C 2 =190
ways to choose two 5 x from the 20 multiplicands and 18 ways to choose one 7 x from the
remaining 18 multiplicands, the answer is 190* 18= 3420.
10 Explain all the three Methods to Solving Recurrences?
Iteration: Start with the recurrence and keep applying the recurrence equation until we get a pattern. The
result is a guess at the closed form.
Substitution: Guess the solution; prove it using induction. The result here is a proven closed form. It's
often difficult to come up the guess so, in practice, iteration and substitution are used hand-in-hand.
Master Theorem: Plugging into a formula that gives an approximate bound on the solution. The result
here is only a bound on the closed form. It is not an exact solution.
11 If we have a recurrence relation for a sequence, is it possible to express the sequence in a way that
does not use recursion?
Sometimes. When we are able to do so, we find what is called the closed form of the recurrence. It is an
algebraic formula or a definition that tells us how to find the nth term without needing to know any of the
preceding terms. The process of finding the closed form is called solving a recurrence.
12 Find a recurrence relation for the sequence 8, 24/7, 72/49, 216/343,…
Here a0=8 and each term is multiplied by 3/7 so an=(3/7)an-1 for n>1.
13 A bank pays 6% (annual) intrest on savings, compounding the interest monthly. If Raj deposits Rs.
1000/- on the first day of may, how much will he deposit be a worth year later?
Interest is 6% annually , so monthly is 6%/12=0.5% ==0.005
Pn+1=Pn+0.005Pn.
14 Define Catalan number.
In combinatorial mathematics, the Catalan numbers form a sequence of natural numbers that occur in
various counting problems, often involving recursively-defined objects.
Cn = 1/(n+1) ∑ni=0 (n i)2
15 Find a12 if an+1 =5a for n0 and a0=2.
2
n
2
17 Solve the recurrence relation an+2-4an-1+3an=-200 for n0 and a0=3000 and a1=3300
The solution for an+2-4an-1+3an=0 is an(h)=c1(3n)+c2.
(Let an(p)=An) The particular solution for an+2-4an-1+3an=-200 is an(p)=100n.
The solution to the problem is an= c1(3n)+c2+100n
Page 20 of 22 PREPARED BY P.JAYALAKSHMI, AP/
CSE
Graph Theory and Applications Department of CSE
Finally, we have an= 100(3n)+2900+100n
18
Solve an = an-1 +8an-2 - 12an-3, with initial conditions a0 = 2, a1 = 3, and a2 = 19.
Let g ( x) n0 a n x n
2 3x 19 x 2 n3 a n x n
2 3x 19 x 2 xk 2 a k x k 8 x 2 k 1 a k x k 12 x 3 k 0 a k x k
2 3x 19 x 2 xg ( x) 8 x 2 g ( x) 12 x 3 g ( x) 2 x 3x 2 16 x 2
2 x xg ( x) 8 x 2 g ( x) 12 x 3 g ( x)
Therefore, g(x)-xg(x)-8x2g(x)+12x3g(x) = 2+x.
That’s, g(x) =(2+x)/(1-x-8x2+12x3).
19 Properties of generating functions.
UNIT-V / PART-B
1 Explain generating Functions.