



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Main points of this past exam are: Prim Algorithm, Minimum Spanning Tree, Algorithm, Demonstrate, Weighted, Difference Between, Trail, Simple Graph, Connected Graph, Complete Graph
Typology: Exams
1 / 6
This page cannot be seen from the preview
Don't miss anything!




Answer FOUR questions Examiners: Dr. Mel O Cinnéide Mr. Martin Donnelly Mr. Vincent Ryan
Question 1. a) Using Prim's Algorithm, find the minimum spanning tree of the following weighted graph. You must demonstrate clearly that you used the algorithm. A solution that does not demonstrate that Prim's algorithm was used will attract zero marks. [8 Marks]
b) In graph theory, what is the difference between a trail and a path? [3 Marks]
c) Explain the terms multigraph , simple graph , connected graph and complete graph. [4 Marks]
d) Describe the S teiner-tree problem. Explain how a slight modification to the problem specification changes it from an NP- Complete problem to a polynomial-time problem. [5 Marks]
e) Explain the integer bin packing problem. Give an algorithm for a brute force solution for this problem. (^) [5 Marks]
a) Prove the following result: Let G=(V,E) be a connected planar graph or multigraph and let |V|=n and |E|=e. Let r be the number of regions in the plane determined by a plane drawing of G, including the infinite region. Then, n - e + r = 2 [7 Marks]
b) What do you understand by the term elementary subdivision? [3 Marks]
c) Consider the following result: Every loop-free, connected graph, which is planar, has a vertex of degree at most X. What is the value of X? [3 Marks]
d) Draw the Petersen Graph. [2 Marks]
e) Give two definitions for the NP class of problems. [5 Marks]
f) Describe the subset-sum problem, and prove that it is in the class NP. [5 Marks]
a) On the first Sunday of 2002, John starts a chain letter by sending six letters to six friends. Each person receiving the letter is to send 6 copies to 6 new people, on the Sunday following the letter’s arrival. How many weeks pass before 5000 people have received a letter? If each letter has a unique number, and all 5000 letters are put together by John and the required number of letters, including those to be sent on, are sent to each person, how many people send no letters? [7 Marks]
b) Using the Ford-Fulkerson algorithm, find the maximum flow through the transport network below. From the outcome of the application of the algorithm, identify the minimum cut.
[8 Marks]
c) Consider the following recursive function:
int BBB( int n ) { if ( n==1 ) return 4; else return( BBB(n-1) + 4BBB(n-1) ); }*
Give a full complexity analysis of the code, leading to finding the big-Oh of the code. [10 Marks]
A Z
G
F
D
B E
a) Distinguish between two graphs being equal and two graphs being isomorphic. Use an example to enhance your answer. [3 Marks]
b) Give an example of a graph which has an Euler Circuit, but does not have a Hamilton Cycle. [3 Marks]
c) List the 4 guidelines that we use when testing whether a graph is Hamiltonian. [3 Marks]
d) A nursery school has children of different ages attending. Every day, the teacher wished to form a line for lunch, in such a way that no child is next to a child who is the same age as him/herself. If the school has 23 children, and most of the children are of age 4, what is the maximum number of 4 year olds that the school can have so that the teacher is guaranteed that such a line can always be formed?
In answering this question, you must use a graph to model the situation, explain clearly and in detail what each aspect of the graph represents, and quote in detail the result(s) that you use in arriving at your solution. [6 Marks]
e) Describe how one can take an optimisation problem and restate it in such a way that if the optimisation problem has a polynomial-time solution, then the decision problem has one also. [3 Marks]
Use the Travelling Salesman problem as an example to illustrate your answer. [4 Marks]
f) Explain the compositeness problem, and give an example of a witness for the problem if the number being tested is 500. [3 Marks]