



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: External Door, Vertices, Edges Represent, Graph Theory Result, Isomorphic, Vertex-Degree Distribution, Vertices, Sum Rule, Multigraph, Steiner-Tree Problem
Typology: Exams
1 / 7
This page cannot be seen from the preview
Don't miss anything!




Computer Science
Answer any four questions. Examiners : Mr. V. Ryan Dr. M. O’Cinneide Mr. M. Donnelly Question 1 a) Explain what is meant by one graph being a subgraph of another. Use an example to illustrate your answer. [3 Marks]
b) A house has only one external door. Show that some room in the house must have an odd number of doors. Model the problem using a graph, and state clearly what the vertices and edges represent. State the graph theory result(s) that you are using in your answer. [5 Marks]
c) What is the difference between two graphs being isomorphic and two graphs being equal. Use an example to illustrate your answer. [3 Marks]
d) Give an example of two graphs which have the same number of vertices and degrees, and have the same vertex-degree distribution, yet are not isomorphic. [4 Marks]
e) What is the definition of big-Oh? [3 Marks]
f) What is meant by the sum rule? [2 Marks]
g) What is the complexity of for (i=0; i<n ; i++) for(j=n; j>i ; j--) S where S is a statement whose complexity is O(1)? Show ALL workings clearly. [5 Marks ]
a) Consider the following graph. Test and decide if it is planar or not. If it is planar, verify Euler’s Formula for the graph. If it is non-planar, verify Kuratowski’s theorem for this graph.
[8 Marks]
b) Prove the following result: Let G=(V,E) be a graph or multigraph. Then, G has an Euler trail if and only if G is connected and has exactly 0 or 2 vertices of odd degree. You may assume that you have already proved the result below, and so may use this result in your proof: Let G=(V,E) be a graph or multigraph. Then G has an Euler Circuit if and only if (a) G is connected and (b) all of its vertices have even degree. [7 Marks]
c) What do you understand by the Steiner-Tree Problem (shortest network problem)? [3 Marks]
d) What do you understand by the Integer Bin Packing Problem? [3 Marks]
e) Give a solution to the Integer Bin Packing Problem and argue why your solution is exponential in time. [4 Marks]
e
c
j
i
d
h
g
f
a
b
a) Show that the following digraph is strongly connected, by computing its reachability matrix.
[8 Marks]
b) Prove the following result: The number of walks of length q from vertex i to vertex j in a graph/digraph/multigraph G=(V,E) with adjacency matrix M is Mq^ (i,j) [7 Marks]
c) What is meant by a problem being NP? [3 Marks]
d) Argue why the COMPOSITENESS problem is NP. [4 Marks]
e) What is meant by the class of problems co-NP? [3 Marks]
a) Give a definition of a tree. [3 Marks]
b) How many leaves will a full ternary (3-ary) tree with 15 levels have? [2 Marks]
c) How many vertices will a full ternary (3-ary) tree with h levels have? [2 Marks]
d) A company wishes to give all of its employees a basic introduction to using product X. It approaches this by sending 3 of its employees on an expensive course. These 3 employees must then train exactly 4 others on using the product, and each of them must train exactly 4 more etc. In total, 8832 other employees must be trained in using the product. Use the results developed in class regarding to trees to solve the following two problems. In all cases, state clearly the result that you are using.
(i) How many of the 8835 employees need train nobody? [4 Marks]
(ii) If it takes exactly 9 days to train a group of 4 employees, how many days after the return of the 3 employees who were sent on the course before all employees are trained in using product X. [4 Marks]
e) Give a polynomial-time reduction of the HAMILTON CYCLE problem to the TRAVELLING SALESMAN problem (TSP). i.e. show that HAMCYCLE <=^ p^ TSP by finding the polynomial-time reduction. [10 Marks]
c) What is the definition of NP-complete? [2 Marks]
d) What is the easiest way to prove that some new problem is NP-complete? [2 Marks]
e) List 6 problems that are NP-complete. [3 Marks]
f) Explain how the NP-complete concept is related to the question Is P = NP? [3 Marks]