D1-1 Algorithms and graph theory — revision question pack

4 specification points · notes, questions, answers and worked methods

Checked against Edexcel 9FM0 section D1-1. Review basis: the qualification registry sourced from the Pearson Edexcel Level 3 Advanced GCE in Further Mathematics (9FM0) specification; registry verification recorded 17 July 2026.

How this checking works

D1-1.1 · The general ideas of algorithms and the implementation of an algorithm given by a flow chart or text.

Explanation

  • An algorithm is a finite, unambiguous sequence of instructions that always terminates. In the exam it is given either as numbered text or as a flow chart, and the marks are for the trace, not for spotting the answer: build a table with one column per variable and one row per pass, and write every value the algorithm assigns.
  • The order of an algorithm measures its efficiency as a function of the size nn of the problem.
  • If an algorithm has order n2n^2 then multiplying the size by kk multiplies the run time by k2k^2, so a time TT scales to T×k2T\times k^2; an order n3n^3 algorithm scales by k3k^3.
  • Standard network algorithms such as Dijkstra's and Prim's have order n2n^2, where nn counts the vertices.
  • To find the order from a count of operations, keep only the highest power of nn: T(n)=3n2+5nT(n)=3n^2+5n has order n2n^2 because the 5n5n term becomes negligible.

Worked example

An algorithm of order n2n^2 sorts 300300 items in 1818 seconds. Find the time it takes on 750750 items, and the largest number of items it can sort in 5050 seconds.

  1. 1.The size is multiplied by 750÷300=2.5750\div300=2.5, so the time is multiplied by 2.52=6.252.5^2=6.25.
  2. 2.The new time is 18×6.25=112.518\times6.25=112.5 seconds.
  3. 3.For 5050 seconds the time factor is 50÷18=25950\div18=\frac{25}{9}, so the size factor is 25/9=53\sqrt{25/9}=\frac53.
  4. 4.The largest size is 300×53=500300\times\frac53=500 items.

Answer: It takes 112.5112.5 seconds on 750750 items, and can sort at most 500500 items in 5050 seconds.

Common mistakes

  • Don't fall into the trap of scaling an order n2n^2 time by the size factor instead of by its square.
  • Don't fall into the trap of reading the loop condition after the update instead of before it, giving one row too many or too few.
  • Don't fall into the trap of quoting 3n2+5n3n^2+5n as the order rather than n2n^2.

Exam tip

Draw the trace table before you start, with a column headed by every variable named in the algorithm; examiners award method marks for a correct partial table.

Tier 1 · Easy

  1. 1.

    An algorithm is given in text form. Step 1: let A=1A=1 and B=1B=1. Step 2: let C=A+BC=A+B. Step 3: let A=BA=B and then B=CB=C. Step 4: if B50B\leqslant50 go to Step 2, otherwise stop. Trace the algorithm and state the final values of AA and BB, and how many times Step 2 is carried out.

    (4)

    (Total for Question 1 is 4 marks)

  2. 2.

    An algorithm has order n2n^2. It takes 0.40.4 seconds to run on a problem of size 200200. Find the time it takes on a problem of size 500500.

    (2)

    (Total for Question 2 is 2 marks)

Tier 2 · Standard

  1. 1.

    A flow chart is described as follows. Box 1: input NN. Box 2: is N=0N=0? If yes, output the count and stop. Box 3: replace NN by the integer part of N÷2N\div2, add 11 to the count, and return to Box 2. The count starts at 00. Trace the algorithm for N=100N=100, listing every value of NN, and state the output.

    (4)

    (Total for Question 1 is 4 marks)

  2. 2.

    The number of operations an algorithm performs on a problem of size nn is T(n)=3n2+5nT(n)=3n^2+5n. Evaluate T(10)T(10) and T(40)T(40), find T(40)÷T(10)T(40)\div T(10), and state the order of the algorithm, explaining why the ratio is not exactly 1616.

    (5)

    (Total for Question 2 is 5 marks)

  3. 3.

    An algorithm of order n3n^3 takes 2.52.5 seconds on a problem of size 6060. Find the time it takes on a problem of size 180180, and state the order of Dijkstra's algorithm on a network with nn vertices.

    (4)

    (Total for Question 3 is 4 marks)

Tier 3 · Hard

  1. 1.

    Euclid's algorithm is given as follows. Step 1: input aa and bb with a>ba>b. Step 2: let qq be the integer part of a÷ba\div b and let r=aqbr=a-qb. Step 3: if r=0r=0 output bb and stop; otherwise let a=ba=b, let b=rb=r and return to Step 2. Trace the algorithm for a=1224a=1224 and b=546b=546, recording aa, bb, qq and rr on each pass, and state the output.

    (6)

    (Total for Question 1 is 6 marks)

  2. 2.

    An algorithm has order n2n^2 and takes 1.441.44 seconds on a problem of size 120120. Find the size of the largest problem it can complete in 99 seconds, and the time it would take on a problem of size 420420.

    (5)

    (Total for Question 2 is 5 marks)

  3. 3.

    Two algorithms solve the same problem. Algorithm P has run time 0.002n20.002n^2 seconds and algorithm Q has run time 0.00005n30.00005n^3 seconds, where nn is the size of the problem. Find the size at which the two run times are equal, state which algorithm is faster for n=100n=100, and justify the choice for large nn.

    (6)

    (Total for Question 3 is 6 marks)

  4. 4.

    An algorithm compares every possible pair of items in a list of nn items exactly once. Write down the number of comparisons in terms of nn, evaluate it for n=6n=6 and n=20n=20, and state the order of the algorithm with a reason.

    (6)

    (Total for Question 4 is 6 marks)

  5. 5.

    A computer runs an order n2n^2 algorithm in 4545 seconds on a problem of size 300300. Find the time on a problem of size 500500, the largest size that can be completed in 8080 seconds, and the largest size after the computer is replaced by one that is 44 times faster and is allowed the same 8080 seconds.

    (7)

    (Total for Question 5 is 7 marks)

D1-1.2 · Bin packing, bubble sort and quick sort.

Explanation

  • Bin packing places items of given sizes into bins of fixed capacity. The lower bound is total sizebin capacity\left\lceil\dfrac{\text{total size}}{\text{bin capacity}}\right\rceil; if a packing uses that many bins it is optimal.
  • First-fit takes the items in the order given and puts each one in the first bin it fits; first-fit decreasing sorts the items into descending order first; the full-bin method looks for combinations that fill bins exactly.
  • None of the three is guaranteed optimal.
  • In a bubble sort each pass compares adjacent items and swaps those in the wrong order; after pass kk the last kk items are in place, so pass kk makes nkn-k comparisons, and the sort stops after a pass with no swaps.
  • In a quick sort the pivot is the middle item of the sublist, at position 12(n+1)\frac12(n+1) when nn is odd and 12(n+2)\frac12(n+2) when nn is even; every sublist that still has more than one item chooses a pivot on each pass, and chosen pivots are then fixed.

Worked example

Items of size 5,8,2,7,4,6,35, 8, 2, 7, 4, 6, 3 are packed into bins of capacity 1212. Find the lower bound and apply first-fit decreasing.

  1. 1.The total is 5+8+2+7+4+6+3=355+8+2+7+4+6+3=35, so the lower bound is 35÷12=2.91˙6˙=3\lceil35\div12\rceil=\lceil2.9\dot{1}\dot{6}\rceil=3 bins.
  2. 2.In descending order the items are 8,7,6,5,4,3,28, 7, 6, 5, 4, 3, 2.
  3. 3.Bin 1 takes 88 then 44 (total 1212); bin 2 takes 77 then 55 (total 1212); bin 3 takes 66, 33 and 22 (total 1111).
  4. 4.Three bins are used, which equals the lower bound.

Answer: The lower bound is 33 bins, and first-fit decreasing achieves it with {8,4}\{8,4\}, {7,5}\{7,5\} and {6,3,2}\{6,3,2\}, so the packing is optimal.

Common mistakes

  • Don't fall into the trap of rounding the lower bound down instead of up.
  • Don't fall into the trap of restarting the search at the last bin used rather than at bin 1 in first-fit.
  • Don't fall into the trap of taking the pivot as the mean of the sublist, or as the middle item of the original list rather than of the current sublist.

Exam tip

Write the descending list out in full before starting first-fit decreasing; most lost marks are sorting slips, not packing slips.

Tier 1 · Easy

  1. 1.

    Items of size 4,7,3,6,5,2,8,54, 7, 3, 6, 5, 2, 8, 5 are to be packed into bins of capacity 1010. Calculate a lower bound for the number of bins, then apply the first-fit algorithm to the list in the order given.

    (5)

    (Total for Question 1 is 5 marks)

  2. 2.

    The list 27,15,34,8,2227, 15, 34, 8, 22 is to be sorted into ascending order using a bubble sort. Write down the list after the first complete pass, and state the number of comparisons made in that pass.

    (3)

    (Total for Question 2 is 3 marks)

Tier 2 · Standard

  1. 1.

    Items of size 4,7,3,6,5,2,8,54, 7, 3, 6, 5, 2, 8, 5 are to be packed into bins of capacity 1010. Apply the first-fit decreasing algorithm and state, with a reason, whether your packing is optimal. You may use the lower bound of 44 bins.

    (5)

    (Total for Question 1 is 5 marks)

  2. 2.

    The list 31,18,45,22,9,37,2631, 18, 45, 22, 9, 37, 26 is to be sorted into descending order using a bubble sort. Write down the list after each of the first three passes.

    (5)

    (Total for Question 2 is 5 marks)

  3. 3.

    The list 23,41,16,35,8,29,12,4723, 41, 16, 35, 8, 29, 12, 47 is to be sorted into ascending order using a quick sort. Write down the pivot chosen on the first pass and the result of the first two passes, showing the sublists clearly.

    (5)

    (Total for Question 3 is 5 marks)

Tier 3 · Hard

  1. 1.

    Items of size 9,12,5,14,7,3,11,8,69, 12, 5, 14, 7, 3, 11, 8, 6 are to be packed into bins of capacity 2020. Calculate a lower bound, apply the first-fit algorithm in the order given, and state with a reason whether the result is optimal.

    (6)

    (Total for Question 1 is 6 marks)

  2. 2.

    Items of size 9,12,5,14,7,3,11,8,69, 12, 5, 14, 7, 3, 11, 8, 6 are to be packed into bins of capacity 2020 using the first-fit decreasing algorithm. Show the sorted list and the resulting packing, and explain why first-fit decreasing is still not guaranteed to be optimal in general.

    (6)

    (Total for Question 2 is 6 marks)

  3. 3.

    The list 56,21,78,34,12,65,4356, 21, 78, 34, 12, 65, 43 is to be sorted into descending order using a quick sort. Carry out the algorithm in full, showing the pivots and the sublists after every pass, and state the number of passes needed.

    (7)

    (Total for Question 3 is 7 marks)

  4. 4.

    The list 14,9,25,6,18,1114, 9, 25, 6, 18, 11 is to be sorted into ascending order using a quick sort. Carry out the algorithm in full, showing the pivot and the sublists after every pass, and state the number of passes needed.

    (7)

    (Total for Question 4 is 7 marks)

  5. 5.

    Ten crates of weight 6,11,4,9,7,13,5,8,3,106, 11, 4, 9, 7, 13, 5, 8, 3, 10 tonnes are to be loaded onto lorries with a capacity of 1515 tonnes each. Write down the list after the first two passes of a bubble sort into descending order, calculate a lower bound for the number of lorries, and apply the first-fit decreasing algorithm.

    (8)

    (Total for Question 5 is 8 marks)

D1-1.3 · Use of the order of the nodes to determine whether a graph is Eulerian, semi-Eulerian or neither.

Explanation

  • The order, or degree, of a node is the number of edges incident to it. The handshaking result says the degrees of a graph sum to 2E2E, where EE is the number of edges, so the number of odd nodes is always even.
  • A connected graph is Eulerian when every node has even order, and it then has a closed trail using every edge exactly once. It is semi-Eulerian when exactly two nodes have odd order, and any trail using every edge exactly once must start at one odd node and finish at the other.
  • With four or more odd nodes the graph is neither.
  • The complete graph KnK_n has nn nodes, each of order n1n-1, and n(n1)2\frac{n(n-1)}{2} edges, so KnK_n is Eulerian exactly when nn is odd.
  • Two graphs are isomorphic when they have the same number of vertices and the degrees of corresponding vertices match, so a difference in the sorted list of degrees is enough to prove that two graphs are not isomorphic.

Worked example

A connected graph has nodes of order 2,2,3,3,4,42, 2, 3, 3, 4, 4. Find the number of edges and classify the graph.

  1. 1.The degrees sum to 2+2+3+3+4+4=182+2+3+3+4+4=18.
  2. 2.The number of edges is 18÷2=918\div2=9.
  3. 3.The odd nodes are the two of order 33.
  4. 4.Exactly two nodes are odd, so the graph is semi-Eulerian.

Answer: The graph has 99 edges and is semi-Eulerian; a trail covering every edge once must start at one node of order 33 and finish at the other.

Common mistakes

  • Don't fall into the trap of forgetting to halve the degree sum when counting edges.
  • Don't fall into the trap of calling a graph with four odd nodes semi-Eulerian.
  • Don't fall into the trap of claiming two graphs are isomorphic from a matching edge count alone, without checking the degrees.

Exam tip

List the degrees in order before answering; almost every part of these questions is settled by that list and the handshaking result.

Tier 1 · Easy

  1. 1.

    A connected graph has nodes of order 2,2,4,4,42, 2, 4, 4, 4. Find the number of edges and state, with a reason, whether the graph is Eulerian, semi-Eulerian or neither.

    (3)

    (Total for Question 1 is 3 marks)

  2. 2.

    A connected graph has vertices AA, BB, CC, DD, EE and edges ABAB, ACAC, BCBC, BDBD, CECE, DEDE. Write down the order of each vertex and classify the graph.

    (3)

    (Total for Question 2 is 3 marks)

Tier 2 · Standard

  1. 1.

    A connected graph has vertices AA, BB, CC, DD, EE, FF and edges ABAB, ACAC, AEAE, BCBC, BDBD, CDCD, DFDF, EFEF. Write down the order of each vertex, classify the graph, and state the smallest number of edges that would have to be added to make it Eulerian.

    (5)

    (Total for Question 1 is 5 marks)

  2. 2.

    Write down the number of edges of the complete graph K7K_7 and the order of each of its vertices. State, with a reason, whether K7K_7 is Eulerian, and find the smallest nn greater than 77 for which KnK_n is Eulerian.

    (5)

    (Total for Question 2 is 5 marks)

  3. 3.

    A connected graph has 1313 edges and 88 vertices. Seven of the vertices have orders 3,3,3,4,4,4,43, 3, 3, 4, 4, 4, 4. Find the order of the eighth vertex and classify the graph.

    (4)

    (Total for Question 3 is 4 marks)

Tier 3 · Hard

  1. 1.

    A connected graph has vertices AA, BB, CC, DD, EE and edges ABAB, ACAC, ADAD, BCBC, BEBE, CDCD, CECE, DEDE. Write down the order of each vertex, classify the graph, and state the number of edges that a trail starting and finishing at AA would have to repeat if it must cover every edge.

    (6)

    (Total for Question 1 is 6 marks)

  2. 2.

    Graph GG has 66 vertices with orders 2,2,3,3,4,42, 2, 3, 3, 4, 4 and graph HH has 66 vertices with orders 2,3,3,3,3,42, 3, 3, 3, 3, 4. Show that GG and HH have the same number of edges, explain why they cannot be isomorphic, and classify each graph.

    (6)

    (Total for Question 2 is 6 marks)

  3. 3.

    A connected graph has nn vertices, every one of order 44, and 1818 edges. Find nn, classify the graph, and determine how many edges a graph with nn vertices all of order 44 would have in general.

    (5)

    (Total for Question 3 is 5 marks)

  4. 4.

    Explain why a graph cannot have exactly three vertices of odd order, and hence write down the possible numbers of odd vertices in a graph with 77 vertices. Determine whether a connected graph with 77 vertices of orders 1,2,2,3,3,4,51, 2, 2, 3, 3, 4, 5 exists.

    (6)

    (Total for Question 4 is 6 marks)

  5. 5.

    A connected graph GG has 66 vertices AA to FF and is semi-Eulerian, with a trail covering every edge exactly once running from AA to FF. The orders of BB, CC, DD and EE are 44, 22, 44 and 22, and GG has 99 edges. Find the orders of AA and FF, and state how many edges must be added so that a closed trail covering every edge exactly once exists, naming a suitable edge.

    (6)

    (Total for Question 5 is 6 marks)

D1-1.4 · The planarity algorithm for planar graphs.

Explanation

  • A graph is planar when it can be drawn so that edges meet only at vertices. The planarity algorithm applies to a graph that contains a Hamiltonian cycle, a cycle passing through every vertex exactly once.
  • Redraw that cycle as a circle with the vertices in cycle order, then every remaining edge is a chord that must be drawn either inside or outside the circle. Two chords conflict when they cross, which happens exactly when the endpoints of one separate the endpoints of the other around the cycle; chords sharing a vertex never conflict.
  • Build the conflict list, then try to label each chord I for inside or O for outside so that conflicting chords get different labels.
  • If a consistent labelling exists the graph is planar and the labelling is a recipe for a plane drawing.
  • If following the conflicts forces a chord to take both labels, no plane drawing exists and the graph is not planar; K5K_5 and K3,3K_{3,3} both fail in exactly this way.

Worked example

A graph has the Hamiltonian cycle ABCDEAABCDEA and the additional edges ACAC, ADAD and BDBD. Use the planarity algorithm to decide whether it is planar.

  1. 1.Draw A,B,C,D,EA, B, C, D, E around a circle in that order; the chords are ACAC, ADAD and BDBD.
  2. 2.ACAC and ADAD share AA, and ADAD and BDBD share DD, so neither pair conflicts.
  3. 3.ACAC separates BB from DD and EE, and the chord BDBD has one endpoint on each side, so ACAC and BDBD conflict.
  4. 4.Label ACAC as I; then BDBD must be O; ADAD conflicts with nothing so it may be I.

Answer: A consistent labelling exists, with ACAC and ADAD inside and BDBD outside, so the graph is planar.

Common mistakes

  • Don't fall into the trap of treating two chords that share a vertex as conflicting.
  • Don't fall into the trap of stopping at one crossing drawing and concluding the graph is not planar, instead of testing every labelling through the conflict list.
  • Don't fall into the trap of applying the algorithm without first identifying a Hamiltonian cycle.

Exam tip

Write the cycle order along the top of your working and read each chord as the set of vertices it separates; the conflicts then fall out mechanically.

Tier 1 · Easy

  1. 1.

    Explain what is meant by a Hamiltonian cycle, and write down a Hamiltonian cycle for the complete graph K4K_4 with vertices AA, BB, CC, DD.

    (3)

    (Total for Question 1 is 3 marks)

  2. 2.

    A graph has the Hamiltonian cycle ABCDEFAABCDEFA and the two additional edges ACAC and DFDF. Decide whether these two chords conflict, and hence state whether the graph is planar.

    (3)

    (Total for Question 2 is 3 marks)

Tier 2 · Standard

  1. 1.

    A graph has the Hamiltonian cycle ABCDEFAABCDEFA and the additional edges ACAC, BDBD, CECE and DFDF. Use the planarity algorithm to determine whether the graph is planar, listing the conflicts and giving a labelling.

    (6)

    (Total for Question 1 is 6 marks)

  2. 2.

    The complete bipartite graph K3,3K_{3,3} has vertices AA, BB, CC joined to each of DD, EE, FF. Verify that ADBECFAADBECFA is a Hamiltonian cycle, list the remaining edges, and determine the conflicts between them.

    (6)

    (Total for Question 2 is 6 marks)

  3. 3.

    A graph has the Hamiltonian cycle ABCDEFAABCDEFA and the additional edges ADAD, BEBE and CFCF. Determine the conflicts and state, with a reason, whether the graph is planar.

    (5)

    (Total for Question 3 is 5 marks)

Tier 3 · Hard

  1. 1.

    Use the planarity algorithm on the complete graph K5K_5 with vertices AA, BB, CC, DD, EE and Hamiltonian cycle ABCDEAABCDEA to show that K5K_5 is not planar. List the chords, the complete set of conflicts, and explain precisely why no labelling succeeds.

    (8)

    (Total for Question 1 is 8 marks)

  2. 2.

    A graph has the Hamiltonian cycle ABCDEFAABCDEFA and the additional edges ACAC, AEAE, BFBF and CECE. Apply the planarity algorithm, giving the conflicts and a labelling, and state whether the graph is planar.

    (7)

    (Total for Question 2 is 7 marks)

  3. 3.

    Explain why the planarity algorithm requires a Hamiltonian cycle, and describe what the algorithm can and cannot conclude about a graph in which no Hamiltonian cycle can be found.

    (6)

    (Total for Question 3 is 6 marks)

  4. 4.

    A graph has the Hamiltonian cycle ABCDEFAABCDEFA and the additional edges ACAC, ADAD, BDBD, BFBF and CFCF. Apply the planarity algorithm and determine whether the graph is planar, showing the conflicts you use.

    (8)

    (Total for Question 4 is 8 marks)

  5. 5.

    A graph has 77 vertices, the Hamiltonian cycle ABCDEFGAABCDEFGA and the additional edges ACAC, ADAD, AEAE, BFBF and CFCF. Apply the planarity algorithm, listing every conflict, and give a labelling or explain why none exists.

    (8)

    (Total for Question 5 is 8 marks)

Answer key

Answers begin on a new printed page so the question pack can be completed without the solutions alongside it.

D1-1.1 · The general ideas of algorithms and the implementation of an algorithm given by a flow chart or text.

Tier 1 · Easy

Mark scheme for D1-1.1 Tier 1 · Easy
QuestionSchemeMarks
1
  • The values of BB produced are 2,3,5,8,13,21,34,552, 3, 5, 8, 13, 21, 34, 55
  • Final A=34A=34
  • Final B=55B=55
  • Step 2 is carried out 88 times
4
(4 marks)4
Notes
Each pass replaces the pair (A,B)(A,B) by (B,A+B)(B,A+B), giving (1,2)(1,2), (2,3)(2,3), (3,5)(3,5), (5,8)(5,8), (8,13)(8,13), (13,21)(13,21), (21,34)(21,34) and (34,55)(34,55). The test at Step 4 first fails when B=55>50B=55>50, after 88 passes, so the algorithm stops with A=34A=34 and B=55B=55.
2
  • Size factor 500÷200=2.5500\div200=2.5
  • Time factor 2.52=6.252.5^2=6.25
  • Time =0.4×6.25=2.5=0.4\times6.25=2.5 seconds
2
(2 marks)2
Notes
For an order n2n^2 algorithm the run time is proportional to n2n^2. The size is multiplied by 2.52.5, so the time is multiplied by 2.52=6.252.5^2=6.25, giving 0.4×6.25=2.50.4\times6.25=2.5 seconds.

Tier 2 · Standard

Mark scheme for D1-1.1 Tier 2 · Standard
QuestionSchemeMarks
1
  • NN takes the values 100,50,25,12,6,3,1,0100, 50, 25, 12, 6, 3, 1, 0
  • The count increases by 11 each time Box 3 is used
  • Output =7=7
4
(4 marks)4
Notes
Halving and taking the integer part gives 1005025126310100\to50\to25\to12\to6\to3\to1\to0, where 25÷2=12.525\div2=12.5 has integer part 1212 and 3÷2=1.53\div2=1.5 has integer part 11. Box 3 is used 77 times before the test at Box 2 succeeds, so the output is 77.
2
  • T(10)=300+50=350T(10)=300+50=350
  • T(40)=4800+200=5000T(40)=4800+200=5000
  • T(40)÷T(10)=5000350=1007=14.3T(40)\div T(10)=\dfrac{5000}{350}=\dfrac{100}{7}=14.3 to 33 significant figures
  • The order is n2n^2
  • The ratio falls short of 1616 because the linear term 5n5n is still a noticeable share of T(10)T(10)
5
(5 marks)5
Notes
Substituting gives T(10)=3(100)+5(10)=350T(10)=3(100)+5(10)=350 and T(40)=3(1600)+5(40)=5000T(40)=3(1600)+5(40)=5000, so the ratio is 5000/350=100/714.35000/350=100/7\approx14.3. The dominant term for large nn is 3n23n^2, so the order is n2n^2 and the ideal ratio would be 42=164^2=16. At n=10n=10 the term 5n=505n=50 is about 14%14\% of T(10)T(10) but at n=40n=40 the term 5n=2005n=200 is only 4%4\% of T(40)T(40), so the measured ratio is below 1616.
3
  • Size factor 180÷60=3180\div60=3
  • Time factor 33=273^3=27
  • Time =2.5×27=67.5=2.5\times27=67.5 seconds
  • Dijkstra's algorithm has order n2n^2
4
(4 marks)4
Notes
An order n3n^3 run time is proportional to n3n^3, so tripling the size multiplies the time by 33=273^3=27, giving 2.5×27=67.52.5\times27=67.5 seconds. Dijkstra's algorithm assigns a permanent label to each of the nn vertices and updates at most nn working values each time, so it is a standard order n2n^2 network algorithm.

Tier 3 · Hard

Mark scheme for D1-1.1 Tier 3 · Hard
QuestionSchemeMarks
1
  • Pass 1: a=1224a=1224, b=546b=546, q=2q=2, r=132r=132
  • Pass 2: a=546a=546, b=132b=132, q=4q=4, r=18r=18
  • Pass 3: a=132a=132, b=18b=18, q=7q=7, r=6r=6
  • Pass 4: a=18a=18, b=6b=6, q=3q=3, r=0r=0
  • Output =6=6
  • The output is the greatest common divisor of 12241224 and 546546
6
(6 marks)6
Notes
Each pass computes r=aqbr=a-qb and then shifts the pair. Since 1224=2(546)+1321224=2(546)+132, 546=4(132)+18546=4(132)+18, 132=7(18)+6132=7(18)+6 and 18=3(6)+018=3(6)+0, the remainder first reaches 00 on the fourth pass with b=6b=6, so the algorithm outputs 66.
2
  • Time factor 9÷1.44=6.259\div1.44=6.25
  • Size factor 6.25=2.5\sqrt{6.25}=2.5
  • Largest size =120×2.5=300=120\times2.5=300
  • Size factor 420÷120=3.5420\div120=3.5, so time factor 3.52=12.253.5^2=12.25
  • Time =1.44×12.25=17.64=1.44\times12.25=17.64 seconds
5
(5 marks)5
Notes
Run time is proportional to n2n^2, so t=cn2t=cn^2 with c=1.44÷1202=104c=1.44\div120^2=10^{-4}. For t=9t=9, n2=9÷104=90000n^2=9\div10^{-4}=90000 and n=300n=300. For n=420n=420, t=104×4202=104×176400=17.64t=10^{-4}\times420^2=10^{-4}\times176400=17.64 seconds.
3
  • 0.002n2=0.00005n30.002n^2=0.00005n^3
  • n=0.002÷0.00005=40n=0.002\div0.00005=40
  • At n=100n=100: P takes 2020 seconds and Q takes 5050 seconds
  • Algorithm P is faster at n=100n=100
  • P is faster for every n>40n>40
  • P has the lower order, n2n^2 against n3n^3, so it wins for all large nn
6
(6 marks)6
Notes
Setting the times equal gives 0.002n2=0.00005n30.002n^2=0.00005n^3, and dividing by n2n^2 (with n>0n>0) gives n=0.002/0.00005=40n=0.002/0.00005=40. At n=100n=100, algorithm P takes 0.002×10000=200.002\times10000=20 seconds while algorithm Q takes 0.00005×106=500.00005\times10^6=50 seconds, so P is faster. Since the ratio of Q's time to P's time is 0.025n0.025n, which exceeds 11 whenever n>40n>40, algorithm P is faster for every larger problem, as its lower order guarantees.
4
  • Number of comparisons =n(n1)2=\dfrac{n(n-1)}{2}
  • For n=6n=6: 6×52=15\dfrac{6\times5}{2}=15
  • For n=20n=20: 20×192=190\dfrac{20\times19}{2}=190
  • n(n1)2=12n212n\dfrac{n(n-1)}{2}=\dfrac12n^2-\dfrac12n
  • The order is n2n^2
  • The highest power of nn present is n2n^2, and the 12n-\frac12n term is negligible for large nn
6
(6 marks)6
Notes
Choosing an unordered pair from nn items can be done in (n2)=n(n1)2\binom{n}{2}=\frac{n(n-1)}{2} ways, so that is the comparison count: 1515 when n=6n=6 and 190190 when n=20n=20. Expanding gives 12n212n\frac12n^2-\frac12n, whose dominant term is 12n2\frac12n^2, so the algorithm has order n2n^2.
5
  • Size factor 500÷300=53500\div300=\dfrac53, so time factor (53)2=259\left(\dfrac53\right)^2=\dfrac{25}{9}
  • Time =45×259=125=45\times\dfrac{25}{9}=125 seconds
  • For 8080 seconds the time factor is 8045=169\dfrac{80}{45}=\dfrac{16}{9}
  • Size factor =16/9=43=\sqrt{16/9}=\dfrac43
  • Largest size =300×43=400=300\times\dfrac43=400
  • A computer 44 times faster multiplies the allowed time factor by 44, so the size factor gains 4=2\sqrt4=2
  • Largest size =400×2=800=400\times2=800
7
(7 marks)7
Notes
Run time satisfies t=cn2t=cn^2 with c=45÷3002=5×104c=45\div300^2=5\times10^{-4}. For n=500n=500, t=5×104×250000=125t=5\times10^{-4}\times250000=125 seconds. For t=80t=80, n2=80÷(5×104)=160000n^2=80\div(5\times10^{-4})=160000, so n=400n=400. Making the machine 44 times faster replaces cc by c/4c/4, so n2=80÷(1.25×104)=640000n^2=80\div(1.25\times10^{-4})=640000 and n=800n=800; equivalently, a factor 44 in speed buys only a factor 4=2\sqrt4=2 in size for a quadratic algorithm.

D1-1.2 · Bin packing, bubble sort and quick sort.

Tier 1 · Easy

Mark scheme for D1-1.2 Tier 1 · Easy
QuestionSchemeMarks
1
  • Total size =40=40
  • Lower bound =4010=4=\left\lceil\dfrac{40}{10}\right\rceil=4 bins
  • Bin 1: 4,3,24, 3, 2
  • Bin 2: 77
  • Bin 3: 66
  • Bin 4: 5,55, 5
  • Bin 5: 88
  • First-fit uses 55 bins
5
(5 marks)5
Notes
The items total 4040, so at least 40÷10=440\div10=4 bins are needed. Working along the list, 44 opens bin 1; 77 will not fit with it so opens bin 2; 33 fits in bin 1; 66 opens bin 3; 55 opens bin 4; 22 fits in bin 1, filling it to 99; 88 fits nowhere so opens bin 5; the final 55 fits in bin 4, filling it to 1010. Five bins are used.
2
  • After the first pass: 15,27,8,22,3415, 27, 8, 22, 34
  • 44 comparisons
3
(3 marks)3
Notes
Comparing adjacent pairs left to right: 2727 and 1515 swap to give 15,27,34,8,2215, 27, 34, 8, 22; 2727 and 3434 do not swap; 3434 and 88 swap to give 15,27,8,34,2215, 27, 8, 34, 22; 3434 and 2222 swap to give 15,27,8,22,3415, 27, 8, 22, 34. A list of 55 items needs 44 comparisons in the first pass, and the largest item 3434 has reached the end.

Tier 2 · Standard

Mark scheme for D1-1.2 Tier 2 · Standard
QuestionSchemeMarks
1
  • Descending order: 8,7,6,5,5,4,3,28, 7, 6, 5, 5, 4, 3, 2
  • Bin 1: 8,28, 2
  • Bin 2: 7,37, 3
  • Bin 3: 6,46, 4
  • Bin 4: 5,55, 5
  • First-fit decreasing uses 44 bins
  • This equals the lower bound, so the packing is optimal
5
(5 marks)5
Notes
Sorting into descending order gives 8,7,6,5,5,4,3,28, 7, 6, 5, 5, 4, 3, 2. Then 88 opens bin 1, 77 opens bin 2, 66 opens bin 3, the first 55 opens bin 4 and the second 55 joins it to make 1010; 44 fits in bin 3 making 1010; 33 fits in bin 2 making 1010; 22 fits in bin 1 making 1010. All four bins are exactly full, and since the lower bound is 44 no packing can do better.
2
  • After pass 1: 31,45,22,18,37,26,931, 45, 22, 18, 37, 26, 9
  • After pass 2: 45,31,22,37,26,18,945, 31, 22, 37, 26, 18, 9
  • After pass 3: 45,31,37,26,22,18,945, 31, 37, 26, 22, 18, 9
5
(5 marks)5
Notes
For a descending sort a pair is swapped when the left item is smaller. Pass 1 swaps 1818 with 4545, then 1818 with 2222, then 99 with 3737 and 99 with 2626, sending 99 to the end and giving 31,45,22,18,37,26,931, 45, 22, 18, 37, 26, 9. Pass 2 works on the first six items and swaps 3131 with 4545, then 1818 with 3737 and 1818 with 2626, giving 45,31,22,37,26,18,945, 31, 22, 37, 26, 18, 9. Pass 3 works on the first five and swaps 2222 with 3737 and then 2222 with 2626, giving 45,31,37,26,22,18,945, 31, 37, 26, 22, 18, 9.
3
  • The list has 88 items, so the pivot is item 12(8+2)=5\tfrac12(8+2)=5, namely 88
  • After pass 1: [8][8], [23,41,16,35,29,12,47][23, 41, 16, 35, 29, 12, 47]
  • The second sublist has 77 items, so its pivot is item 12(7+1)=4\tfrac12(7+1)=4, namely 3535
  • After pass 2: [8][8], [23,16,29,12][23, 16, 29, 12], [35][35], [41,47][41, 47]
5
(5 marks)5
Notes
With n=8n=8 the middle item is in position 12(n+2)=5\frac12(n+2)=5, which holds 88. Nothing is smaller than 88, so pass 1 gives the fixed pivot 88 followed by the sublist 23,41,16,35,29,12,4723, 41, 16, 35, 29, 12, 47 in its original relative order. That sublist has n=7n=7, so its pivot is in position 12(7+1)=4\frac12(7+1)=4, which holds 3535. Items smaller than 3535 are 23,16,29,1223, 16, 29, 12 and items larger are 41,4741, 47, so pass 2 gives [8][8], [23,16,29,12][23, 16, 29, 12], [35][35], [41,47][41, 47].

Tier 3 · Hard

Mark scheme for D1-1.2 Tier 3 · Hard
QuestionSchemeMarks
1
  • Total size =75=75
  • Lower bound =7520=3.75=4=\left\lceil\dfrac{75}{20}\right\rceil=\lceil3.75\rceil=4 bins
  • Bin 1: 9,5,39, 5, 3 (total 1717)
  • Bin 2: 12,712, 7 (total 1919)
  • Bin 3: 14,614, 6 (total 2020)
  • Bin 4: 11,811, 8 (total 1919)
  • First-fit uses 44 bins, which equals the lower bound, so the packing is optimal
6
(6 marks)6
Notes
The items total 7575, so at least 75/20=4\lceil75/20\rceil=4 bins are needed. First-fit gives: 99 opens bin 1; 1212 opens bin 2; 55 joins bin 1 (1414); 1414 opens bin 3; 77 joins bin 2 (1919); 33 joins bin 1 (1717); 1111 opens bin 4; 88 joins bin 4 (1919); 66 joins bin 3 (2020). Four bins are used, matching the lower bound, so no packing uses fewer.
2
  • Descending order: 14,12,11,9,8,7,6,5,314, 12, 11, 9, 8, 7, 6, 5, 3
  • Bin 1: 14,614, 6 (total 2020)
  • Bin 2: 12,812, 8 (total 2020)
  • Bin 3: 11,911, 9 (total 2020)
  • Bin 4: 7,5,37, 5, 3 (total 1515)
  • First-fit decreasing uses 44 bins
  • It is a heuristic: it makes a locally best choice for each item in turn and never reconsiders an earlier placement, so on other data it can use more bins than the optimum
6
(6 marks)6
Notes
Sorting gives 14,12,11,9,8,7,6,5,314, 12, 11, 9, 8, 7, 6, 5, 3. Then 1414 opens bin 1, 1212 opens bin 2, 1111 opens bin 3, 99 joins bin 3 (2020), 88 joins bin 2 (2020), 77 opens bin 4, 66 joins bin 1 (2020), 55 joins bin 4 (1212) and 33 joins bin 4 (1515). Four bins are used. First-fit decreasing places each item in the first bin with room and never moves it again, so it cannot recover from an early placement that blocks a later exact fit; that is why an examiner asks for the lower bound before accepting a packing as optimal.
3
  • Pass 1 pivot: item 12(7+1)=4\tfrac12(7+1)=4, namely 3434; result [56,78,65,43][56, 78, 65, 43], [34][34], [21,12][21, 12]
  • Pass 2 pivots: 6565 from the first sublist and 1212 from the last; result [78][78], [65][65], [56,43][56, 43], [34][34], [21][21], [12][12]
  • Pass 3 pivot: 4343; result [78][78], [65][65], [56][56], [43][43], [34][34], [21][21], [12][12]
  • Sorted list: 78,65,56,43,34,21,1278, 65, 56, 43, 34, 21, 12
  • 33 passes are needed
7
(7 marks)7
Notes
For a descending sort, items larger than the pivot are written before it. With n=7n=7 the first pivot is in position 44, namely 3434; the larger items 56,78,65,4356, 78, 65, 43 go before it and the smaller items 21,1221, 12 after it. On pass 2 the sublist 56,78,65,4356, 78, 65, 43 has n=4n=4 and pivot in position 12(4+2)=3\frac12(4+2)=3, namely 6565, giving [78][78], [65][65], [56,43][56, 43]; the sublist 21,1221, 12 has n=2n=2 and pivot in position 22, namely 1212, giving [21][21], [12][12]. On pass 3 the only sublist left is 56,4356, 43, whose pivot is 4343, giving [56][56], [43][43]. Every item is now a chosen pivot, so the sort is complete after 33 passes.
4
  • Pass 1 pivot: item 12(6+2)=4\tfrac12(6+2)=4, namely 66; result [6][6], [14,9,25,18,11][14, 9, 25, 18, 11]
  • Pass 2 pivot: 2525; result [6][6], [14,9,18,11][14, 9, 18, 11], [25][25]
  • Pass 3 pivot: 1818; result [6][6], [14,9,11][14, 9, 11], [18][18], [25][25]
  • Pass 4 pivot: 99; result [6][6], [9][9], [14,11][14, 11], [18][18], [25][25]
  • Pass 5 pivot: 1111; result [6][6], [9][9], [11][11], [14][14], [18][18], [25][25]
  • 55 passes are needed
7
(7 marks)7
Notes
With n=6n=6 the first pivot is in position 12(6+2)=4\frac12(6+2)=4, namely 66; nothing is smaller, so the pass gives [6][6] then 14,9,25,18,1114, 9, 25, 18, 11. That sublist has n=5n=5 and pivot in position 33, namely 2525, and nothing is larger, giving [14,9,18,11][14, 9, 18, 11], [25][25]. Next n=4n=4 and the pivot is in position 33, namely 1818, giving [14,9,11][14, 9, 11], [18][18]. Then n=3n=3 with pivot in position 22, namely 99, giving [9][9], [14,11][14, 11]. Finally n=2n=2 with pivot in position 22, namely 1111, giving [11][11], [14][14]. Five passes are needed because each pass fixes only the pivots of the sublists that are still active.
5
  • After pass 1: 11,6,9,7,13,5,8,4,10,311, 6, 9, 7, 13, 5, 8, 4, 10, 3
  • After pass 2: 11,9,7,13,6,8,5,10,4,311, 9, 7, 13, 6, 8, 5, 10, 4, 3
  • Total weight =76=76 tonnes
  • Lower bound =7615=5.06˙=6=\left\lceil\dfrac{76}{15}\right\rceil=\lceil5.0\dot{6}\rceil=6 lorries
  • Descending order: 13,11,10,9,8,7,6,5,4,313, 11, 10, 9, 8, 7, 6, 5, 4, 3
  • Lorry 1: 1313; lorry 2: 11,411, 4; lorry 3: 10,510, 5; lorry 4: 9,69, 6; lorry 5: 8,78, 7; lorry 6: 33
  • First-fit decreasing uses 66 lorries, which equals the lower bound, so it is optimal
8
(8 marks)8
Notes
In a descending bubble sort a pair is swapped when the left value is the smaller. Pass 1 makes nine comparisons and swaps 66 with 1111, then carries 44 rightwards past 99, 77, 1313, 55 and 88, and finally swaps 33 with 1010, giving 11,6,9,7,13,5,8,4,10,311, 6, 9, 7, 13, 5, 8, 4, 10, 3. Pass 2 works on the first nine entries, makes eight comparisons and carries 66 past 99, 77 and 1313, then 55 past 88 and 44 past 1010, giving 11,9,7,13,6,8,5,10,4,311, 9, 7, 13, 6, 8, 5, 10, 4, 3. The crates total 6+11+4+9+7+13+5+8+3+10=766+11+4+9+7+13+5+8+3+10=76 tonnes, so at least 76/15=6\lceil76/15\rceil=6 lorries are needed. Applying first-fit to 13,11,10,9,8,7,6,5,4,313, 11, 10, 9, 8, 7, 6, 5, 4, 3: 1313 opens lorry 1; 1111 opens lorry 2; 1010 opens lorry 3; 99 opens lorry 4; 88 opens lorry 5; 77 joins lorry 5 (1515); 66 joins lorry 4 (1515); 55 joins lorry 3 (1515); 44 joins lorry 2 (1515); 33 fits nowhere and opens lorry 6. Six lorries are used, matching the lower bound.

D1-1.3 · Use of the order of the nodes to determine whether a graph is Eulerian, semi-Eulerian or neither.

Tier 1 · Easy

Mark scheme for D1-1.3 Tier 1 · Easy
QuestionSchemeMarks
1
  • Sum of orders =16=16
  • Number of edges =16÷2=8=16\div2=8
  • Every node has even order, so the graph is Eulerian
3
(3 marks)3
Notes
The orders sum to 2+2+4+4+4=162+2+4+4+4=16, and each edge contributes 22 to that sum, so there are 88 edges. There are no odd nodes, so a connected graph of this type is Eulerian and has a closed trail using every edge exactly once.
2
  • Orders: AA is 22, BB is 33, CC is 33, DD is 22, EE is 22
  • Exactly two vertices, BB and CC, have odd order
  • The graph is semi-Eulerian
3
(3 marks)3
Notes
Counting the edges at each vertex gives AA in AB,ACAB, AC so order 22; BB in AB,BC,BDAB, BC, BD so order 33; CC in AC,BC,CEAC, BC, CE so order 33; DD in BD,DEBD, DE so order 22; and EE in CE,DECE, DE so order 22. The orders sum to 1212, confirming 66 edges. Exactly two vertices are odd, so the graph is semi-Eulerian.

Tier 2 · Standard

Mark scheme for D1-1.3 Tier 2 · Standard
QuestionSchemeMarks
1
  • Orders: AA is 33, BB is 33, CC is 33, DD is 33, EE is 22, FF is 22
  • Sum of orders =16=16, so there are 88 edges
  • Four vertices have odd order, so the graph is neither Eulerian nor semi-Eulerian
  • 22 edges must be added
  • For example ABAB and CDCD repeated, or ACAC and BDBD, since each new edge changes the parity of two vertices
5
(5 marks)5
Notes
The vertex AA lies in AB,AC,AEAB, AC, AE so has order 33; similarly BB is in AB,BC,BDAB, BC, BD, CC is in AC,BC,CDAC, BC, CD and DD is in BD,CD,DFBD, CD, DF, all of order 33; EE is in AE,EFAE, EF and FF is in DF,EFDF, EF, both of order 22. With four odd vertices the graph is neither Eulerian nor semi-Eulerian. Each added edge raises the order of two vertices by one, so it can fix at most two odd vertices, and two added edges suffice: pairing AA with BB and CC with DD makes every order even.
2
  • Each vertex of K7K_7 has order 66
  • Number of edges =7×62=21=\dfrac{7\times6}{2}=21
  • Every order is even, so K7K_7 is Eulerian
  • KnK_n is Eulerian exactly when n1n-1 is even, that is when nn is odd
  • The smallest such nn greater than 77 is 99
5
(5 marks)5
Notes
In KnK_n every vertex joins to all n1n-1 others, so each has order n1n-1 and the degree sum is n(n1)n(n-1), giving n(n1)2\frac{n(n-1)}{2} edges. For n=7n=7 this is order 66 and 2121 edges, and since 66 is even K7K_7 is Eulerian. In general KnK_n is Eulerian when n1n-1 is even, so nn must be odd; K8K_8 has odd order 77 at every vertex, and the next odd value is n=9n=9.
3
  • Sum of all orders =2×13=26=2\times13=26
  • The seven given orders sum to 2525
  • The eighth vertex has order 2625=126-25=1
  • The odd vertices are the three of order 33 together with the vertex of order 11
  • Four vertices have odd order, so the graph is neither Eulerian nor semi-Eulerian
4
(4 marks)4
Notes
By the handshaking result the orders sum to twice the number of edges, so the total is 2626. The seven listed orders sum to 3+3+3+4+4+4+4=253+3+3+4+4+4+4=25, leaving 11 for the eighth vertex. That gives four odd vertices in all, so the graph is neither Eulerian nor semi-Eulerian.

Tier 3 · Hard

Mark scheme for D1-1.3 Tier 3 · Hard
QuestionSchemeMarks
1
  • Orders: AA is 33, BB is 33, CC is 44, DD is 33, EE is 33
  • Sum of orders =16=16, so there are 88 edges
  • Four vertices are odd, so the graph is neither Eulerian nor semi-Eulerian
  • A closed trail needs every vertex even, so the four odd vertices AA, BB, DD, EE must be paired
  • Two edges must be repeated
6
(6 marks)6
Notes
Counting incidences: AA appears in AB,AC,ADAB, AC, AD; BB in AB,BC,BEAB, BC, BE; CC in AC,BC,CD,CEAC, BC, CD, CE; DD in AD,CD,DEAD, CD, DE; EE in BE,CE,DEBE, CE, DE. The orders are 3,3,4,3,33, 3, 4, 3, 3, summing to 1616 for 88 edges, and four odd vertices means the graph is neither Eulerian nor semi-Eulerian. Repeating an edge raises the order of both its endpoints by one, so pairing the four odd vertices AA, BB, DD, EE into two pairs and repeating one edge for each pair makes every order even; two repeats are therefore the minimum for a closed trail.
2
  • Sum of orders of G=18G=18, so GG has 99 edges
  • Sum of orders of H=18H=18, so HH has 99 edges
  • The sorted order lists 2,2,3,3,4,42, 2, 3, 3, 4, 4 and 2,3,3,3,3,42, 3, 3, 3, 3, 4 are different
  • Isomorphic graphs have matching orders at corresponding vertices, so GG and HH are not isomorphic
  • GG has exactly two odd vertices, so GG is semi-Eulerian
  • HH has four odd vertices, so HH is neither Eulerian nor semi-Eulerian
6
(6 marks)6
Notes
Both degree lists sum to 1818, so each graph has 18÷2=918\div2=9 edges; equal edge counts are therefore not enough to decide isomorphism. Isomorphism requires a one-to-one correspondence of vertices preserving order, which forces the sorted degree lists to agree. Here GG has two vertices of order 44 while HH has only one, so no such correspondence exists. Counting odd vertices classifies each graph: GG has two, so it is semi-Eulerian, while HH has four, so it is neither.
3
  • Sum of orders =2×18=36=2\times18=36
  • 4n=364n=36, so n=9n=9
  • Every order is even, so the graph is Eulerian
  • In general the degree sum is 4n4n, so the number of edges is 2n2n
5
(5 marks)5
Notes
By the handshaking result the orders sum to 2×18=362\times18=36. If all nn vertices have order 44 then 4n=364n=36 and n=9n=9. Since every vertex has even order and the graph is connected, it is Eulerian. For a general nn the same argument gives 4n=2E4n=2E, so E=2nE=2n, which indeed returns 1818 when n=9n=9.
4
  • The orders sum to 2E2E, which is even
  • The even-order vertices contribute an even total, so the odd-order vertices must also contribute an even total
  • A sum of an odd number of odd values is odd, so the number of odd vertices is even
  • With 77 vertices the number of odd vertices can be 00, 22, 44 or 66
  • The given orders sum to 1+2+2+3+3+4+5=201+2+2+3+3+4+5=20, so E=10E=10
  • There are four odd vertices, which is allowed, so such a graph can exist
6
(6 marks)6
Notes
Every edge adds 11 to the order of each endpoint, so the degree sum equals 2E2E and is even. Splitting the sum into even-order and odd-order vertices, the even part is even, so the odd part must be even too; a sum of odd numbers is even only when there is an even count of them, so three odd vertices are impossible. With 77 vertices the even counts available are 0,2,4,60, 2, 4, 6. The proposed list sums to 2020, giving 1010 edges, and contains the four odd values 1,3,3,51, 3, 3, 5, an even count, so the list passes both necessary tests and no contradiction arises.
5
  • Sum of orders =2×9=18=2\times9=18
  • The four known orders sum to 1212, so the orders of AA and FF sum to 66
  • AA and FF are the two odd vertices, so their orders are odd and sum to 66
  • The possible pairs are (1,5)(1,5), (3,3)(3,3) and (5,1)(5,1)
  • 11 edge must be added
  • Adding the edge AFAF makes both orders even, so a closed trail exists
6
(6 marks)6
Notes
The degree sum is 2×9=182\times9=18 and 4+2+4+2=124+2+4+2=12, so the orders of AA and FF total 66. A semi-Eulerian graph has exactly two odd vertices and its trail runs between them, so AA and FF are the odd pair; the odd pairs summing to 66 are (1,5)(1,5), (3,3)(3,3) and (5,1)(5,1). Adding a single edge AFAF raises both orders by one, making every vertex even, so the graph becomes Eulerian and one added edge is enough.

D1-1.4 · The planarity algorithm for planar graphs.

Tier 1 · Easy

Mark scheme for D1-1.4 Tier 1 · Easy
QuestionSchemeMarks
1
  • A Hamiltonian cycle is a cycle that passes through every vertex of the graph exactly once and returns to its starting vertex
  • A suitable cycle is ABCDAABCDA
3
(3 marks)3
Notes
A cycle is a closed path, and a Hamiltonian cycle is one that visits each vertex once and only once before returning to the start. In K4K_4 every pair of vertices is joined, so the edges ABAB, BCBC, CDCD and DADA all exist and ABCDAABCDA is a Hamiltonian cycle.
2
  • ACAC separates BB from DD, EE and FF
  • Both DD and FF lie on the same side of ACAC, so the chords do not conflict
  • Both chords may be drawn inside, so the graph is planar
3
(3 marks)3
Notes
With A,B,C,D,E,FA, B, C, D, E, F around a circle, the chord ACAC cuts off the single vertex BB. The chord DFDF has both endpoints among DD, EE, FF, on the other side of ACAC, so the two chords do not cross. With no conflicts at all, both chords can be drawn inside the circle and the graph is planar.

Tier 2 · Standard

Mark scheme for D1-1.4 Tier 2 · Standard
QuestionSchemeMarks
1
  • ACAC and BDBD conflict, because BB lies between AA and CC but DD does not
  • BDBD and CECE conflict, because CC lies between BB and DD but EE does not
  • CECE and DFDF conflict, because EE lies between DD and FF but CC does not
  • There are no other conflicts
  • Labelling: ACAC inside, BDBD outside, CECE inside, DFDF outside
  • A consistent labelling exists, so the graph is planar
6
(6 marks)6
Notes
Place A,B,C,D,E,FA, B, C, D, E, F around a circle. Chord ACAC separates {B}\{B\} from {D,E,F}\{D, E, F\}; chord BDBD separates {C}\{C\} from {E,F,A}\{E, F, A\}; chord CECE separates {D}\{D\} from {F,A,B}\{F, A, B\}; chord DFDF separates {E}\{E\} from {A,B,C}\{A, B, C\}. Two chords conflict when exactly one endpoint of the second lies in the set separated by the first, which gives the pairs ACACBDBD, BDBDCECE and CECEDFDF and no others; ACAC and DFDF do not conflict, and ACACCECE and BDBDDFDF share a vertex. The conflicts form a chain, so alternating labels I, O, I, O works and the graph is planar.
2
  • ADAD, DBDB, BEBE, ECEC, CFCF and FAFA all join a vertex of {A,B,C}\{A,B,C\} to one of {D,E,F}\{D,E,F\}, so all six edges exist
  • The cycle visits AA, DD, BB, EE, CC, FF once each and returns to AA
  • K3,3K_{3,3} has 99 edges, so the remaining edges are AEAE, BFBF and CDCD
  • AEAE and BFBF conflict
  • AEAE and CDCD conflict
  • BFBF and CDCD conflict
6
(6 marks)6
Notes
Each consecutive pair in ADBECFAADBECFA takes one vertex from {A,B,C}\{A, B, C\} and one from {D,E,F}\{D, E, F\}, so every step is an edge of K3,3K_{3,3}, and the six vertices each appear once, making it a Hamiltonian cycle. Since K3,3K_{3,3} has 3×3=93\times3=9 edges and the cycle uses six, three chords remain: AEAE, BFBF and CDCD. Reading round the circle A,D,B,E,C,FA, D, B, E, C, F, the chord AEAE separates {D,B}\{D, B\} from {C,F}\{C, F\}, and BFBF has BB on one side and FF on the other, so they conflict; CDCD has DD on one side and CC on the other, so it conflicts with AEAE too; and BFBF separates {E,C}\{E, C\} from {A,D}\{A, D\}, so CDCD conflicts with BFBF as well.
3
  • ADAD separates {B,C}\{B, C\} from {E,F}\{E, F\}, and BEBE has BB on one side and EE on the other, so ADAD and BEBE conflict
  • CFCF has CC on one side of ADAD and FF on the other, so ADAD and CFCF conflict
  • BEBE separates {C,D}\{C, D\} from {F,A}\{F, A\}, and CFCF has CC on one side and FF on the other, so BEBE and CFCF conflict
  • The three chords conflict in pairs, so no two of them may share a label
  • Three labels would be needed but only inside and outside are available, so the graph is not planar
5
(5 marks)5
Notes
The three long chords are the main diagonals of the hexagon. Reading round A,B,C,D,E,FA, B, C, D, E, F, each diagonal separates the other four vertices into two pairs with one endpoint of each remaining diagonal on each side, so every pair of diagonals conflicts. Labelling ADAD as I forces BEBE to be O and CFCF to be O, but BEBE and CFCF conflict and cannot share a label, so the algorithm fails and the graph is not planar.

Tier 3 · Hard

Mark scheme for D1-1.4 Tier 3 · Hard
QuestionSchemeMarks
1
  • K5K_5 has 5×42=10\dfrac{5\times4}{2}=10 edges and the cycle uses 55, so the chords are ACAC, ADAD, BDBD, BEBE and CECE
  • ACAC conflicts with BDBD and with BEBE
  • ADAD conflicts with BEBE and with CECE
  • BDBD conflicts with CECE
  • These are all the conflicts; every other pair shares a vertex
  • The conflicts form the five-cycle ACACBDBDCECEADADBEBEACAC
  • Alternating labels round a cycle of odd length forces two conflicting chords to share a label
  • No consistent labelling exists, so K5K_5 is not planar
8
(8 marks)8
Notes
With A,B,C,D,EA, B, C, D, E on a circle, ACAC separates {B}\{B\} from {D,E}\{D, E\}, ADAD separates {B,C}\{B, C\} from {E}\{E\}, BDBD separates {C}\{C\} from {E,A}\{E, A\}, BEBE separates {C,D}\{C, D\} from {A}\{A\} and CECE separates {D}\{D\} from {A,B}\{A, B\}. Testing each of the ten pairs, the five listed pairs cross and the other five share a vertex. Following the conflicts from ACAC gives ACAC as I, BDBD as O, CECE as I, ADAD as O and BEBE as I; but BEBE conflicts with ACAC, which is also I, a contradiction. The conflicts form a cycle of length five, and a cycle of odd length can never be labelled with two alternating labels, so K5K_5 is not planar.
2
  • ACAC separates {B}\{B\} from {D,E,F}\{D, E, F\}
  • AEAE separates {B,C,D}\{B, C, D\} from {F}\{F\}
  • BFBF separates {C,D,E}\{C, D, E\} from {A}\{A\}
  • CECE separates {D}\{D\} from {F,A,B}\{F, A, B\}
  • ACAC and BFBF conflict, since BB is separated from FF by ACAC
  • AEAE and BFBF conflict, since BB is separated from FF by AEAE
  • There are no other conflicts, since ACAC and AEAE share AA, ACAC and CECE share CC, AEAE and CECE share EE, and BFBF and CECE do not cross
  • Labelling BFBF outside and ACAC, AEAE, CECE inside is consistent, so the graph is planar
7
(7 marks)7
Notes
Place the six vertices round a circle in cycle order. Two chords cross exactly when one endpoint of the second lies in the set the first separates and the other does not. Checking BFBF against CECE: the set separated by BFBF is {C,D,E}\{C, D, E\}, which contains both CC and EE, so they do not cross. Checking ACAC against CECE and AEAE against CECE: each pair shares a vertex, so neither conflicts. That leaves only ACACBFBF and AEAEBFBF, both of which cross. The conflict graph is therefore a star centred on BFBF, which is two-colourable: put BFBF outside and the other three chords inside.
3
  • The algorithm redraws a chosen cycle as a circle so that every other edge becomes a chord that lies wholly inside or wholly outside
  • This is only valid when the cycle passes through every vertex, so that no vertex is left off the circle
  • Without a Hamiltonian cycle some vertices would sit inside or outside the circle and their edges could not be classified as simple chords
  • If no Hamiltonian cycle exists the algorithm cannot be applied
  • Failure to apply the algorithm does not prove the graph is non-planar
  • The graph may still be planar and would need a different method, such as an explicit plane drawing
6
(6 marks)6
Notes
The algorithm turns a plane-drawing question into a two-colouring question by fixing one cycle as a circle and forcing every remaining edge to be a chord drawn on one side or the other. That reduction depends on every vertex lying on the circle, which is exactly the Hamiltonian condition. A graph with no Hamiltonian cycle simply falls outside the method's scope, so the correct conclusion is that the algorithm gives no information, not that the graph fails to be planar; the algorithm proves non-planarity only when it is applied and the conflict labelling is forced into a contradiction.
4
  • ACAC separates {B}\{B\} from {D,E,F}\{D, E, F\}, ADAD separates {B,C}\{B, C\} from {E,F}\{E, F\}, BDBD separates {C}\{C\} from {E,F,A}\{E, F, A\}, BFBF separates {C,D,E}\{C, D, E\} from {A}\{A\} and CFCF separates {D,E}\{D, E\} from {A,B}\{A, B\}
  • ACAC and BDBD conflict
  • ACAC and BFBF conflict
  • ADAD and BFBF conflict
  • ADAD and CFCF conflict
  • BDBD and CFCF conflict
  • The conflicts form the five-cycle ACACBDBDCFCFADADBFBFACAC, which has odd length
  • No two-labelling of an odd cycle exists, so the graph is not planar
8
(8 marks)8
Notes
Reading round A,B,C,D,E,FA, B, C, D, E, F, a pair of chords crosses when exactly one endpoint of the second lies in the set separated by the first. This gives the five listed conflicts; the remaining pairs ACACADAD, ACACCFCF, ADADBDBD, BDBDBFBF and BFBFCFCF each share a vertex. Starting from ACAC as I forces BDBD to be O, then CFCF to be I, then ADAD to be O, then BFBF to be I; but BFBF conflicts with ACAC, which is already I. The conflicts close up into a cycle of five chords, and an odd cycle cannot be two-coloured, so the graph is not planar.
5
  • ACAC separates {B}\{B\} from {D,E,F,G}\{D, E, F, G\}
  • ADAD separates {B,C}\{B, C\} from {E,F,G}\{E, F, G\}
  • AEAE separates {B,C,D}\{B, C, D\} from {F,G}\{F, G\}
  • BFBF separates {C,D,E}\{C, D, E\} from {G,A}\{G, A\}
  • CFCF separates {D,E}\{D, E\} from {G,A,B}\{G, A, B\}
  • Conflicts: ACACBFBF, ADADBFBF, ADADCFCF, AEAEBFBF and AEAECFCF
  • ACAC, ADAD and AEAE share the vertex AA, and BFBF and CFCF share the vertex FF, so neither of those groups conflicts internally
  • Labelling ACAC, ADAD and AEAE inside and BFBF and CFCF outside is consistent, so the graph is planar
8
(8 marks)8
Notes
Place AA to GG around a circle in cycle order and read off the set each chord separates. A pair conflicts when exactly one endpoint of the second lies in that set. The chord ACAC cuts off only BB, so it crosses BFBF but not CFCF; ADAD cuts off BB and CC, so it crosses both BFBF and CFCF; AEAE cuts off BB, CC and DD, so it also crosses both. That is all five conflicts, because the three chords at AA share a vertex with one another and BFBF and CFCF share FF. The conflict graph therefore splits into the two groups {AC,AD,AE}\{AC, AD, AE\} and {BF,CF}\{BF, CF\} with every conflict running between them, so putting the first group inside and the second outside gives a plane drawing.