



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
A collection of exam questions covering topics such as graph properties, tree algorithms, packing algorithms, network flow, and linear programming. Students are required to use various algorithms like prim's algorithm, dijkstra's algorithm, and the simplex algorithm to solve problems related to graphs, trees, and linear programming.
Typology: Exams
1 / 7
This page cannot be seen from the preview
Don't miss anything!




A1 (a) Give two properties that a graph must possess for it to be a tree. [2]
(b) Give the total number of unlabelled, different trees that can be drawn on 5 vertices, and draw an example of each. [3]
[5 marks] A
(i) Use the first-fit algorithm to pack the following weights (in kg) into boxes that can each hold up to 8 kg. Show clearly which weights are packed into which boxes.
(ii) Use the first-fit decreasing algorithm to pack the same weights into boxes that can hold 8kg each. [Note: you do not need to use an algorithm to sort the list into decreasing order.] [3] (iii) A computer takes 0.2 seconds to apply the first-fit decreasing algorithm to a list of 100 items. Given that the first-fit decreasing algorithm displays quadratic complexity, approximately how long will it take to apply the same algorithm to a list of 1000 items? [2] [7 marks]
The diagram above shows a network of paths. The number on each arc gives the distance, in metres, of that path.
Solve the route inspection problem for the network shown in the diagram. You should make your method and working clear. State a shortest route, starting at A , and find its length.
[The total weight of the network is 1241] [8 marks] A
(a) Define the terms
(i) alternating path, [2]
(ii) matching. [2]
Figure 1 Figure 2
At a school fair, five teachers, A, B, C, D and E, are to supervise five stalls, 1, 2, 3, 4 and
A bipartite graph showing their possible allocations is given in Figure 1. An initial matching is given in Figure 2.
(b) Use the maximum matching algorithm twice to obtain a complete matching. List clearly the alternating paths you use and show your final matching on a diagram. [5] [9 marks]
The table below shows the activities involved in constructing a short length of road to bypass a
village. The table gives the durations of the activities and their immediate predecessors.
Activity Duration (weeks) Immediate predecessors A Survey site 8 - B Purchase land 22 A C Source and order materials 10 - D Source and order equipment 4 - E Excavate cuttings and clear route 9 B, D F Build bridges and embankments 11 B, C, D G Lay drains along route 9 E, F H Lay hardcore 5 G I Surface road 3 H J Install road furniture 10 E, F
(a) Draw an activity-on-arc network for these activities. [5] (b) Mark on your diagram the early time and late time for each event. Give the minimum completion time and list the critical activities. [8] (c) Each of the tasks E, F, G and J can be speeded up at extra cost. The maximum number of weeks by which each task can be shortened, and the extra cost per week, are shown in the table below:
Task E F G J Maximum number of weeks by which the task may be shortened
Cost per week of shortening the task (in £1000)
(i) Find the new shortest time for the bypass to be completed. (ii) List the activities which will need to be speeded up in order to achieve this new shortest time, and the number of weeks by which each must be shortened. (iii) Find the total extra cost needed to achieve the new shortest time. [7]
[20 marks]
B2. An initial Simplex tableau for the solution of a linear maximisation problem is
Basic variable x y z r s t Value r 4 5 10 1 0 0 140 s 2 1 4 0 1 0 60 t 1 2 3 0 0 1 60 P – 350 – 350 – 650 0 0 0 0
(a) Write down the profit equation given by this initial tableau and explain the need for the variables r , s and t. [3]
(b) Perform one complete iteration of the Simplex algorithm to form a new tableau T. Take the most negative number in the profit row to indicate the pivotal column. [10]
(c) State the value of every variable as given by tableau T. [4]
(d) Write down the profit equation given by tableau T. [2]
(e) Use your profit equation to explain why tableau T is not optimal. [1] [20 marks]