Skip to content

Edexcel A-level Further Maths revision notes

Algorithms and graph theory

Section D1-1
Both years
Both years: this holds AS subject content and content the exam board adds beyond it for the full A-level.
4 specification points

Notes and three levels of exam-style practice for each registered specification point in this section.

Checked against Edexcel 9FM0 section D1-1

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

In the exam: Formulae booklet provided · calculator allowed in every paper

Open the printable pack
D1-1.1

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

Notes
Evidence from your answers: none yet
Your confidence:

A self-report of how sure you feel. It does not measure mastery. Evidence from your answers reaches secure after the latest Tier 2/3 attempt is correct, with three correct distinct drills across at least two dates and two practice sources.

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

ORIGINAL

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)

Tier 2 · Standard

ORIGINAL

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)

Tier 3 · Hard

ORIGINAL

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)

Your progress and exam materials

This section: Evidence from your answers: 0/4 secureYour confidence: 0 self-rated secureTracker status: 0/4 secure, 0 shaky, 4 unseen

Overall: Evidence from your answers: 0/116 secureYour confidence: 0 self-rated secureTracker status: 0/116 secure, 0 shaky, 116 unseen

Progress is saved on this device for guests and accounts right now; cross-device account sync is not live yet.

D1-1.2

Bin packing, bubble sort and quick sort.

Notes
Evidence from your answers: none yet
Your confidence:

A self-report of how sure you feel. It does not measure mastery. Evidence from your answers reaches secure after the latest Tier 2/3 attempt is correct, with three correct distinct drills across at least two dates and two practice sources.

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

ORIGINAL

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)

Tier 2 · Standard

ORIGINAL

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)

Tier 3 · Hard

ORIGINAL

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)

D1-1.3

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

Notes
Evidence from your answers: none yet
Your confidence:

A self-report of how sure you feel. It does not measure mastery. Evidence from your answers reaches secure after the latest Tier 2/3 attempt is correct, with three correct distinct drills across at least two dates and two practice sources.

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

ORIGINAL

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)

Tier 2 · Standard

ORIGINAL

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)

Tier 3 · Hard

ORIGINAL

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)

D1-1.4

The planarity algorithm for planar graphs.

Notes
Evidence from your answers: none yet
Your confidence:

A self-report of how sure you feel. It does not measure mastery. Evidence from your answers reaches secure after the latest Tier 2/3 attempt is correct, with three correct distinct drills across at least two dates and two practice sources.

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

ORIGINAL

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)

Tier 2 · Standard

ORIGINAL

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)

Tier 3 · Hard

ORIGINAL

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)

Want help turning these notes into marks?

Bring a tricky specification point or a recent answer, and we can work through the method and exam wording together.